diff --git a/data/language/ar-EG.txt b/data/language/ar-EG.txt index bbb0911364..d42744b990 100644 --- a/data/language/ar-EG.txt +++ b/data/language/ar-EG.txt @@ -1565,8 +1565,8 @@ STR_2212 :Show list of security guards in park STR_2213 :Show list of entertainers in park STR_2214 :Construction not possible while game is paused! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} on {STRINGID} hasn’t returned to the {STRINGID} yet!{NEWLINE}Check whether it is stuck or has stalled STR_2219 :{RED}{COMMA16} أشخاص قد ماتوا بحادثة علي {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Park Rating: {BLACK}{COMMA16} diff --git a/data/language/ca-ES.txt b/data/language/ca-ES.txt index f93f687de3..945bf385f3 100644 --- a/data/language/ca-ES.txt +++ b/data/language/ca-ES.txt @@ -1571,8 +1571,8 @@ STR_2212 :Mostra una llista dels guardes de seguretat del parc. STR_2213 :Mostra una llista dels animadors del parc. STR_2214 :No es pot construir mentre la partida està en pausa! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} de {STRINGID} encara no ha tornat a {STRINGID}!{NEWLINE}Comproveu què li ha passat. STR_2219 :{RED}{COMMA16} persones han mort en l’accident de {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Valoració del parc: {BLACK}{COMMA16} @@ -3296,7 +3296,7 @@ STR_6237 :Grups STR_6238 :Opcions multijugador STR_6239 :Retallat vertical STR_6240 :Retallat horitzontal -STR_6241 :Seleccioneu una àrea +STR_6241 :Selecciona una àrea STR_6242 :Esborra la selecció STR_6243 :Retoca l’atracció,{NEWLINE}fent-la parèixer nova STR_6244 :No es pot retocar l’atracció… @@ -3825,3 +3825,23 @@ STR_6781 :Captures de pantalla STR_6782 :Notificacions de parc STR_6783 :Notificacions d’atraccions STR_6784 :Notificacions de visitants +STR_6785 :Comandament de joc +STR_6786 :Zona morta: +STR_6787 :Zona morta del pal analògic (cal moviment mínim) +STR_6788 :Sensitivitat: +STR_6789 :Multiplicador de la sensivitat del pal analògic +STR_6790 :Zona morta {COMMA32} % +STR_6791 :Sensitivitat: {COMMA32} % +STR_6792 :Entrades d’edificis +STR_6793 :Visitants i treballadors +STR_6794 :Decoracions i temes +STR_6795 :{MOVE_X}{10}{STRINGID} +STR_6796 :•{MOVE_X}{10}{STRINGID} +STR_6797 :Sense previsualització +STR_6798 :Captura de pantalla +STR_6799 :Minimapa +STR_7000 :o +STR_7001 :Nom de l’atracció +STR_7002 :{STRINGID} {STRINGID} +STR_7003 :El fitxer d’àudio «{STRING}» està truncat. Mostra esperada de {INT32}, però només n’hi ha {INT32}. Considereu reinstal·lar el RCT2. +STR_7004 :Força que es torni a dibuixar diff --git a/data/language/cs-CZ.txt b/data/language/cs-CZ.txt index 7cd3c153d3..cbbba7e1a2 100644 --- a/data/language/cs-CZ.txt +++ b/data/language/cs-CZ.txt @@ -1573,8 +1573,8 @@ STR_2212 :Zobrazit seznam hlídačů STR_2213 :Zobrazit seznam maskotů STR_2214 :Nelze stavět při pozastavené hře! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} na {STRINGID} se stále nevrátil do {STRINGID}!{NEWLINE}Zkontrolujte, jestli se nezasekl nebo nezastavil STR_2219 :{RED}{COMMA16} lidí zemřelo při nehodě na {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Hodnocení parku: {BLACK}{COMMA16} @@ -3843,3 +3843,6 @@ STR_7000 :nebo STR_7001 :Název atrakce STR_7002 :{STRINGID} {STRINGID} STR_7003 :Zvukový soubor ‘{STRING}’ je zkrácený. Očekáván sample {INT32}, avšak pouze {INT32} je dostupných. Zvažte přeinstalování RCT2. +STR_7004 :Vynutit překresl. (force redraw) +STR_7005 :Stavět cesty v oblasti označené tažením +STR_7006 :Vykreslit okraje tlačítek s obrázky \ No newline at end of file diff --git a/data/language/da-DK.txt b/data/language/da-DK.txt index 66e9d11127..5183b13c5d 100644 --- a/data/language/da-DK.txt +++ b/data/language/da-DK.txt @@ -1566,8 +1566,8 @@ STR_2212 :Vis liste over Sikkerhedsvagter i parken STR_2213 :Vis liste over entertainere i parken STR_2214 :Konstruktion er ikke muligt, når spillet er sat på pause! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} på {STRINGID} er ikke kommet tilbage til {STRINGID} Endnu!{NEWLINE}Kontroller omm den sidder fast erler er strandet STR_2219 :{RED}{COMMA16} personer er døde i ulykken på {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Park Vurdering: {BLACK}{COMMA16} diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index b61e75e722..3ca5780fe4 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -1569,8 +1569,8 @@ STR_2212 :Liste der Aufseher im Park anzeigen STR_2213 :Liste der Animateure im Park anzeigen STR_2214 :Konstruktion während des Pausemodus nicht möglich! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} bei {STRINGID} ist noch nicht zu {STRINGID} zurückgekehrt!{NEWLINE}Überprüfen Sie, ob es steckengeblieben ist oder angehalten hat STR_2219 :{RED}{COMMA16} Menschen sind bei einem Unfall in {STRINGID} gestorben STR_2220 :{WINDOW_COLOUR_2}Parkbewertung: {BLACK}{COMMA16} diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 4c49b555b8..ae91bf194e 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -473,14 +473,14 @@ STR_1076 :Shop stall mode STR_1077 :Rotation mode STR_1078 :Forward rotation STR_1079 :Backward rotation -STR_1080 :Film: “Avenging aviators” -STR_1081 :3D film: “Mouse tails” +STR_1080 :Film: “Avenging Aviators” +STR_1081 :3D film: “Mouse Tails” STR_1082 :Space rings mode STR_1083 :Beginners mode STR_1084 :LIM-powered launch -STR_1085 :Film: “Thrill riders” -STR_1086 :3D film: “Storm chasers” -STR_1087 :3D film: “Space raiders” +STR_1085 :Film: “Thrill Riders” +STR_1086 :3D film: “Storm Chasers” +STR_1087 :3D film: “Space Raiders” STR_1088 :Intense mode STR_1089 :Berserk mode STR_1090 :Haunted house mode @@ -1568,8 +1568,8 @@ STR_2212 :Show list of security guards in park STR_2213 :Show list of entertainers in park STR_2214 :Construction not possible while game is paused! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} on {STRINGID} hasn’t returned to the {STRINGID} yet!{NEWLINE}Check whether it is stuck or has stalled STR_2219 :{RED}{COMMA16} people have died in an accident on {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Park Rating: {BLACK}{COMMA16} @@ -3843,3 +3843,6 @@ STR_7001 :Ride name STR_7002 :{STRINGID} {STRINGID} STR_7003 :Audio file ‘{STRING}’ is truncated. Expected sample {INT32}, but only {INT32} are available. Consider reinstalling RCT2. STR_7004 :Force Redraw +STR_7005 :Drag an area of footpath +STR_7006 :Draw border around image buttons +STR_7007 :Ride Type diff --git a/data/language/eo-ZZ.txt b/data/language/eo-ZZ.txt index abdf48d873..959192e0a4 100644 --- a/data/language/eo-ZZ.txt +++ b/data/language/eo-ZZ.txt @@ -1568,8 +1568,8 @@ STR_2212 :Montri liston de gardistoj en parko STR_2213 :Montri liston de amuzistoj en parko STR_2214 :Ne eblas konstrui, dum ludo estas paŭzita! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} sur {STRINGID} ne jam revenis al la {STRINGID}!{NEWLINE}Kontrolu se ĝi ne povas reveni, aŭ staŭlis STR_2219 :{RED}{COMMA16} homoj mortis pro akcidento sur {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Pritakso de Parko: {BLACK}{COMMA16} @@ -3839,3 +3839,5 @@ STR_7000 :aŭ STR_7001 :Nomo de atrakcio STR_7002 :{STRINGID} {STRINGID} STR_7003 :Sondosiero ‘{STRING}’ estas distranĉita. Atendis sonpecon {INT32}, sed nur {INT32} disponeblas. Konsideru reinstali je RCT2. +STR_7004 :Devigi redesegnon +STR_7005 :Treni areon de trotuaro diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index ee01e7422c..bb97334438 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -1569,8 +1569,8 @@ STR_2212 :Mostrar lista de guardias de seguridad en el parque STR_2213 :Mostrar lista de animadores en el parque STR_2214 :¡No es posible construir mientras el juego está pausado! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}¡{STRINGID} en {STRINGID} no ha regresado a la {STRINGID}!{NEWLINE}Comprueba si se ha atorado o se ha detenido. STR_2219 :{RED}{COMMA16} personas han muerto en un accidente en {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Valoración del parque: {BLACK}{COMMA16} diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index 4dbb695221..daa597ce76 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -1570,8 +1570,8 @@ STR_2212 :Näytä puiston vartijat STR_2213 :Näytä puiston viihdyttäjät STR_2214 :Rakentaminen ei ole mahdollista pelin ollessa pysäytettynä! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} laitteessa {STRINGID} ei ole vielä palannut {STRINGID}lle!{NEWLINE}Tarkista, onko se jumissa tai juuttunut STR_2219 :{RED}{COMMA16} henkilöä on kuollut laitteen {STRINGID} onnettomuudessa STR_2220 :{WINDOW_COLOUR_2}Puiston taso: {BLACK}{COMMA16} diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index 2c97359851..7b0292da80 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -473,12 +473,12 @@ STR_1076 :Mode magasins et boutiques STR_1077 :Mode rotation STR_1078 :Rotation avant STR_1079 :Rotation arrière -STR_1080 :Film : « Les aviateurs vengeurs » -STR_1081 :Film 3D : « Les queues de souris » +STR_1080 :Film : « Les Aviateurs vengeurs » +STR_1081 :Film 3D : « Les Queues de souris » STR_1082 :Mode anneaux de l’espace STR_1083 :Mode débutants STR_1084 :Lancement à induction linéaire -STR_1085 :Film : « Le grand frisson » +STR_1085 :Film : « Le Grand frisson » STR_1086 :Film 3D : « Chasseurs de tempêtes » STR_1087 :Film 3D : « Commandos de l’espace » STR_1088 :Mode intense @@ -1571,8 +1571,8 @@ STR_2212 :Afficher la liste des agents de sécurité dans le parc STR_2213 :Afficher la liste des animateurs dans le parc STR_2214 :Construction impossible tant que le jeu est en pause ! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} sur {STRINGID} n’est pas encore revenu à {STRINGID} !{NEWLINE}Vérifiez s’il est coincé ou au point mort. STR_2219 :{RED}{COMMA16} personnes sont décédées dans un accident sur {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Évaluation du parc : {BLACK}{COMMA16} @@ -3845,3 +3845,6 @@ STR_7000 :ou STR_7001 :Nom de l’attraction STR_7002 :{STRINGID} {STRINGID} STR_7003 :Le fichier audio « {STRING} » est tronqué. L’échantillon {INT32} était attendu, mais seulement {INT32} sont disponibles. Songez à réinstaller RCT2. +STR_7004 :Forcer le rendu +STR_7005 :Remplir de chemin une zone +STR_7006 :Dessiner une bordure autour des boutons-images diff --git a/data/language/gl-ES.txt b/data/language/gl-ES.txt index 7b27665fc0..561bb8bf39 100644 --- a/data/language/gl-ES.txt +++ b/data/language/gl-ES.txt @@ -473,13 +473,13 @@ STR_1076 :Modo de posto de venda STR_1077 :Modo de rotación STR_1078 :Rotación cara adiante STR_1079 :Rotación cara atrás -STR_1080 :Filme: "Avións vingadores" -STR_1081 :Filme 3D: "Rabos de rato" +STR_1080 :Filme: "Aviadores vingadores" +STR_1081 :Filme 3D: "Contos do rato" STR_1082 :Modo aneis espaciais STR_1083 :Modo principiante STR_1084 :Lanzamento impulsado por LIM (motores indución lineal) STR_1085 :Filme: "Pilotos da emoción" -STR_1086 :Filme 3D: "Perseguidores de tormentas" +STR_1086 :Filme 3D: "Cazadores de tempestades" STR_1087 :Filme 3D: "Asaltantes do espazo" STR_1088 :Modo intenso STR_1089 :Modo frenético @@ -1568,7 +1568,7 @@ STR_2212 :Amosar a lista de vixilantes no parque STR_2213 :Amosar a lista de animadores do parque STR_2214 :Non é posible construír mentres o xogo está en pausa! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C STR_2217  :{WINDOW_COLOUR_2}{COMMA16}°F STR_2218 :{RED}{STRINGID} en {STRINGID} non volveu a {STRINGID}!{NEWLINE}Comproba se quedou atascado ou parado. STR_2219 :{RED}{COMMA16} persoas morreron nun accidente en {STRINGID} @@ -3839,3 +3839,6 @@ STR_7000 :ou STR_7001 :Nome da atracción STR_7002 :{STRINGID} {STRINGID} STR_7003 :O ficheiro de son ‘{STRING}’ está incompleto. Agardabase {INT32} mostras, pero só {INT32} están dispoñibles. Considera reinstalar RCT2. +STR_7004 :Forzar redeseño +STR_7005 :Arrastra unha área de camiño +STR_7006 :Debuxa un bordo arredor dos botóns de imaxe diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index 627e71331f..7cac004fb2 100644 --- a/data/language/hu-HU.txt +++ b/data/language/hu-HU.txt @@ -5,12 +5,12 @@ STR_0000 : STR_0001 :{STRINGID} {COMMA16} STR_0002 :Spirális hullámvasút STR_0003 :Álló hullámvasút -STR_0004 :Felfüggesztett lengő hullámvasút +STR_0004 :Függesztett lengő hullámvasút STR_0005 :Fordított hullámvasút STR_0006 :Gyerek hullámvasút STR_0007 :Kisvasút STR_0008 :Egysínű vasút -STR_0009 :Mini felfüggesztett hullámvasút +STR_0009 :Mini függesztett hullámvasút STR_0010 :Csónakkölcsönző STR_0011 :Fa vadegér STR_0012 :Akadályverseny @@ -66,7 +66,7 @@ STR_0061 :Virginia Reel STR_0062 :Csobbanó csónakok STR_0063 :Mini helikopterek STR_0064 :Fekvő hullámvasút -STR_0065 :Felfüggesztett egysínű vasút +STR_0065 :Egysínű függővasút STR_0066 :Ismeretlen játék (40) STR_0067 :Irányváltó hullámvasút STR_0068 :Palástorsózó hullámvasút @@ -103,12 +103,12 @@ STR_0098 :LSM kilövéses hullámvasút STR_0099 :Klasszikus fa csavart hullámvasút STR_0512 :Egy kompakt hullámvasút spirális felvonószakasszal és sima, csavaros esésekkel. STR_0513 :Egy átforduló hullámvasút, amelyen az utasok álló helyzetben utaznak -STR_0514 :A hullámvasút pályája alatt felfüggesztett vonatok oldalt kilengenek a kanyarokban -STR_0515 :Egy acél hullámvasút, pálya alatt felfüggesztett vonatokkal, valamint számos összetett és csavarodó pályaelemmel +STR_0514 :A hullámvasút pályája alatt függesztett vonatok oldalt kilengenek a kanyarokban +STR_0515 :Egy acél hullámvasút, pálya alatt függesztett vonatokkal, valamint számos összetett és csavarodó pályaelemmel STR_0516 :Egy enyhe hullámvasút azok számára, akik még nem éreznek magukban elég bátorságot ahhoz, hogy felüljenek a nagyobb játékokra STR_0517 :Az utasok miniatűr vonatokon utaznak egy keskeny nyomtávú vasúti pályán STR_0518 :Az utasok elektromos vonatokon utaznak egy egysínű pályán -STR_0519 :Az utasok az egysínű pálya alatt felfüggesztett kocsikban utaznak, amelyek kétoldalt szabadon kilengenek a kanyarokban +STR_0519 :Az utasok az egysínű pálya alatt függesztett kocsikban utaznak, amelyek kétoldalt szabadon kilengenek a kanyarokban STR_0520 :Egy kikötőállomás, ahonnan a vendégek saját vízi járművel vezethetnek/evezhetnek ki a vízre STR_0521 :Egy gyors és csavaros hullámvasút, tele éles kanyarokkal és meredek esésekkel. Nagy intenzitással rendelkezik STR_0522 :Egy kisebb hullámvasút, amelyen az utasok a pálya felett ülnek, anélkül, hogy kocsik vennék körbe őket @@ -138,7 +138,7 @@ STR_0548 :Egy illemhely STR_0549 :Nagy forgó kerék, nyitott székekkel STR_0550 :Az utasok filmet néznek a mozgásszimulátor kabinjában, miközben azt egy hidraulikus kar forgatja és mozgatja STR_0551 :3D-s filmeket vetítő mozi egy geodéziai gömb alakú épületben -STR_0552 :A nagy forgó karokkal felfüggesztett kabinban az utasok előre-hátra forognak és bukfenceznek +STR_0552 :A nagy forgó karokkal függesztett kabinban az utasok előre-hátra forognak és bukfenceznek STR_0553 :Koncentrikus forgó gyűrűk, amelyekben az utasok szabadon foroghatnak minden irányba STR_0554 :A kocsi aszinkronmotoros gyorsítással hagyja el az állomást egy hosszú vízszintes pálya mentén, hogy felmenjen egy teljesen függőleges emelkedőn, ahonnan szabadeséssel zuhan le, hogy visszatérjen az állomásra STR_0555 :Az utasok egy függőleges torony liftjében utazhatnak a szintek között @@ -153,7 +153,7 @@ STR_0563 :Kényelmes, egyszerű biztonsági rudas vonatokban ülve élvezheti STR_0564 :Ez a fa pályán futó hullámvasút gyors, durva, hangos és „kontrollvesztett” utazási élményt nyújt, bőséges „légi idővel” STR_0565 :Egy egyszerű, kizárólag enyhe lejtőkre és fordulókra képes fa hullámvasút, amelyen a kocsikat csak az oldalirányú súrlódásos kerekek és a gravitáció tartják a pályán STR_0566 :A különálló hullámvasút kocsik egy szűk, éles kanyarokkal és rövid, meredek esésekkel tarkított, cikcakkos pályán száguldoznak -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_0567 :A pálya mindkét oldalán fü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ószalag hajtja őket, majd a meredek lejtőkön lefelé gyorsulva óriási csobbanással áztatják el az utasokat @@ -168,14 +168,14 @@ STR_0581 :A gyűrű alakban elhelyezkedő székeket egy magas torony tetejér STR_0582 :A vendégek légpárnás járművekben utaznak, amelyeket szabadon irányítanak STR_0583 :Egy épület, amely ferde szobákat és kanyargó folyosókat tartalmaz, hogy összezavarja az áthaladó embereket STR_0584 :Speciális, az utasok pedálozásával hajtott biciklik közlekednek egy acél egysínű pályán -STR_0585 :Az utasok a pálya alatt felfüggesztett üléspárokban ülnek, miközben kanyarognak és csavarodnak a szoros fordítókon +STR_0585 :Az utasok a pálya alatt függesztett üléspárokban ülnek, miközben kanyarognak és csavarodnak a szoros fordítókon STR_0586 :A csónak alakú kocsik a hullámvasút pályáján haladnak, hogy lehetővé tegyék a csavaros kanyarokat és a meredek zuhanásokat, a szelíd folyószakaszok vizébe csobbanva STR_0587 :Egy izgalmas, léghajtású indítás után a vonat felfelé száguld egy függőleges pályán, át a tetején, majd függőlegesen lefelé a másik oldalon, hogy visszatérjen az állomásra STR_0588 :Különálló kocsik futnak a cikcakkos, hajtűkanyarokkal és éles esésekkel teli pálya alatt STR_0589 :Egy nagy, repülőszőnyeg-témájú kocsi, amely ciklikusan fel-le mozog a 4 kar végén STR_0590 :Az utasok egy alámerült tengeralattjáróban utaznak végig egy víz alatti pályán STR_0591 :A tutaj alakú csónakok szelíden kanyarognak a folyó pályája mentén -STR_0593 :Forgó kerék felfüggesztett utaskabinokkal, amely először elkezd forogni, majd egy tartókar segítségével felfelé dől. +STR_0593 :Forgó kerék függesztett utaskabinokkal, amely először elkezd forogni, majd egy tartókar segítségével felfelé dől. STR_0598 :A fordított hullámvasút vonatai az állomásból kifelé gyorsulva felfelé haladnak egy függőleges pályacsúcson, majd visszafordulnak az állomáson keresztül, hogy visszafelé haladjanak egy másik függőleges pályacsúcson. STR_0599 :Egy kompakt hullámvasút különálló kocsikkal és sima, csavaros esésekkel STR_0600 :Motoros bányavonatok futnak egy sima és csavaros pálya mentén @@ -375,7 +375,7 @@ STR_0978 :Új enyhe játékok STR_0979 :Új hullámvasutak STR_0980 :Új izgalmas játékok STR_0981 :Új vízi játékok -STR_0982 :Új boltok & bódék +STR_0982 :Új boltok és bódék STR_0983 :Kutatás-fejlesztés STR_0984 :{WINDOW_COLOUR_2}▲{BLACK} {CURRENCY2DP} STR_0985 :{WINDOW_COLOUR_2}▼{BLACK} {CURRENCY2DP} @@ -919,7 +919,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émje igazán megéri az árát” +STR_1526 :„{STRINGID} fagylaltja igazán megéri az árát” STR_1527 :„{STRINGID} vattacukra igazán megéri az árát” STR_1528 : STR_1529 : @@ -953,7 +953,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émje túl sokba kerül számomra” +STR_1560 :„{STRINGID} fagylaltja túl sokba kerül számomra” STR_1561 :„{STRINGID} vattacukra túl sokba kerül számomra” STR_1562 : STR_1563 : @@ -1335,7 +1335,7 @@ STR_1964 :{WINDOW_COLOUR_2}Esernyő ára: STR_1965 :{WINDOW_COLOUR_2}Üdítőital ára: STR_1966 :{WINDOW_COLOUR_2}Hamburger ára: STR_1967 :{WINDOW_COLOUR_2}Sült krumpli ára: -STR_1968 :{WINDOW_COLOUR_2}Jégkrém ára: +STR_1968 :{WINDOW_COLOUR_2}Fagylalt ára: STR_1969 :{WINDOW_COLOUR_2}Vattacukor ára: STR_1970 :{WINDOW_COLOUR_2} STR_1971 :{WINDOW_COLOUR_2} @@ -1363,7 +1363,7 @@ STR_1992 :Esernyő STR_1993 :Üdítőital STR_1994 :Hamburger STR_1995 :Sült krumpli -STR_1996 :Jégkrém +STR_1996 :Fagylalt STR_1997 :Vattacukor STR_1998 :Üres italos doboz STR_1999 :Szemét @@ -1391,7 +1391,7 @@ STR_2020 :Esernyő STR_2021 :Üdítőital STR_2022 :Hamburger STR_2023 :Sült krumpli -STR_2024 :Jégkrém +STR_2024 :Fagylalt STR_2025 :Vattacukor STR_2026 :Üres italos doboz STR_2027 :Szemét @@ -1419,7 +1419,7 @@ STR_2048 :egy esernyő STR_2049 :üdítőital STR_2050 :egy hamburger STR_2051 :sült krumpli -STR_2052 :egy jégkrém +STR_2052 :egy fagylalt STR_2053 :egy vattacukor STR_2054 :egy üres italos doboz STR_2055 :szemét @@ -1447,7 +1447,7 @@ STR_2076 :„{STRINGID}” esernyő STR_2077 :Üdítőital STR_2078 :Hamburger STR_2079 :Sült krumpli -STR_2080 :Jégkrém +STR_2080 :Fagylalt STR_2081 :Vattacukor STR_2082 :Üres italos doboz STR_2083 :Szemét @@ -1568,8 +1568,8 @@ STR_2212 :A park biztonsági őreinek listája STR_2213 :A park szórakoztatóinak listája STR_2214 :Szünet közben nem lehet építeni! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} itt van: {STRINGID} és még nem érkezett vissza ide: {STRINGID}!{NEWLINE}Ellenőrizd, hogy nincs-e beragadva vagy elakadva STR_2219 :{RED}{STRINGID} balesete közben {COMMA16} ember meghalt STR_2220 :{WINDOW_COLOUR_2}Park értékelése: {BLACK}{COMMA16} @@ -3839,3 +3839,6 @@ STR_7000 :vagy STR_7001 :Játéknév STR_7002 :{STRINGID} {STRINGID} STR_7003 :A(z) „{STRING}” hangfájl csonka. Minta {INT32} lenne az elvárt, de csak {INT32} érhető el. Fontold meg az RCT2 újratelepítését. +STR_7004 :Újrarajzolás kényszerítése +STR_7005 :Útterület építése húzással +STR_7006 :Keret rajzolása a képgombok köré diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index 000aee2e09..3f90ee919d 100644 --- a/data/language/it-IT.txt +++ b/data/language/it-IT.txt @@ -1569,8 +1569,8 @@ STR_2212 :Mostra la lista dei vigilanti del parco STR_2213 :Mostra la lista degli intrattenitori del parco STR_2214 :Non è possibile costruire quando il gioco è in pausa! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} sull’attrazione {STRINGID} non ha ancora fatto ritorno presso: {STRINGID}!{NEWLINE}Controlla se si è bloccato o se è entrato in stallo STR_2219 :{RED}{COMMA16} persone sono rimaste uccise in un incidente su {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Valutazione del parco: {BLACK}{COMMA16} diff --git a/data/language/ja-JP.txt b/data/language/ja-JP.txt index 82087e3433..f3c7cfd3c4 100644 --- a/data/language/ja-JP.txt +++ b/data/language/ja-JP.txt @@ -1564,8 +1564,8 @@ STR_2212 :パークの警備員の表示 STR_2213 :パークのエンターテイナーの表示 STR_2214 :ゲームが一時停止中で建設はできません。 STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}℃ -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}℉ +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}℃ +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}℉ STR_2218 :{RED}{STRINGID}の{STRINGID}が{STRINGID}にまだ戻ってきていません!{NEWLINE}どこかにひっかかったり止まったりしていないか確認してください STR_2219 :{RED}{COMMA16}人の来客は{STRINGID}上の事故で死亡してしまいました。 STR_2220 :{WINDOW_COLOUR_2}パーク評価値: {BLACK}{COMMA16} diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 0ea7e2ca33..e1de5bb2b8 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -1572,8 +1572,8 @@ STR_2212 :경비원 목록을 보여줍니다 STR_2213 :엔터테이너 목록을 보여줍니다 STR_2214 :게임 일시정지 중에는 건설할 수 없습니다! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{POP16}{POP16}{STRINGID}의 {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{STRINGID}(이)가 {POP16}{POP16}{POP16}{STRINGID}으로 아직 돌아오지 않았습니다!{NEWLINE}놀이기구가 멈춰있거나 오도가도 못하고 있는지 확인하세요. STR_2219 :{RED}{COMMA16}명의 손님이 {STRINGID} 사고로 사망하였습니다! STR_2220 :{WINDOW_COLOUR_2}공원 등급: {BLACK}{COMMA16} @@ -2935,7 +2935,7 @@ STR_5835 :게임 밖으로 커서가 나가면 게임에서 소리가 나지 STR_5836 :첫 화면에서 사용할 음악을 선택합니다.{NEWLINE}RCT1 테마를 선택하려면 고급 탭에서 RCT1의 경로를 지정해야 합니다. STR_5837 :사용자 UI 테마를 생성하고 관리합니다. STR_5838 :메인 메뉴에 재정 창을 위한 별도의 버튼을 표시합니다. -STR_5839 :메인 매뉴에 연구 및 개발 창을 위한 별도의 버튼을 표시합니다. +STR_5839 :메인 메뉴에 연구 및 개발 창을 위한 별도의 버튼을 표시합니다. STR_5840 :메인 메뉴에 치트 창을 위한 별도의 버튼을 표시합니다. STR_5841 :메인 메뉴에 최근 메시지 창을 위한 별도의 버튼을 표시합니다. STR_5842 :시나리오를 RCT2처럼 난이도별로 정렬하거나, RCT1처럼 게임별로 정렬합니다. @@ -3842,3 +3842,6 @@ STR_7000 :(또는) STR_7001 :놀이기구 이름 STR_7002 :{STRINGID} {STRINGID} STR_7003 :오디오 파일(‘{STRING}’) 데이터가 잘려있습니다. {INT32}개의 데이터가 있어야 하지만 {INT32}개만 존재합니다. RCT2를 재설치해보세요. +STR_7004 :강제 화면 갱신 +STR_7005 :드래그로 보도 건설 +STR_7006 :버튼 주위에 경계선 표시 diff --git a/data/language/nb-NO.txt b/data/language/nb-NO.txt index 44c6900c35..670d500567 100644 --- a/data/language/nb-NO.txt +++ b/data/language/nb-NO.txt @@ -1562,8 +1562,8 @@ STR_2212 :Vis liste over sikkerhetsvakter i parken STR_2213 :Vis liste over underholdere i parken STR_2214 :Konstruksjon ikke mulig mens spillet er pauset! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} på {STRINGID} har ikke returnet til {STRINGID} enda!{NEWLINE}Sjekk om den sitter fast eller har stoppet STR_2219 :{RED}{COMMA16} personer har omkommet i en ulykke på {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Park Vurdering: {BLACK}{COMMA16} diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 397bcb5322..c68013fec4 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -1569,8 +1569,8 @@ STR_2212 :Toon lijst van bewakers in het park STR_2213 :Toon lijst van entertainers in het park STR_2214 :Bouwen is niet mogelijk wanneer het spel is gepauzeerd! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16} °C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16} °F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16} °C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16} °F STR_2218 :{RED}{STRINGID} van {STRINGID} is nog niet teruggekeerd naar de opstapplaats ({STRINGID})!{NEWLINE}Controleer of het is vastgelopen of stil komen te staan STR_2219 :{RED}{COMMA16} personen zijn om het leven gekomen bij een ongeluk in {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Parkwaardering: {BLACK}{COMMA16} @@ -3838,3 +3838,5 @@ STR_7000 :of STR_7001 :Attractienaam STR_7002 :{STRINGID} {STRINGID} STR_7003 :Audiobestand ‘{STRING}’ is beschadigd. Sample nr. {INT32} kon niet worden geladen, aangezien er maar {INT32} beschikbaar zijn. Installeer RollerCoaster Tycoon 2 opnieuw. +STR_7004 :Volledig beeld hertekenen +STR_7005 :Voetpaden aanleggen door te slepen diff --git a/data/language/pl-PL.txt b/data/language/pl-PL.txt index 8a3490dca4..03c72fa953 100644 --- a/data/language/pl-PL.txt +++ b/data/language/pl-PL.txt @@ -1568,8 +1568,8 @@ STR_2212 :Pokaż listę wszystkich strażników w parku STR_2213 :Pokaż listę wszystkich komików w parku STR_2214 :Nie można budować przy wstrzymanej grze! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} na {STRINGID} jeszcze nie powrócił do {STRINGID}!{NEWLINE}Sprawdź czy gdzieś nie utknął. STR_2219 :{RED}{COMMA16} ludzi zginęło w wypadku na atrakcji {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Atrakcyjność parku: {BLACK}{COMMA16} diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index 20d471d196..55b53037eb 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -473,14 +473,14 @@ STR_1076 :Modo de lojas e barracas STR_1077 :Modo de rotação STR_1078 :Rotação para frente STR_1079 :Rotação para trás -STR_1080 :Filme: ”Aviadores Vingadores” -STR_1081 :Filme em 3D: ”Caudas de Rato” +STR_1080 :Filme: “Aviadores vingadores” +STR_1081 :Filme em 3D: “Bichos e rabichos” STR_1082 :Modo anéis espaciais STR_1083 :Modo iniciante STR_1084 :Lançamento por indução linear -STR_1085 :Filme: ”Pilotos de Emoção” -STR_1086 :Filme em 3D: ”Caçadores de tempestades” -STR_1087 :Filme em 3D: ”Caçadores do espaço” +STR_1085 :Filme: “Pilotos de emoção” +STR_1086 :Filme em 3D: “Caçadores de tempestades” +STR_1087 :Filme em 3D: “Corsários do espaço” STR_1088 :Modo intenso STR_1089 :Modo frenético STR_1090 :Modo casa mal-assombrada @@ -1568,8 +1568,8 @@ STR_2212 :Exibir a lista de seguranças no parque STR_2213 :Exibir a lista de animadores no parque STR_2214 :Impossível construir enquanto o jogo está pausado! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} em {STRINGID} não voltou à {STRINGID} ainda!{NEWLINE}Verifique se está preso ou parado STR_2219 :{RED}{COMMA16} pessoas morreram em um acidente em {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Classificação do Parque: {BLACK}{COMMA16} @@ -3838,4 +3838,6 @@ STR_6799 :Mini mapa STR_7000 :ou STR_7001 :Nome da atração STR_7002 :{STRINGID} {STRINGID} -STR_7003 :O arquito de áudio ‘{STRING}’ está incompleto. {INT32} amostras eram esperadas, mas apenas {INT32} estão disponíveis. Considere reinstalar o RCT2. +STR_7003 :O arquivo de áudio ‘{STRING}’ está incompleto. {INT32} amostras eram esperadas, mas apenas {INT32} estão disponíveis. Considere reinstalar o RCT2. +STR_7004 :Forçar Redesenho +STR_7005 :Arrastar uma área de calçada diff --git a/data/language/ru-RU.txt b/data/language/ru-RU.txt index 362dc04e0f..c76ca1961b 100644 --- a/data/language/ru-RU.txt +++ b/data/language/ru-RU.txt @@ -1562,8 +1562,8 @@ STR_2212 :Показать список охранников STR_2213 :Показать список артистов STR_2214 :Нельзя строить во время паузы! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} на аттр. {STRINGID} не возвращается к {STRINGID}!{NEWLINE}Нужна помощь. STR_2219 :{RED}{COMMA16} людей погибло на {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Рейтинг парка: {BLACK}{COMMA16} @@ -3827,3 +3827,5 @@ STR_7000 :или STR_7001 :Название аттр. STR_7002 :{STRINGID} {STRINGID} STR_7003 :Аудио-файл «{STRING}» повреждён. Ожидалось {INT32} образцов, но доступны только {INT32}. Рекомендуется повторная установка RCT2. +STR_7004 :Полная перерисовка +STR_7006 :Бордюр на кнопках с изображениями diff --git a/data/language/sv-SE.txt b/data/language/sv-SE.txt index 6ad73b8c03..f7fbdb412b 100644 --- a/data/language/sv-SE.txt +++ b/data/language/sv-SE.txt @@ -1569,8 +1569,8 @@ STR_2212 :Visa listan över alla säkerhetsvakter STR_2213 :Visa listan över alla underhållare STR_2214 :Konstruktion är inte möjligt när spelet är pausat! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} på {STRINGID} har inte kommit tillbaka till {STRINGID} än!{NEWLINE}Kolla om den sitter fast eller har fått motorstopp STR_2219 :{RED}{COMMA16} personer har omkommit i en olycka på {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Parkomdöme: {BLACK}{COMMA16} diff --git a/data/language/tr-TR.txt b/data/language/tr-TR.txt index 74c8f520e3..ef5290f0b1 100644 --- a/data/language/tr-TR.txt +++ b/data/language/tr-TR.txt @@ -1555,8 +1555,8 @@ STR_2212 :Parktaki tüm güvenlikler STR_2213 :Parktaki tüm animatörler STR_2214 :Oyun durdurulduğu sürece inşa edilemiyor! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} aletinde {STRINGID} halen {STRINGID}ye dönmedi!{NEWLINE}Aleti kontrol ediniz STR_2219 :{RED}{STRINGID} aletinde {COMMA16} kişi canını kayıp etti STR_2220 :{WINDOW_COLOUR_2}Park değerlendirmesi: {BLACK}{COMMA16} diff --git a/data/language/uk-UA.txt b/data/language/uk-UA.txt index 6cdebd9291..cd5986b4ba 100644 --- a/data/language/uk-UA.txt +++ b/data/language/uk-UA.txt @@ -1562,8 +1562,8 @@ STR_2212 :Show list of security guards in park STR_2213 :Show list of entertainers in park STR_2214 :Construction not possible while game is paused! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} on {STRINGID} hasn’t returned to the {STRINGID} yet!{NEWLINE}Check whether it is stuck or has stalled STR_2219 :{RED}{COMMA16} people have died in an accident on {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Рейтинг парку: {BLACK}{COMMA16} diff --git a/data/language/vi-VN.txt b/data/language/vi-VN.txt index 623739d7eb..2a01d4b0ca 100644 --- a/data/language/vi-VN.txt +++ b/data/language/vi-VN.txt @@ -1518,8 +1518,8 @@ STR_2212 :Hiện danh sách nhân viên bảo vệ trong công viên STR_2213 :Hiện danh sách người giải trí trong công viên STR_2214 :Không thể xây dựng khi trò chơi đang tạm dừng! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} trên {STRINGID} vẫn chưa trở lại {STRINGID}!{NEWLINE}Kiểm tra xem nó có bị kẹt hay bị dừng không STR_2219 :{RED}{COMMA16} người đã chết trong một tai nạn trên {STRINGID} STR_2220 :{WINDOW_COLOUR_2}Đánh giá công viên: {BLACK}{COMMA16} diff --git a/data/language/zh-CN.txt b/data/language/zh-CN.txt index 875f14b2eb..70f3763a67 100644 --- a/data/language/zh-CN.txt +++ b/data/language/zh-CN.txt @@ -1568,8 +1568,8 @@ STR_2212 :列出游乐园内的安全警卫 STR_2213 :列出游乐园内的表演人员 STR_2214 :你不能在游戏暂停时建造! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID} ,{STRINGID}的一部份,尚未返回到{STRINGID}!{NEWLINE}检查是否被卡住或被停止了 STR_2219 :{RED}{COMMA16}人已丧生于{STRINGID}的意外中 STR_2220 :{WINDOW_COLOUR_2}游乐园评价:{BLACK}{COMMA16} diff --git a/data/language/zh-TW.txt b/data/language/zh-TW.txt index 6745fc705c..eb279738bc 100644 --- a/data/language/zh-TW.txt +++ b/data/language/zh-TW.txt @@ -1572,8 +1572,8 @@ STR_2212 :列出樂園內的安全警衛 STR_2213 :列出樂園內的表演人員 STR_2214 :遊戲暫停時無法建造任何物件! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) -STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C -STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F +STR_2216 :{WINDOW_COLOUR_1}{COMMA16}°C +STR_2217 :{WINDOW_COLOUR_1}{COMMA16}°F STR_2218 :{RED}{STRINGID}, {STRINGID}的一部份, 尚未返回到{STRINGID}!{NEWLINE}檢查是否被卡住或被停止了 STR_2219 :{RED}{COMMA16}人已於{STRINGID}的意外中喪生 STR_2220 :{WINDOW_COLOUR_2}樂園評價: {BLACK}{COMMA16} diff --git a/data/scenario_patches/1286934.parkpatch b/data/scenario_patches/1286934.parkpatch index afa47848e8..c2a9db2dce 100644 --- a/data/scenario_patches/1286934.parkpatch +++ b/data/scenario_patches/1286934.parkpatch @@ -7,5 +7,25 @@ [ 9, 74 ] ] } - } + }, + "paths": [ + { + "railings": "rct2.footpath_railings.concrete", + "surface": "rct1aa.footpath_surface.queue_red", + "coordinates": [ + [ 19, 58, 26 ], + [ 20, 58, 26 ], + [ 21, 58, 26 ], + [ 22, 58, 26 ], + [ 23, 58, 26 ], + [ 23, 57, 26 ], + [ 23, 56, 26 ], + [ 22, 56, 26 ], + [ 21, 56, 26 ], + [ 21, 57, 26 ], + [ 20, 57, 26 ] + ], + "queue": true + } + ] } diff --git a/data/scenario_patches/608cd8a.parkpatch b/data/scenario_patches/608cd8a.parkpatch index 6cb89a8fb8..eec0fe9aea 100644 --- a/data/scenario_patches/608cd8a.parkpatch +++ b/data/scenario_patches/608cd8a.parkpatch @@ -22,5 +22,11 @@ [ 95, 25 ] ] } - } + }, + "rides": [ + { + "id": 34, + "operation": "swap_entrance_exit" + } + ] } diff --git a/data/scenario_patches/72b0ef7.parkpatch b/data/scenario_patches/72b0ef7.parkpatch index 746657cfcf..adb3109e4d 100644 --- a/data/scenario_patches/72b0ef7.parkpatch +++ b/data/scenario_patches/72b0ef7.parkpatch @@ -7,5 +7,25 @@ [ 9, 74 ] ] } - } + }, + "paths": [ + { + "railings": "rct2.footpath_railings.concrete", + "surface": "rct2.footpath_surface.queue_yellow", + "coordinates": [ + [ 19, 58, 26 ], + [ 20, 58, 26 ], + [ 21, 58, 26 ], + [ 22, 58, 26 ], + [ 23, 58, 26 ], + [ 23, 57, 26 ], + [ 23, 56, 26 ], + [ 22, 56, 26 ], + [ 21, 56, 26 ], + [ 21, 57, 26 ], + [ 20, 57, 26 ] + ], + "queue": true + } + ] } diff --git a/data/scenario_patches/8965a5c.parkpatch b/data/scenario_patches/8965a5c.parkpatch index b0b30027c8..9d46c447ea 100644 --- a/data/scenario_patches/8965a5c.parkpatch +++ b/data/scenario_patches/8965a5c.parkpatch @@ -17,5 +17,33 @@ [ 126, 73 ] ] } + ], + "paths": [ + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.queue_green", + "coordinates": [ [ 51, 58, 16 ] ], + "queue": true + }, + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.queue_green", + "coordinates": [ [ 51, 59, 14 ] ], + "slope_direction": 3, + "queue": true + }, + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.tarmac_green", + "coordinates": [ [ 50, 58, 16 ] ], + "queue": false + }, + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.tarmac_green", + "coordinates": [ [ 50, 59, 14 ] ], + "slope_direction": 3, + "queue": false + } ] } diff --git a/data/scenario_patches/d055327.parkpatch b/data/scenario_patches/d055327.parkpatch index dac91ddcba..eb180606fa 100644 --- a/data/scenario_patches/d055327.parkpatch +++ b/data/scenario_patches/d055327.parkpatch @@ -17,5 +17,33 @@ [ 126, 73 ] ] } + ], + "paths": [ + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.queue_green", + "coordinates": [ [ 51, 58, 16 ] ], + "queue": true + }, + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.queue_green", + "coordinates": [ [ 51, 59, 14 ] ], + "slope_direction": 3, + "queue": true + }, + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.tarmac_green", + "coordinates": [ [ 50, 58, 16 ] ], + "queue": false + }, + { + "railings": "rct2.footpath_railings.concrete_green", + "surface": "rct2.footpath_surface.tarmac_green", + "coordinates": [ [ 50, 59, 14 ] ], + "slope_direction": 3, + "queue": false + } ] } diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 5052c6ee8e..19044b75f2 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,8 +1,46 @@ +0.4.28 (in development) +------------------------------------------------------------------------ +- Feature: [#25286] Footpath area dragging tool. +- Feature: [#25379] Add an option to the command line screenshot function to draw debug segment heights. +- Improved: [#21375] The `load_object` console command now allows loading JSON objects. +- Improved: [#25297] Paths on the ground in SV4/SC4 no longer block supports of the paths above. +- Improved: [#25349] ‘Recent Messages’ window can now be fully themed. +- Improved: [#25433] Colour dropdown now uses bigger images in Enlarged UI mode. +- Change: [#25089] Peep actions and animations that cause them to stop moving no longer trigger when they are on a level crossing. +- Change: [#25337] Placing track designs with scenery that is obstructed no longer disables all of the scenery. +- Fix: [#20198] Guest inventory from RCT1 base game saves is not imported. +- Fix: [#20486] Multiplayer desync when placing track designs without any scenery. +- Fix: [#22779, #25330] Incorrect queue paths in Nevermore Park and Six Flags Holland scenarios (bug in the original scenarios). +- Fix: [#24975] The Corkscrew and LIM Launched (original bug) roller coaster quarter loop tunnels are too high. +- Fix: [#25139] Steam locomotive and tram claxons can sound louder than normal when approaching crossings that span multiple tiles. +- Fix: [#25190] Inserting a block brake while a coaster is simulating will cause the simulation to behave strangely. +- Fix: [#25206] System file picker does not show up on the Steam Deck. +- Fix: [#25272] Text colour dropdown in the Banner window is too narrow, resulting in truncated labels. +- Fix: [#25299] The Mine Train Coaster left large helix draws incorrect sprites at certain angles (original bug). +- Fix: [#25328] Spiral Slide in Blackpool Pleasure Beach has its entrance and exit the wrong way round (bug in the original scenario). +- Fix: [#25342] The Go-Karts medium right gentle sloped turn does not have a tunnel at the end. +- Fix: [#25349] Items in Recent Messages are too narrow if there is no scrollbar visible. +- Fix: [#25350] The scrolling intro background switches colour halfway through (original bug). +- Fix: [#25350] When skipping the scrolling intro, the screen does not get cleared properly. +- Fix: [#25350] Scrolling intro cannot be skipped using a mouse click. +- Fix: [#25358] The Stand Up Roller Coaster left corkscrew does not block supports correctly. +- Fix: [#25363] The Mine Train Coaster flat-to-steep track pieces do not block all metal supports. +- Fix: [#25369] The Go-Karts medium turns and small flat and sloped turns do not block metal supports correctly. +- Fix: [#25370] The Hybrid Coaster diagonal brakes and block brakes do not block metal supports consistently. +- Fix: [#25371] The Wooden Roller Coaster small banked turns block too many metal supports. +- Fix: [#25378] The land tool sometimes allows land to be raised through a maze. +- Fix: [#25380] The Lay-down Roller Coaster left corkscrew supports are incorrect at one angle (original bug). +- Fix: [#25388] The Shortcut Keys window uses the wrong colours for separators, scrollbars and buttons. +- Fix: [#25401] Mazes can be built 2 units higher than their support limits. +- Fix: [#25404] Guests that have been removed with the remove all guests cheat will still be visible if they were sliding down the Spiral Slide. +- Fix: [#25410] Guest flags (e.g. tracking) not imported from RCT1. + 0.4.27 (2025-10-04) ------------------------------------------------------------------------ - Feature: [#25218] `sprite exportobject` command, which allows extracting images from an object. - Feature: [#25274] New title sequence (see https://github.com/OpenRCT2/title-sequences/releases/tag/v0.4.26 for credits). - Improved: [#2296, #2307] The land tool now takes sloped track and paths into account when modifying land. +- Improved: [#25192] Ride List now allows sorting by ride type. - Change: [#25111] Frozen guests no longer finish consuming any food or drink they are carrying. - Change: [#25161] Revert to the ‘fair ride price’ calculation of vanilla RCT2. - Change: [#25201] Ride List: put unknown popularity and satisfaction last when sorting. diff --git a/resources/g2/icons/colour_invisible_large.png b/resources/g2/icons/colour_invisible_large.png new file mode 100644 index 0000000000..3d8b2389f6 Binary files /dev/null and b/resources/g2/icons/colour_invisible_large.png differ diff --git a/resources/g2/icons/colour_invisible_pressed_large.png b/resources/g2/icons/colour_invisible_pressed_large.png new file mode 100644 index 0000000000..9a7cd2b9cc Binary files /dev/null and b/resources/g2/icons/colour_invisible_pressed_large.png differ diff --git a/resources/g2/icons/colour_large.png b/resources/g2/icons/colour_large.png new file mode 100644 index 0000000000..0941a813ae Binary files /dev/null and b/resources/g2/icons/colour_large.png differ diff --git a/resources/g2/icons/colour_pressed_large.png b/resources/g2/icons/colour_pressed_large.png new file mode 100644 index 0000000000..c73c31cb28 Binary files /dev/null and b/resources/g2/icons/colour_pressed_large.png differ diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index d69b3c6fb4..0bfa446504 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -324,6 +324,18 @@ { "path": "icons/colour_invisible_pressed.png" }, + { + "path": "icons/colour_large.png" + }, + { + "path": "icons/colour_pressed_large.png" + }, + { + "path": "icons/colour_invisible_large.png" + }, + { + "path": "icons/colour_invisible_pressed_large.png" + }, { "path": "icons/folder.png" }, @@ -838,5 +850,10 @@ }, { "path": "icons/rotate_view_anti-clockwise.png" + }, + { + "path": "tool/path_drag_tool.png", + "x": 1, + "y": 2 } ] diff --git a/resources/g2/tool/path_drag_tool.png b/resources/g2/tool/path_drag_tool.png new file mode 100644 index 0000000000..b64fed1f06 Binary files /dev/null and b/resources/g2/tool/path_drag_tool.png differ diff --git a/resources/tracks/sprites.json b/resources/tracks/sprites.json index 10d7e7cccd..75c9bfa4bb 100644 --- a/resources/tracks/sprites.json +++ b/resources/tracks/sprites.json @@ -24635,165 +24635,205 @@ "palette": "keep" }, { - "path": "support/flat_to_steep_1_1.png", - "x": -32, - "y": -5 - }, - { - "path": "support/flat_to_steep_1_2.png", - "x": -32, - "y": -1 - }, - { - "path": "support/flat_to_steep_1_3.png", - "x": -32, - "y": -1 - }, - { - "path": "support/flat_to_steep_1_4.png", - "x": -32, - "y": -5 - }, - { - "path": "support/flat_to_steep_2_1.png", - "x": -32, - "y": -18 - }, - { - "path": "support/flat_to_steep_2_2.png", - "x": -32, - "y": -5 - }, - { - "path": "support/flat_to_steep_2_3.png", - "x": -32, - "y": -5 - }, - { - "path": "support/flat_to_steep_2_4.png", - "x": -32, - "y": -18 - }, - { - "path": "support/flat_to_steep_3_1.png", - "x": -32, - "y": -27 - }, - { - "path": "support/flat_to_steep_3_2.png", - "x": -32, - "y": -11 - }, - { - "path": "support/flat_to_steep_3_3.png", - "x": -32, - "y": -11 - }, - { - "path": "support/flat_to_steep_3_4.png", - "x": -32, - "y": -27 - }, - { - "path": "support/flat_to_steep_4_1.png", - "x": -32, - "y": -57 - }, - { - "path": "support/flat_to_steep_4_2.png", - "x": -32, - "y": -41 - }, - { - "path": "support/flat_to_steep_4_3.png", - "x": -32, - "y": -41 - }, - { - "path": "support/flat_to_steep_4_4.png", - "x": -32, - "y": -57 - }, - { - "path": "support/steep_to_flat_1_1.png", - "x": -32, - "y": -54 - }, - { - "path": "support/steep_to_flat_1_2.png", - "x": -32, - "y": -38 - }, - { - "path": "support/steep_to_flat_1_3.png", - "x": -32, - "y": -38 - }, - { - "path": "support/steep_to_flat_1_4.png", - "x": -32, - "y": -54 - }, - { - "path": "support/steep_to_flat_2_1.png", - "x": -32, - "y": -31 - }, - { - "path": "support/steep_to_flat_2_2.png", - "x": -32, - "y": -15 - }, - { - "path": "support/steep_to_flat_2_3.png", - "x": -32, - "y": -15 - }, - { - "path": "support/steep_to_flat_2_4.png", - "x": -32, - "y": -31 - }, - { - "path": "support/steep_to_flat_3_1.png", - "x": -32, - "y": -28 - }, - { - "path": "support/steep_to_flat_3_2.png", + "path": "support/wooden/truss/up_25_even_1.png", "x": -32, "y": -16 }, { - "path": "support/steep_to_flat_3_3.png", + "path": "support/wooden/truss/up_25_even_2.png", + "x": -32, + "y": -1 + }, + { + "path": "support/wooden/truss/up_25_even_3.png", + "x": -32, + "y": -1 + }, + { + "path": "support/wooden/truss/up_25_even_4.png", "x": -32, "y": -16 }, { - "path": "support/steep_to_flat_3_4.png", + "path": "support/wooden/truss/flat_to_steep_1_1.png", + "x": -32, + "y": -5 + }, + { + "path": "support/wooden/truss/flat_to_steep_1_2.png", + "x": -32, + "y": -1 + }, + { + "path": "support/wooden/truss/flat_to_steep_1_3.png", + "x": -32, + "y": -1 + }, + { + "path": "support/wooden/truss/flat_to_steep_1_4.png", + "x": -32, + "y": -5 + }, + { + "path": "support/wooden/truss/flat_to_steep_2_1.png", + "x": -32, + "y": -18 + }, + { + "path": "support/wooden/truss/flat_to_steep_2_2.png", + "x": -32, + "y": -5 + }, + { + "path": "support/wooden/truss/flat_to_steep_2_3.png", + "x": -32, + "y": -5 + }, + { + "path": "support/wooden/truss/flat_to_steep_2_4.png", + "x": -32, + "y": -18 + }, + { + "path": "support/wooden/truss/flat_to_steep_3_1.png", + "x": -32, + "y": -27 + }, + { + "path": "support/wooden/truss/flat_to_steep_3_2.png", + "x": -32, + "y": -11 + }, + { + "path": "support/wooden/truss/flat_to_steep_3_3.png", + "x": -32, + "y": -11 + }, + { + "path": "support/wooden/truss/flat_to_steep_3_4.png", + "x": -32, + "y": -27 + }, + { + "path": "support/wooden/truss/flat_to_steep_4_1.png", + "x": -32, + "y": -57 + }, + { + "path": "support/wooden/truss/flat_to_steep_4_2.png", + "x": -32, + "y": -41 + }, + { + "path": "support/wooden/truss/flat_to_steep_4_3.png", + "x": -32, + "y": -41 + }, + { + "path": "support/wooden/truss/flat_to_steep_4_4.png", + "x": -32, + "y": -57 + }, + { + "path": "support/wooden/truss/steep_to_flat_1_1.png", + "x": -32, + "y": -54 + }, + { + "path": "support/wooden/truss/steep_to_flat_1_2.png", + "x": -32, + "y": -38 + }, + { + "path": "support/wooden/truss/steep_to_flat_1_3.png", + "x": -32, + "y": -38 + }, + { + "path": "support/wooden/truss/steep_to_flat_1_4.png", + "x": -32, + "y": -54 + }, + { + "path": "support/wooden/truss/steep_to_flat_2_1.png", + "x": -32, + "y": -31 + }, + { + "path": "support/wooden/truss/steep_to_flat_2_2.png", + "x": -32, + "y": -15 + }, + { + "path": "support/wooden/truss/steep_to_flat_2_3.png", + "x": -32, + "y": -15 + }, + { + "path": "support/wooden/truss/steep_to_flat_2_4.png", + "x": -32, + "y": -31 + }, + { + "path": "support/wooden/truss/steep_to_flat_3_1.png", "x": -32, "y": -28 }, { - "path": "support/steep_to_flat_4_1.png", + "path": "support/wooden/truss/steep_to_flat_3_2.png", + "x": -32, + "y": -16 + }, + { + "path": "support/wooden/truss/steep_to_flat_3_3.png", + "x": -32, + "y": -16 + }, + { + "path": "support/wooden/truss/steep_to_flat_3_4.png", + "x": -32, + "y": -28 + }, + { + "path": "support/wooden/truss/steep_to_flat_4_1.png", "x": -32, "y": -17 }, { - "path": "support/steep_to_flat_4_2.png", + "path": "support/wooden/truss/steep_to_flat_4_2.png", "x": -32, "y": -12 }, { - "path": "support/steep_to_flat_4_3.png", + "path": "support/wooden/truss/steep_to_flat_4_3.png", "x": -32, "y": -12 }, { - "path": "support/steep_to_flat_4_4.png", + "path": "support/wooden/truss/steep_to_flat_4_4.png", "x": -32, "y": -17 }, + { + "path": "support/wooden/mine/up_25_even_1.png", + "x": -24, + "y": -12 + }, + { + "path": "support/wooden/mine/up_25_even_2.png", + "x": -24, + "y": 4 + }, + { + "path": "support/wooden/mine/up_25_even_3.png", + "x": -24, + "y": 3 + }, + { + "path": "support/wooden/mine/up_25_even_4.png", + "x": -24, + "y": -12 + }, { "path": "support/wooden/mine/flat_to_steep_1_1.png", "x": -24, diff --git a/resources/tracks/support/wooden/mine/up_25_even_1.png b/resources/tracks/support/wooden/mine/up_25_even_1.png new file mode 100644 index 0000000000..e3a02fd69c Binary files /dev/null and b/resources/tracks/support/wooden/mine/up_25_even_1.png differ diff --git a/resources/tracks/support/wooden/mine/up_25_even_2.png b/resources/tracks/support/wooden/mine/up_25_even_2.png new file mode 100644 index 0000000000..ba1dedc9cf Binary files /dev/null and b/resources/tracks/support/wooden/mine/up_25_even_2.png differ diff --git a/resources/tracks/support/wooden/mine/up_25_even_3.png b/resources/tracks/support/wooden/mine/up_25_even_3.png new file mode 100644 index 0000000000..c1548d380b Binary files /dev/null and b/resources/tracks/support/wooden/mine/up_25_even_3.png differ diff --git a/resources/tracks/support/wooden/mine/up_25_even_4.png b/resources/tracks/support/wooden/mine/up_25_even_4.png new file mode 100644 index 0000000000..637cf30a6d Binary files /dev/null and b/resources/tracks/support/wooden/mine/up_25_even_4.png differ diff --git a/resources/tracks/support/flat_to_steep_1_1.png b/resources/tracks/support/wooden/truss/flat_to_steep_1_1.png similarity index 100% rename from resources/tracks/support/flat_to_steep_1_1.png rename to resources/tracks/support/wooden/truss/flat_to_steep_1_1.png diff --git a/resources/tracks/support/flat_to_steep_1_2.png b/resources/tracks/support/wooden/truss/flat_to_steep_1_2.png similarity index 100% rename from resources/tracks/support/flat_to_steep_1_2.png rename to resources/tracks/support/wooden/truss/flat_to_steep_1_2.png diff --git a/resources/tracks/support/flat_to_steep_1_3.png b/resources/tracks/support/wooden/truss/flat_to_steep_1_3.png similarity index 100% rename from resources/tracks/support/flat_to_steep_1_3.png rename to resources/tracks/support/wooden/truss/flat_to_steep_1_3.png diff --git a/resources/tracks/support/flat_to_steep_1_4.png b/resources/tracks/support/wooden/truss/flat_to_steep_1_4.png similarity index 100% rename from resources/tracks/support/flat_to_steep_1_4.png rename to resources/tracks/support/wooden/truss/flat_to_steep_1_4.png diff --git a/resources/tracks/support/flat_to_steep_2_1.png b/resources/tracks/support/wooden/truss/flat_to_steep_2_1.png similarity index 100% rename from resources/tracks/support/flat_to_steep_2_1.png rename to resources/tracks/support/wooden/truss/flat_to_steep_2_1.png diff --git a/resources/tracks/support/flat_to_steep_2_2.png b/resources/tracks/support/wooden/truss/flat_to_steep_2_2.png similarity index 100% rename from resources/tracks/support/flat_to_steep_2_2.png rename to resources/tracks/support/wooden/truss/flat_to_steep_2_2.png diff --git a/resources/tracks/support/flat_to_steep_2_3.png b/resources/tracks/support/wooden/truss/flat_to_steep_2_3.png similarity index 100% rename from resources/tracks/support/flat_to_steep_2_3.png rename to resources/tracks/support/wooden/truss/flat_to_steep_2_3.png diff --git a/resources/tracks/support/flat_to_steep_2_4.png b/resources/tracks/support/wooden/truss/flat_to_steep_2_4.png similarity index 100% rename from resources/tracks/support/flat_to_steep_2_4.png rename to resources/tracks/support/wooden/truss/flat_to_steep_2_4.png diff --git a/resources/tracks/support/flat_to_steep_3_1.png b/resources/tracks/support/wooden/truss/flat_to_steep_3_1.png similarity index 100% rename from resources/tracks/support/flat_to_steep_3_1.png rename to resources/tracks/support/wooden/truss/flat_to_steep_3_1.png diff --git a/resources/tracks/support/flat_to_steep_3_2.png b/resources/tracks/support/wooden/truss/flat_to_steep_3_2.png similarity index 100% rename from resources/tracks/support/flat_to_steep_3_2.png rename to resources/tracks/support/wooden/truss/flat_to_steep_3_2.png diff --git a/resources/tracks/support/flat_to_steep_3_3.png b/resources/tracks/support/wooden/truss/flat_to_steep_3_3.png similarity index 100% rename from resources/tracks/support/flat_to_steep_3_3.png rename to resources/tracks/support/wooden/truss/flat_to_steep_3_3.png diff --git a/resources/tracks/support/flat_to_steep_3_4.png b/resources/tracks/support/wooden/truss/flat_to_steep_3_4.png similarity index 100% rename from resources/tracks/support/flat_to_steep_3_4.png rename to resources/tracks/support/wooden/truss/flat_to_steep_3_4.png diff --git a/resources/tracks/support/flat_to_steep_4_1.png b/resources/tracks/support/wooden/truss/flat_to_steep_4_1.png similarity index 100% rename from resources/tracks/support/flat_to_steep_4_1.png rename to resources/tracks/support/wooden/truss/flat_to_steep_4_1.png diff --git a/resources/tracks/support/flat_to_steep_4_2.png b/resources/tracks/support/wooden/truss/flat_to_steep_4_2.png similarity index 100% rename from resources/tracks/support/flat_to_steep_4_2.png rename to resources/tracks/support/wooden/truss/flat_to_steep_4_2.png diff --git a/resources/tracks/support/flat_to_steep_4_3.png b/resources/tracks/support/wooden/truss/flat_to_steep_4_3.png similarity index 100% rename from resources/tracks/support/flat_to_steep_4_3.png rename to resources/tracks/support/wooden/truss/flat_to_steep_4_3.png diff --git a/resources/tracks/support/flat_to_steep_4_4.png b/resources/tracks/support/wooden/truss/flat_to_steep_4_4.png similarity index 100% rename from resources/tracks/support/flat_to_steep_4_4.png rename to resources/tracks/support/wooden/truss/flat_to_steep_4_4.png diff --git a/resources/tracks/support/steep_to_flat_1_1.png b/resources/tracks/support/wooden/truss/steep_to_flat_1_1.png similarity index 100% rename from resources/tracks/support/steep_to_flat_1_1.png rename to resources/tracks/support/wooden/truss/steep_to_flat_1_1.png diff --git a/resources/tracks/support/steep_to_flat_1_2.png b/resources/tracks/support/wooden/truss/steep_to_flat_1_2.png similarity index 100% rename from resources/tracks/support/steep_to_flat_1_2.png rename to resources/tracks/support/wooden/truss/steep_to_flat_1_2.png diff --git a/resources/tracks/support/steep_to_flat_1_3.png b/resources/tracks/support/wooden/truss/steep_to_flat_1_3.png similarity index 100% rename from resources/tracks/support/steep_to_flat_1_3.png rename to resources/tracks/support/wooden/truss/steep_to_flat_1_3.png diff --git a/resources/tracks/support/steep_to_flat_1_4.png b/resources/tracks/support/wooden/truss/steep_to_flat_1_4.png similarity index 100% rename from resources/tracks/support/steep_to_flat_1_4.png rename to resources/tracks/support/wooden/truss/steep_to_flat_1_4.png diff --git a/resources/tracks/support/steep_to_flat_2_1.png b/resources/tracks/support/wooden/truss/steep_to_flat_2_1.png similarity index 100% rename from resources/tracks/support/steep_to_flat_2_1.png rename to resources/tracks/support/wooden/truss/steep_to_flat_2_1.png diff --git a/resources/tracks/support/steep_to_flat_2_2.png b/resources/tracks/support/wooden/truss/steep_to_flat_2_2.png similarity index 100% rename from resources/tracks/support/steep_to_flat_2_2.png rename to resources/tracks/support/wooden/truss/steep_to_flat_2_2.png diff --git a/resources/tracks/support/steep_to_flat_2_3.png b/resources/tracks/support/wooden/truss/steep_to_flat_2_3.png similarity index 100% rename from resources/tracks/support/steep_to_flat_2_3.png rename to resources/tracks/support/wooden/truss/steep_to_flat_2_3.png diff --git a/resources/tracks/support/steep_to_flat_2_4.png b/resources/tracks/support/wooden/truss/steep_to_flat_2_4.png similarity index 100% rename from resources/tracks/support/steep_to_flat_2_4.png rename to resources/tracks/support/wooden/truss/steep_to_flat_2_4.png diff --git a/resources/tracks/support/steep_to_flat_3_1.png b/resources/tracks/support/wooden/truss/steep_to_flat_3_1.png similarity index 100% rename from resources/tracks/support/steep_to_flat_3_1.png rename to resources/tracks/support/wooden/truss/steep_to_flat_3_1.png diff --git a/resources/tracks/support/steep_to_flat_3_2.png b/resources/tracks/support/wooden/truss/steep_to_flat_3_2.png similarity index 100% rename from resources/tracks/support/steep_to_flat_3_2.png rename to resources/tracks/support/wooden/truss/steep_to_flat_3_2.png diff --git a/resources/tracks/support/steep_to_flat_3_3.png b/resources/tracks/support/wooden/truss/steep_to_flat_3_3.png similarity index 100% rename from resources/tracks/support/steep_to_flat_3_3.png rename to resources/tracks/support/wooden/truss/steep_to_flat_3_3.png diff --git a/resources/tracks/support/steep_to_flat_3_4.png b/resources/tracks/support/wooden/truss/steep_to_flat_3_4.png similarity index 100% rename from resources/tracks/support/steep_to_flat_3_4.png rename to resources/tracks/support/wooden/truss/steep_to_flat_3_4.png diff --git a/resources/tracks/support/steep_to_flat_4_1.png b/resources/tracks/support/wooden/truss/steep_to_flat_4_1.png similarity index 100% rename from resources/tracks/support/steep_to_flat_4_1.png rename to resources/tracks/support/wooden/truss/steep_to_flat_4_1.png diff --git a/resources/tracks/support/steep_to_flat_4_2.png b/resources/tracks/support/wooden/truss/steep_to_flat_4_2.png similarity index 100% rename from resources/tracks/support/steep_to_flat_4_2.png rename to resources/tracks/support/wooden/truss/steep_to_flat_4_2.png diff --git a/resources/tracks/support/steep_to_flat_4_3.png b/resources/tracks/support/wooden/truss/steep_to_flat_4_3.png similarity index 100% rename from resources/tracks/support/steep_to_flat_4_3.png rename to resources/tracks/support/wooden/truss/steep_to_flat_4_3.png diff --git a/resources/tracks/support/steep_to_flat_4_4.png b/resources/tracks/support/wooden/truss/steep_to_flat_4_4.png similarity index 100% rename from resources/tracks/support/steep_to_flat_4_4.png rename to resources/tracks/support/wooden/truss/steep_to_flat_4_4.png diff --git a/resources/tracks/support/wooden/truss/up_25_even_1.png b/resources/tracks/support/wooden/truss/up_25_even_1.png new file mode 100644 index 0000000000..555b56b70a Binary files /dev/null and b/resources/tracks/support/wooden/truss/up_25_even_1.png differ diff --git a/resources/tracks/support/wooden/truss/up_25_even_2.png b/resources/tracks/support/wooden/truss/up_25_even_2.png new file mode 100644 index 0000000000..191601a4cb Binary files /dev/null and b/resources/tracks/support/wooden/truss/up_25_even_2.png differ diff --git a/resources/tracks/support/wooden/truss/up_25_even_3.png b/resources/tracks/support/wooden/truss/up_25_even_3.png new file mode 100644 index 0000000000..0ae3a283a3 Binary files /dev/null and b/resources/tracks/support/wooden/truss/up_25_even_3.png differ diff --git a/resources/tracks/support/wooden/truss/up_25_even_4.png b/resources/tracks/support/wooden/truss/up_25_even_4.png new file mode 100644 index 0000000000..3a924d80f9 Binary files /dev/null and b/resources/tracks/support/wooden/truss/up_25_even_4.png differ diff --git a/src/openrct2-ui/CursorRepository.cpp b/src/openrct2-ui/CursorRepository.cpp index ce6a895fd5..9a98428c9b 100644 --- a/src/openrct2-ui/CursorRepository.cpp +++ b/src/openrct2-ui/CursorRepository.cpp @@ -28,7 +28,7 @@ CursorRepository::~CursorRepository() void CursorRepository::LoadCursors() { - SetCursorScale(static_cast(round(Config::Get().general.WindowScale))); + SetCursorScale(static_cast(round(Config::Get().general.windowScale))); SetCurrentCursor(CursorID::Arrow); } diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp index b7ab3c0b94..7b2978d93a 100644 --- a/src/openrct2-ui/UiContext.Linux.cpp +++ b/src/openrct2-ui/UiContext.Linux.cpp @@ -20,6 +20,7 @@ #include #include #include + #include #include #include #include @@ -102,21 +103,22 @@ namespace OpenRCT2::Ui std::string executablePath; DialogType dtype = GetDialogApp(&executablePath); - switch (dtype) { case DialogType::kdialog: { - std::string cmd = String::stdFormat( - "%s --title \"OpenRCT2\" --msgbox \"%s\"", executablePath.c_str(), message.c_str()); - Platform::Execute(cmd); + const char* args[] = { + executablePath.c_str(), "--title", "OpenRCT2", "--msgbox", message.c_str(), nullptr + }; + Platform::Execute(args); break; } case DialogType::zenity: { - std::string cmd = String::stdFormat( - "%s --title=\"OpenRCT2\" --info --text=\"%s\"", executablePath.c_str(), message.c_str()); - Platform::Execute(cmd); + const char* args[] = { + executablePath.c_str(), "--title=OpenRCT2", "--info", "--text", message.c_str(), nullptr + }; + Platform::Execute(args); break; } default: @@ -127,15 +129,15 @@ namespace OpenRCT2::Ui void OpenFolder(const std::string& path) override { - std::string cmd = String::stdFormat("xdg-open %s", EscapePathForShell(path).c_str()); - Platform::Execute(cmd); + const char* args[] = { "xdg-open", path.c_str(), nullptr }; + Platform::Execute(args); } void OpenURL(const std::string& url) override { #ifndef __EMSCRIPTEN__ - std::string cmd = String::stdFormat("xdg-open %s", url.c_str()); - Platform::Execute(cmd); + const char* args[] = { "xdg-open", url.c_str(), nullptr }; + Platform::Execute(args); #else MAIN_THREAD_EM_ASM({ window.open(UTF8ToString($0)); }, url.c_str()); #endif @@ -145,19 +147,28 @@ namespace OpenRCT2::Ui { std::string result; std::string executablePath; - u8string directory = EscapePathForShell(desc.InitialDirectory + '/'); + u8string directory = desc.InitialDirectory + '/'; DialogType dtype = GetDialogApp(&executablePath); switch (dtype) { case DialogType::kdialog: { std::string action = (desc.Type == FileDialogType::Open) ? "--getopenfilename" : "--getsavefilename"; - std::string filter = GetKDialogFilterString(desc.Filters); - std::string cmd = String::stdFormat( - "%s --title '%s' %s %s '%s'", executablePath.c_str(), desc.Title.c_str(), action.c_str(), - directory.c_str(), filter.c_str()); + std::vector filters = GetKDialogFilterString(desc.Filters); + std::vector argsVec = { executablePath, "--title", desc.Title, action, directory }; + for (const auto& filter : filters) + { + argsVec.push_back(filter); + } + std::vector args; + for (const auto& arg : argsVec) + { + args.push_back(arg.c_str()); + } + args.push_back(nullptr); + std::string output; - if (Platform::Execute(cmd, &output) == 0) + if (Platform::Execute(args.data(), &output) == 0) { result = output; } @@ -166,17 +177,30 @@ namespace OpenRCT2::Ui case DialogType::zenity: { std::string action = "--file-selection"; - std::string flags; + std::vector filters = GetZenityFilterString(desc.Filters); + u8string directoryarg = String::stdFormat("--filename=%s", directory.c_str()); + std::vector argsVec = { executablePath, action, directoryarg }; if (desc.Type == FileDialogType::Save) { - flags = "--confirm-overwrite --save"; + argsVec.push_back("--confirm-overwrite"); + argsVec.push_back("--save"); } - std::string filters = GetZenityFilterString(desc.Filters); - std::string cmd = String::stdFormat( - "%s %s --filename=%s %s --title='%s' / %s", executablePath.c_str(), action.c_str(), directory.c_str(), - flags.c_str(), desc.Title.c_str(), filters.c_str()); + argsVec.push_back("--title"); + argsVec.push_back(desc.Title); + argsVec.push_back("/"); + for (const auto& filter : filters) + { + argsVec.push_back(filter); + } + std::vector args; + for (const auto& arg : argsVec) + { + args.push_back(arg.c_str()); + } + args.push_back(nullptr); + std::string output; - if (Platform::Execute(cmd, &output) == 0) + if (Platform::Execute(args.data(), &output) == 0) { if (desc.Type == FileDialogType::Save) { @@ -219,8 +243,9 @@ namespace OpenRCT2::Ui } if (desc.Type == FileDialogType::Save && access(result.c_str(), F_OK) != -1 && dtype == DialogType::kdialog) { - std::string cmd = String::stdFormat("%s --yesno \"Overwrite %s?\"", executablePath.c_str(), result.c_str()); - if (Platform::Execute(cmd) != 0) + u8string overwrite = String::stdFormat("Overwrite %s?", result.c_str()); + const char* args[] = { executablePath.c_str(), "--yesno", overwrite.c_str(), nullptr }; + if (Platform::Execute(args) != 0) { result = std::string(); } @@ -241,7 +266,9 @@ namespace OpenRCT2::Ui std::string output; std::string cmd = String::stdFormat( "%s --title '%s' --getexistingdirectory /", executablePath.c_str(), title.c_str()); - if (Platform::Execute(cmd, &output) == 0) + const char* args[] = { executablePath.c_str(), "--title", title.c_str(), + "--getexistingdirectory", "/", nullptr }; + if (Platform::Execute(args, &output) == 0) { result = output; } @@ -252,7 +279,9 @@ namespace OpenRCT2::Ui std::string output; std::string cmd = String::stdFormat( "%s --title='%s' --file-selection --directory /", executablePath.c_str(), title.c_str()); - if (Platform::Execute(cmd, &output) == 0) + const char* args[] = { executablePath.c_str(), "--title", title.c_str(), "--file-selection", + "--directory", "/", nullptr }; + if (Platform::Execute(args, &output) == 0) { result = output; } @@ -306,30 +335,49 @@ namespace OpenRCT2::Ui { case DialogType::zenity: { - auto sb = StringBuilder(); - sb.Append(String::stdFormat("zenity --list --column '' --width=%d --height=%d", width, height)); + std::vector argsVec = { executablePath, + "--list", + "--column", + "", + String::stdFormat("--width=%d", width), + String::stdFormat("--height=%d", height) }; for (const auto& option : options) { - sb.Append(String::stdFormat(" '%s'", option.c_str())); + argsVec.push_back(option); } - sb.Append(String::stdFormat(" --title '%s' --text '%s'", title.c_str(), text.c_str())); - + argsVec.push_back("--title"); + argsVec.push_back(title); + argsVec.push_back("--text"); + argsVec.push_back(text); + std::vector args; + for (const auto& arg : argsVec) + { + args.push_back(arg.c_str()); + } + args.push_back(nullptr); std::string buff; - Platform::Execute(sb.GetBuffer(), &buff); + Platform::Execute(args.data(), &buff); return std::find(options.begin(), options.end(), buff) - options.begin(); } case DialogType::kdialog: { - auto sb = StringBuilder(); - sb.Append(String::stdFormat("kdialog --geometry %dx%d --title '%s' --menu ", width, height, title.c_str())); - sb.Append(String::stdFormat(" '%s'", text.c_str())); + std::vector argsVec = { + executablePath, "--geometry", String::stdFormat("%dx%d", width, height), "--title", title, + "--menu", text + }; for (const auto& option : options) { - sb.Append(String::stdFormat(" '%s' '%s'", option.c_str(), option.c_str())); + argsVec.push_back(option); + argsVec.push_back(option); } - + std::vector args; + for (const auto& arg : argsVec) + { + args.push_back(arg.c_str()); + } + args.push_back(nullptr); std::string buff; - Platform::Execute(sb.GetBuffer(), &buff); + Platform::Execute(args.data(), &buff); return std::find(options.begin(), options.end(), buff) - options.begin(); } default: @@ -346,8 +394,6 @@ namespace OpenRCT2::Ui { // Prefer zenity as it offers more required features, e.g., overwrite // confirmation and selecting only existing files. - // Silence error output with 2> /dev/null to avoid confusion in the - // case where a user does not have zenity and/or kdialog. // OpenRCT2 will fall back to an SDL pop-up if the user has neither. if (Platform::FindApp("zenity", executablePath)) { @@ -360,35 +406,31 @@ namespace OpenRCT2::Ui return DialogType::none; } - static std::string GetKDialogFilterString(const std::vector filters) + static std::vector GetKDialogFilterString(const std::vector& filters) { - std::stringstream filtersb; - bool first = true; + std::vector filterStrings; for (const auto& filter : filters) { - if (!first) - { - filtersb << "\\n"; - } - first = false; - + std::stringstream filtersb; filtersb << filter.Name.c_str() << " ("; AddFilterCaseInsensitive(filtersb, filter.Pattern); filtersb << ")"; + filterStrings.push_back(filtersb.str()); } - return filtersb.str(); + return filterStrings; } - static std::string GetZenityFilterString(const std::vector filters) + static std::vector GetZenityFilterString(const std::vector& filters) { - std::stringstream filtersb; + std::vector filterStrings; for (const auto& filter : filters) { - filtersb << " --file-filter='" << filter.Name << " | "; + std::stringstream filtersb; + filtersb << "--file-filter=" << filter.Name << " | "; AddFilterCaseInsensitive(filtersb, filter.Pattern); - filtersb << "'"; + filterStrings.push_back(filtersb.str()); } - return filtersb.str(); + return filterStrings; } static void AddFilterCaseInsensitive(std::stringstream& stream, u8string pattern) @@ -418,15 +460,6 @@ namespace OpenRCT2::Ui uiContext.ShowMessageBox(dialogMissingWarning); throw std::runtime_error(dialogMissingWarning); } - - static std::string EscapePathForShell(std::string path) - { - for (size_t index = 0; (index = path.find('"', index)) != std::string::npos; index += 2) - { - path.replace(index, 1, "\\\""); - } - return '"' + path + '"'; - } }; std::unique_ptr CreatePlatformUiContext() diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 3c75079196..329845ae29 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -198,12 +198,12 @@ public: // Set window size UpdateFullscreenResolutions(); Resolution resolution = GetClosestResolution( - Config::Get().general.FullscreenWidth, Config::Get().general.FullscreenHeight); + Config::Get().general.fullscreenWidth, Config::Get().general.fullscreenHeight); SDL_SetWindowSize(_window, resolution.Width, resolution.Height); } else if (mode == FullscreenMode::windowed) { - SDL_SetWindowSize(_window, Config::Get().general.WindowWidth, Config::Get().general.WindowHeight); + SDL_SetWindowSize(_window, Config::Get().general.windowWidth, Config::Get().general.windowHeight); } if (SDL_SetWindowFullscreen(_window, windowFlags)) @@ -374,16 +374,16 @@ public: { // Update default display index int32_t displayIndex = SDL_GetWindowDisplayIndex(_window); - if (displayIndex != Config::Get().general.DefaultDisplay) + if (displayIndex != Config::Get().general.defaultDisplay) { - Config::Get().general.DefaultDisplay = displayIndex; + Config::Get().general.defaultDisplay = displayIndex; Config::Save(); } break; } } - if (Config::Get().sound.audio_focus) + if (Config::Get().sound.audioFocus) { if (e.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) { @@ -396,8 +396,8 @@ public: } break; case SDL_MOUSEMOTION: - _cursorState.position = { static_cast(e.motion.x / Config::Get().general.WindowScale), - static_cast(e.motion.y / Config::Get().general.WindowScale) }; + _cursorState.position = { static_cast(e.motion.x / Config::Get().general.windowScale), + static_cast(e.motion.y / Config::Get().general.windowScale) }; break; case SDL_MOUSEWHEEL: if (_inGameConsole.IsOpen()) @@ -413,8 +413,8 @@ public: { break; } - ScreenCoordsXY mousePos = { static_cast(e.button.x / Config::Get().general.WindowScale), - static_cast(e.button.y / Config::Get().general.WindowScale) }; + ScreenCoordsXY mousePos = { static_cast(e.button.x / Config::Get().general.windowScale), + static_cast(e.button.y / Config::Get().general.windowScale) }; switch (e.button.button) { case SDL_BUTTON_LEFT: @@ -449,8 +449,8 @@ public: { break; } - ScreenCoordsXY mousePos = { static_cast(e.button.x / Config::Get().general.WindowScale), - static_cast(e.button.y / Config::Get().general.WindowScale) }; + ScreenCoordsXY mousePos = { static_cast(e.button.x / Config::Get().general.windowScale), + static_cast(e.button.y / Config::Get().general.windowScale) }; switch (e.button.button) { case SDL_BUTTON_LEFT: @@ -604,7 +604,7 @@ public: { char scaleQualityBuffer[4]; _scaleQuality = ScaleQuality::SmoothNearestNeighbour; - if (Config::Get().general.WindowScale == std::floor(Config::Get().general.WindowScale)) + if (Config::Get().general.windowScale == std::floor(Config::Get().general.windowScale)) { _scaleQuality = ScaleQuality::NearestNeighbour; } @@ -624,10 +624,10 @@ public: void CreateWindow() override { - SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, Config::Get().general.MinimizeFullscreenFocusLoss ? "1" : "0"); + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, Config::Get().general.minimizeFullscreenFocusLoss ? "1" : "0"); // Set window position to default display - int32_t defaultDisplay = std::clamp(Config::Get().general.DefaultDisplay, 0, 0xFFFF); + int32_t defaultDisplay = std::clamp(Config::Get().general.defaultDisplay, 0, 0xFFFF); auto windowPos = ScreenCoordsXY{ static_cast(SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay)), static_cast(SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay)) }; @@ -770,7 +770,7 @@ private: void InferDisplayDPI() { auto& config = Config::Get().general; - if (!config.InferDisplayDPI) + if (!config.inferDisplayDPI) return; int wWidth, wHeight; @@ -779,9 +779,9 @@ private: auto renderer = SDL_GetRenderer(_window); int rWidth, rHeight; if (SDL_GetRendererOutputSize(renderer, &rWidth, &rHeight) == 0) - config.WindowScale = rWidth / wWidth; + config.windowScale = rWidth / wWidth; - config.InferDisplayDPI = false; + config.inferDisplayDPI = false; Config::Save(); } @@ -797,8 +797,8 @@ private: emscripten_get_canvas_element_size("!canvas", &width, &height); #else // Get saved window size - int32_t width = Config::Get().general.WindowWidth; - int32_t height = Config::Get().general.WindowHeight; + int32_t width = Config::Get().general.windowWidth; + int32_t height = Config::Get().general.windowHeight; #endif if (width <= 0) width = 640; @@ -807,7 +807,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 (Config::Get().general.DrawingEngine == DrawingEngine::OpenGL) + if (Config::Get().general.drawingEngine == DrawingEngine::OpenGL) { flags |= SDL_WINDOW_OPENGL; } @@ -821,7 +821,7 @@ private: ApplyScreenSaverLockSetting(); SDL_SetWindowMinimumSize(_window, 720, 480); - SetCursorTrap(Config::Get().general.TrapCursor); + SetCursorTrap(Config::Get().general.trapCursor); _platformUiContext->SetWindowIcon(_window); // Initialise the surface, palette and draw buffer @@ -831,15 +831,15 @@ private: UpdateFullscreenResolutions(); - SetFullscreenMode(static_cast(Config::Get().general.FullscreenMode)); + SetFullscreenMode(static_cast(Config::Get().general.fullscreenMode)); TriggerResize(); } void OnResize(int32_t width, int32_t height) { // Scale the native window size to the game's canvas size - _width = static_cast(width / Config::Get().general.WindowScale); - _height = static_cast(height / Config::Get().general.WindowScale); + _width = static_cast(width / Config::Get().general.windowScale); + _height = static_cast(height / Config::Get().general.windowScale); DrawingEngineResize(); @@ -861,10 +861,10 @@ private: if (!(flags & nonWindowFlags)) { - if (width != Config::Get().general.WindowWidth || height != Config::Get().general.WindowHeight) + if (width != Config::Get().general.windowWidth || height != Config::Get().general.windowHeight) { - Config::Get().general.WindowWidth = width; - Config::Get().general.WindowHeight = height; + Config::Get().general.windowWidth = width; + Config::Get().general.windowHeight = height; Config::Save(); } } @@ -911,10 +911,10 @@ private: // Update config fullscreen resolution if not set if (!resolutions.empty() - && (Config::Get().general.FullscreenWidth == -1 || Config::Get().general.FullscreenHeight == -1)) + && (Config::Get().general.fullscreenWidth == -1 || Config::Get().general.fullscreenHeight == -1)) { - Config::Get().general.FullscreenWidth = resolutions.back().Width; - Config::Get().general.FullscreenHeight = resolutions.back().Height; + Config::Get().general.fullscreenWidth = resolutions.back().Width; + Config::Get().general.fullscreenHeight = resolutions.back().Height; } _fsResolutions = resolutions; diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index eeeb28c011..39d72a38f9 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -703,6 +703,7 @@ namespace OpenRCT2 STR_CONSTRUCT_THE_SELECTED_FOOTPATH_SECTION_TIP = 1189, STR_DIRECTION = 1183, STR_DIRECTION_TIP = 1185, + STR_DRAG_AREA_OF_FOOTPATH_TIP = 7005, STR_FOOTPATHS = 1181, STR_FOOTPATH_TIP = 1424, STR_LEVEL_TIP = 1187, @@ -1786,6 +1787,7 @@ namespace OpenRCT2 STR_RIDE_LIST_INFORMATION_TYPE_TIP = 1844, STR_RIDE_LIST_INTENSITY = 6464, STR_RIDE_LIST_NAUSEA = 6466, + STR_RIDE_LIST_RIDETYPE = 7007, STR_RIDE_LIST_RUNNING_COST = 5771, STR_RIDE_LIST_RUNNING_COST_LABEL = 5780, STR_RIDE_LIST_RUNNING_COST_UNKNOWN = 5781, @@ -1971,6 +1973,7 @@ namespace OpenRCT2 STR_THEMES_OPTION_RCT1_PARK_CONTROLS = 5283, STR_THEMES_OPTION_RCT1_RIDE_CONTROLS = 5282, STR_THEMES_OPTION_RCT1_SCENARIO_SELECTION_FONT = 5284, + STR_THEMES_OPTION_USE_3D_IMAGE_BUTTONS = 7006, STR_THEMES_PROMPT_ENTER_THEME_NAME = 5240, STR_THEMES_TAB_EDITORS_TIP = 5232, STR_THEMES_TAB_FEATURES_TIP = 5281, diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 82dcab401c..b71e0d78d5 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -182,7 +182,7 @@ public: case WindowView::financesResearch: return FinancesResearchOpen(); case WindowView::rideResearch: - if (Config::Get().interface.ToolbarShowResearch) + if (Config::Get().interface.toolbarShowResearch) { return this->OpenWindow(WindowClass::research); } @@ -855,7 +855,7 @@ public: // Check if there are any window slots left // include kWindowLimitReserved for items such as the main viewport and toolbars to not appear to be counted. - if (gWindowList.size() >= static_cast(Config::Get().general.WindowLimit + kWindowLimitReserved)) + if (gWindowList.size() >= static_cast(Config::Get().general.windowLimit + kWindowLimitReserved)) { // Close least recently used window for (auto& w : gWindowList) diff --git a/src/openrct2-ui/audio/AudioMixer.cpp b/src/openrct2-ui/audio/AudioMixer.cpp index e7e72fa33e..01a7de4bde 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 || Config::Get().sound.SoundEnabled) && Config::Get().sound.MasterSoundEnabled - && Config::Get().sound.MasterVolume != 0) + if ((group != MixerGroup::Sound || Config::Get().sound.soundEnabled) && Config::Get().sound.masterSoundEnabled + && Config::Get().sound.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 != Config::Get().sound.SoundVolume) + if (_settingSoundVolume != Config::Get().sound.soundVolume) { - _settingSoundVolume = Config::Get().sound.SoundVolume; + _settingSoundVolume = Config::Get().sound.soundVolume; _adjustSoundVolume = powf(static_cast(_settingSoundVolume) / 100.f, 10.f / 6.f); } - if (_settingMusicVolume != Config::Get().sound.AudioFocus) + if (_settingMusicVolume != Config::Get().sound.rideMusicVolume) { - _settingMusicVolume = Config::Get().sound.AudioFocus; + _settingMusicVolume = Config::Get().sound.rideMusicVolume; _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 *= Config::Get().sound.MasterSoundEnabled ? (static_cast(Config::Get().sound.MasterVolume) / 100.0f) + volumeAdjust *= Config::Get().sound.masterSoundEnabled ? (static_cast(Config::Get().sound.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 0a0186f1b0..f58f25f74b 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -153,7 +153,7 @@ public: SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaleQualityBuffer); - uint32_t scale = std::ceil(Config::Get().general.WindowScale); + uint32_t scale = std::ceil(Config::Get().general.windowScale); _scaledScreenTexture = SDL_CreateTexture( _sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_TARGET, width * scale, height * scale); @@ -186,7 +186,7 @@ public: _paletteHWMapped[i] = SDL_MapRGB(_screenTextureFormat, palette[i].Red, palette[i].Green, palette[i].Blue); } - if (Config::Get().general.EnableLightFx) + if (Config::Get().general.enableLightFx) { auto& lightPalette = LightFx::GetPalette(); for (int32_t i = 0; i < 256; i++) @@ -235,7 +235,7 @@ private: { auto* viewport = WindowGetViewport(WindowGetMain()); - if (Config::Get().general.EnableLightFx && viewport != nullptr) + if (Config::Get().general.enableLightFx && viewport != nullptr) { void* pixels; int32_t pitch; @@ -351,8 +351,8 @@ private: SDL_GetWindowSize(_window, &windowX, &windowY); SDL_GetRendererOutputSize(_sdlRenderer, &renderX, &renderY); - float scaleX = Config::Get().general.WindowScale * renderX / static_cast(windowX); - float scaleY = Config::Get().general.WindowScale * renderY / static_cast(windowY); + float scaleX = Config::Get().general.windowScale * renderX / static_cast(windowX); + float scaleY = Config::Get().general.windowScale * renderY / static_cast(windowY); SDL_SetRenderDrawBlendMode(_sdlRenderer, SDL_BLENDMODE_BLEND); for (uint32_t y = 0; y < _invalidationGrid.getRowCount(); y++) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 01221e9941..7fd40749ab 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -613,7 +613,7 @@ private: } if (GetContext()->GetUiContext().GetScaleQuality() == ScaleQuality::SmoothNearestNeighbour) { - uint32_t scale = std::ceil(Config::Get().general.WindowScale); + uint32_t scale = std::ceil(Config::Get().general.windowScale); _smoothScaleFramebuffer = std::make_unique(_width * scale, _height * scale, false, false); } } diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index ffe9fd0f20..6f2d5a8bdd 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -263,7 +263,7 @@ void InputManager::handleViewScrolling() } // Mouse edge scrolling - if (Config::Get().general.EdgeScrolling) + if (Config::Get().general.edgeScrolling) { if (InputGetState() != InputState::Normal) return; @@ -299,7 +299,7 @@ void InputManager::handleModifiers() } #endif - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { if (isModifierKeyPressed(ModifierKey::ctrl) || isModifierKeyPressed(ModifierKey::shift)) VirtualFloorEnable(); diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index cbf5833de6..0de2167bfa 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -233,8 +233,8 @@ namespace OpenRCT2 windowMgr->InvalidateByNumber(w->classification, w->number); ScreenCoordsXY fixedCursorPosition = { - static_cast(std::ceil(gInputDragLast.x * Config::Get().general.WindowScale)), - static_cast(std::ceil(gInputDragLast.y * Config::Get().general.WindowScale)) + static_cast(std::ceil(gInputDragLast.x * Config::Get().general.windowScale)), + static_cast(std::ceil(gInputDragLast.y * Config::Get().general.windowScale)) }; ContextSetCursorPosition(fixedCursorPosition); @@ -492,7 +492,7 @@ namespace OpenRCT2 { int32_t snapProximity; - snapProximity = (w.flags.has(WindowFlag::noSnapping)) ? 0 : Config::Get().general.WindowSnapProximity; + snapProximity = (w.flags.has(WindowFlag::noSnapping)) ? 0 : Config::Get().general.windowSnapProximity; WindowMoveAndSnap(w, newScreenCoords - lastScreenCoords, snapProximity); } @@ -547,7 +547,7 @@ namespace OpenRCT2 _ticksSinceDragStart = gCurrentRealTimeTicks; auto cursorPosition = ContextGetCursorPosition(); gInputDragLast = cursorPosition; - if (!Config::Get().general.InvertViewportDrag) + if (!Config::Get().general.invertViewportDrag) { ContextHideCursor(); } @@ -608,7 +608,7 @@ namespace OpenRCT2 differentialCoords.x = posX ? -differentialCoords.x : differentialCoords.x; differentialCoords.y = posY ? -differentialCoords.y : differentialCoords.y; - if (Config::Get().general.InvertViewportDrag) + if (Config::Get().general.invertViewportDrag) { w->savedViewPos -= differentialCoords; } @@ -621,7 +621,7 @@ namespace OpenRCT2 #ifndef __EMSCRIPTEN__ const CursorState* cursorState = ContextGetCursorState(); - if (cursorState->touch || Config::Get().general.InvertViewportDrag) + if (cursorState->touch || Config::Get().general.invertViewportDrag) { gInputDragLast = newDragCoords; } @@ -1115,6 +1115,7 @@ namespace OpenRCT2 case WidgetType::trnBtn: case WidgetType::tab: case WidgetType::flatBtn: + case WidgetType::hiddenButton: case WidgetType::button: case WidgetType::tableHeader: case WidgetType::spinner: @@ -1634,7 +1635,7 @@ namespace OpenRCT2 if (viewport == nullptr) return; - const int32_t speed = Config::Get().general.EdgeScrollingSpeed; + const int32_t speed = Config::Get().general.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 f04f523d40..df517933d3 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -457,7 +457,7 @@ static void ShortcutOpenSceneryPicker() static void ShortcutScaleUp() { - Config::Get().general.WindowScale += 0.25f; + Config::Get().general.windowScale += 0.25f; Config::Save(); GfxInvalidateScreen(); ContextTriggerResize(); @@ -466,8 +466,8 @@ static void ShortcutScaleUp() static void ShortcutScaleDown() { - Config::Get().general.WindowScale -= 0.25f; - Config::Get().general.WindowScale = std::max(0.5f, Config::Get().general.WindowScale); + Config::Get().general.windowScale -= 0.25f; + Config::Get().general.windowScale = std::max(0.5f, Config::Get().general.windowScale); Config::Save(); GfxInvalidateScreen(); ContextTriggerResize(); @@ -623,7 +623,7 @@ static void ShortcutToggleConsole() { console.Toggle(); } - else if (Config::Get().general.DebuggingTools && !ContextIsInputActive()) + else if (Config::Get().general.debuggingTools && !ContextIsInputActive()) { WindowCancelTextbox(); console.Toggle(); @@ -737,7 +737,7 @@ static void ShortcutToggleTransparentWater() if (gLegacyScene == LegacyScene::titleSequence) return; - Config::Get().general.TransparentWater ^= 1; + Config::Get().general.transparentWater ^= 1; Config::Save(); GfxInvalidateScreen(); } @@ -827,7 +827,7 @@ void ShortcutManager::registerDefaultShortcuts() registerShortcut(ShortcutId::kInterfaceOpenTransparencyOptions, STR_SHORTCUT_OPEN_TRANSPARENCY_OPTIONS, "CTRL+T", ShortcutOpenTransparencyWindow); registerShortcut(ShortcutId::kInterfaceOpenCheats, STR_SHORTCUT_OPEN_CHEATS_WINDOW, "CTRL+ALT+C", ShortcutOpenCheatWindow); registerShortcut(ShortcutId::kInterfaceOpenTileInspector, STR_SHORTCUT_OPEN_TILE_INSPECTOR, []() { - if (Config::Get().interface.ToolbarShowCheats) + if (Config::Get().interface.toolbarShowCheats) { OpenWindow(WindowClass::tileInspector); } diff --git a/src/openrct2-ui/interface/FileBrowser.cpp b/src/openrct2-ui/interface/FileBrowser.cpp index 8618e966b5..ab7a0539c3 100644 --- a/src/openrct2-ui/interface/FileBrowser.cpp +++ b/src/openrct2-ui/interface/FileBrowser.cpp @@ -62,7 +62,7 @@ namespace OpenRCT2::Ui::FileBrowser auto& config = Config::Get().general; // Open system file picker? - if (config.UseNativeBrowseDialog && hasFilePicker) + if (config.useNativeBrowseDialog && hasFilePicker) { const bool isSave = (action == LoadSaveAction::save); const auto defaultDirectory = GetDir(type); @@ -84,7 +84,7 @@ namespace OpenRCT2::Ui::FileBrowser if (a.type != b.type) return EnumValue(a.type) - EnumValue(b.type) < 0; - switch (Config::Get().general.LoadSaveSort) + switch (Config::Get().general.loadSaveSort) { case FileBrowserSort::NameAscending: return String::logicalCmp(a.name.c_str(), b.name.c_str()) < 0; @@ -123,16 +123,16 @@ namespace OpenRCT2::Ui::FileBrowser switch (type) { case LoadSaveType::park: - return Config::Get().general.LastSaveGameDirectory; + return Config::Get().general.lastSaveGameDirectory; case LoadSaveType::landscape: - return Config::Get().general.LastSaveLandscapeDirectory; + return Config::Get().general.lastSaveLandscapeDirectory; case LoadSaveType::scenario: - return Config::Get().general.LastSaveScenarioDirectory; + return Config::Get().general.lastSaveScenarioDirectory; case LoadSaveType::track: - return Config::Get().general.LastSaveTrackDirectory; + return Config::Get().general.lastSaveTrackDirectory; default: return u8string(); @@ -257,7 +257,7 @@ namespace OpenRCT2::Ui::FileBrowser { case (LoadSaveType::park): { - SetAndSaveConfigPath(Config::Get().general.LastSaveGameDirectory, pathBuffer); + SetAndSaveConfigPath(Config::Get().general.lastSaveGameDirectory, pathBuffer); if (GetContext()->LoadParkFromFile(pathBuffer)) { InvokeCallback(ModalResult::ok, pathBuffer); @@ -278,7 +278,7 @@ namespace OpenRCT2::Ui::FileBrowser } case (LoadSaveType::landscape): { - SetAndSaveConfigPath(Config::Get().general.LastSaveLandscapeDirectory, pathBuffer); + SetAndSaveConfigPath(Config::Get().general.lastSaveLandscapeDirectory, pathBuffer); if (Editor::LoadLandscape(pathBuffer)) { gCurrentLoadedPath = pathBuffer; @@ -295,12 +295,12 @@ namespace OpenRCT2::Ui::FileBrowser } case (LoadSaveType::scenario): { - SetAndSaveConfigPath(Config::Get().general.LastSaveScenarioDirectory, pathBuffer); + SetAndSaveConfigPath(Config::Get().general.lastSaveScenarioDirectory, pathBuffer); int32_t parkFlagsBackup = gameState.park.flags; gameState.park.flags &= ~PARK_FLAGS_SPRITES_INITIALISED; gameState.editorStep = EditorStep::Invalid; gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer))); - int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2); + int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2); gameState.park.flags = parkFlagsBackup; if (success) @@ -321,7 +321,7 @@ namespace OpenRCT2::Ui::FileBrowser } case (LoadSaveType::track): { - SetAndSaveConfigPath(Config::Get().general.LastSaveTrackDirectory, pathBuffer); + SetAndSaveConfigPath(Config::Get().general.lastSaveTrackDirectory, pathBuffer); auto intent = Intent(WindowClass::installTrack); intent.PutExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer }); ContextOpenIntent(&intent); @@ -344,8 +344,8 @@ namespace OpenRCT2::Ui::FileBrowser { case LoadSaveType::park: { - SetAndSaveConfigPath(Config::Get().general.LastSaveGameDirectory, pathBuffer); - if (ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 1 : 0)) + SetAndSaveConfigPath(Config::Get().general.lastSaveGameDirectory, pathBuffer); + if (ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 1 : 0)) { gScenarioSavePath = pathBuffer; gCurrentLoadedPath = pathBuffer; @@ -366,9 +366,9 @@ namespace OpenRCT2::Ui::FileBrowser } case LoadSaveType::landscape: { - SetAndSaveConfigPath(Config::Get().general.LastSaveLandscapeDirectory, pathBuffer); + SetAndSaveConfigPath(Config::Get().general.lastSaveLandscapeDirectory, pathBuffer); gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer))); - if (ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2)) + if (ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2)) { gCurrentLoadedPath = pathBuffer; windowMgr->CloseByClass(WindowClass::loadsave); @@ -384,12 +384,12 @@ namespace OpenRCT2::Ui::FileBrowser } case LoadSaveType::scenario: { - SetAndSaveConfigPath(Config::Get().general.LastSaveScenarioDirectory, pathBuffer); + SetAndSaveConfigPath(Config::Get().general.lastSaveScenarioDirectory, pathBuffer); int32_t parkFlagsBackup = gameState.park.flags; gameState.park.flags &= ~PARK_FLAGS_SPRITES_INITIALISED; gameState.editorStep = EditorStep::Invalid; gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer))); - int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2); + int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2); gameState.park.flags = parkFlagsBackup; if (success) @@ -410,7 +410,7 @@ namespace OpenRCT2::Ui::FileBrowser } case LoadSaveType::track: { - SetAndSaveConfigPath(Config::Get().general.LastSaveTrackDirectory, pathBuffer); + SetAndSaveConfigPath(Config::Get().general.lastSaveTrackDirectory, pathBuffer); const auto withExtension = Path::WithExtension(pathBuffer, ".td6"); String::set(pathBuffer, sizeof(pathBuffer), withExtension.c_str()); diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index db7d698f0e..a56d97a2e3 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -11,11 +11,14 @@ #include #include +#include #include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Graph { constexpr int32_t kDashLength = 2; @@ -37,13 +40,13 @@ namespace OpenRCT2::Graph rt, { internalBounds.GetLeft() - kYTickMarkPadding, curScreenPos }, { FontStyle::Small, TextAlignment::RIGHT }, buffer); // Draw Y label tick mark - GfxFillRect( + Rectangle::fill( rt, { { internalBounds.GetLeft() - 5, curScreenPos + 5 }, { internalBounds.GetLeft(), curScreenPos + 5 } }, PaletteIndex::pi10); // Draw horizontal gridline - GfxFillRectInset( + Rectangle::fillInset( rt, { { internalBounds.GetLeft(), curScreenPos + 5 }, { internalBounds.GetRight(), curScreenPos + 5 } }, - lineCol, INSET_RECT_FLAG_BORDER_INSET); + lineCol, Rectangle::BorderStyle::inset); curScreenPos += yLabelStepPx; curLabel -= yLabelStep; } @@ -68,7 +71,7 @@ namespace OpenRCT2::Graph rt, screenCoords - ScreenCoordsXY{ 0, 14 }, STR_GRAPH_LABEL, ft, { FontStyle::Small, TextAlignment::CENTRE }); // Draw month tick mark - GfxFillRect( + Rectangle::fill( rt, { screenCoords - ScreenCoordsXY{ 0, 4 }, screenCoords - ScreenCoordsXY{ 0, 1 } }, PaletteIndex::pi10); } @@ -99,8 +102,8 @@ namespace OpenRCT2::Graph DrawText(rt, coords - ScreenCoordsXY{ 0, 16 }, { textCol, TextAlignment::CENTRE }, text); - GfxFillRect(rt, { { coords - ScreenCoordsXY{ 2, 2 } }, coords + ScreenCoordsXY{ 2, 2 } }, PaletteIndex::pi10); - GfxFillRect(rt, { { coords - ScreenCoordsXY{ 1, 1 } }, { coords + ScreenCoordsXY{ 1, 1 } } }, PaletteIndex::pi21); + Rectangle::fill(rt, { { coords - ScreenCoordsXY{ 2, 2 } }, coords + ScreenCoordsXY{ 2, 2 } }, PaletteIndex::pi10); + Rectangle::fill(rt, { { coords - ScreenCoordsXY{ 1, 1 } }, { coords + ScreenCoordsXY{ 1, 1 } } }, PaletteIndex::pi21); } template @@ -134,7 +137,7 @@ namespace OpenRCT2::Graph } if (i == 0) { - GfxFillRect(rt, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PaletteIndex::pi10); + Rectangle::fill(rt, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PaletteIndex::pi10); } } else @@ -147,7 +150,7 @@ namespace OpenRCT2::Graph } if (i == 0) { - GfxFillRect( + Rectangle::fill( rt, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PaletteIndex::pi21); } } diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 44b09c1061..ef5b1a7104 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -27,13 +28,14 @@ #include using namespace OpenRCT2; +using namespace OpenRCT2::Drawing; using namespace OpenRCT2::Ui; static InGameConsole _inGameConsole; static FontStyle InGameConsoleGetFontStyle() { - return (Config::Get().interface.ConsoleSmallFont ? FontStyle::Small : FontStyle::Medium); + return (Config::Get().interface.consoleSmallFont ? FontStyle::Small : FontStyle::Medium); } static int32_t InGameConsoleGetLineHeight() @@ -310,19 +312,21 @@ void InGameConsole::Draw(RenderTarget& rt) const Invalidate(); // Give console area a translucent effect. - GfxFilterRect(rt, { _consoleTopLeft, _consoleBottomRight }, FilterPaletteID::palette51); + Rectangle::filter(rt, { _consoleTopLeft, _consoleBottomRight }, FilterPaletteID::palette51); // Make input area more opaque. - GfxFilterRect( + Rectangle::filter( rt, { { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 }, _consoleBottomRight - ScreenCoordsXY{ 0, 1 } }, FilterPaletteID::palette51); // Paint background colour. auto backgroundColour = ThemeGetColour(WindowClass::console, 0); - GfxFillRectInset(rt, { _consoleTopLeft, _consoleBottomRight }, backgroundColour, INSET_RECT_FLAG_FILL_NONE); - GfxFillRectInset( + Rectangle::fillInset( + rt, { _consoleTopLeft, _consoleBottomRight }, backgroundColour, Rectangle::BorderStyle::outset, + Rectangle::FillBrightness::light, Rectangle::FillMode::none); + Rectangle::fillInset( rt, { _consoleTopLeft + ScreenCoordsXY{ 1, 1 }, _consoleBottomRight - ScreenCoordsXY{ 1, 1 } }, backgroundColour, - INSET_RECT_FLAG_BORDER_INSET); + Rectangle::BorderStyle::inset); std::string lineBuffer; auto screenCoords = _consoleTopLeft + ScreenCoordsXY{ kConsoleEdgePadding, kConsoleEdgePadding }; @@ -331,7 +335,7 @@ void InGameConsole::Draw(RenderTarget& rt) const for (std::size_t i = 0; i < _consoleLines.size() && i < static_cast(maxLines); i++) { const size_t index = i + _consoleScrollPos; - if (_consoleLines[index].second == FormatToken::ColourWindow2) + if (_consoleLines[index].second == FormatToken::colourWindow2) { // This is something of a hack to ensure the text is actually black // as opposed to a desaturated grey @@ -373,7 +377,7 @@ void InGameConsole::Draw(RenderTarget& rt) const { auto caret = screenCoords + ScreenCoordsXY{ _caretScreenPosX, lineHeight }; uint8_t caretColour = ColourMapA[textColour.colour].lightest; - GfxFillRect(rt, { caret, caret + ScreenCoordsXY{ kConsoleCaretWidth, 1 } }, caretColour); + Rectangle::fill(rt, { caret, caret + ScreenCoordsXY{ kConsoleCaretWidth, 1 } }, caretColour); } // What about border colours? @@ -381,22 +385,22 @@ void InGameConsole::Draw(RenderTarget& rt) const uint8_t borderColour2 = ColourMapA[backgroundColour.colour].mid_dark; // Input area top border - GfxFillRect( + Rectangle::fill( rt, { { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 11 }, { _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 11 } }, borderColour1); - GfxFillRect( + Rectangle::fill( rt, { { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 }, { _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 10 } }, borderColour2); // Input area bottom border - GfxFillRect( + Rectangle::fill( rt, { { _consoleTopLeft.x, _consoleBottomRight.y - 1 }, { _consoleBottomRight.x, _consoleBottomRight.y - 1 } }, borderColour1); - GfxFillRect(rt, { { _consoleTopLeft.x, _consoleBottomRight.y }, _consoleBottomRight }, borderColour2); + Rectangle::fill(rt, { { _consoleTopLeft.x, _consoleBottomRight.y }, _consoleBottomRight }, borderColour2); } // Calculates the amount of visible lines, based on the console size, excluding the input line. diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 84198b8c89..3dbe710cf7 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -88,7 +88,46 @@ namespace OpenRCT2::Ui */ static UITheme* FromJson(json_t& json); static UITheme* FromFile(const std::string& path); - static UITheme CreatePredefined(const std::string& name, const UIThemeWindowEntry* entries, uint8_t flags); + static UITheme CreatePredefined(const std::string& name, std::span entries, uint8_t flags); + }; + + struct VariableWindowColours + { + uint8_t numColours{}; + WindowTheme defaultTheme{}; + + constexpr VariableWindowColours() = default; + + constexpr VariableWindowColours(ColourWithFlags colour1) + { + numColours = 1; + defaultTheme.Colours[0] = colour1; + } + + constexpr VariableWindowColours(ColourWithFlags colour1, ColourWithFlags colour2) + { + numColours = 2; + defaultTheme.Colours[0] = colour1; + defaultTheme.Colours[1] = colour2; + } + + constexpr VariableWindowColours(ColourWithFlags colour1, ColourWithFlags colour2, ColourWithFlags colour3) + { + numColours = 3; + defaultTheme.Colours[0] = colour1; + defaultTheme.Colours[1] = colour2; + defaultTheme.Colours[2] = colour3; + } + + constexpr VariableWindowColours( + ColourWithFlags colour1, ColourWithFlags colour2, ColourWithFlags colour3, ColourWithFlags colour4) + { + numColours = 4; + defaultTheme.Colours[0] = colour1; + defaultTheme.Colours[1] = colour2; + defaultTheme.Colours[2] = colour3; + defaultTheme.Colours[3] = colour4; + } }; /** @@ -99,150 +138,133 @@ namespace OpenRCT2::Ui ::WindowClass WindowClass; const utf8* WindowClassSZ; StringId WindowName; - uint8_t NumColours; - WindowTheme DefaultTheme; + VariableWindowColours windowColours; }; #pragma region Window Theme Descriptors // clang-format off -#define COLOURS_1(c0) 1, { { (c0), 0, 0, 0, 0, 0 } } -#define COLOURS_2(c0, c1) 2, { { (c0), (c1), 0, 0, 0, 0 } } -#define COLOURS_3(c0, c1, c2) 3, { { (c0), (c1), (c2), 0, 0, 0 } } -#define COLOURS_4(c0, c1, c2, c3) 4, { { (c0), (c1), (c2), (c3), 0, 0 } } -#define COLOURS_5(c0, c1, c2, c3, c4) 5, { { (c0), (c1), (c2), (c3), (c4), 0 } } -#define COLOURS_6(c0, c1, c2, c3, c4, c5) 6, { { (c0), (c1), (c2), (c3), (c4), (c5) } } -#define THEME_DEF_END { WindowClass::null, { 0, 0, 0, 0, 0, 0 } } + static constexpr ColourWithFlags opaque(colour_t colour) + { + return ColourWithFlags{ colour }; + } + static constexpr ColourWithFlags translucent(colour_t colour) + { + return ColourWithFlags{ colour, EnumToFlag(ColourFlag::translucent) }; + } -#define TWINDOW(window_class, window_name, window_string_id, theme) { window_class, window_name, window_string_id, theme } - -static constexpr ColourWithFlags opaque(colour_t colour) -{ - return ColourWithFlags{ colour }; -} -static constexpr ColourWithFlags translucent(colour_t colour) -{ - return ColourWithFlags{ colour, EnumToFlag(ColourFlag::translucent) }; -} - -static constexpr WindowThemeDesc WindowThemeDescriptors[] = -{ - // WindowClass WindowClassSZ WindowName NumColours, DefaultTheme - { WindowClass::topToolbar, "WC_TOP_TOOLBAR", STR_THEMES_WINDOW_TOP_TOOLBAR, COLOURS_4(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_GREY) ) }, - { WindowClass::bottomToolbar, "WC_BOTTOM_TOOLBAR", STR_THEMES_WINDOW_BOTTOM_TOOLBAR, COLOURS_4(translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN), opaque(COLOUR_BLACK), opaque(COLOUR_BRIGHT_GREEN) ) }, - { WindowClass::ride, "WC_RIDE", STR_THEMES_WINDOW_RIDE, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_SATURATED_GREEN) ) }, - { WindowClass::rideConstruction, "WC_RIDE_CONSTRUCTION", STR_THEMES_WINDOW_RIDE_CONSTRUCTION, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::rideList, "WC_RIDE_LIST", STR_THEMES_WINDOW_RIDE_LIST, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::savePrompt, "WC_SAVE_PROMPT", STR_THEMES_WINDOW_SAVE_PROMPT, COLOURS_1(translucent(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::constructRide, "WC_CONSTRUCT_RIDE", STR_THEMES_WINDOW_CONSTRUCT_RIDE, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::demolishRidePrompt, "WC_DEMOLISH_RIDE_PROMPT", STR_THEMES_WINDOW_DEMOLISH_RIDE_PROMPT, COLOURS_1(translucent(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::error, "WC_ERROR", STR_THEMES_WINDOW_ERROR, COLOURS_1(translucent(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::scenery, "WC_SCENERY", STR_THEMES_WINDOW_SCENERY, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) ) }, - { WindowClass::sceneryScatter, "WC_SCENERY_SCATTER", STR_THEMES_WINDOW_SCENERY_SCATTER, COLOURS_2(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) ) }, - { WindowClass::options, "WC_OPTIONS", STR_THEMES_WINDOW_OPTIONS, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::assetPacks, "WC_ASSET_PACKS", STR_ASSET_PACKS, COLOURS_3(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::footpath, "WC_FOOTPATH", STR_THEMES_WINDOW_FOOTPATH, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::land, "WC_LAND", STR_THEMES_WINDOW_LAND, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::water, "WC_WATER", STR_THEMES_WINDOW_WATER, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::peep, "WC_PEEP", STR_THEMES_WINDOW_PEEP, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_OLIVE_GREEN), opaque(COLOUR_OLIVE_GREEN) ) }, - { WindowClass::guestList, "WC_GUEST_LIST", STR_THEMES_WINDOW_GUEST_LIST, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_OLIVE_GREEN), opaque(COLOUR_OLIVE_GREEN) ) }, - { WindowClass::staffList, "WC_STAFF_LIST", STR_THEMES_WINDOW_STAFF_LIST, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE) ) }, - { WindowClass::firePrompt, "WC_FIRE_PROMPT", STR_THEMES_WINDOW_FIRE_PROMPT, COLOURS_1(translucent(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::parkInformation, "WC_PARK_INFORMATION", STR_THEMES_WINDOW_PARK_INFORMATION, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) ) }, - { WindowClass::finances, "WC_FINANCES", STR_THEMES_WINDOW_FINANCES, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) ) }, - { WindowClass::titleMenu, "WC_TITLE_MENU", STR_THEMES_WINDOW_TITLE_MENU_BUTTONS, COLOURS_3(translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN) ) }, - { WindowClass::titleExit, "WC_TITLE_EXIT", STR_THEMES_WINDOW_TITLE_MENU_EXIT, COLOURS_3(translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN) ) }, - { WindowClass::recentNews, "WC_RECENT_NEWS", STR_THEMES_WINDOW_RECENT_NEWS, COLOURS_3(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_GREY), opaque(COLOUR_BLACK) ) }, - { WindowClass::scenarioSelect, "WC_SCENARIO_SELECT", STR_THEMES_WINDOW_TITLE_MENU_SCENARIO_SELECTION, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::trackDesignList, "WC_TRACK_DESIGN_LIST", STR_THEMES_WINDOW_TRACK_DESIGN_LIST, COLOURS_3(opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::trackDesignPlace, "WC_TRACK_DESIGN_PLACE", STR_THEMES_WINDOW_TRACK_DESIGN_PLACE, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::newCampaign, "WC_NEW_CAMPAIGN", STR_THEMES_WINDOW_NEW_CAMPAIGN, COLOURS_3(opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) ) }, - { WindowClass::keyboardShortcutList, "WC_KEYBOARD_SHORTCUT_LIST", STR_THEMES_WINDOW_KEYBOARD_SHORTCUT_LIST, COLOURS_3(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::changeKeyboardShortcut, "WC_CHANGE_KEYBOARD_SHORTCUT", STR_THEMES_WINDOW_CHANGE_KEYBOARD_SHORTCUT, COLOURS_3(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::resetShortcutKeysPrompt, "WC_RESET_SHORTCUT_KEYS_PROMPT", STR_SHORTCUT_ACTION_RESET, COLOURS_1(translucent(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::map, "WC_MAP", STR_THEMES_WINDOW_MAP, COLOURS_2(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::banner, "WC_BANNER", STR_THEMES_WINDOW_BANNER, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::editorObjectSelection, "WC_EDITOR_OBJECT_SELECTION", STR_THEMES_WINDOW_EDITOR_OBJECT_SELECTION, COLOURS_3(opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY) ) }, - { WindowClass::editorInventionList, "WC_EDITOR_INVENTION_LIST", STR_THEMES_WINDOW_EDITOR_INVENTION_LIST, COLOURS_3(opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY) ) }, - { WindowClass::editorScenarioOptions, "WC_EDITOR_SCENARIO_OPTIONS", STR_THEMES_WINDOW_EDITOR_SCENARIO_OPTIONS, COLOURS_3(opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY) ) }, - { WindowClass::manageTrackDesign, "WC_MANAGE_TRACK_DESIGN", STR_THEMES_WINDOW_MANAGE_TRACK_DESIGN, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_GREY) ) }, - { WindowClass::trackDeletePrompt, "WC_TRACK_DELETE_PROMPT", STR_THEMES_WINDOW_TRACK_DELETE_PROMPT, COLOURS_3(opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::installTrack, "WC_INSTALL_TRACK", STR_THEMES_WINDOW_INSTALL_TRACK, COLOURS_3(opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::clearScenery, "WC_CLEAR_SCENERY", STR_THEMES_WINDOW_CLEAR_SCENERY, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::cheats, "WC_CHEATS", STR_CHEAT_TITLE, COLOURS_2(opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW) ) }, - { WindowClass::research, "WC_RESEARCH", STR_THEMES_WINDOW_RESEARCH, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) ) }, - { WindowClass::viewport, "WC_VIEWPORT", STR_THEMES_WINDOW_VIEWPORT, COLOURS_3(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::mapgen, "WC_MAPGEN", STR_THEMES_WINDOW_MAPGEN, COLOURS_3(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) ) }, - { WindowClass::loadsave, "WC_LOADSAVE", STR_THEMES_WINDOW_LOADSAVE, COLOURS_3(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) ) }, - { WindowClass::loadsaveOverwritePrompt, "WC_LOADSAVE_OVERWRITE_PROMPT", STR_THEMES_WINDOW_LOADSAVE_OVERWRITE_PROMPT, COLOURS_1(translucent(COLOUR_BORDEAUX_RED) ) }, - { WindowClass::titleOptions, "WC_TITLE_OPTIONS", STR_THEMES_WINDOW_TITLE_MENU_OPTIONS, COLOURS_3(translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN) ) }, - { WindowClass::landRights, "WC_LAND_RIGHTS", STR_THEMES_WINDOW_LAND_RIGHTS, COLOURS_3(opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) ) }, - { WindowClass::themes, "WC_THEMES", STR_THEMES_WINDOW_THEMES, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) ) }, - { WindowClass::staff, "WC_STAFF", STR_THEMES_WINDOW_STAFF, COLOURS_3(opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE) ) }, - { WindowClass::editorTrackBottomToolbar, "WC_EDITOR_TRACK_BOTTOM_TOOLBAR", STR_THEMES_WINDOW_BOTTOM_TOOLBAR_TRACK_EDITOR, COLOURS_3(translucent(COLOUR_LIGHT_BLUE), translucent(COLOUR_LIGHT_BLUE), translucent(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::editorScenarioBottomToolbar, "WC_EDITOR_SCENARIO_BOTTOM_TOOLBAR", STR_THEMES_WINDOW_BOTTOM_TOOLBAR_SCENARIO_EDITOR, COLOURS_3(translucent(COLOUR_LIGHT_BROWN), translucent(COLOUR_LIGHT_BROWN), translucent(COLOUR_MOSS_GREEN) ) }, - { WindowClass::tileInspector, "WC_TILE_INSPECTOR", STR_TILE_INSPECTOR_TITLE, COLOURS_2(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::viewClipping, "WC_VIEW_CLIPPING", STR_VIEW_CLIPPING_TITLE, COLOURS_1(opaque(COLOUR_DARK_GREEN) ) }, - { WindowClass::patrolArea, "WC_PATROL_AREA", STR_SET_PATROL_AREA, COLOURS_3(opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE) ) }, - { WindowClass::transparency, "WC_TRANSPARENCY", STR_TRANSPARENCY_OPTIONS_TITLE, COLOURS_3(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::about, "WC_ABOUT", STR_ABOUT, COLOURS_2(opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::changelog, "WC_CHANGELOG", STR_CHANGELOG_TITLE, COLOURS_2(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::multiplayer, "WC_MULTIPLAYER", STR_MULTIPLAYER, COLOURS_3(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::player, "WC_PLAYER", STR_THEMES_WINDOW_PLAYER, COLOURS_3(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::networkStatus, "WC_NETWORK_STATUS", STR_THEMES_WINDOW_NETWORK_STATUS, COLOURS_1(opaque(COLOUR_BLACK) ) }, - { WindowClass::serverList, "WC_SERVER_LIST", STR_SERVER_LIST, COLOURS_2(opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) ) }, - { WindowClass::chat, "WC_CHAT", STR_CHAT, COLOURS_1(translucent(COLOUR_GREY) ) }, - { WindowClass::console, "WC_CONSOLE", STR_CONSOLE, COLOURS_2(translucent(COLOUR_LIGHT_BLUE), opaque(COLOUR_WHITE) ) }, - { WindowClass::progressWindow, "WC_PROGRESS_WINDOW", STR_THEME_LOADING_WINDOW, COLOURS_1(opaque(COLOUR_BLACK) ) }, - { WindowClass::editorParkEntrance, "WC_EDITOR_PARK_ENTRANCE", STR_OBJECT_SELECTION_PARK_ENTRANCE, COLOURS_2(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN) ) }, -}; + static constexpr WindowThemeDesc kWindowThemeDescriptors[] = + { + // WindowClass WindowClassSZ WindowName windowColours + { WindowClass::topToolbar, "WC_TOP_TOOLBAR", STR_THEMES_WINDOW_TOP_TOOLBAR, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_GREY) } }, + { WindowClass::bottomToolbar, "WC_BOTTOM_TOOLBAR", STR_THEMES_WINDOW_BOTTOM_TOOLBAR, { translucent(COLOUR_DARK_GREEN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BRIGHT_GREEN) } }, + { WindowClass::ride, "WC_RIDE", STR_THEMES_WINDOW_RIDE, { opaque(COLOUR_GREY), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_SATURATED_GREEN) } }, + { WindowClass::rideConstruction, "WC_RIDE_CONSTRUCTION", STR_THEMES_WINDOW_RIDE_CONSTRUCTION, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::rideList, "WC_RIDE_LIST", STR_THEMES_WINDOW_RIDE_LIST, { opaque(COLOUR_GREY), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) } }, + { WindowClass::savePrompt, "WC_SAVE_PROMPT", STR_THEMES_WINDOW_SAVE_PROMPT, { translucent(COLOUR_BORDEAUX_RED) } }, + { WindowClass::constructRide, "WC_CONSTRUCT_RIDE", STR_THEMES_WINDOW_CONSTRUCT_RIDE, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) } }, + { WindowClass::demolishRidePrompt, "WC_DEMOLISH_RIDE_PROMPT", STR_THEMES_WINDOW_DEMOLISH_RIDE_PROMPT, { translucent(COLOUR_BORDEAUX_RED) } }, + { WindowClass::error, "WC_ERROR", STR_THEMES_WINDOW_ERROR, { translucent(COLOUR_BORDEAUX_RED) } }, + { WindowClass::scenery, "WC_SCENERY", STR_THEMES_WINDOW_SCENERY, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) } }, + { WindowClass::sceneryScatter, "WC_SCENERY_SCATTER", STR_THEMES_WINDOW_SCENERY_SCATTER, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) } }, + { WindowClass::options, "WC_OPTIONS", STR_THEMES_WINDOW_OPTIONS, { opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::assetPacks, "WC_ASSET_PACKS", STR_ASSET_PACKS, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::footpath, "WC_FOOTPATH", STR_THEMES_WINDOW_FOOTPATH, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::land, "WC_LAND", STR_THEMES_WINDOW_LAND, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::water, "WC_WATER", STR_THEMES_WINDOW_WATER, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::peep, "WC_PEEP", STR_THEMES_WINDOW_PEEP, { opaque(COLOUR_GREY), opaque(COLOUR_OLIVE_GREEN), opaque(COLOUR_OLIVE_GREEN) } }, + { WindowClass::guestList, "WC_GUEST_LIST", STR_THEMES_WINDOW_GUEST_LIST, { opaque(COLOUR_GREY), opaque(COLOUR_OLIVE_GREEN), opaque(COLOUR_OLIVE_GREEN) } }, + { WindowClass::staffList, "WC_STAFF_LIST", STR_THEMES_WINDOW_STAFF_LIST, { opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE) } }, + { WindowClass::firePrompt, "WC_FIRE_PROMPT", STR_THEMES_WINDOW_FIRE_PROMPT, { translucent(COLOUR_BORDEAUX_RED) } }, + { WindowClass::parkInformation, "WC_PARK_INFORMATION", STR_THEMES_WINDOW_PARK_INFORMATION, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) } }, + { WindowClass::finances, "WC_FINANCES", STR_THEMES_WINDOW_FINANCES, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) } }, + { WindowClass::titleMenu, "WC_TITLE_MENU", STR_THEMES_WINDOW_TITLE_MENU_BUTTONS, { translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN) } }, + { WindowClass::titleExit, "WC_TITLE_EXIT", STR_THEMES_WINDOW_TITLE_MENU_EXIT, { translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN) } }, + { WindowClass::recentNews, "WC_RECENT_NEWS", STR_THEMES_WINDOW_RECENT_NEWS, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::scenarioSelect, "WC_SCENARIO_SELECT", STR_THEMES_WINDOW_TITLE_MENU_SCENARIO_SELECTION, { opaque(COLOUR_GREY), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) } }, + { WindowClass::trackDesignList, "WC_TRACK_DESIGN_LIST", STR_THEMES_WINDOW_TRACK_DESIGN_LIST, { opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) } }, + { WindowClass::trackDesignPlace, "WC_TRACK_DESIGN_PLACE", STR_THEMES_WINDOW_TRACK_DESIGN_PLACE, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::newCampaign, "WC_NEW_CAMPAIGN", STR_THEMES_WINDOW_NEW_CAMPAIGN, { opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) } }, + { WindowClass::keyboardShortcutList, "WC_KEYBOARD_SHORTCUT_LIST", STR_THEMES_WINDOW_KEYBOARD_SHORTCUT_LIST, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::changeKeyboardShortcut, "WC_CHANGE_KEYBOARD_SHORTCUT", STR_THEMES_WINDOW_CHANGE_KEYBOARD_SHORTCUT, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::resetShortcutKeysPrompt, "WC_RESET_SHORTCUT_KEYS_PROMPT", STR_SHORTCUT_ACTION_RESET, { translucent(COLOUR_BORDEAUX_RED) } }, + { WindowClass::map, "WC_MAP", STR_THEMES_WINDOW_MAP, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::banner, "WC_BANNER", STR_THEMES_WINDOW_BANNER, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::editorObjectSelection, "WC_EDITOR_OBJECT_SELECTION", STR_THEMES_WINDOW_EDITOR_OBJECT_SELECTION, { opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY) } }, + { WindowClass::editorInventionList, "WC_EDITOR_INVENTION_LIST", STR_THEMES_WINDOW_EDITOR_INVENTION_LIST, { opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY) } }, + { WindowClass::editorScenarioOptions, "WC_EDITOR_SCENARIO_OPTIONS", STR_THEMES_WINDOW_EDITOR_SCENARIO_OPTIONS, { opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY) } }, + { WindowClass::manageTrackDesign, "WC_MANAGE_TRACK_DESIGN", STR_THEMES_WINDOW_MANAGE_TRACK_DESIGN, { opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_GREY) } }, + { WindowClass::trackDeletePrompt, "WC_TRACK_DELETE_PROMPT", STR_THEMES_WINDOW_TRACK_DELETE_PROMPT, { opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) } }, + { WindowClass::installTrack, "WC_INSTALL_TRACK", STR_THEMES_WINDOW_INSTALL_TRACK, { opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED) } }, + { WindowClass::clearScenery, "WC_CLEAR_SCENERY", STR_THEMES_WINDOW_CLEAR_SCENERY, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::cheats, "WC_CHEATS", STR_CHEAT_TITLE, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW) } }, + { WindowClass::research, "WC_RESEARCH", STR_THEMES_WINDOW_RESEARCH, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) } }, + { WindowClass::viewport, "WC_VIEWPORT", STR_THEMES_WINDOW_VIEWPORT, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::mapgen, "WC_MAPGEN", STR_THEMES_WINDOW_MAPGEN, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN) } }, + { WindowClass::loadsave, "WC_LOADSAVE", STR_THEMES_WINDOW_LOADSAVE, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) } }, + { WindowClass::loadsaveOverwritePrompt, "WC_LOADSAVE_OVERWRITE_PROMPT", STR_THEMES_WINDOW_LOADSAVE_OVERWRITE_PROMPT, { translucent(COLOUR_BORDEAUX_RED) } }, + { WindowClass::titleOptions, "WC_TITLE_OPTIONS", STR_THEMES_WINDOW_TITLE_MENU_OPTIONS, { translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN), translucent(COLOUR_DARK_GREEN) } }, + { WindowClass::landRights, "WC_LAND_RIGHTS", STR_THEMES_WINDOW_LAND_RIGHTS, { opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW), opaque(COLOUR_DARK_YELLOW) } }, + { WindowClass::themes, "WC_THEMES", STR_THEMES_WINDOW_THEMES, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_GREEN) } }, + { WindowClass::staff, "WC_STAFF", STR_THEMES_WINDOW_STAFF, { opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE) } }, + { WindowClass::editorTrackBottomToolbar, "WC_EDITOR_TRACK_BOTTOM_TOOLBAR", STR_THEMES_WINDOW_BOTTOM_TOOLBAR_TRACK_EDITOR, { translucent(COLOUR_LIGHT_BLUE), translucent(COLOUR_LIGHT_BLUE), translucent(COLOUR_LIGHT_BLUE) } }, + { WindowClass::editorScenarioBottomToolbar, "WC_EDITOR_SCENARIO_BOTTOM_TOOLBAR", STR_THEMES_WINDOW_BOTTOM_TOOLBAR_SCENARIO_EDITOR, { translucent(COLOUR_LIGHT_BROWN), translucent(COLOUR_LIGHT_BROWN), translucent(COLOUR_MOSS_GREEN) } }, + { WindowClass::tileInspector, "WC_TILE_INSPECTOR", STR_TILE_INSPECTOR_TITLE, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::viewClipping, "WC_VIEW_CLIPPING", STR_VIEW_CLIPPING_TITLE, { opaque(COLOUR_DARK_GREEN) } }, + { WindowClass::patrolArea, "WC_PATROL_AREA", STR_SET_PATROL_AREA, { opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE) } }, + { WindowClass::transparency, "WC_TRANSPARENCY", STR_TRANSPARENCY_OPTIONS_TITLE, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::about, "WC_ABOUT", STR_ABOUT, { opaque(COLOUR_GREY), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::changelog, "WC_CHANGELOG", STR_CHANGELOG_TITLE, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::multiplayer, "WC_MULTIPLAYER", STR_MULTIPLAYER, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::player, "WC_PLAYER", STR_THEMES_WINDOW_PLAYER, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::networkStatus, "WC_NETWORK_STATUS", STR_THEMES_WINDOW_NETWORK_STATUS, { opaque(COLOUR_BLACK) } }, + { WindowClass::serverList, "WC_SERVER_LIST", STR_SERVER_LIST, { opaque(COLOUR_LIGHT_BLUE), opaque(COLOUR_LIGHT_BLUE) } }, + { WindowClass::chat, "WC_CHAT", STR_CHAT, { translucent(COLOUR_GREY) } }, + { WindowClass::console, "WC_CONSOLE", STR_CONSOLE, { translucent(COLOUR_LIGHT_BLUE), opaque(COLOUR_WHITE) } }, + { WindowClass::progressWindow, "WC_PROGRESS_WINDOW", STR_THEME_LOADING_WINDOW, { opaque(COLOUR_BLACK) } }, + { WindowClass::editorParkEntrance, "WC_EDITOR_PARK_ENTRANCE", STR_OBJECT_SELECTION_PARK_ENTRANCE, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_DARK_BROWN) } }, + }; #pragma endregion #pragma region Pre-defined Themes -#define COLOURS_RCT1(c0, c1, c2, c3, c4, c5) { { (c0), (c1), (c2), (c3), (c4), (c5) } } - -static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = -{ - { WindowClass::topToolbar, COLOURS_RCT1(opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::bottomToolbar, COLOURS_RCT1(translucent(COLOUR_GREY), translucent(COLOUR_GREY), opaque(COLOUR_VOID), opaque(COLOUR_YELLOW), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::ride, COLOURS_RCT1(opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_GREY), opaque(COLOUR_SATURATED_GREEN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::rideList, COLOURS_RCT1(opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::constructRide, COLOURS_RCT1(opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::peep, COLOURS_RCT1(opaque(COLOUR_LIGHT_BROWN), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::guestList, COLOURS_RCT1(opaque(COLOUR_LIGHT_BROWN), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::staffList, COLOURS_RCT1(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::finances, COLOURS_RCT1(opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::titleMenu, COLOURS_RCT1(translucent(COLOUR_GREY), translucent(COLOUR_GREY), translucent(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::titleExit, COLOURS_RCT1(translucent(COLOUR_GREY), translucent(COLOUR_GREY), translucent(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::newCampaign, COLOURS_RCT1(opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::titleOptions, COLOURS_RCT1(translucent(COLOUR_GREY), translucent(COLOUR_GREY), translucent(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::staff, COLOURS_RCT1(opaque(COLOUR_DARK_GREEN), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::options, COLOURS_RCT1(opaque(COLOUR_GREY), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::assetPacks, COLOURS_RCT1(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::keyboardShortcutList, COLOURS_RCT1(opaque(COLOUR_GREY), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::changeKeyboardShortcut, COLOURS_RCT1(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::recentNews, COLOURS_RCT1(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::trackDesignList, COLOURS_RCT1(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::map, COLOURS_RCT1(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::about, COLOURS_RCT1(opaque(COLOUR_GREY), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_WHITE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - { WindowClass::changelog, COLOURS_RCT1(opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_WHITE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK)) }, - THEME_DEF_END, -}; + static constexpr std::array kPredefinedThemeRCT1Entries = std::to_array({ + { WindowClass::topToolbar, { opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::bottomToolbar, { translucent(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_VOID), opaque(COLOUR_YELLOW), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::ride, { opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_GREY), opaque(COLOUR_SATURATED_GREEN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::rideList, { opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::constructRide, { opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::peep, { opaque(COLOUR_LIGHT_BROWN), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::guestList, { opaque(COLOUR_LIGHT_BROWN), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BORDEAUX_RED), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::staffList, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::finances, { opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::titleMenu, { translucent(COLOUR_GREY), translucent(COLOUR_GREY), translucent(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::titleExit, { translucent(COLOUR_GREY), translucent(COLOUR_GREY), translucent(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::newCampaign, { opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::titleOptions, { translucent(COLOUR_GREY), translucent(COLOUR_GREY), translucent(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::staff, { opaque(COLOUR_DARK_GREEN), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_LIGHT_PURPLE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::options, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::assetPacks, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::keyboardShortcutList, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::changeKeyboardShortcut, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::recentNews, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_VOID), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::trackDesignList, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::map, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_GREY), opaque(COLOUR_GREY), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::about, { opaque(COLOUR_GREY), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_WHITE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + { WindowClass::changelog, { opaque(COLOUR_DARK_BROWN), opaque(COLOUR_DARK_BROWN), opaque(COLOUR_WHITE), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK), opaque(COLOUR_BLACK) } }, + }); // clang-format on - static constexpr UIThemeWindowEntry PredefinedThemeRCT2_Entries[] = { - THEME_DEF_END, - }; + static constexpr std::array kPredefinedThemeRCT2Entries = {}; - const UITheme PredefinedThemeRCT1 = UITheme::CreatePredefined( - "*RCT1", PredefinedThemeRCT1_Entries, + const UITheme kPredefinedThemeRCT1 = UITheme::CreatePredefined( + "*RCT1", kPredefinedThemeRCT1Entries, UITHEME_FLAG_USE_LIGHTS_RIDE | UITHEME_FLAG_USE_LIGHTS_PARK | UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT - | UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR); + | UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR | UITHEME_FLAG_USE_3D_IMAGE_BUTTONS); - const UITheme PredefinedThemeRCT2 = UITheme::CreatePredefined("*RCT2", PredefinedThemeRCT2_Entries, 0); + const UITheme kPredefinedThemeRCT2 = UITheme::CreatePredefined("*RCT2", kPredefinedThemeRCT2Entries, 0); struct PredefinedTheme { @@ -250,16 +272,16 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = StringId Name; }; - static constexpr PredefinedTheme PredefinedThemes[] = { - { &PredefinedThemeRCT1, STR_TITLE_SEQUENCE_RCT1 }, - { &PredefinedThemeRCT2, STR_TITLE_SEQUENCE_RCT2 }, + static constexpr PredefinedTheme kPredefinedThemes[] = { + { &kPredefinedThemeRCT1, STR_TITLE_SEQUENCE_RCT1 }, + { &kPredefinedThemeRCT2, STR_TITLE_SEQUENCE_RCT2 }, }; #pragma endregion static const WindowThemeDesc* GetWindowThemeDescriptor(WindowClass windowClass) { - for (const auto& desc : WindowThemeDescriptors) + for (const auto& desc : kWindowThemeDescriptors) { if (desc.WindowClass == windowClass) { @@ -271,7 +293,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = static const WindowThemeDesc* GetWindowThemeDescriptor(const utf8* windowClassSZ) { - for (const auto& desc : WindowThemeDescriptors) + for (const auto& desc : kWindowThemeDescriptors) { if (String::equals(desc.WindowClassSZ, windowClassSZ)) { @@ -297,7 +319,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = } json_t jsonColours = json_t::array(); - for (uint8_t i = 0; i < wtDesc->NumColours; i++) + for (uint8_t i = 0; i < wtDesc->windowColours.numColours; i++) { json_t jsonEntry = { { "colour", Colour::ToString(Theme.Colours[i].colour) }, { "translucent", Theme.Colours[i].hasFlag(ColourFlag::translucent) } }; @@ -325,10 +347,10 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = UIThemeWindowEntry result{}; result.Class = wtDesc->WindowClass; - result.Theme = wtDesc->DefaultTheme; + result.Theme = wtDesc->windowColours.defaultTheme; // result.Theme.Colours only has 6 values - size_t colourCount = std::min(jsonColours.size(), static_cast(wtDesc->NumColours)); + size_t colourCount = std::min(jsonColours.size(), static_cast(wtDesc->windowColours.numColours)); for (size_t i = 0; i < colourCount; i++) { @@ -419,6 +441,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { "useLightsPark", (Flags & UITHEME_FLAG_USE_LIGHTS_PARK) != 0 }, { "useAltScenarioSelectFont", (Flags & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT) != 0 }, { "useFullBottomToolbar", (Flags & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) != 0 }, + { "use3dImageButtons", (Flags & UITHEME_FLAG_USE_3D_IMAGE_BUTTONS) != 0 }, }; return jsonTheme; @@ -467,6 +490,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { "useLightsPark", UITHEME_FLAG_USE_LIGHTS_PARK }, { "useAltScenarioSelectFont", UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT }, { "useFullBottomToolbar", UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR }, + { "use3dImageButtons", UITHEME_FLAG_USE_3D_IMAGE_BUTTONS }, }); if (jsonEntries.is_object()) @@ -513,18 +537,11 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = return result; } - UITheme UITheme::CreatePredefined(const std::string& name, const UIThemeWindowEntry* entries, uint8_t flags) + UITheme UITheme::CreatePredefined(const std::string& name, std::span entries, uint8_t flags) { auto theme = UITheme(name); theme.Flags = flags | UITHEME_FLAG_PREDEFINED; - - size_t numEntries = 0; - for (const UIThemeWindowEntry* entry = entries; entry->Class != WindowClass::null; entry++) - { - numEntries++; - } - - theme.Entries = std::vector(entries, entries + numEntries); + theme.Entries.assign(entries.begin(), entries.end()); return theme; } @@ -555,7 +572,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = outThemes->clear(); NumPredefinedThemes = 0; - for (auto predefinedTheme : PredefinedThemes) + for (auto predefinedTheme : kPredefinedThemes) { AvailableTheme theme{}; theme.Name = predefinedTheme.Theme->Name; @@ -610,7 +627,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = if (theme == nullptr) { // Fall-back to default - theme = const_cast(&PredefinedThemeRCT2); + theme = const_cast(&kPredefinedThemeRCT2); LoadTheme(theme); } else @@ -629,7 +646,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { if (theme.Path.empty()) { - LoadTheme(const_cast(PredefinedThemes[i].Theme)); + LoadTheme(const_cast(kPredefinedThemes[i].Theme)); } else { @@ -645,13 +662,13 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = static void Initialise() { ThemeManager::GetAvailableThemes(&ThemeManager::AvailableThemes); - LoadTheme(const_cast(&PredefinedThemeRCT2)); + LoadTheme(const_cast(&kPredefinedThemeRCT2)); ActiveAvailableThemeIndex = 1; bool configValid = false; - if (!Config::Get().interface.CurrentThemePreset.empty()) + if (!Config::Get().interface.currentThemePreset.empty()) { - if (LoadThemeByConfigName(Config::Get().interface.CurrentThemePreset.c_str())) + if (LoadThemeByConfigName(Config::Get().interface.currentThemePreset.c_str())) { configValid = true; } @@ -659,7 +676,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = if (!configValid) { - Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(1); + Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(1); } } @@ -714,7 +731,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = const utf8* ThemeManagerGetAvailableThemeName(size_t index) { if (index < ThemeManager::NumPredefinedThemes) - return LanguageGetString(PredefinedThemes[index].Name); + return LanguageGetString(kPredefinedThemes[index].Name); return ThemeManager::AvailableThemes[index].Name.c_str(); } @@ -727,7 +744,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { if (index < ThemeManager::NumPredefinedThemes) { - ThemeManager::LoadTheme(const_cast(PredefinedThemes[index].Theme)); + ThemeManager::LoadTheme(const_cast(kPredefinedThemes[index].Theme)); } else { @@ -741,7 +758,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = } } ThemeManager::ActiveAvailableThemeIndex = index; - Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(index); + Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(index); ColourSchemeUpdateAll(); } @@ -770,7 +787,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { return {}; } - return desc->DefaultTheme.Colours[index]; + return desc->windowColours.defaultTheme.Colours[index]; } return entry->Theme.Colours[index]; @@ -793,7 +810,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { return; } - entry.Theme = desc->DefaultTheme; + entry.Theme = desc->windowColours.defaultTheme; } entry.Theme.Colours[index] = colour; @@ -837,7 +854,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path)) { ThemeManager::ActiveAvailableThemeIndex = i; - Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(1); + Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(1); break; } } @@ -862,7 +879,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path)) { ThemeManager::ActiveAvailableThemeIndex = i; - Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(i); + Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(i); break; } } @@ -871,9 +888,9 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = void ThemeDelete() { File::Delete(ThemeManager::CurrentThemePath); - ThemeManager::LoadTheme(const_cast(&PredefinedThemeRCT2)); + ThemeManager::LoadTheme(const_cast(&kPredefinedThemeRCT2)); ThemeManager::ActiveAvailableThemeIndex = 1; - Config::Get().interface.CurrentThemePreset = ThemeManagerGetAvailableThemeConfigName(1); + Config::Get().interface.currentThemePreset = ThemeManagerGetAvailableThemeConfigName(1); } void ThemeManagerInitialise() @@ -888,7 +905,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { return 0; } - return desc->NumColours; + return desc->windowColours.numColours; } StringId ThemeDescGetName(WindowClass wc) @@ -929,7 +946,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = return; } - windowTheme = &desc->DefaultTheme; + windowTheme = &desc->windowColours.defaultTheme; } for (int32_t i = 0; i < 6; i++) diff --git a/src/openrct2-ui/interface/Theme.h b/src/openrct2-ui/interface/Theme.h index e504e71412..daafcc6973 100644 --- a/src/openrct2-ui/interface/Theme.h +++ b/src/openrct2-ui/interface/Theme.h @@ -21,6 +21,7 @@ namespace OpenRCT2::Ui UITHEME_FLAG_USE_LIGHTS_PARK = 1 << 2, UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT = 1 << 3, UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR = 1 << 4, + UITHEME_FLAG_USE_3D_IMAGE_BUTTONS = 1 << 5, }; void ColourSchemeUpdate(WindowBase* window); diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index a203a6c113..8a7d92cb94 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -114,7 +114,7 @@ namespace OpenRCT2::Ui case ViewportInteractionItem::entity: switch (sprite->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: { auto vehicle = sprite->As(); if (vehicle != nullptr && !vehicle->IsCableLift()) @@ -123,8 +123,8 @@ namespace OpenRCT2::Ui info.interactionType = ViewportInteractionItem::none; } break; - case EntityType::Guest: - case EntityType::Staff: + case EntityType::guest: + case EntityType::staff: { auto peep = sprite->As(); if (peep != nullptr) @@ -205,22 +205,22 @@ namespace OpenRCT2::Ui auto entity = info.Entity; switch (entity->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: { auto intent = Intent(WindowDetail::vehicle); intent.PutExtra(INTENT_EXTRA_VEHICLE, entity); ContextOpenIntent(&intent); break; } - case EntityType::Guest: - case EntityType::Staff: + case EntityType::guest: + case EntityType::staff: { auto intent = Intent(WindowClass::peep); intent.PutExtra(INTENT_EXTRA_PEEP, entity); ContextOpenIntent(&intent); break; } - case EntityType::Balloon: + case EntityType::balloon: { if (GameIsNotPaused()) { @@ -229,7 +229,7 @@ namespace OpenRCT2::Ui } } break; - case EntityType::Duck: + case EntityType::duck: { if (GameIsNotPaused()) { @@ -288,7 +288,7 @@ namespace OpenRCT2::Ui case ViewportInteractionItem::entity: { auto sprite = info.Entity; - if (gLegacyScene == LegacyScene::scenarioEditor || sprite->Type != EntityType::Vehicle) + if (gLegacyScene == LegacyScene::scenarioEditor || sprite->Type != EntityType::vehicle) { info.interactionType = ViewportInteractionItem::none; return info; @@ -573,7 +573,7 @@ namespace OpenRCT2::Ui case ViewportInteractionItem::entity: { auto entity = info.Entity; - if (entity->Type == EntityType::Vehicle) + if (entity->Type == EntityType::vehicle) { auto vehicle = entity->As(); if (vehicle == nullptr) diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 4d12a443b5..0c9c3476f4 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -12,18 +12,21 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include #include using namespace OpenRCT2; +using namespace OpenRCT2::Drawing; namespace OpenRCT2::Ui { @@ -80,6 +83,7 @@ namespace OpenRCT2::Ui WidgetTabDraw(rt, w, widgetIndex); break; case WidgetType::flatBtn: + case WidgetType::hiddenButton: WidgetFlatButtonDraw(rt, w, widgetIndex); break; case WidgetType::button: @@ -141,12 +145,14 @@ namespace OpenRCT2::Ui int32_t b = w.windowPos.y + widget.bottom; // - uint8_t press = (w.flags.has(WindowFlag::higherContrastOnPress) ? INSET_RECT_FLAG_FILL_MID_LIGHT : 0); + auto brightness + = (w.flags.has(WindowFlag::higherContrastOnPress) ? Rectangle::FillBrightness::dark + : Rectangle::FillBrightness::light); auto colour = w.colours[widget.colour]; // Draw the frame - GfxFillRectInset(rt, { leftTop, { r, b } }, colour, press); + Rectangle::fillInset(rt, { leftTop, { r, b } }, colour, Rectangle::BorderStyle::outset, brightness); if (!w.canBeResized()) return; @@ -173,7 +179,7 @@ namespace OpenRCT2::Ui auto colour = w.colours[widget.colour]; // Draw the panel - GfxFillRectInset(rt, { leftTop, { r, b } }, colour, 0); + Rectangle::fillInset(rt, { leftTop, { r, b } }, colour); if (!w.canBeResized()) return; @@ -197,7 +203,8 @@ namespace OpenRCT2::Ui w.windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; // Check if the button is pressed down - uint8_t press = widgetIsPressed(w, widgetIndex) || isToolActive(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0; + auto borderStyle = widgetIsPressed(w, widgetIndex) || isToolActive(w, widgetIndex) ? Rectangle::BorderStyle::inset + : Rectangle::BorderStyle::outset; auto colour = w.colours[widget.colour]; @@ -205,12 +212,12 @@ namespace OpenRCT2::Ui if (static_cast(widget.image.GetIndex()) == -2) { // Draw border with no fill - GfxFillRectInset(rt, rect, colour, press | INSET_RECT_FLAG_FILL_NONE); + Rectangle::fillInset(rt, rect, colour, borderStyle, Rectangle::FillBrightness::light, Rectangle::FillMode::none); return; } // Draw the border with fill - GfxFillRectInset(rt, rect, colour, press); + Rectangle::fillInset(rt, rect, colour, borderStyle); WidgetDrawImage(rt, w, widgetIndex); } @@ -270,15 +277,15 @@ namespace OpenRCT2::Ui */ static void WidgetFlatButtonDraw(RenderTarget& rt, WindowBase& w, WidgetIndex widgetIndex) { - if (!widgetIsDisabled(w, widgetIndex) && widgetIsHighlighted(w, widgetIndex)) + const auto& widget = w.widgets[widgetIndex]; + // First check is needed as this function handles both WidgetType::flatBtn and WidgetType::hiddenButton + const bool alwaysDrawAs3d = widget.type == WidgetType::flatBtn && (ThemeGetFlags() & UITHEME_FLAG_USE_3D_IMAGE_BUTTONS); + if (alwaysDrawAs3d || (!widgetIsDisabled(w, widgetIndex) && widgetIsHighlighted(w, widgetIndex))) { WidgetButtonDraw(rt, w, widgetIndex); return; } - // Get the widget - const auto& widget = w.widgets[widgetIndex]; - // Resolve the absolute ltrb ScreenRect rect{ w.windowPos + ScreenCoordsXY{ widget.left, widget.top }, w.windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; @@ -292,12 +299,14 @@ namespace OpenRCT2::Ui if (static_cast(widget.image.GetIndex()) == -2) { // Draw border with no fill - GfxFillRectInset(rt, rect, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE); + Rectangle::fillInset( + rt, rect, colour, Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); return; } // Draw the border with fill - GfxFillRectInset(rt, rect, colour, INSET_RECT_FLAG_BORDER_INSET); + Rectangle::fillInset(rt, rect, colour, Rectangle::BorderStyle::inset); } // Draw image @@ -320,8 +329,9 @@ namespace OpenRCT2::Ui auto colour = w.colours[widget.colour]; // Border - uint8_t press = widgetIsPressed(w, widgetIndex) || isToolActive(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0; - GfxFillRectInset(rt, rect, colour, press); + auto borderStyle = widgetIsPressed(w, widgetIndex) || isToolActive(w, widgetIndex) ? Rectangle::BorderStyle::inset + : Rectangle::BorderStyle::outset; + Rectangle::fillInset(rt, rect, colour, borderStyle); // Button caption if (widget.type != WidgetType::tableHeader) @@ -442,7 +452,9 @@ namespace OpenRCT2::Ui auto colour = w.colours[widget.colour]; - GfxFillRectInset(rt, rect, colour, INSET_RECT_F_60); + Rectangle::fillInset( + rt, rect, colour, Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::dontLightenWhenInset); WidgetText(rt, w, widgetIndex); } @@ -501,24 +513,24 @@ namespace OpenRCT2::Ui uint8_t colour = w.colours[widget.colour].colour; // Border left of text - GfxFillRect(rt, { { l, t }, { l + 4, t } }, ColourMapA[colour].mid_dark); - GfxFillRect(rt, { { l + 1, t + 1 }, { l + 4, t + 1 } }, ColourMapA[colour].lighter); + Rectangle::fill(rt, { { l, t }, { l + 4, t } }, ColourMapA[colour].mid_dark); + Rectangle::fill(rt, { { l + 1, t + 1 }, { l + 4, t + 1 } }, ColourMapA[colour].lighter); // Border right of text - GfxFillRect(rt, { { textRight, t }, { r - 1, t } }, ColourMapA[colour].mid_dark); - GfxFillRect(rt, { { textRight, t + 1 }, { r - 2, t + 1 } }, ColourMapA[colour].lighter); + Rectangle::fill(rt, { { textRight, t }, { r - 1, t } }, ColourMapA[colour].mid_dark); + Rectangle::fill(rt, { { textRight, t + 1 }, { r - 2, t + 1 } }, ColourMapA[colour].lighter); // Border right - GfxFillRect(rt, { { r - 1, t + 1 }, { r - 1, b - 1 } }, ColourMapA[colour].mid_dark); - GfxFillRect(rt, { { r, t }, { r, b } }, ColourMapA[colour].lighter); + Rectangle::fill(rt, { { r - 1, t + 1 }, { r - 1, b - 1 } }, ColourMapA[colour].mid_dark); + Rectangle::fill(rt, { { r, t }, { r, b } }, ColourMapA[colour].lighter); // Border bottom - GfxFillRect(rt, { { l, b - 1 }, { r - 2, b - 1 } }, ColourMapA[colour].mid_dark); - GfxFillRect(rt, { { l, b }, { r - 1, b } }, ColourMapA[colour].lighter); + Rectangle::fill(rt, { { l, b - 1 }, { r - 2, b - 1 } }, ColourMapA[colour].mid_dark); + Rectangle::fill(rt, { { l, b }, { r - 1, b } }, ColourMapA[colour].lighter); // Border left - GfxFillRect(rt, { { l, t + 1 }, { l, b - 2 } }, ColourMapA[colour].mid_dark); - GfxFillRect(rt, { { l + 1, t + 2 }, { l + 1, b - 2 } }, ColourMapA[colour].lighter); + Rectangle::fill(rt, { { l, t + 1 }, { l, b - 2 } }, ColourMapA[colour].mid_dark); + Rectangle::fill(rt, { { l + 1, t + 2 }, { l + 1, b - 2 } }, ColourMapA[colour].lighter); } /** @@ -536,19 +548,21 @@ namespace OpenRCT2::Ui auto colour = w.colours[widget->colour]; - uint8_t press = INSET_RECT_F_60; + auto brightness = Rectangle::FillBrightness::light; if (w.flags.has(WindowFlag::higherContrastOnPress)) - press |= INSET_RECT_FLAG_FILL_MID_LIGHT; + brightness = Rectangle::FillBrightness::dark; - GfxFillRectInset(rt, { topLeft, bottomRight }, colour, press); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, colour, Rectangle::BorderStyle::inset, brightness, + Rectangle::FillMode::dontLightenWhenInset); // Black caption bars look slightly green, this fixes that if (colour.colour == COLOUR_BLACK) - GfxFillRect( + Rectangle::fill( rt, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } }, ColourMapA[colour.colour].dark); else - GfxFilterRect( + Rectangle::filter( rt, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } }, FilterPaletteID::paletteDarken3); @@ -568,9 +582,9 @@ namespace OpenRCT2::Ui width -= kCloseButtonSize; } topLeft.x += width / 2; - if (Config::Get().interface.WindowButtonsOnTheLeft) + if (Config::Get().interface.windowButtonsOnTheLeft) topLeft.x += kCloseButtonSize; - if (Config::Get().interface.EnlargedUi) + if (Config::Get().interface.enlargedUi) topLeft.y += kTitleHeightLarge / 4; DrawTextEllipsised( @@ -592,16 +606,17 @@ namespace OpenRCT2::Ui auto bottomRight = w.windowPos + ScreenCoordsXY{ widget.right, widget.bottom }; // Check if the button is pressed down - uint8_t press = 0; + auto brightness = Rectangle::FillBrightness::light; + auto borderStyle = Rectangle::BorderStyle::outset; if (w.flags.has(WindowFlag::higherContrastOnPress)) - press |= INSET_RECT_FLAG_FILL_MID_LIGHT; + brightness = Rectangle::FillBrightness::dark; if (widgetIsPressed(w, widgetIndex) || isToolActive(w, widgetIndex)) - press |= INSET_RECT_FLAG_BORDER_INSET; + borderStyle = Rectangle::BorderStyle::inset; auto colour = w.colours[widget.colour]; // Draw the button - GfxFillRectInset(rt, { topLeft, bottomRight }, colour, press); + Rectangle::fillInset(rt, { topLeft, bottomRight }, colour, borderStyle, brightness); if (widget.string == nullptr) return; @@ -631,7 +646,9 @@ namespace OpenRCT2::Ui auto colour = w.colours[widget.colour]; // checkbox - GfxFillRectInset(rt, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, INSET_RECT_F_60); + Rectangle::fillInset( + rt, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::light, Rectangle::FillMode::dontLightenWhenInset); if (widgetIsDisabled(w, widgetIndex)) { @@ -680,7 +697,9 @@ namespace OpenRCT2::Ui auto colour = w.colours[widget.colour]; // Draw the border - GfxFillRectInset(rt, { topLeft, bottomRight }, colour, INSET_RECT_F_60); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, colour, Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::dontLightenWhenInset); // Inflate by -1 topLeft.x++; @@ -746,19 +765,24 @@ namespace OpenRCT2::Ui colour.setFlag(ColourFlag::translucent, false); // Trough - GfxFillRect(rt, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, ColourMapA[colour.colour].lighter); - GfxFillRect( + Rectangle::fill(rt, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, ColourMapA[colour.colour].lighter); + Rectangle::fill( rt, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, 0x1000000 | ColourMapA[colour.colour].mid_dark); - GfxFillRect(rt, { { l + kScrollBarWidth, t + 2 }, { r - kScrollBarWidth, t + 2 } }, ColourMapA[colour.colour].mid_dark); - GfxFillRect(rt, { { l + kScrollBarWidth, t + 3 }, { r - kScrollBarWidth, t + 3 } }, ColourMapA[colour.colour].lighter); - GfxFillRect(rt, { { l + kScrollBarWidth, t + 7 }, { r - kScrollBarWidth, t + 7 } }, ColourMapA[colour.colour].mid_dark); - GfxFillRect(rt, { { l + kScrollBarWidth, t + 8 }, { r - kScrollBarWidth, t + 8 } }, ColourMapA[colour.colour].lighter); + Rectangle::fill( + rt, { { l + kScrollBarWidth, t + 2 }, { r - kScrollBarWidth, t + 2 } }, ColourMapA[colour.colour].mid_dark); + Rectangle::fill( + rt, { { l + kScrollBarWidth, t + 3 }, { r - kScrollBarWidth, t + 3 } }, ColourMapA[colour.colour].lighter); + Rectangle::fill( + rt, { { l + kScrollBarWidth, t + 7 }, { r - kScrollBarWidth, t + 7 } }, ColourMapA[colour.colour].mid_dark); + Rectangle::fill( + rt, { { l + kScrollBarWidth, t + 8 }, { r - kScrollBarWidth, t + 8 } }, ColourMapA[colour.colour].lighter); // Left button { - uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; + auto borderStyle = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? Rectangle::BorderStyle::inset + : Rectangle::BorderStyle::outset; - GfxFillRectInset(rt, { { l, t }, { l + (kScrollBarWidth - 1), b } }, colour, flags); + Rectangle::fillInset(rt, { { l, t }, { l + (kScrollBarWidth - 1), b } }, colour, borderStyle); DrawText(rt, { l + 1, t }, {}, kBlackLeftArrowString); } @@ -766,16 +790,18 @@ namespace OpenRCT2::Ui { int16_t left = std::max(l + kScrollBarWidth, l + scroll.hThumbLeft - 1); int16_t right = std::min(r - kScrollBarWidth, l + scroll.hThumbRight - 1); - uint8_t flags = (scroll.flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; + auto borderStyle = (scroll.flags & HSCROLLBAR_THUMB_PRESSED) ? Rectangle::BorderStyle::inset + : Rectangle::BorderStyle::outset; - GfxFillRectInset(rt, { { left, t }, { right, b } }, colour, flags); + Rectangle::fillInset(rt, { { left, t }, { right, b } }, colour, borderStyle); } // Right button { - uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; + auto borderStyle = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? Rectangle::BorderStyle::inset + : Rectangle::BorderStyle::outset; - GfxFillRectInset(rt, { { r - (kScrollBarWidth - 1), t }, { r, b } }, colour, flags); + Rectangle::fillInset(rt, { { r - (kScrollBarWidth - 1), t }, { r, b } }, colour, borderStyle); DrawText(rt, { r - 6, t }, {}, kBlackRightArrowString); } } @@ -786,31 +812,36 @@ namespace OpenRCT2::Ui colour.setFlag(ColourFlag::translucent, false); // Trough - GfxFillRect(rt, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter); - GfxFillRect( + Rectangle::fill(rt, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter); + Rectangle::fill( rt, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, 0x1000000 | ColourMapA[colour.colour].mid_dark); - GfxFillRect(rt, { { l + 2, t + kScrollBarWidth }, { l + 2, b - kScrollBarWidth } }, ColourMapA[colour.colour].mid_dark); - GfxFillRect(rt, { { l + 3, t + kScrollBarWidth }, { l + 3, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter); - GfxFillRect(rt, { { l + 7, t + kScrollBarWidth }, { l + 7, b - kScrollBarWidth } }, ColourMapA[colour.colour].mid_dark); - GfxFillRect(rt, { { l + 8, t + kScrollBarWidth }, { l + 8, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter); + Rectangle::fill( + rt, { { l + 2, t + kScrollBarWidth }, { l + 2, b - kScrollBarWidth } }, ColourMapA[colour.colour].mid_dark); + Rectangle::fill( + rt, { { l + 3, t + kScrollBarWidth }, { l + 3, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter); + Rectangle::fill( + rt, { { l + 7, t + kScrollBarWidth }, { l + 7, b - kScrollBarWidth } }, ColourMapA[colour.colour].mid_dark); + Rectangle::fill( + rt, { { l + 8, t + kScrollBarWidth }, { l + 8, b - kScrollBarWidth } }, ColourMapA[colour.colour].lighter); // Up button - GfxFillRectInset( + Rectangle::fillInset( rt, { { l, t }, { r, t + (kScrollBarWidth - 1) } }, colour, - ((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); + ((scroll.flags & VSCROLLBAR_UP_PRESSED) ? Rectangle::BorderStyle::inset : Rectangle::BorderStyle::outset)); DrawText(rt, { l + 1, t - 1 }, {}, kBlackUpArrowString); // Thumb - GfxFillRectInset( + Rectangle::fillInset( rt, { { l, std::max(t + kScrollBarWidth, t + scroll.vThumbTop - 1) }, { r, std::min(b - kScrollBarWidth, t + scroll.vThumbBottom - 1) } }, - { colour }, ((scroll.flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); + { colour }, + ((scroll.flags & VSCROLLBAR_THUMB_PRESSED) ? Rectangle::BorderStyle::inset : Rectangle::BorderStyle::outset)); // Down button - GfxFillRectInset( + Rectangle::fillInset( rt, { { l, b - (kScrollBarWidth - 1) }, { r, b } }, colour, - ((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); + ((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? Rectangle::BorderStyle::inset : Rectangle::BorderStyle::outset)); DrawText(rt, { l + 1, b - (kScrollBarWidth - 1) }, {}, kBlackDownArrowString); } @@ -1128,8 +1159,10 @@ namespace OpenRCT2::Ui bool active = w.classification == tbIdent.window.classification && w.number == tbIdent.window.number && widgetIndex == tbIdent.widgetIndex; - // GfxFillRectInset(rt, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00)); - GfxFillRectInset(rt, { topLeft, bottomRight }, w.colours[widget.colour], INSET_RECT_F_60); + // Rectangle::fillInset(rt, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00)); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, w.colours[widget.colour], Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::light, Rectangle::FillMode::dontLightenWhenInset); // Figure out where the text should be positioned vertically. topLeft.y = w.windowPos.y + widget.textTop(); @@ -1175,7 +1208,7 @@ namespace OpenRCT2::Ui { auto colour = ColourMapA[w.colours[1].colour].mid_light; auto y = topLeft.y + 1 + widget.height() - 4; - GfxFillRect(rt, { { curX, y }, { curX + width, y } }, colour + 5); + Rectangle::fill(rt, { { curX, y }, { curX + width, y } }, colour + 5); } } @@ -1193,7 +1226,9 @@ namespace OpenRCT2::Ui auto isBlinking = (lowerBlinkBounds != upperBlinkBounds) && (percentage >= lowerBlinkBounds) && (percentage <= upperBlinkBounds); - GfxFillRectInset(rt, { topLeft, bottomRight }, w.colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, w.colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); if (isBlinking) { if (GameIsNotPaused() && (gCurrentRealTimeTicks & 8)) @@ -1204,9 +1239,9 @@ namespace OpenRCT2::Ui const int32_t fillSize = (barWidth * percentage) / 100; if (fillSize > 0) { - GfxFillRectInset( + Rectangle::fillInset( rt, { topLeft + ScreenCoordsXY{ 1, 1 }, topLeft + ScreenCoordsXY{ fillSize + 1, widget.height() - 1 } }, - { widget.colour }, 0); + { widget.colour }); } } @@ -1215,7 +1250,7 @@ namespace OpenRCT2::Ui ScreenCoordsXY topLeft{ w.windowPos + ScreenCoordsXY{ widget.left, widget.top } }; ScreenCoordsXY bottomRight{ w.windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; - GfxFillRectInset(rt, { topLeft, bottomRight }, w.colours[1], INSET_RECT_FLAG_BORDER_INSET); + Rectangle::fillInset(rt, { topLeft, bottomRight }, w.colours[1], Rectangle::BorderStyle::inset); } ImageId getColourButtonImage(colour_t colour) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 7a92872627..47ef4eef48 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -24,12 +24,15 @@ #include #include #include +#include #include #include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui { // The amount of pixels to scroll per wheel click @@ -314,7 +317,7 @@ namespace OpenRCT2::Ui void ApplyScreenSaverLockSetting() { - Config::Get().general.DisableScreensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver(); + Config::Get().general.disableScreensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver(); } void Window::scrollToViewport() @@ -514,7 +517,7 @@ namespace OpenRCT2::Ui ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w) { - const uint8_t buttonOffset = (Config::Get().interface.WindowButtonsOnTheLeft) ? kCloseButtonSize + 2 : 0; + const uint8_t buttonOffset = (Config::Get().interface.windowButtonsOnTheLeft) ? kCloseButtonSize + 2 : 0; return w.windowPos + ScreenCoordsXY{ 2 + buttonOffset, 2 }; } } // namespace OpenRCT2::Ui @@ -960,7 +963,7 @@ namespace OpenRCT2::Ui::Windows w.maxWidth = std::max(minSize.width, maxSize.width); w.maxHeight = std::max(minSize.height, maxSize.height); - if (Config::Get().interface.EnlargedUi) + if (Config::Get().interface.enlargedUi) { // Not sure why plugin windows have to be treated differently, // but they currently show a deviation if we don't. @@ -1022,7 +1025,7 @@ namespace OpenRCT2::Ui::Windows void WindowDrawWidgets(WindowBase& w, RenderTarget& rt) { if ((w.flags.has(WindowFlag::transparent)) && !(w.flags.has(WindowFlag::noBackground))) - GfxFilterRect( + Rectangle::filter( rt, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, FilterPaletteID::palette51); // todo: some code missing here? Between 006EB18C and 006EB260 @@ -1048,9 +1051,9 @@ namespace OpenRCT2::Ui::Windows if (w.flashTimer > 0) { - GfxFillRectInset( + Rectangle::fillInset( rt, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, { COLOUR_WHITE }, - INSET_RECT_FLAG_FILL_NONE); + Rectangle::BorderStyle::outset, Rectangle::FillBrightness::light, Rectangle::FillMode::none); } } diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index 5b6c9841c3..7dc92a811a 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -18,9 +18,11 @@ #include #include #include + #include #include #include +using namespace OpenRCT2::Drawing; using namespace OpenRCT2::Scripting; using namespace OpenRCT2::Ui::Windows; @@ -565,7 +567,7 @@ void CustomListView::MouseUp(const ScreenCoordsXY& pos) void CustomListView::Paint(WindowBase* w, RenderTarget& rt, const ScrollArea* scroll) const { auto paletteIndex = ColourMapA[w->colours[1].colour].mid_light; - GfxFillRect(rt, { { rt.x, rt.y }, { rt.x + rt.width, rt.y + rt.height } }, paletteIndex); + Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width, rt.y + rt.height } }, paletteIndex); int32_t y = ShowColumnHeaders ? kColumnHeaderHeight : 0; for (size_t i = 0; i < Items.size(); i++) @@ -595,17 +597,17 @@ void CustomListView::Paint(WindowBase* w, RenderTarget& rt, const ScrollArea* sc auto isSelected = (SelectedCell && itemIndex == SelectedCell->Row); if (isSelected) { - GfxFilterRect( + Rectangle::filter( rt, { { rt.x, y }, { rt.x + rt.width, y + (kListRowHeight - 1) } }, FilterPaletteID::paletteDarken2); } else if (isHighlighted) { - GfxFilterRect( + Rectangle::filter( rt, { { rt.x, y }, { rt.x + rt.width, y + (kListRowHeight - 1) } }, FilterPaletteID::paletteDarken2); } else if (isStriped) { - GfxFillRect( + Rectangle::fill( rt, { { rt.x, y }, { rt.x + rt.width, y + (kListRowHeight - 1) } }, ColourMapA[w->colours[1].colour].lighter | 0x1000000); } @@ -652,7 +654,7 @@ void CustomListView::Paint(WindowBase* w, RenderTarget& rt, const ScrollArea* sc y = scroll->contentOffsetY; auto bgColour = ColourMapA[w->colours[1].colour].mid_light; - GfxFillRect(rt, { { rt.x, y }, { rt.x + rt.width, y + 12 } }, bgColour); + Rectangle::fill(rt, { { rt.x, y }, { rt.x + rt.width, y + 12 } }, bgColour); int32_t x = 0; for (int32_t j = 0; j < static_cast(Columns.size()); j++) @@ -679,12 +681,12 @@ void CustomListView::PaintHeading( WindowBase* w, RenderTarget& rt, const ScreenCoordsXY& pos, const ScreenSize& size, const std::string& text, ColumnSortOrder sortOrder, bool isPressed) const { - auto boxFlags = 0; + auto borderStyle = Rectangle::BorderStyle::outset; if (isPressed) { - boxFlags = INSET_RECT_FLAG_BORDER_INSET; + borderStyle = Rectangle::BorderStyle::inset; } - GfxFillRectInset(rt, { pos, pos + ScreenCoordsXY{ size.width - 1, size.height - 1 } }, w->colours[1], boxFlags); + Rectangle::fillInset(rt, { pos, pos + ScreenCoordsXY{ size.width - 1, size.height - 1 } }, w->colours[1], borderStyle); if (!text.empty()) { PaintCell(rt, pos, size, text.c_str(), false); diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 9cdb4c16a7..6e786ef75e 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -489,7 +489,7 @@ namespace OpenRCT2::Ui::Windows { auto& closeButton = widgets[WIDX_CLOSE]; bool translucent = colours[closeButton.colour].hasFlag(ColourFlag::translucent); - if (Config::Get().interface.EnlargedUi) + if (Config::Get().interface.enlargedUi) closeButton.string = !translucent ? kCloseBoxStringBlackLarge : kCloseBoxStringWhiteLarge; else closeButton.string = !translucent ? kCloseBoxStringBlackNormal : kCloseBoxStringWhiteNormal; diff --git a/src/openrct2-ui/scripting/ScGraphicsContext.hpp b/src/openrct2-ui/scripting/ScGraphicsContext.hpp index fec871b793..02db09929d 100644 --- a/src/openrct2-ui/scripting/ScGraphicsContext.hpp +++ b/src/openrct2-ui/scripting/ScGraphicsContext.hpp @@ -13,9 +13,12 @@ #include "CustomImages.h" + #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Scripting { class ScGraphicsContext @@ -163,14 +166,14 @@ namespace OpenRCT2::Scripting void box(int32_t x, int32_t y, int32_t width, int32_t height) { - GfxFillRectInset(_rt, { x, y, x + width - 1, y + height - 1 }, { _colour.value_or(0) }, 0); + Rectangle::fillInset(_rt, { x, y, x + width - 1, y + height - 1 }, { _colour.value_or(0) }); } void well(int32_t x, int32_t y, int32_t width, int32_t height) { - GfxFillRectInset( - _rt, { x, y, x + width - 1, y + height - 1 }, { _colour.value_or(0) }, - INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rectangle::fillInset( + _rt, { x, y, x + width - 1, y + height - 1 }, { _colour.value_or(0) }, Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::light, Rectangle::FillMode::dontLightenWhenInset); } void clear() @@ -229,7 +232,7 @@ namespace OpenRCT2::Scripting } if (_fill != 0) { - GfxFillRect(_rt, { x, y, x + width - 1, y + height - 1 }, _fill); + Rectangle::fill(_rt, { x, y, x + width - 1, y + height - 1 }, _fill); } } diff --git a/src/openrct2-ui/scripting/ScTileSelection.hpp b/src/openrct2-ui/scripting/ScTileSelection.hpp index dae1306706..bc9b058993 100644 --- a/src/openrct2-ui/scripting/ScTileSelection.hpp +++ b/src/openrct2-ui/scripting/ScTileSelection.hpp @@ -57,10 +57,10 @@ namespace OpenRCT2::Scripting auto range = GetMapRange(value); if (range) { - gMapSelectPositionA.x = range->GetLeft(); - gMapSelectPositionA.y = range->GetTop(); - gMapSelectPositionB.x = range->GetRight(); - gMapSelectPositionB.y = range->GetBottom(); + gMapSelectPositionA.x = range->GetX1(); + gMapSelectPositionA.y = range->GetY1(); + gMapSelectPositionB.x = range->GetX2(); + gMapSelectPositionB.y = range->GetY2(); gMapSelectType = MapSelectType::full; gMapSelectFlags.set(MapSelectFlag::enable); } diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 5b8dc2f6f2..d12f02f96d 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -79,6 +79,7 @@ namespace OpenRCT2::Scripting case WidgetType::imgBtn: case WidgetType::trnBtn: case WidgetType::flatBtn: + case WidgetType::hiddenButton: case WidgetType::button: case WidgetType::closeBox: return "button"; diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index ad8602fc6e..a56f342c5a 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -16,11 +16,14 @@ #include #include #include +#include #include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr StringId kWindowTitle = STR_ASSET_PACKS; @@ -192,7 +195,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { auto rtCoords = ScreenCoordsXY{ rt.x, rt.y }; - GfxFillRect( + Rectangle::fill( rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); @@ -241,12 +244,12 @@ namespace OpenRCT2::Ui::Windows auto fillRectangle = ScreenRect{ { 0, y }, { listWidth, y + ItemHeight - 1 } }; if (isSelected) { - GfxFillRect(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark); + Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark); stringId = STR_WINDOW_COLOUR_2_STRINGID; } else if (isHighlighted) { - GfxFillRect(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark); + Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark); } DrawTextEllipsised(rt, { 16, y + 1 }, listWidth, stringId, ft); @@ -257,7 +260,9 @@ namespace OpenRCT2::Ui::Windows void PaintCheckbox(RenderTarget& rt, const ScreenRect& rect, bool checked) { - GfxFillRectInset(rt, rect, colours[1], INSET_RECT_F_E0); + Rectangle::fillInset( + rt, rect, colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::dark, + Rectangle::FillMode::dontLightenWhenInset); if (checked) { auto checkmark = Formatter(); diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 3cf07e3fb2..c3af927081 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -72,9 +72,9 @@ namespace OpenRCT2::Ui::Windows makeWidget({kWindowSize.width - 25, 19}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_RENAME), STR_CHANGE_BANNER_TEXT_TIP ), // change banner button makeWidget({kWindowSize.width - 25, 43}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_NO_ENTRY), STR_SET_AS_NO_ENTRY_BANNER_TIP ), // no entry button makeWidget({kWindowSize.width - 25, 67}, {24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH), STR_DEMOLISH_BANNER_TIP ), // demolish button - makeWidget({ 5, kWindowSize.height - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // high money - makeWidget({ 43, kWindowSize.height - 16}, {39, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // high money - makeWidget({ 70, kWindowSize.height - 15}, {11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_TEXT_COLOUR_TIP ) // high money + makeWidget({ 5, kWindowSize.height - 16}, {12, 12}, WidgetType::colourBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // main colour + makeWidget({ 43, kWindowSize.height - 16}, {39, 12}, WidgetType::dropdownMenu, WindowColour::secondary ), // text colour + makeWidget({ 70, kWindowSize.height - 15}, {11, 10}, WidgetType::button, WindowColour::secondary, STR_DROPDOWN_GLYPH, STR_SELECT_TEXT_COLOUR_TIP ) // text colour ); // clang-format on @@ -91,7 +91,7 @@ namespace OpenRCT2::Ui::Windows (viewportWidget.width()) - 1, (viewportWidget.height()) - 1, Focus(_bannerViewPos)); if (viewport != nullptr) - viewport->flags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; + viewport->flags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; invalidate(); } @@ -177,7 +177,7 @@ namespace OpenRCT2::Ui::Windows WindowDropdownShowTextCustomWidth( { widget->left + windowPos.x, widget->top + windowPos.y }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, numItems, widget->width() - 3); + Dropdown::Flag::StayOpen, numItems, widget->width() + 3); gDropdown.items[EnumValue(banner->textColour) - 1].setChecked(true); break; diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 9f98a32ab5..ab8f25dfe5 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -72,16 +72,16 @@ namespace OpenRCT2::Ui::Windows close(); break; case WIDX_RATE_UP: - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate += 1; - Config::Get().general.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate += 1; + Config::Get().general.customCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate; Config::Save(); windowMgr->InvalidateAll(); break; case WIDX_RATE_DOWN: - if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate > 1) + if (CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate > 1) { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate -= 1; - Config::Get().general.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate -= 1; + Config::Get().general.customCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate; Config::Save(); windowMgr->InvalidateAll(); } @@ -94,7 +94,7 @@ namespace OpenRCT2::Ui::Windows { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, 2, widget->width() - 3); - if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) + if (CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode == CurrencyAffix::prefix) { gDropdown.items[0].setChecked(true); } @@ -107,7 +107,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_SYMBOL_TEXT: WindowTextInputRawOpen( this, WIDX_SYMBOL_TEXT, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC, - {}, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, kCurrencySymbolMaxSize); + {}, CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode, kCurrencySymbolMaxSize); break; } } @@ -119,7 +119,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_RATE: WindowTextInputOpen( this, WIDX_RATE, STR_RATE_INPUT_TITLE, STR_RATE_INPUT_DESC, {}, STR_FORMAT_INTEGER, - static_cast(CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate), + static_cast(CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate), kCurrencyRateMaxNumDigits); break; } @@ -134,16 +134,16 @@ namespace OpenRCT2::Ui::Windows { if (dropdownIndex == 0) { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Prefix; - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Prefix; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_ascii = CurrencyAffix::prefix; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode = CurrencyAffix::prefix; } else if (dropdownIndex == 1) { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Suffix; - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Suffix; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_ascii = CurrencyAffix::suffix; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode = CurrencyAffix::suffix; } - Config::Get().general.CustomCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode; + Config::Get().general.customCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode; Config::Save(); auto* windowMgr = Ui::GetWindowManager(); @@ -162,10 +162,10 @@ namespace OpenRCT2::Ui::Windows { case WIDX_SYMBOL_TEXT: String::safeUtf8Copy( - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, std::string(text).c_str(), + CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode, std::string(text).c_str(), kCurrencySymbolMaxSize); - Config::Get().general.CustomCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::Custom)] + Config::Get().general.customCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::custom)] .symbol_unicode; Config::Save(); @@ -178,8 +178,8 @@ namespace OpenRCT2::Ui::Windows if (res.has_value()) { int32_t rate = res.value(); - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = rate; - Config::Get().general.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate = rate; + Config::Get().general.customCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate; Config::Save(); windowMgr->InvalidateAll(); } @@ -198,7 +198,7 @@ namespace OpenRCT2::Ui::Windows DrawTextBasic(rt, screenCoords, STR_RATE, {}, { colours[1] }); - int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::Pounds)].rate; + int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::pounds)].rate; ft = Formatter(); ft.Add(baseExchange); DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] }); @@ -209,11 +209,11 @@ namespace OpenRCT2::Ui::Windows screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_SYMBOL_TEXT].left + 1, widgets[WIDX_SYMBOL_TEXT].top }; - DrawText(rt, screenCoords, { colours[1] }, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode); + DrawText(rt, screenCoords, { colours[1] }, CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode); auto drawPos = windowPos + ScreenCoordsXY{ widgets[WIDX_AFFIX_DROPDOWN].left + 1, widgets[WIDX_AFFIX_DROPDOWN].top }; - StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) + StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode == CurrencyAffix::prefix) ? STR_PREFIX : STR_SUFFIX; DrawTextBasic(rt, drawPos, stringId, {}, { colours[1] }); diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 2596ade153..0e5f4f8c64 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -21,11 +21,14 @@ #include #include #include +#include #include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { constexpr int32_t kDropdownItemHeight = 12; @@ -75,12 +78,12 @@ namespace OpenRCT2::Ui::Windows static int32_t GetDefaultRowHeight() { - return Config::Get().interface.EnlargedUi ? kDropdownItemHeightTouch : kDropdownItemHeight; + return Config::Get().interface.enlargedUi ? kDropdownItemHeightTouch : kDropdownItemHeight; } static int32_t GetAdditionalRowPadding() { - return Config::Get().interface.EnlargedUi ? 6 : 0; + return Config::Get().interface.enlargedUi ? 6 : 0; } static void drawTextItem( @@ -125,13 +128,13 @@ namespace OpenRCT2::Ui::Windows if (colours[0].hasFlag(ColourFlag::translucent)) { TranslucentWindowPalette palette = kTranslucentWindowPalettes[colours[0].colour]; - GfxFilterRect(rt, { leftTop, rightBottom }, palette.highlight); - GfxFilterRect(rt, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow); + Rectangle::filter(rt, { leftTop, rightBottom }, palette.highlight); + Rectangle::filter(rt, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow); } else { - GfxFillRect(rt, { leftTop, rightBottom }, ColourMapA[colours[0].colour].mid_dark); - GfxFillRect( + Rectangle::fill(rt, { leftTop, rightBottom }, ColourMapA[colours[0].colour].mid_dark); + Rectangle::fill( rt, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0].colour].lightest); } } @@ -142,7 +145,7 @@ namespace OpenRCT2::Ui::Windows { // Darken the cell's background slightly when highlighted const ScreenCoordsXY rightBottom = screenCoords + ScreenCoordsXY{ ItemWidth - 1, ItemHeight - 1 }; - GfxFilterRect(rt, { screenCoords, rightBottom }, FilterPaletteID::paletteDarken3); + Rectangle::filter(rt, { screenCoords, rightBottom }, FilterPaletteID::paletteDarken3); } const auto& item = gDropdown.items[i]; @@ -386,7 +389,7 @@ namespace OpenRCT2::Ui::Windows size_t num_items, int32_t width, size_t prefRowsPerColumn) { gInputFlags.unset(InputFlag::dropdownStayOpen, InputFlag::dropdownMouseUp); - if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.TouchEnhancements) + if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.touchEnhancements) gInputFlags.set(InputFlag::dropdownStayOpen); WindowDropdownClose(); @@ -430,7 +433,7 @@ namespace OpenRCT2::Ui::Windows int32_t itemHeight, int32_t numColumns) { gInputFlags.unset(InputFlag::dropdownStayOpen, InputFlag::dropdownMouseUp); - if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.TouchEnhancements) + if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.touchEnhancements) gInputFlags.set(InputFlag::dropdownStayOpen); // Close existing dropdown @@ -465,7 +468,7 @@ namespace OpenRCT2::Ui::Windows return -1; } - // colour_t ordered for use in color dropdown + // colour_t ordered for use in colour dropdown static constexpr colour_t kColoursDropdownOrder[] = { COLOUR_BLACK, COLOUR_SATURATED_RED, @@ -618,9 +621,17 @@ namespace OpenRCT2::Ui::Windows if (selectedColour == orderedColour) defaultIndex = i; - // Use special graphic for Invisible colour - auto imageId = (orderedColour == COLOUR_INVISIBLE) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE, COLOUR_WHITE) - : ImageId(SPR_PALETTE_BTN, orderedColour); + ImageId imageId; + if (Config::Get().interface.enlargedUi) + { + imageId = (orderedColour == COLOUR_INVISIBLE) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE_LARGE, COLOUR_WHITE) + : ImageId(SPR_G2_ICON_PALETTE_LARGE, orderedColour); + } + else + { + imageId = (orderedColour == COLOUR_INVISIBLE) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE, COLOUR_WHITE) + : ImageId(SPR_PALETTE_BTN, orderedColour); + } gDropdown.items[i] = { .type = Dropdown::ItemType::colour, .image = imageId, .tooltip = kColourTooltips[i] }; } diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 1226708d95..e180bca9c2 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr int32_t kToolbarHeight = 32; @@ -336,7 +339,7 @@ namespace OpenRCT2::Ui::Windows const auto& previousWidget = widgets[WIDX_PREVIOUS_IMAGE]; auto leftTop = windowPos + ScreenCoordsXY{ previousWidget.left, previousWidget.top }; auto rightBottom = windowPos + ScreenCoordsXY{ previousWidget.right, previousWidget.bottom }; - GfxFilterRect(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); + Rectangle::filter(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); } void DrawLeftButton(RenderTarget& rt) @@ -345,7 +348,9 @@ namespace OpenRCT2::Ui::Windows + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 1, widgets[WIDX_PREVIOUS_IMAGE].top + 1 }; const auto bottomRight = windowPos + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 }; - GfxFillRectInset(rt, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); GfxDrawSprite( rt, ImageId(SPR_PREVIOUS), @@ -374,7 +379,7 @@ namespace OpenRCT2::Ui::Windows auto nextWidget = widgets[WIDX_NEXT_IMAGE]; auto leftTop = windowPos + ScreenCoordsXY{ nextWidget.left, nextWidget.top }; auto rightBottom = windowPos + ScreenCoordsXY{ nextWidget.right, nextWidget.bottom }; - GfxFilterRect(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); + Rectangle::filter(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); } void DrawRightButton(RenderTarget& rt) @@ -383,7 +388,9 @@ namespace OpenRCT2::Ui::Windows + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].left + 1, widgets[WIDX_NEXT_IMAGE].top + 1 }; const auto bottomRight = windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 }; - GfxFillRectInset(rt, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); GfxDrawSprite( rt, ImageId(SPR_NEXT), diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index c3e5a5153e..72c7747b02 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { #pragma region Widgets @@ -107,11 +110,10 @@ namespace OpenRCT2::Ui::Windows const StringId itemNameId = researchItem.GetName(); int16_t columnSplitOffset = width / 2; - if (researchItem.type == Research::EntryType::Ride + if (researchItem.type == Research::EntryType::ride && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RtdFlag::listVehiclesSeparately)) { - const StringId rideTypeName = GetRideNaming( - researchItem.baseRideType, *GetRideEntryByIndex(researchItem.entryIndex)) + const StringId rideTypeName = GetRideNaming(researchItem.baseRideType, GetRideEntryByIndex(researchItem.entryIndex)) .Name; // Draw group name @@ -301,7 +303,7 @@ namespace OpenRCT2::Ui::Windows bottom = itemY; } - GfxFilterRect(rt, { 0, top, boxWidth, bottom }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, top, boxWidth, bottom }, FilterPaletteID::paletteDarken1); } if (dragItem != nullptr && researchItem == *dragItem) @@ -371,7 +373,7 @@ namespace OpenRCT2::Ui::Windows // Preview background auto& bkWidget = widgets[WIDX_PREVIEW]; - GfxFillRect( + Rectangle::fill( rt, { windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 }, windowPos + ScreenCoordsXY{ bkWidget.right - 1, bkWidget.bottom - 1 } }, @@ -386,7 +388,7 @@ namespace OpenRCT2::Ui::Windows // Preview image ObjectType objectEntryType = ObjectType::sceneryGroup; - if (researchItem->type == Research::EntryType::Ride) + if (researchItem->type == Research::EntryType::ride) objectEntryType = ObjectType::ride; auto chunk = ObjectEntryGetChunk(objectEntryType, researchItem->entryIndex); @@ -415,12 +417,11 @@ namespace OpenRCT2::Ui::Windows StringId stringId = researchItem->GetName(); auto ft = Formatter(); - if (researchItem->type == Research::EntryType::Ride + if (researchItem->type == Research::EntryType::ride && !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RtdFlag::listVehiclesSeparately)) { drawString = STR_WINDOW_COLOUR_2_STRINGID_STRINGID; - StringId rideTypeName = GetRideNaming( - researchItem->baseRideType, *GetRideEntryByIndex(researchItem->entryIndex)) + StringId rideTypeName = GetRideNaming(researchItem->baseRideType, GetRideEntryByIndex(researchItem->entryIndex)) .Name; ft.Add(rideTypeName); ft.Add(stringId); diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 8b96430059..a44b487dd8 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum : uint16_t @@ -277,7 +280,7 @@ namespace OpenRCT2::Ui::Windows Sub6AB211(); ResetSelectedObjectCountAndSize(); - _filterFlags = FILTER_RIDES_ALL | Config::Get().interface.ObjectSelectionFilterFlags; + _filterFlags = FILTER_RIDES_ALL | Config::Get().interface.objectSelectionFilterFlags; _filter.clear(); WindowInitScrollWidgets(*this); @@ -411,7 +414,7 @@ namespace OpenRCT2::Ui::Windows _filterFlags &= ~FILTER_RIDES_ALL; _filterFlags |= subTabDef.flagFilter; - Config::Get().interface.ObjectSelectionFilterFlags = _filterFlags; + Config::Get().interface.objectSelectionFilterFlags = _filterFlags; Config::Save(); VisibleListRefresh(); @@ -572,7 +575,7 @@ namespace OpenRCT2::Ui::Windows { _filterFlags ^= (1 << dropdownIndex); } - Config::Get().interface.ObjectSelectionFilterFlags = _filterFlags; + Config::Get().interface.objectSelectionFilterFlags = _filterFlags; Config::Save(); scrolls->contentOffsetY = 0; @@ -739,8 +742,10 @@ namespace OpenRCT2::Ui::Windows { // Draw checkbox if (!(gLegacyScene == LegacyScene::trackDesignsManager) && !(*listItem.flags & 0x20)) - GfxFillRectInset( - rt, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0); + Rectangle::fillInset( + rt, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], + Rectangle::BorderStyle::inset, Rectangle::FillBrightness::dark, + Rectangle::FillMode::dontLightenWhenInset); // Highlight background auto highlighted = i == static_cast(selectedListItem) @@ -748,7 +753,7 @@ namespace OpenRCT2::Ui::Windows if (highlighted) { auto bottom = screenCoords.y + (kScrollableRowHeight - 1); - GfxFilterRect(rt, { 0, screenCoords.y, width, bottom }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, screenCoords.y, width, bottom }, FilterPaletteID::paletteDarken1); } // Draw checkmark @@ -923,7 +928,7 @@ namespace OpenRCT2::Ui::Windows widget.type = WidgetType::empty; } - if (Config::Get().general.DebuggingTools) + if (Config::Get().general.debuggingTools) widgets[WIDX_RELOAD_OBJECT].type = WidgetType::imgBtn; else widgets[WIDX_RELOAD_OBJECT].type = WidgetType::empty; @@ -1057,7 +1062,7 @@ namespace OpenRCT2::Ui::Windows // Preview background const auto& previewWidget = widgets[WIDX_PREVIEW]; - GfxFillRect( + Rectangle::fill( rt, { windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 }, windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } }, @@ -1288,12 +1293,12 @@ namespace OpenRCT2::Ui::Windows { auto* rideObject = reinterpret_cast(_loadedObject.get()); const auto& rideEntry = rideObject->GetEntry(); - if (rideEntry.shop_item[0] != ShopItem::None) + if (rideEntry.shop_item[0] != ShopItem::none) { std::string sells = ""; for (size_t i = 0; i < std::size(rideEntry.shop_item); i++) { - if (rideEntry.shop_item[i] == ShopItem::None) + if (rideEntry.shop_item[i] == ShopItem::none) continue; if (!sells.empty()) @@ -1337,15 +1342,15 @@ namespace OpenRCT2::Ui::Windows { switch (type) { - case AnimationPeepType::Handyman: + case AnimationPeepType::handyman: return STR_HANDYMAN_PLURAL; - case AnimationPeepType::Mechanic: + case AnimationPeepType::mechanic: return STR_MECHANIC_PLURAL; - case AnimationPeepType::Security: + case AnimationPeepType::security: return STR_SECURITY_GUARD_PLURAL; - case AnimationPeepType::Entertainer: + case AnimationPeepType::entertainer: return STR_ENTERTAINER_PLURAL; - case AnimationPeepType::Guest: + case AnimationPeepType::guest: default: return STR_GUESTS; } @@ -1497,21 +1502,21 @@ namespace OpenRCT2::Ui::Windows bool SourcesMatch(ObjectSourceGame source) { // clang-format off - return (IsFilterActive(FILTER_RCT1) && source == ObjectSourceGame::RCT1) || - (IsFilterActive(FILTER_AA) && source == ObjectSourceGame::AddedAttractions) || - (IsFilterActive(FILTER_LL) && source == ObjectSourceGame::LoopyLandscapes) || - (IsFilterActive(FILTER_RCT2) && source == ObjectSourceGame::RCT2) || - (IsFilterActive(FILTER_WW) && source == ObjectSourceGame::WackyWorlds) || - (IsFilterActive(FILTER_TT) && source == ObjectSourceGame::TimeTwister) || - (IsFilterActive(FILTER_OO) && source == ObjectSourceGame::OpenRCT2Official) || + return (IsFilterActive(FILTER_RCT1) && source == ObjectSourceGame::rct1) || + (IsFilterActive(FILTER_AA) && source == ObjectSourceGame::addedAttractions) || + (IsFilterActive(FILTER_LL) && source == ObjectSourceGame::loopyLandscapes) || + (IsFilterActive(FILTER_RCT2) && source == ObjectSourceGame::rct2) || + (IsFilterActive(FILTER_WW) && source == ObjectSourceGame::wackyWorlds) || + (IsFilterActive(FILTER_TT) && source == ObjectSourceGame::timeTwister) || + (IsFilterActive(FILTER_OO) && source == ObjectSourceGame::openRCT2Official) || (IsFilterActive(FILTER_CUSTOM) && - source != ObjectSourceGame::RCT1 && - source != ObjectSourceGame::AddedAttractions && - source != ObjectSourceGame::LoopyLandscapes && - source != ObjectSourceGame::RCT2 && - source != ObjectSourceGame::WackyWorlds && - source != ObjectSourceGame::TimeTwister && - source != ObjectSourceGame::OpenRCT2Official); + source != ObjectSourceGame::rct1 && + source != ObjectSourceGame::addedAttractions && + source != ObjectSourceGame::loopyLandscapes && + source != ObjectSourceGame::rct2 && + source != ObjectSourceGame::wackyWorlds && + source != ObjectSourceGame::timeTwister && + source != ObjectSourceGame::openRCT2Official); // clang-format on } diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 5714781102..18d9c01020 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr StringId kWindowTitle = STR_OBJECT_SELECTION_PARK_ENTRANCE; @@ -313,16 +316,22 @@ namespace OpenRCT2::Ui::Windows for (auto& entranceType : _entranceTypes) { // Draw flat button rectangle - int32_t buttonFlags = 0; + auto borderStyle = Rectangle::BorderStyle::outset; + auto fillBrightness = Rectangle::FillBrightness::light; if (_selectedEntranceType == entranceType.entryIndex) - buttonFlags |= INSET_RECT_FLAG_BORDER_INSET; + { + borderStyle = Rectangle::BorderStyle::inset; + fillBrightness = Rectangle::FillBrightness::dark; + } else if (_highlightedEntranceType == entranceType.entryIndex) - buttonFlags |= INSET_RECT_FLAG_FILL_MID_LIGHT; + { + fillBrightness = Rectangle::FillBrightness::dark; + } - if (buttonFlags != 0) - GfxFillRectInset( - rt, { coords, coords + ScreenCoordsXY{ kImageSize - 1, kImageSize - 1 } }, colours[1], - INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags); + if (fillBrightness != Rectangle::FillBrightness::light) + Rectangle::fillInset( + rt, { coords, coords + ScreenCoordsXY{ kImageSize - 1, kImageSize - 1 } }, colours[1], borderStyle, + fillBrightness); RenderTarget clipDPI; auto screenPos = coords + ScreenCoordsXY{ kScrollPadding, kScrollPadding }; diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 3c893ee7a3..3b9bcc7d5f 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr ScreenSize kSizeObjective = { 450, 122 }; @@ -2337,7 +2340,7 @@ namespace OpenRCT2::Ui::Windows void RidesOnScrollDraw(RenderTarget& rt, int32_t scrollIndex) { int32_t colour = ColourMapA[colours[1].colour].mid_light; - GfxFillRect(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, colour); + Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, colour); for (int32_t i = 0; i < static_cast(_rideableRides.size()); i++) { @@ -2347,14 +2350,16 @@ namespace OpenRCT2::Ui::Windows continue; // Checkbox - GfxFillRectInset(rt, { { 2, y }, { 11, y + 10 } }, colours[1], INSET_RECT_F_E0); + Rectangle::fillInset( + rt, { { 2, y }, { 11, y + 10 } }, colours[1], Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::dark, Rectangle::FillMode::dontLightenWhenInset); // Highlighted auto stringId = STR_BLACK_STRING; if (i == selectedListItem) { stringId = STR_WINDOW_COLOUR_2_STRINGID; - GfxFilterRect(rt, { 0, y, width, y + 11 }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, width, y + 11 }, FilterPaletteID::paletteDarken1); } // Checkbox mark diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 7918d12bde..a3de9740f4 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum @@ -407,7 +410,7 @@ namespace OpenRCT2::Ui::Windows { // Darken every even row if (i % 2 == 0) - GfxFillRect( + Rectangle::fill( rt, { screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ row_width, (kTableCellHeight - 2) } }, @@ -462,7 +465,7 @@ namespace OpenRCT2::Ui::Windows DrawTextBasic( rt, screenCoords + ScreenCoordsXY{ kExpenditureColumnWidth, 0 }, format, ft, { TextAlignment::RIGHT }); - GfxFillRect( + Rectangle::fill( rt, { screenCoords + ScreenCoordsXY{ 10, -2 }, screenCoords + ScreenCoordsXY{ kExpenditureColumnWidth, -2 } }, PaletteIndex::pi10); @@ -602,7 +605,7 @@ namespace OpenRCT2::Ui::Windows { // Darken every even row if (i % 2 == 0) - GfxFillRect( + Rectangle::fill( rt, { screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (kTableCellHeight - 2) } }, ColourMapA[colours[1].colour].lighter | 0x1000000); @@ -612,11 +615,11 @@ namespace OpenRCT2::Ui::Windows } // Horizontal rule below expenditure / income table - GfxFillRectInset( + Rectangle::fillInset( rt, { windowPos + ScreenCoordsXY{ 8, titleBarBottom + 258 }, windowPos + ScreenCoordsXY{ 8 + 513, titleBarBottom + 258 + 1 } }, - colours[1], INSET_RECT_FLAG_BORDER_INSET); + colours[1], Rectangle::BorderStyle::inset); // Loan and interest rate DrawTextBasic(rt, windowPos + ScreenCoordsXY{ 8, titleBarBottom + 265 }, STR_FINANCES_SUMMARY_LOAN); @@ -789,13 +792,15 @@ namespace OpenRCT2::Ui::Windows DrawTextBasic(rt, _graphBounds.Point1 - ScreenCoordsXY{ 0, 11 }, fmt, ft); // Graph - GfxFillRectInset(rt, _graphBounds, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, _graphBounds, colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); // hide resize widget on graph area constexpr ScreenCoordsXY offset{ 1, 1 }; constexpr ScreenCoordsXY bigOffset{ 5, 5 }; - GfxFillRectInset( - rt, { _graphBounds.Point2 - bigOffset, _graphBounds.Point2 - offset }, colours[1], - INSET_RECT_FLAG_FILL_DONT_LIGHTEN | INSET_RECT_FLAG_BORDER_NONE); + Rectangle::fillInset( + rt, { _graphBounds.Point2 - bigOffset, _graphBounds.Point2 - offset }, colours[1], Rectangle::BorderStyle::none, + Rectangle::FillBrightness::light, Rectangle::FillMode::dontLightenWhenInset); Graph::DrawFinanceGraph(rt, _graphProps); } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index f4f4c4b35d..32fed7dc57 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -50,13 +50,25 @@ using namespace OpenRCT2::Numerics; namespace OpenRCT2::Ui::Windows { + struct ProvisionalTile + { + CoordsXYZ position; + FootpathSlope slope; + + constexpr bool operator==(const ProvisionalTile& rhs) const + { + return position == rhs.position && slope == rhs.slope; + } + }; + static money64 FootpathProvisionalSet( - ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXYZ& footpathLoc, int32_t slope, - PathConstructFlags constructFlags); + ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXY& footpathLocA, const CoordsXY& footpathLocB, + int32_t startZ, const std::span tiles, PathConstructFlags constructFlags); enum class PathConstructionMode : uint8_t { - land, + onLand, + dragArea, /** * When picking a location to start the bridge or tunnel */ @@ -77,26 +89,39 @@ namespace OpenRCT2::Ui::Windows forceRecheck = 2, }; + enum class SlopePitch : uint8_t + { + flat, + upwards, + downwards, + }; + using ProvisionalPathFlags = FlagHolder; + struct ProvisionalFootpath { - ObjectEntryIndex type; - CoordsXYZ position; - uint8_t slope; - ProvisionalPathFlags flags; - ObjectEntryIndex surfaceIndex; - ObjectEntryIndex railingsIndex; - PathConstructFlags constructFlags; + ObjectEntryIndex type{}; + CoordsXY positionA{}; + CoordsXY positionB{}; + /** + * Z of the first tile. Used for checking if the provisional path needs updating. + */ + int32_t startZ{}; + ProvisionalPathFlags flags{}; + ObjectEntryIndex surfaceIndex{}; + ObjectEntryIndex railingsIndex{}; + PathConstructFlags constructFlags{}; + std::vector tiles{}; }; static ProvisionalFootpath _provisionalFootpath; static CoordsXYZ _footpathConstructFromPosition; - static uint8_t _footpathConstructSlope; + static SlopePitch _footpathConstructSlope; #pragma region Measurements static constexpr StringId kWindowTitle = STR_FOOTPATHS; - static constexpr ScreenSize kWindowSize = { 106, 421 }; + static constexpr ScreenSize kWindowSize = { 106, 461 }; #pragma endregion @@ -129,10 +154,11 @@ namespace OpenRCT2::Ui::Windows WIDX_MODE_GROUP, WIDX_CONSTRUCT_ON_LAND, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, + WIDX_CONSTRUCT_DRAG_AREA, }; // clang-format off - static constexpr auto window_footpath_widgets = makeWidgets( + static constexpr auto kWindowFootpathWidgets = makeWidgets( makeWindowShim(kWindowTitle, kWindowSize), // Type group @@ -157,18 +183,19 @@ namespace OpenRCT2::Ui::Windows makeWidget({30, 335}, { 46, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_DEMOLISH_CURRENT_SECTION), STR_REMOVE_PREVIOUS_FOOTPATH_SECTION_TIP ), // Mode group - makeWidget({ 3, 361}, {100, 54}, WidgetType::groupbox, WindowColour::primary ), + makeWidget({ 3, 361}, {100, 99}, WidgetType::groupbox, WindowColour::primary ), makeWidget({13, 372}, { 36, 36}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_FOOTPATH_LAND), STR_CONSTRUCT_FOOTPATH_ON_LAND_TIP ), - makeWidget({57, 372}, { 36, 36}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_FOOTPATH_BRIDGE), STR_CONSTRUCT_BRIDGE_OR_TUNNEL_FOOTPATH_TIP ) + makeWidget({57, 372}, { 36, 36}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_CONSTRUCTION_FOOTPATH_BRIDGE), STR_CONSTRUCT_BRIDGE_OR_TUNNEL_FOOTPATH_TIP ), + makeWidget({35, 416}, { 36, 36}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_G2_ICON_PATH_DRAG_TOOL), STR_DRAG_AREA_OF_FOOTPATH_TIP ) ); #pragma endregion /** rct2: 0x0098D7E0 */ - static constexpr uint8_t ConstructionPreviewImages[][4] = { - { 5, 10, 5, 10 }, // Flat - { 16, 17, 18, 19 }, // Upwards - { 18, 19, 16, 17 }, // Downwards + static constexpr uint8_t kConstructionPreviewImages[][4] = { + { 5, 10, 5, 10 }, // SlopePitch::flat + { 16, 17, 18, 19 }, // SlopePitch::upwards + { 18, 19, 16, 17 }, // SlopePitch::downwards }; // clang-format on @@ -197,19 +224,21 @@ namespace OpenRCT2::Ui::Windows int32_t _footpathPlaceZ; + CoordsXY _dragStartPos; + public: #pragma region Window Override Events void onOpen() override { - setWidgets(window_footpath_widgets); + setWidgets(kWindowFootpathWidgets); WindowInitScrollWidgets(*this); WindowPushOthersRight(*this); ShowGridlines(); ToolCancel(); - _footpathConstructionMode = PathConstructionMode::land; + _footpathConstructionMode = PathConstructionMode::onLand; ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::pathDown); gInputFlags.set(InputFlag::unk6); _footpathErrorOccured = false; @@ -246,16 +275,25 @@ namespace OpenRCT2::Ui::Windows } // Check tool - if (_footpathConstructionMode == PathConstructionMode::land) + switch (_footpathConstructionMode) { - if (!isToolActive(WindowClass::footpath, WIDX_CONSTRUCT_ON_LAND)) - close(); - } - else if (_footpathConstructionMode == PathConstructionMode::bridgeOrTunnelPick) - { - if (!isToolActive(WindowClass::footpath, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL)) - close(); + case PathConstructionMode::onLand: + if (!isToolActive(WindowClass::footpath, WIDX_CONSTRUCT_ON_LAND)) + close(); + break; + case PathConstructionMode::dragArea: + break; + case PathConstructionMode::bridgeOrTunnelPick: + if (!isToolActive(WindowClass::footpath, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL)) + close(); + break; + case PathConstructionMode::bridgeOrTunnel: + break; } + + // If another window has enabled a tool, close ours. + if (gInputFlags.has(InputFlag::toolActive) && gCurrentToolWidget.windowClassification != WindowClass::footpath) + close(); } void onMouseDown(WidgetIndex widgetIndex) override @@ -284,13 +322,13 @@ namespace OpenRCT2::Ui::Windows WindowFootpathMousedownDirection(3); break; case WIDX_SLOPEDOWN: - WindowFootpathMousedownSlope(6); + WindowFootpathMousedownSlope(SlopePitch::downwards); break; case WIDX_LEVEL: - WindowFootpathMousedownSlope(0); + WindowFootpathMousedownSlope(SlopePitch::flat); break; case WIDX_SLOPEUP: - WindowFootpathMousedownSlope(2); + WindowFootpathMousedownSlope(SlopePitch::upwards); break; case WIDX_CONSTRUCT: WindowFootpathConstruct(); @@ -301,6 +339,20 @@ namespace OpenRCT2::Ui::Windows } } + void enableDragAreaMode() + { + _windowFootpathCost = kMoney64Undefined; + ToolCancel(); + FootpathUpdateProvisional(); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags.unset(MapSelectFlag::enableConstruct); + _footpathConstructionMode = PathConstructionMode::dragArea; + ToolSet(*this, WIDX_CONSTRUCT_DRAG_AREA, Tool::pathDown); + gInputFlags.set(InputFlag::unk6); + _footpathErrorOccured = false; + WindowFootpathSetEnabledAndPressedWidgets(); + } + void onMouseUp(WidgetIndex widgetIndex) override { switch (widgetIndex) @@ -309,7 +361,7 @@ namespace OpenRCT2::Ui::Windows close(); break; case WIDX_CONSTRUCT_ON_LAND: - if (_footpathConstructionMode == PathConstructionMode::land) + if (_footpathConstructionMode == PathConstructionMode::onLand) { break; } @@ -319,12 +371,20 @@ namespace OpenRCT2::Ui::Windows FootpathUpdateProvisional(); MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); - _footpathConstructionMode = PathConstructionMode::land; + _footpathConstructionMode = PathConstructionMode::onLand; ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::pathDown); gInputFlags.set(InputFlag::unk6); _footpathErrorOccured = false; WindowFootpathSetEnabledAndPressedWidgets(); break; + case WIDX_CONSTRUCT_DRAG_AREA: + if (_footpathConstructionMode == PathConstructionMode::dragArea) + { + break; + } + + enableDragAreaMode(); + break; case WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL: if (_footpathConstructionMode == PathConstructionMode::bridgeOrTunnelPick) { @@ -397,6 +457,10 @@ namespace OpenRCT2::Ui::Windows { WindowFootpathSetProvisionalPathAtPoint(screenCoords); } + else if (widgetIndex == WIDX_CONSTRUCT_DRAG_AREA) + { + WindowFootpathPlaceDragAreaHover(screenCoords); + } else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) { WindowFootpathSetSelectionStartBridgeAtPoint(screenCoords); @@ -409,6 +473,11 @@ namespace OpenRCT2::Ui::Windows { _footpathErrorOccured = false; } + else if (widgetIndex == WIDX_CONSTRUCT_DRAG_AREA) + { + WindowFootpathPlacePath(); + _footpathErrorOccured = false; + } } void onToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override @@ -417,6 +486,10 @@ namespace OpenRCT2::Ui::Windows { WindowFootpathPlacePathAtPoint(screenCoords); } + else if (widgetIndex == WIDX_CONSTRUCT_DRAG_AREA) + { + WindowFootpathPlaceDragAreaSetStart(screenCoords); + } else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) { WindowFootpathStartBridgeAtPoint(screenCoords); @@ -429,6 +502,24 @@ namespace OpenRCT2::Ui::Windows { WindowFootpathPlacePathAtPoint(screenCoords); } + else if (widgetIndex == WIDX_CONSTRUCT_DRAG_AREA) + { + WindowFootpathPlaceDragAreaSetEnd(screenCoords); + } + } + + void onToolAbort(WidgetIndex widgetIndex) override + { + // Needs both checks as this will otherwise be triggered when switching from the dragArea tool + // to another. + if (widgetIndex == WIDX_CONSTRUCT_DRAG_AREA && _footpathConstructionMode == PathConstructionMode::dragArea) + { + FootpathUpdateProvisional(); + enableDragAreaMode(); + // When this tool is aborted, the mouse button is still down. + // Set this to prevent a stray piece of path from being placed under the mouse pointer. + _footpathErrorOccured = true; + } } void onPrepareDraw() override @@ -462,16 +553,8 @@ namespace OpenRCT2::Ui::Windows if (!isWidgetDisabled(WIDX_CONSTRUCT)) { // Get construction image - uint8_t direction = (_footpathConstructDirection + GetCurrentRotation()) % 4; - uint8_t slope = 0; - if (_footpathConstructSlope == 2) - { - slope = kTileSlopeNCornerUp; - } - else if (_footpathConstructSlope == 6) - { - slope = kTileSlopeECornerUp; - } + uint8_t direction = (_footpathConstructDirection + GetCurrentRotation()) % kNumOrthogonalDirections; + auto slopeOffset = EnumValue(_footpathConstructSlope); std::optional baseImage; if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull) @@ -499,7 +582,7 @@ namespace OpenRCT2::Ui::Windows if (baseImage) { - auto image = *baseImage + ConstructionPreviewImages[slope][direction]; + auto image = *baseImage + kConstructionPreviewImages[slopeOffset][direction]; // Draw construction image screenCoords = this->windowPos @@ -530,17 +613,6 @@ namespace OpenRCT2::Ui::Windows #pragma endregion private: - FootpathPlacementResult FootpathGetPlacementFromScreenCoords(const ScreenCoordsXY& screenCoords) - { - if (_footpathPlaceZ > 0) - return { _footpathPlaceZ, kTileSlopeFlat }; - - auto info = GetMapCoordinatesFromPos( - screenCoords, EnumsToFlags(ViewportInteractionItem::terrain, ViewportInteractionItem::footpath)); - - return FootpathGetPlacementFromInfo(info); - } - /** * * rct2: 0x006A7760 @@ -566,11 +638,13 @@ namespace OpenRCT2::Ui::Windows ObjectEntryIndex railings = gFootpathSelection.Railings; CoordsXYZ footpathLoc; - int32_t slope; + FootpathSlope slope; FootpathGetNextPathInfo(&type, footpathLoc, &slope); auto pathConstructFlags = FootpathCreateConstructFlags(type); + auto tiles = std::array({ footpathLoc, slope }); - _windowFootpathCost = FootpathProvisionalSet(type, railings, footpathLoc, slope, pathConstructFlags); + _windowFootpathCost = FootpathProvisionalSet( + type, railings, footpathLoc, footpathLoc, footpathLoc.z, tiles, pathConstructFlags); invalidateWidget(WIDX_CONSTRUCT); } @@ -583,7 +657,7 @@ namespace OpenRCT2::Ui::Windows _provisionalFootpath.flags.flip(ProvisionalPathFlag::showArrow); CoordsXYZ footpathLoc; - int32_t slope; + FootpathSlope slope; FootpathGetNextPathInfo(nullptr, footpathLoc, &slope); gMapSelectArrowPosition = footpathLoc; gMapSelectArrowDirection = _footpathConstructDirection; @@ -795,10 +869,10 @@ namespace OpenRCT2::Ui::Windows * * rct2: 0x006A81AA 0x006A81C5 0x006A81E0 */ - void WindowFootpathMousedownSlope(int32_t slope) + void WindowFootpathMousedownSlope(SlopePitch pitch) { FootpathUpdateProvisional(); - _footpathConstructSlope = slope; + _footpathConstructSlope = pitch; _windowFootpathCost = kMoney64Undefined; WindowFootpathSetEnabledAndPressedWidgets(); } @@ -885,12 +959,8 @@ namespace OpenRCT2::Ui::Windows if (_footpathPlaceShiftState) { - auto surfaceElement = MapGetSurfaceElementAt(mapCoords); - if (surfaceElement == nullptr) - return std::nullopt; - - auto mapZ = floor2(surfaceElement->GetBaseZ(), 16); - mapZ += _footpathPlaceShiftZ; + auto res = FootpathGetPlacementFromInfo(info); + auto mapZ = res.baseZ + _footpathPlaceShiftZ; mapZ = std::max(mapZ, 16); _footpathPlaceZ = mapZ; } @@ -946,10 +1016,11 @@ namespace OpenRCT2::Ui::Windows auto pathElement = info.Element->AsPath(); if (pathElement != nullptr) { - auto slope = pathElement->GetSlopeDirection(); + auto slopeDirection = pathElement->GetSlopeDirection(); + FootpathSlope slope = { FootpathSlopeType::flat, slopeDirection }; if (pathElement->IsSloped()) { - slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; + slope.type = FootpathSlopeType::sloped; } return { pathElement->GetBaseZ(), slope }; } @@ -977,9 +1048,8 @@ namespace OpenRCT2::Ui::Windows return; // Check for change - auto provisionalPos = CoordsXYZ(*mapPos, _footpathPlaceZ); - if ((_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) - && _provisionalFootpath.position == provisionalPos) + if ((_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) && _provisionalFootpath.positionA == mapPos + && _provisionalFootpath.startZ == _footpathPlaceZ) { return; } @@ -987,13 +1057,12 @@ namespace OpenRCT2::Ui::Windows // Set map selection gMapSelectFlags.set(MapSelectFlag::enable); gMapSelectType = MapSelectType::full; - gMapSelectPositionA = *mapPos; - gMapSelectPositionB = *mapPos; + setMapSelectRange(*mapPos); FootpathUpdateProvisional(); // Figure out what slope and height to use - auto placement = FootpathGetPlacementFromScreenCoords(screenCoords); + auto placement = WindowFootpathGetPlacementFromScreenCoords(screenCoords); if (!placement.isValid()) { gMapSelectFlags.unset(MapSelectFlag::enable); @@ -1004,8 +1073,61 @@ namespace OpenRCT2::Ui::Windows // Set provisional path auto pathType = gFootpathSelection.GetSelectedSurface(); auto constructFlags = FootpathCreateConstructFlags(pathType); + auto footpathLoc = CoordsXYZ(*mapPos, placement.baseZ); + auto tiles = std::array({ footpathLoc, placement.slope }); const auto footpathCost = FootpathProvisionalSet( - pathType, gFootpathSelection.Railings, { *mapPos, placement.baseZ }, placement.slope, constructFlags); + pathType, gFootpathSelection.Railings, *mapPos, *mapPos, placement.baseZ, tiles, constructFlags); + + if (_windowFootpathCost != footpathCost) + { + _windowFootpathCost = footpathCost; + invalidateWidget(WIDX_CONSTRUCT); + } + } + + static std::vector buildTileVector(MapRange range, int32_t baseZ) + { + std::vector tiles{}; + for (auto y = range.GetY1(); y <= range.GetY2(); y += kCoordsXYStep) + { + for (auto x = range.GetX1(); x <= range.GetX2(); x += kCoordsXYStep) + { + FootpathPlacementResult placement = { baseZ, {} }; + if (baseZ == 0) + placement = FootpathGetOnTerrainPlacement(TileCoordsXY(CoordsXY(x, y))); + + auto calculatedLocation = CoordsXYZ(x, y, placement.baseZ); + tiles.push_back({ calculatedLocation, placement.slope }); + } + } + + return tiles; + } + + void WindowFootpathSetProvisionalPathDragArea(MapRange range, int32_t baseZ) + { + MapInvalidateSelectionRect(); + gMapSelectFlags.unset(MapSelectFlag::enableArrow); + + // Check for change + if ((_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) && range.Point1 == _provisionalFootpath.positionA + && range.Point2 == _provisionalFootpath.positionB && baseZ == _provisionalFootpath.startZ) + { + return; + } + + // Set map selection + gMapSelectFlags.set(MapSelectFlag::enable); + gMapSelectType = MapSelectType::full; + + FootpathUpdateProvisional(); + + // Set provisional path + auto tiles = buildTileVector(range, baseZ); + auto pathType = gFootpathSelection.GetSelectedSurface(); + auto constructFlags = FootpathCreateConstructFlags(pathType); + const auto footpathCost = FootpathProvisionalSet( + pathType, gFootpathSelection.Railings, range.Point1, range.Point2, baseZ, tiles, constructFlags); if (_windowFootpathCost != footpathCost) { @@ -1034,8 +1156,7 @@ namespace OpenRCT2::Ui::Windows gMapSelectFlags.set(MapSelectFlag::enable, MapSelectFlag::enableArrow); gMapSelectType = MapSelectType::full; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords; + setMapSelectRange(mapCoords); int32_t z = tileElement->GetBaseZ(); @@ -1056,6 +1177,136 @@ namespace OpenRCT2::Ui::Windows MapInvalidateSelectionRect(); } + FootpathPlacementResult WindowFootpathGetPlacementFromScreenCoords(const ScreenCoordsXY& screenCoords) + { + if (_footpathPlaceZ != 0) + return { _footpathPlaceZ, { FootpathSlopeType::flat } }; + + const auto info = GetMapCoordinatesFromPos( + screenCoords, EnumsToFlags(ViewportInteractionItem::terrain, ViewportInteractionItem::footpath)); + return FootpathGetPlacementFromInfo(info); + } + + void WindowFootpathPlaceDragAreaSetStart(const ScreenCoordsXY& screenCoords) + { + if (_footpathErrorOccured) + { + return; + } + _provisionalFootpath.tiles.clear(); + + auto mapPos = FootpathGetPlacePositionFromScreenPosition(screenCoords); + if (!mapPos) + return; + + auto placement = WindowFootpathGetPlacementFromScreenCoords(screenCoords); + if (placement.baseZ > 0 && placement.slope.type == FootpathSlopeType::flat) + _footpathPlaceZ = placement.baseZ; + + gMapSelectFlags.set(MapSelectFlag::enable); + gMapSelectType = MapSelectType::full; + + auto correctedPosition = mapPos->ToTileStart(); + setMapSelectRange(correctedPosition); + _dragStartPos = correctedPosition; + WindowFootpathSetProvisionalPathDragArea(getMapSelectRange(), placement.baseZ); + } + + void WindowFootpathPlaceDragAreaSetEnd(const ScreenCoordsXY& screenCoords) + { + if (_footpathErrorOccured) + { + return; + } + + std::optional mapPos; + if (_footpathPlaceShiftState) + mapPos = ScreenGetMapXYWithZ(screenCoords, _footpathPlaceZ); + else + mapPos = FootpathGetPlacePositionFromScreenPosition(screenCoords); + + if (!mapPos) + { + return; + } + + auto correctedPos = mapPos->ToTileStart(); + + // For queues, only allow selecting a single line. + if (gFootpathSelection.IsQueueSelected) + { + auto xDiff = correctedPos.x - _dragStartPos.x; + auto yDiff = correctedPos.y - _dragStartPos.y; + if (std::abs(xDiff) > std::abs(yDiff)) + { + correctedPos.y = _dragStartPos.y; + } + else + { + correctedPos.x = _dragStartPos.x; + } + } + + setMapSelectRange({ _dragStartPos, correctedPos }); + WindowFootpathSetProvisionalPathDragArea(getMapSelectRange(), _footpathPlaceZ); + } + + void WindowFootpathPlaceDragAreaHover(const ScreenCoordsXY& screenCoords) + { + bool isLeftMousePressed = gInputFlags.has(InputFlag::leftMousePressed); + if (isLeftMousePressed) + return; + + WindowFootpathSetProvisionalPathAtPoint(screenCoords); + } + + void WindowFootpathPlacePath() + { + if (_footpathErrorOccured) + { + return; + } + + FootpathUpdateProvisional(); + if (_provisionalFootpath.tiles.size() == 0) + return; + + // Try and place path + auto selectedType = gFootpathSelection.GetSelectedSurface(); + PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); + + bool anySuccess = false; + money64 cost = 0; + CoordsXYZ lastLocation; + + for (const auto& tile : _provisionalFootpath.tiles) + { + auto footpathPlaceAction = GameActions::FootpathPlaceAction( + tile.position, tile.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, constructFlags); + auto result = GameActions::Execute(&footpathPlaceAction, getGameState()); + if (result.Error == GameActions::Status::Ok) + { + anySuccess = true; + cost += result.Cost; + } + lastLocation = tile.position; + } + + if (anySuccess) + { + // Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no + // money scenarios + if (cost != 0) + { + Audio::Play3D(Audio::SoundId::placeItem, lastLocation); + } + } + else + { + _footpathErrorOccured = true; + } + } + /** * * rct2: 0x006A82C5 @@ -1073,7 +1324,7 @@ namespace OpenRCT2::Ui::Windows if (!mapPos) return; - auto placement = FootpathGetPlacementFromScreenCoords(screenCoords); + auto placement = WindowFootpathGetPlacementFromScreenCoords(screenCoords); // Try and place path auto selectedType = gFootpathSelection.GetSelectedSurface(); @@ -1150,7 +1401,7 @@ namespace OpenRCT2::Ui::Windows _footpathConstructFromPosition = { mapCoords, z }; _footpathConstructDirection = direction; _provisionalFootpath.flags.clearAll(); - _footpathConstructSlope = 0; + _footpathConstructSlope = SlopePitch::flat; _footpathConstructionMode = PathConstructionMode::bridgeOrTunnel; _footpathConstructValidDirections = kInvalidDirection; WindowFootpathSetEnabledAndPressedWidgets(); @@ -1166,7 +1417,7 @@ namespace OpenRCT2::Ui::Windows FootpathUpdateProvisional(); ObjectEntryIndex type; - int32_t slope; + FootpathSlope slope; CoordsXYZ footpathLoc; FootpathGetNextPathInfo(&type, footpathLoc, &slope); @@ -1191,7 +1442,7 @@ namespace OpenRCT2::Ui::Windows if (result->Error == GameActions::Status::Ok) { - if (_footpathConstructSlope == 0) + if (_footpathConstructSlope == SlopePitch::flat) { self->_footpathConstructValidDirections = kInvalidDirection; } @@ -1209,7 +1460,7 @@ namespace OpenRCT2::Ui::Windows // 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 (_footpathConstructSlope == 2) + if (_footpathConstructSlope == SlopePitch::upwards) { _footpathConstructFromPosition.z += kPathHeightStep; } @@ -1373,18 +1624,17 @@ namespace OpenRCT2::Ui::Windows newPressedWidgets |= (1LL << (WIDX_DIRECTION_NW + direction)); // Set pressed slope widget - int32_t slope = _footpathConstructSlope; - if (slope == kTileSlopeSESideUp) + switch (_footpathConstructSlope) { - newPressedWidgets |= (1uLL << WIDX_SLOPEDOWN); - } - else if (slope == kTileSlopeFlat) - { - newPressedWidgets |= (1uLL << WIDX_LEVEL); - } - else - { - newPressedWidgets |= (1uLL << WIDX_SLOPEUP); + case SlopePitch::flat: + newPressedWidgets |= (1uLL << WIDX_LEVEL); + break; + case SlopePitch::upwards: + newPressedWidgets |= (1uLL << WIDX_SLOPEUP); + break; + case SlopePitch::downwards: + newPressedWidgets |= (1uLL << WIDX_SLOPEDOWN); + break; } // Enable / disable directional widgets @@ -1416,7 +1666,7 @@ namespace OpenRCT2::Ui::Windows * * rct2: 0x006A7B20 */ - void FootpathGetNextPathInfo(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope) + void FootpathGetNextPathInfo(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, FootpathSlope* slope) { auto direction = _footpathConstructDirection; footpathLoc.x = _footpathConstructFromPosition.x + CoordsDirectionDelta[direction].x; @@ -1426,14 +1676,14 @@ namespace OpenRCT2::Ui::Windows { *type = gFootpathSelection.GetSelectedSurface(); } - *slope = kTileSlopeFlat; - if (_footpathConstructSlope != 0) + *slope = {}; + if (_footpathConstructSlope != SlopePitch::flat) { - *slope = _footpathConstructDirection | kTileSlopeSCornerUp; - if (_footpathConstructSlope != 2) + *slope = { FootpathSlopeType::sloped, _footpathConstructDirection }; + if (_footpathConstructSlope == SlopePitch::downwards) { footpathLoc.z -= kPathHeightStep; - *slope ^= kTileSlopeECornerUp; + slope->direction = DirectionReverse(slope->direction); } } } @@ -1489,14 +1739,14 @@ namespace OpenRCT2::Ui::Windows switch (_footpathConstructSlope) { - case 0: + case SlopePitch::flat: onMouseDown(WIDX_SLOPEDOWN); break; - case 2: + case SlopePitch::upwards: onMouseDown(WIDX_LEVEL); break; default: - case 6: + case SlopePitch::downwards: return; } } @@ -1511,14 +1761,14 @@ namespace OpenRCT2::Ui::Windows switch (_footpathConstructSlope) { - case 6: + case SlopePitch::downwards: onMouseDown(WIDX_LEVEL); break; - case 0: + case SlopePitch::flat: onMouseDown(WIDX_SLOPEUP); break; default: - case 2: + case SlopePitch::upwards: return; } } @@ -1526,7 +1776,7 @@ namespace OpenRCT2::Ui::Windows void KeyboardShortcutSlopeLevel() { if (isWidgetDisabled(WIDX_SLOPEDOWN) || isWidgetDisabled(WIDX_LEVEL) || isWidgetDisabled(WIDX_SLOPEUP) - || widgets[WIDX_LEVEL].type == WidgetType::empty || _footpathConstructSlope == 0) + || widgets[WIDX_LEVEL].type == WidgetType::empty || _footpathConstructSlope == SlopePitch::flat) { return; } @@ -1686,24 +1936,38 @@ namespace OpenRCT2::Ui::Windows * rct2: 0x006A76FF */ static money64 FootpathProvisionalSet( - ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXYZ& footpathLoc, int32_t slope, - PathConstructFlags constructFlags) + ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXY& footpathLocA, const CoordsXY& footpathLocB, + int32_t startZ, const std::span tiles, PathConstructFlags constructFlags) { FootpathRemoveProvisional(); - auto footpathPlaceAction = GameActions::FootpathPlaceAction( - footpathLoc, slope, type, railingsType, kInvalidDirection, constructFlags); - footpathPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + GameActions::Result res; + std::vector succesfulTiles{}; + money64 cost = 0; + for (const auto& tile : tiles) + { + auto footpathPlaceAction = GameActions::FootpathPlaceAction( + tile.position, tile.slope, type, railingsType, kInvalidDirection, constructFlags); + footpathPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + res = GameActions::Execute(&footpathPlaceAction, getGameState()); + // The latter status will be returned if there is already path at the tile in question, to prevent a ghost + // from glitching through the existing path. + if (res.Error == GameActions::Status::Ok || res.Error == GameActions::Status::ItemAlreadyPlaced) + { + succesfulTiles.emplace_back(tile); + cost += res.Cost; + } + } - auto res = GameActions::Execute(&footpathPlaceAction, getGameState()); - money64 cost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - - if (res.Error == GameActions::Status::Ok) + bool anySuccesful = succesfulTiles.size() > 0; + if (anySuccesful) { _provisionalFootpath.surfaceIndex = type; _provisionalFootpath.railingsIndex = railingsType; - _provisionalFootpath.position = footpathLoc; - _provisionalFootpath.slope = slope; + _provisionalFootpath.positionA = footpathLocA; + _provisionalFootpath.positionB = footpathLocB; + _provisionalFootpath.startZ = startZ; + _provisionalFootpath.tiles = succesfulTiles; _provisionalFootpath.constructFlags = constructFlags; _provisionalFootpath.flags.set(ProvisionalPathFlag::placed); @@ -1719,26 +1983,26 @@ namespace OpenRCT2::Ui::Windows if (!isToolActive(WindowClass::scenery)) { - if (res.Error != GameActions::Status::Ok) + if (succesfulTiles.size() == 0) { // If we can't build this, don't show a virtual floor. VirtualFloorSetHeight(0); } else if ( - _provisionalFootpath.slope == kTileSlopeFlat - || _provisionalFootpath.position.z < _footpathConstructFromPosition.z) + succesfulTiles[0].slope.type == FootpathSlopeType::flat + || succesfulTiles[0].position.z < _footpathConstructFromPosition.z) { // Going either straight on, or down. - VirtualFloorSetHeight(_provisionalFootpath.position.z); + VirtualFloorSetHeight(succesfulTiles[0].position.z); } else { // Going up in the world! - VirtualFloorSetHeight(_provisionalFootpath.position.z + kLandHeightStep); + VirtualFloorSetHeight(succesfulTiles[0].position.z + kLandHeightStep); } } - return cost; + return anySuccesful ? cost : kMoney64Undefined; } /** @@ -1747,11 +2011,14 @@ namespace OpenRCT2::Ui::Windows */ void FootpathRemoveProvisional() { - if (_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) - { - _provisionalFootpath.flags.unset(ProvisionalPathFlag::placed); + if (!_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)) + return; - auto action = GameActions::FootpathRemoveAction(_provisionalFootpath.position); + _provisionalFootpath.flags.unset(ProvisionalPathFlag::placed); + + for (const auto& tile : _provisionalFootpath.tiles) + { + auto action = GameActions::FootpathRemoveAction(tile.position); action.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); GameActions::Execute(&action, getGameState()); } @@ -1788,8 +2055,9 @@ namespace OpenRCT2::Ui::Windows { _provisionalFootpath.flags.unset(ProvisionalPathFlag::placed); FootpathProvisionalSet( - _provisionalFootpath.surfaceIndex, _provisionalFootpath.railingsIndex, _provisionalFootpath.position, - _provisionalFootpath.slope, _provisionalFootpath.constructFlags); + _provisionalFootpath.surfaceIndex, _provisionalFootpath.railingsIndex, _provisionalFootpath.positionA, + _provisionalFootpath.positionB, _provisionalFootpath.startZ, _provisionalFootpath.tiles, + _provisionalFootpath.constructFlags); } } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 0eaa88fe00..ca82b080a7 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum WindowGameBottomToolbarWidgetIdx @@ -57,18 +60,18 @@ namespace OpenRCT2::Ui::Windows { makeWidget({ 0, 0}, {142, 34}, WidgetType::imgBtn, WindowColour::primary ), // Left outset panel makeWidget({ 2, 2}, {138, 30}, WidgetType::imgBtn, WindowColour::primary ), // Left inset panel - makeWidget({ 2, 1}, {138, 12}, WidgetType::flatBtn, WindowColour::primary , 0xFFFFFFFF, STR_PROFIT_PER_WEEK_AND_PARK_VALUE_TIP), // Money window - makeWidget({ 2, 11}, {138, 12}, WidgetType::flatBtn, WindowColour::primary ), // Guests window - makeWidget({ 2, 21}, {138, 11}, WidgetType::flatBtn, WindowColour::primary , 0xFFFFFFFF, STR_PARK_RATING_TIP ), // Park rating window + makeWidget({ 2, 1}, {138, 12}, WidgetType::hiddenButton,WindowColour::primary , 0xFFFFFFFF, STR_PROFIT_PER_WEEK_AND_PARK_VALUE_TIP), // Money window + makeWidget({ 2, 11}, {138, 12}, WidgetType::hiddenButton,WindowColour::primary ), // Guests window + makeWidget({ 2, 21}, {138, 11}, WidgetType::hiddenButton,WindowColour::primary , 0xFFFFFFFF, STR_PARK_RATING_TIP ), // Park rating window makeWidget({142, 0}, {356, 34}, WidgetType::imgBtn, WindowColour::tertiary ), // Middle outset panel - makeWidget({144, 2}, {352, 30}, WidgetType::flatBtn, WindowColour::tertiary ), // Middle inset panel - makeWidget({147, 5}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary, 0xFFFFFFFF, STR_SHOW_SUBJECT_TIP ), // Associated news item window - makeWidget({469, 5}, { 24, 24}, WidgetType::flatBtn, WindowColour::tertiary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP ), // Scroll to news item target + makeWidget({144, 2}, {352, 30}, WidgetType::hiddenButton,WindowColour::tertiary ), // Middle inset panel + makeWidget({147, 5}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, 0xFFFFFFFF, STR_SHOW_SUBJECT_TIP ), // Associated news item window + makeWidget({469, 5}, { 24, 24}, WidgetType::flatBtn, WindowColour::secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP ), // Scroll to news item target makeWidget({498, 0}, {142, 34}, WidgetType::imgBtn, WindowColour::primary ), // Right outset panel makeWidget({500, 2}, {138, 30}, WidgetType::imgBtn, WindowColour::primary ), // Right inset panel - makeWidget({500, 2}, {138, 12}, WidgetType::flatBtn, WindowColour::primary ), // Date + makeWidget({500, 2}, {138, 12}, WidgetType::hiddenButton,WindowColour::primary ), // Date }; // clang-format on @@ -92,7 +95,9 @@ namespace OpenRCT2::Ui::Windows const auto topLeft = windowPos + ScreenCoordsXY{ leftPanelWidget.left + 1, leftPanelWidget.top + 1 }; const auto bottomRight = windowPos + ScreenCoordsXY{ leftPanelWidget.right - 1, leftPanelWidget.bottom - 1 }; // Draw green inset rectangle on panel - GfxFillRectInset(rt, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, colours[0], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); // Figure out how much line height we have to work with. uint32_t line_height = FontGetLineHeight(FontStyle::Medium); @@ -151,15 +156,16 @@ namespace OpenRCT2::Ui::Windows void DrawParkRating(RenderTarget& rt, int32_t colour, const ScreenCoordsXY& coords, uint8_t factor) { int16_t bar_width = (factor * 114) / 255; - GfxFillRectInset( - rt, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, colours[0], + Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, Rectangle::FillMode::none); if (!(colour & kBarBlink) || GameIsPaused() || (gCurrentRealTimeTicks & 8)) { if (bar_width > 2) { - GfxFillRectInset( + Rectangle::fillInset( rt, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, - ColourWithFlags{ static_cast(colour) }, 0); + ColourWithFlags{ static_cast(colour) }); } } @@ -175,7 +181,9 @@ namespace OpenRCT2::Ui::Windows const auto topLeft = windowPos + ScreenCoordsXY{ rightPanelWidget.left + 1, rightPanelWidget.top + 1 }; const auto bottomRight = windowPos + ScreenCoordsXY{ rightPanelWidget.right - 1, rightPanelWidget.bottom - 1 }; // Draw green inset rectangle on panel - GfxFillRectInset(rt, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, colours[0], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); auto screenCoords = ScreenCoordsXY{ (rightPanelWidget.left + rightPanelWidget.right) / 2 + windowPos.x, rightPanelWidget.top + windowPos.y + 2 }; @@ -187,7 +195,7 @@ namespace OpenRCT2::Ui::Windows int32_t day = date.GetDay(); auto colour = GetHoverWidgetColour(WIDX_DATE); - StringId stringId = DateFormatStringFormatIds[Config::Get().general.DateFormat]; + StringId stringId = DateFormatStringFormatIds[Config::Get().general.dateFormat]; auto ft = Formatter(); ft.Add(DateDayNames[day]); ft.Add(month); @@ -202,7 +210,7 @@ namespace OpenRCT2::Ui::Windows int32_t temperature = getGameState().weatherCurrent.temperature; StringId format = STR_CELSIUS_VALUE; - if (Config::Get().general.TemperatureFormat == TemperatureUnit::Fahrenheit) + if (Config::Get().general.temperatureFormat == TemperatureUnit::Fahrenheit) { temperature = ClimateCelsiusToFahrenheit(temperature); format = STR_FAHRENHEIT_VALUE; @@ -234,12 +242,12 @@ namespace OpenRCT2::Ui::Windows auto* newsItem = News::GetItem(0); // Current news item - GfxFillRectInset( + Rectangle::fillInset( rt, { windowPos + ScreenCoordsXY{ middleOutsetWidget.left + 1, middleOutsetWidget.top + 1 }, windowPos + ScreenCoordsXY{ middleOutsetWidget.right - 1, middleOutsetWidget.bottom - 1 } }, - colours[2], INSET_RECT_F_30); + colours[2], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, Rectangle::FillMode::none); // Text auto screenCoords = windowPos + ScreenCoordsXY{ middleOutsetWidget.midX(), middleOutsetWidget.top + 11 }; @@ -281,7 +289,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - uint32_t image_id_base = animObj->GetPeepAnimation(peep->AnimationGroup).base_image; + uint32_t image_id_base = animObj->GetPeepAnimation(peep->AnimationGroup).baseImage; image_id_base += currentFrame & 0xFFFFFFFC; image_id_base++; @@ -296,7 +304,7 @@ namespace OpenRCT2::Ui::Windows // as well as 1 sprite for sitting and 1 for standing still. auto itemFrame = (currentFrame / 4) % 6; - if (guest->AnimationGroup == PeepAnimationGroup::Hat) + if (guest->AnimationGroup == PeepAnimationGroup::hat) { auto itemOffset = kPeepSpriteHatItemStart + 1; auto imageId = ImageId(itemOffset + itemFrame * 4, guest->HatColour); @@ -304,7 +312,7 @@ namespace OpenRCT2::Ui::Windows return; } - if (guest->AnimationGroup == PeepAnimationGroup::Balloon) + if (guest->AnimationGroup == PeepAnimationGroup::balloon) { auto itemOffset = kPeepSpriteBalloonItemStart + 1; auto imageId = ImageId(itemOffset + itemFrame * 4, guest->BalloonColour); @@ -312,7 +320,7 @@ namespace OpenRCT2::Ui::Windows return; } - if (guest->AnimationGroup == PeepAnimationGroup::Umbrella) + if (guest->AnimationGroup == PeepAnimationGroup::umbrella) { auto itemOffset = kPeepSpriteUmbrellaItemStart + 1; auto imageId = ImageId(itemOffset + itemFrame * 4, guest->UmbrellaColour); @@ -348,11 +356,11 @@ namespace OpenRCT2::Ui::Windows { Widget* middleOutsetWidget = &widgets[WIDX_MIDDLE_OUTSET]; - GfxFillRectInset( + Rectangle::fillInset( rt, { windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 }, windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } }, - colours[1], INSET_RECT_F_30); + colours[0], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, Rectangle::FillMode::none); // Figure out how much line height we have to work with. uint32_t line_height = FontGetLineHeight(FontStyle::Medium); @@ -524,7 +532,7 @@ namespace OpenRCT2::Ui::Windows } else { - widgets[WIDX_MONEY].type = WidgetType::flatBtn; + widgets[WIDX_MONEY].type = WidgetType::hiddenButton; widgets[WIDX_MONEY].bottom = widgets[WIDX_MONEY].top + line_height; widgets[WIDX_GUESTS].top = widgets[WIDX_MONEY].bottom + 1; widgets[WIDX_GUESTS].bottom = widgets[WIDX_GUESTS].top + line_height; @@ -572,7 +580,7 @@ namespace OpenRCT2::Ui::Windows else { widgets[WIDX_MIDDLE_OUTSET].type = WidgetType::imgBtn; - widgets[WIDX_MIDDLE_INSET].type = WidgetType::flatBtn; + widgets[WIDX_MIDDLE_INSET].type = WidgetType::hiddenButton; widgets[WIDX_NEWS_SUBJECT].type = WidgetType::empty; widgets[WIDX_NEWS_LOCATE].type = WidgetType::empty; widgets[WIDX_MIDDLE_OUTSET].colour = 0; @@ -583,7 +591,7 @@ namespace OpenRCT2::Ui::Windows { News::Item* newsItem = News::GetItem(0); widgets[WIDX_MIDDLE_OUTSET].type = WidgetType::imgBtn; - widgets[WIDX_MIDDLE_INSET].type = WidgetType::flatBtn; + widgets[WIDX_MIDDLE_INSET].type = WidgetType::hiddenButton; widgets[WIDX_NEWS_SUBJECT].type = WidgetType::flatBtn; widgets[WIDX_NEWS_LOCATE].type = WidgetType::flatBtn; widgets[WIDX_MIDDLE_OUTSET].colour = 2; @@ -620,18 +628,18 @@ namespace OpenRCT2::Ui::Windows // Draw panel grey backgrounds auto leftTop = windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top }; auto rightBottom = windowPos + ScreenCoordsXY{ leftWidget.right, leftWidget.bottom }; - GfxFilterRect(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); + Rectangle::filter(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); leftTop = windowPos + ScreenCoordsXY{ rightWidget.left, rightWidget.top }; rightBottom = windowPos + ScreenCoordsXY{ rightWidget.right, rightWidget.bottom }; - GfxFilterRect(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); + Rectangle::filter(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) { // Draw grey background leftTop = windowPos + ScreenCoordsXY{ middleWidget.left, middleWidget.top }; rightBottom = windowPos + ScreenCoordsXY{ middleWidget.right, middleWidget.bottom }; - GfxFilterRect(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); + Rectangle::filter(rt, { leftTop, rightBottom }, FilterPaletteID::palette51); } drawWidgets(rt); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 654a119e84..fb8dc2fda4 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr StringId kWindowTitle = STR_STRINGID; @@ -494,7 +497,7 @@ namespace OpenRCT2::Ui::Windows { newDisabledWidgets |= (1uLL << WIDX_TAB_4); // Disable finance tab if no money } - if (!Config::Get().general.DebuggingTools) + if (!Config::Get().general.debuggingTools) { newDisabledWidgets |= (1uLL << WIDX_TAB_7); // Disable debug tab when debug tools not turned on } @@ -569,7 +572,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - int32_t animationFrame = animObj->GetPeepAnimation(peep->AnimationGroup).base_image + 1; + int32_t animationFrame = animObj->GetPeepAnimation(peep->AnimationGroup).baseImage + 1; int32_t animationFrameOffset = 0; if (page == WINDOW_GUEST_OVERVIEW) @@ -589,21 +592,21 @@ namespace OpenRCT2::Ui::Windows // There are only 6 walking frames available for each item. auto itemFrame = (_guestAnimationFrame / 4) % 6; - if (guest->AnimationGroup == PeepAnimationGroup::Hat) + if (guest->AnimationGroup == PeepAnimationGroup::hat) { auto itemOffset = kPeepSpriteHatItemStart + 1; auto imageId = ImageId(itemOffset + itemFrame * 4, guest->HatColour); GfxDrawSprite(clipDpi, imageId, screenCoords); } - if (guest->AnimationGroup == PeepAnimationGroup::Balloon) + if (guest->AnimationGroup == PeepAnimationGroup::balloon) { auto itemOffset = kPeepSpriteBalloonItemStart + 1; auto imageId = ImageId(itemOffset + itemFrame * 4, guest->BalloonColour); GfxDrawSprite(clipDpi, imageId, screenCoords); } - if (guest->AnimationGroup == PeepAnimationGroup::Umbrella) + if (guest->AnimationGroup == PeepAnimationGroup::umbrella) { auto itemOffset = kPeepSpriteUmbrellaItemStart + 1; auto imageId = ImageId(itemOffset + itemFrame * 4, guest->UmbrellaColour); @@ -759,7 +762,7 @@ namespace OpenRCT2::Ui::Windows onPrepareDraw(); - if (peep->State != PeepState::Picked && viewport == nullptr) + if (peep->State != PeepState::picked && viewport == nullptr) { const auto& viewWidget = widgets[WIDX_VIEWPORT]; auto screenPos = ScreenCoordsXY{ viewWidget.left + 1 + windowPos.x, viewWidget.top + 1 + windowPos.y }; @@ -903,8 +906,8 @@ namespace OpenRCT2::Ui::Windows _guestAnimationFrame %= 24; // Get pickup animation length - const auto& pickAnim = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::Hanging); - const auto pickAnimLength = pickAnim.frame_offsets.size(); + const auto& pickAnim = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::hanging); + const auto pickAnimLength = pickAnim.frameOffsets.size(); // Update pickup animation, can only happen in this tab. pickedPeepFrame++; @@ -940,7 +943,7 @@ namespace OpenRCT2::Ui::Windows } } - const std::optional currentFocus = peep->State != PeepState::Picked ? std::optional(Focus(peep->Id)) + const std::optional currentFocus = peep->State != PeepState::picked ? std::optional(Focus(peep->Id)) : std::nullopt; if (focus != currentFocus) { @@ -1006,7 +1009,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - auto baseImageId = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::Hanging).base_image; + auto baseImageId = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::hanging).baseImage; baseImageId += pickedPeepFrame >> 2; gPickupPeepImage = ImageId(baseImageId, peep->TshirtColour, peep->TrousersColour); } @@ -1355,7 +1358,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDrawRides(int32_t scrollIndex, RenderTarget& rt) { auto colour = ColourMapA[colours[1].colour].mid_light; - GfxFillRect(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, colour); + Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, colour); for (int32_t listIndex = 0; listIndex < static_cast(_riddenRides.size()); listIndex++) { @@ -1363,7 +1366,7 @@ namespace OpenRCT2::Ui::Windows StringId stringId = STR_BLACK_STRING; if (listIndex == selectedListItem) { - GfxFilterRect(rt, { 0, y, 800, y + 9 }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, 800, y + 9 }, FilterPaletteID::paletteDarken1); stringId = STR_WINDOW_COLOUR_2_STRINGID; } @@ -1442,9 +1445,9 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += kListRowHeight * 2; } - GfxFillRectInset( + Rectangle::fillInset( rt, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); + Rectangle::BorderStyle::inset); // Paid to enter { @@ -1643,10 +1646,10 @@ namespace OpenRCT2::Ui::Windows Ride* invRide{}; switch (item) { - case ShopItem::Balloon: + case ShopItem::balloon: itemImage = ImageId(itemDesc.Image, guest.BalloonColour); break; - case ShopItem::Photo: + case ShopItem::photo: invRide = GetRide(guest.Photo1RideRef); if (invRide != nullptr) { @@ -1656,10 +1659,10 @@ namespace OpenRCT2::Ui::Windows } break; - case ShopItem::Umbrella: + case ShopItem::umbrella: itemImage = ImageId(itemDesc.Image, guest.UmbrellaColour); break; - case ShopItem::Voucher: + case ShopItem::voucher: switch (guest.VoucherType) { case VOUCHER_TYPE_PARK_ENTRY_FREE: @@ -1694,13 +1697,13 @@ namespace OpenRCT2::Ui::Windows break; } break; - case ShopItem::Hat: + case ShopItem::hat: itemImage = ImageId(itemDesc.Image, guest.HatColour); break; - case ShopItem::TShirt: + case ShopItem::tShirt: itemImage = ImageId(itemDesc.Image, guest.TshirtColour); break; - case ShopItem::Photo2: + case ShopItem::photo2: invRide = GetRide(guest.Photo2RideRef); if (invRide != nullptr) { @@ -1709,7 +1712,7 @@ namespace OpenRCT2::Ui::Windows invRide->formatNameTo(ft); } break; - case ShopItem::Photo3: + case ShopItem::photo3: invRide = GetRide(guest.Photo3RideRef); if (invRide != nullptr) { @@ -1718,7 +1721,7 @@ namespace OpenRCT2::Ui::Windows invRide->formatNameTo(ft); } break; - case ShopItem::Photo4: + case ShopItem::photo4: invRide = GetRide(guest.Photo4RideRef); if (invRide != nullptr) { @@ -1759,7 +1762,7 @@ namespace OpenRCT2::Ui::Windows int32_t maxY = windowPos.y + height - 22; int32_t numItems = 0; - for (ShopItem item = ShopItem::Balloon; item < ShopItem::Count; item++) + for (ShopItem item = ShopItem::balloon; item < ShopItem::count; item++) { if (screenCoords.y >= maxY) break; @@ -1921,7 +1924,7 @@ namespace OpenRCT2::Ui::Windows if (window == nullptr) { auto windowSize = kWindowSize; - if (Config::Get().general.DebuggingTools) + if (Config::Get().general.debuggingTools) windowSize.width += kTabWidth; window = windowMgr->Create(WindowClass::peep, windowSize, WindowFlag::resizable); diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 9f86a0a293..4b31c17cba 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include +using namespace OpenRCT2::Drawing; using namespace OpenRCT2::Numerics; namespace OpenRCT2::Ui::Windows @@ -573,7 +575,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { - GfxFillRect( + Rectangle::fill( rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); switch (_selectedTab) { @@ -628,8 +630,8 @@ namespace OpenRCT2::Ui::Windows { // Tab 1 image auto i = (_selectedTab == TabId::Individual ? _tabAnimationIndex & ~3 : 0); - auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest); - i += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1; + auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest); + i += animObj->GetPeepAnimation(PeepAnimationGroup::normal).baseImage + 1; GfxDrawSprite( rt, ImageId(i, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].midX(), widgets[WIDX_TAB_1].bottom - 6 }); @@ -655,7 +657,7 @@ namespace OpenRCT2::Ui::Windows StringId format = STR_BLACK_STRING; if (index == _highlightedIndex) { - GfxFilterRect(rt, { 0, y, 800, y + kScrollableRowHeight - 1 }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, 800, y + kScrollableRowHeight - 1 }, FilterPaletteID::paletteDarken1); format = STR_WINDOW_COLOUR_2_STRINGID; } @@ -725,7 +727,7 @@ namespace OpenRCT2::Ui::Windows StringId format = STR_BLACK_STRING; if (index == _highlightedIndex) { - GfxFilterRect(rt, { 0, y, 800, y + kSummarisedGuestsRowHeight }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, 800, y + kSummarisedGuestsRowHeight }, FilterPaletteID::paletteDarken1); format = STR_WINDOW_COLOUR_2_STRINGID; } diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 357204b6de..78c86b7314 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum @@ -154,7 +157,7 @@ namespace OpenRCT2::Ui::Windows Widget* widget = &widgets[WIDX_TRACK_PREVIEW]; auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; int32_t colour = ColourMapA[colours[0].colour].darkest; - GfxFillRect(rt, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); + Rectangle::fill(rt, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); G1Element g1temp = {}; g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * kTrackPreviewImageSize); @@ -201,7 +204,7 @@ namespace OpenRCT2::Ui::Windows if (objectEntry != nullptr) { auto groupIndex = ObjectManagerGetLoadedObjectEntryIndex(objectEntry); - auto rideName = GetRideNaming(td.trackAndVehicle.rtdIndex, *GetRideEntryByIndex(groupIndex)); + auto rideName = GetRideNaming(td.trackAndVehicle.rtdIndex, GetRideEntryByIndex(groupIndex)); ft.Add(rideName.Name); } else @@ -356,7 +359,7 @@ namespace OpenRCT2::Ui::Windows private: void UpdatePreview() { - TrackDesignDrawPreview(*_trackDesign, _trackDesignPreviewPixels.data()); + TrackDesignDrawPreview(*_trackDesign, _trackDesignPreviewPixels.data(), !gTrackDesignSceneryToggle); } void InstallTrackDesign() diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index d5df1fcd0e..ee09d4bb3a 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ namespace OpenRCT2::Ui::Windows { + using namespace OpenRCT2::Drawing; using namespace OpenRCT2::Ui::FileBrowser; #pragma region Widgets @@ -136,13 +138,13 @@ namespace OpenRCT2::Ui::Windows bool ShowPreviews() { auto& config = Config::Get().general; - return config.FileBrowserPreviewType != ParkPreviewPref::disabled; + return config.fileBrowserPreviewType != ParkPreviewPref::disabled; } ScreenSize GetPreviewSize() const { auto& config = Config::Get().general; - switch (config.FileBrowserPreviewType) + switch (config.fileBrowserPreviewType) { case ParkPreviewPref::screenshot: return { kPreviewWidthScreenshot, kPreviewWidthScreenshot / 5 * 4 }; @@ -405,7 +407,7 @@ namespace OpenRCT2::Ui::Windows { // Find preview image to draw PreviewImage* image = nullptr; - auto targetPref = Config::Get().general.FileBrowserPreviewType; + auto targetPref = Config::Get().general.fileBrowserPreviewType; auto targetType = targetPref == ParkPreviewPref::screenshot ? PreviewImageType::screenshot : PreviewImageType::miniMap; for (auto& candidate : _preview.images) @@ -442,8 +444,9 @@ namespace OpenRCT2::Ui::Windows if (drawFrame) { - GfxFillRectInset( - rt, { frameStartPos, frameEndPos }, colours[1], INSET_RECT_F_60 | INSET_RECT_FLAG_FILL_MID_LIGHT); + Rectangle::fillInset( + rt, { frameStartPos, frameEndPos }, colours[1], Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::dark, Rectangle::FillMode::dontLightenWhenInset); } // Draw image, or placeholder if no preview was found @@ -483,7 +486,7 @@ namespace OpenRCT2::Ui::Windows // Date { auto ft = Formatter(); - ft.Add(DateFormatStringFormatIds[Config::Get().general.DateFormat]); + ft.Add(DateFormatStringFormatIds[Config::Get().general.dateFormat]); ft.Add(DateDayNames[_preview.day]); ft.Add(_preview.month); ft.Add(_preview.year + 1); @@ -606,8 +609,8 @@ namespace OpenRCT2::Ui::Windows WindowSetResize(*this, GetMinimumWindowSize(), kWindowSizeMax); auto& config = Config::Get().general; - config.FileBrowserWidth = width; - config.FileBrowserHeight = height - getTitleBarDiffNormal(); + config.fileBrowserWidth = width; + config.fileBrowserHeight = height - getTitleBarDiffNormal(); } void onUpdate() override @@ -642,7 +645,7 @@ namespace OpenRCT2::Ui::Windows customiseWidget.left = customiseWidget.right - 14; auto& config = Config::Get().general; - if (config.FileBrowserShowDateColumn) + if (config.fileBrowserShowDateColumn) { // Date column on the right Widget& dateWidget = widgets[WIDX_SORT_DATE]; @@ -650,7 +653,7 @@ namespace OpenRCT2::Ui::Windows dateWidget.right = customiseWidget.left - 1; dateWidget.left = dateWidget.right - (maxDateWidth + maxTimeWidth + (4 * kDateTimeGap) + (kScrollBarWidth + 1)); - if (config.FileBrowserShowSizeColumn) + if (config.fileBrowserShowSizeColumn) { // File size column in the middle Widget& sizeWidget = widgets[WIDX_SORT_SIZE]; @@ -671,7 +674,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_SORT_NAME].right = dateWidget.left - 1; } } - else if (config.FileBrowserShowSizeColumn) + else if (config.fileBrowserShowSizeColumn) { // Hide date header Widget& dateWidget = widgets[WIDX_SORT_DATE]; @@ -758,9 +761,9 @@ namespace OpenRCT2::Ui::Windows const auto drawButtonCaption = [rt, this](Widget& widget, StringId strId, FileBrowserSort ascSort, FileBrowserSort descSort) { StringId indicatorId = kStringIdNone; - if (Config::Get().general.LoadSaveSort == ascSort) + if (Config::Get().general.loadSaveSort == ascSort) indicatorId = STR_UP; - else if (Config::Get().general.LoadSaveSort == descSort) + else if (Config::Get().general.loadSaveSort == descSort) indicatorId = STR_DOWN; auto ft = Formatter(); @@ -776,12 +779,12 @@ namespace OpenRCT2::Ui::Windows drawButtonCaption( widgets[WIDX_SORT_NAME], STR_NAME_COLUMN, FileBrowserSort::NameAscending, FileBrowserSort::NameDescending); - if (config.FileBrowserShowSizeColumn) + if (config.fileBrowserShowSizeColumn) drawButtonCaption( widgets[WIDX_SORT_SIZE], STR_FILEBROWSER_SIZE_COLUMN, FileBrowserSort::SizeAscending, FileBrowserSort::SizeDescending); - if (config.FileBrowserShowDateColumn) + if (config.fileBrowserShowDateColumn) drawButtonCaption( widgets[WIDX_SORT_DATE], STR_DATE_COLUMN, FileBrowserSort::DateAscending, FileBrowserSort::DateDescending); @@ -833,13 +836,13 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_SORT_NAME: - if (Config::Get().general.LoadSaveSort == FileBrowserSort::NameAscending) + if (Config::Get().general.loadSaveSort == FileBrowserSort::NameAscending) { - Config::Get().general.LoadSaveSort = FileBrowserSort::NameDescending; + Config::Get().general.loadSaveSort = FileBrowserSort::NameDescending; } else { - Config::Get().general.LoadSaveSort = FileBrowserSort::NameAscending; + Config::Get().general.loadSaveSort = FileBrowserSort::NameAscending; } Config::Save(); SortList(); @@ -847,13 +850,13 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_SORT_SIZE: - if (Config::Get().general.LoadSaveSort == FileBrowserSort::SizeDescending) + if (Config::Get().general.loadSaveSort == FileBrowserSort::SizeDescending) { - Config::Get().general.LoadSaveSort = FileBrowserSort::SizeAscending; + Config::Get().general.loadSaveSort = FileBrowserSort::SizeAscending; } else { - Config::Get().general.LoadSaveSort = FileBrowserSort::SizeDescending; + Config::Get().general.loadSaveSort = FileBrowserSort::SizeDescending; } Config::Save(); SortList(); @@ -861,13 +864,13 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_SORT_DATE: - if (Config::Get().general.LoadSaveSort == FileBrowserSort::DateDescending) + if (Config::Get().general.loadSaveSort == FileBrowserSort::DateDescending) { - Config::Get().general.LoadSaveSort = FileBrowserSort::DateAscending; + Config::Get().general.loadSaveSort = FileBrowserSort::DateAscending; } else { - Config::Get().general.LoadSaveSort = FileBrowserSort::DateDescending; + Config::Get().general.loadSaveSort = FileBrowserSort::DateDescending; } Config::Save(); SortList(); @@ -921,11 +924,11 @@ namespace OpenRCT2::Ui::Windows auto& config = Config::Get().general; gDropdown.items[0].setChecked(true); - gDropdown.items[1].setChecked(config.FileBrowserShowSizeColumn); - gDropdown.items[2].setChecked(config.FileBrowserShowDateColumn); - gDropdown.items[4].setChecked(config.FileBrowserPreviewType == ParkPreviewPref::disabled); - gDropdown.items[5].setChecked(config.FileBrowserPreviewType == ParkPreviewPref::miniMap); - gDropdown.items[6].setChecked(config.FileBrowserPreviewType == ParkPreviewPref::screenshot); + gDropdown.items[1].setChecked(config.fileBrowserShowSizeColumn); + gDropdown.items[2].setChecked(config.fileBrowserShowDateColumn); + gDropdown.items[4].setChecked(config.fileBrowserPreviewType == ParkPreviewPref::disabled); + gDropdown.items[5].setChecked(config.fileBrowserPreviewType == ParkPreviewPref::miniMap); + gDropdown.items[6].setChecked(config.fileBrowserPreviewType == ParkPreviewPref::screenshot); } void onDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override @@ -937,23 +940,23 @@ namespace OpenRCT2::Ui::Windows bool changed = false; if (selectedIndex == 1) { - config.FileBrowserShowSizeColumn ^= true; + config.fileBrowserShowSizeColumn ^= true; changed = true; } else if (selectedIndex == 2) { - config.FileBrowserShowDateColumn ^= true; + config.fileBrowserShowDateColumn ^= true; changed = true; } else if (selectedIndex >= 4 && selectedIndex <= 6) { auto newPref = ParkPreviewPref(selectedIndex - 4); - if (config.FileBrowserPreviewType != newPref) + if (config.fileBrowserPreviewType != newPref) { invalidate(); width -= GetPreviewSize().width; - config.FileBrowserPreviewType = newPref; + config.fileBrowserPreviewType = newPref; width += GetPreviewSize().width; changed = true; @@ -1075,7 +1078,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { - GfxFillRect( + Rectangle::fill( rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); const int32_t listWidth = widgets[WIDX_SCROLL].width(); @@ -1100,7 +1103,7 @@ namespace OpenRCT2::Ui::Windows if (i == selectedListItem) { stringId = STR_WINDOW_COLOUR_2_STRINGID; - GfxFilterRect(rt, { 0, y, listWidth, y + kScrollableRowHeight }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, listWidth, y + kScrollableRowHeight }, FilterPaletteID::paletteDarken1); } // display a marker next to the currently loaded game file if (_listItems[i].loaded) @@ -1127,7 +1130,7 @@ namespace OpenRCT2::Ui::Windows if (_listItems[i].type != FileType::file) continue; - if (config.FileBrowserShowSizeColumn) + if (config.fileBrowserShowSizeColumn) { ft = Formatter(); ft.Add(STR_FILEBROWSER_FILE_SIZE_VALUE); @@ -1136,7 +1139,7 @@ namespace OpenRCT2::Ui::Windows DrawTextEllipsised(rt, { sizeColumnLeft + 2, y }, maxDateWidth + maxTimeWidth, stringId, ft); } - if (config.FileBrowserShowDateColumn) + if (config.fileBrowserShowDateColumn) { ft = Formatter(); ft.Add(STR_STRING); @@ -1168,15 +1171,15 @@ namespace OpenRCT2::Ui::Windows if (w == nullptr) { auto& config = Config::Get().general; - if (config.FileBrowserWidth < kWindowSizeMin.width || config.FileBrowserHeight < kWindowSizeMin.height - || config.FileBrowserWidth > kWindowSizeMax.width || config.FileBrowserHeight > kWindowSizeMax.height) + if (config.fileBrowserWidth < kWindowSizeMin.width || config.fileBrowserHeight < kWindowSizeMin.height + || config.fileBrowserWidth > kWindowSizeMax.width || config.fileBrowserHeight > kWindowSizeMax.height) { - config.FileBrowserWidth = kWindowSize.width; - config.FileBrowserHeight = kWindowSize.height; + config.fileBrowserWidth = kWindowSize.width; + config.fileBrowserHeight = kWindowSize.height; Config::Save(); } - ScreenSize windowSize = { config.FileBrowserWidth, config.FileBrowserHeight }; + ScreenSize windowSize = { config.fileBrowserWidth, config.fileBrowserHeight }; w = windowMgr->Create( WindowClass::loadsave, windowSize, diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 785a576aaa..a336ac81c0 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -55,17 +55,17 @@ namespace OpenRCT2::Ui::Windows void SetViewportFlags() { viewport->flags |= VIEWPORT_FLAG_SOUND_ON; - if (Config::Get().general.InvisibleRides) + if (Config::Get().general.invisibleRides) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_RIDES; - if (Config::Get().general.InvisibleVehicles) + if (Config::Get().general.invisibleVehicles) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEHICLES; - if (Config::Get().general.InvisibleTrees) + if (Config::Get().general.invisibleTrees) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEGETATION; - if (Config::Get().general.InvisibleScenery) + if (Config::Get().general.invisibleScenery) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SCENERY; - if (Config::Get().general.InvisiblePaths) + if (Config::Get().general.invisiblePaths) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_PATHS; - if (Config::Get().general.InvisibleSupports) + if (Config::Get().general.invisibleSupports) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SUPPORTS; } }; diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index df62bb42de..3e02d2b62c 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr uint16_t MapColour2(uint8_t colourA, uint8_t colourB) @@ -676,7 +679,7 @@ namespace OpenRCT2::Ui::Windows for (uint32_t i = 0; i < std::size(RideKeyColours); i++) { - GfxFillRect( + Rectangle::fill( rt, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, RideKeyColours[i]); DrawTextBasic(rt, screenCoords + ScreenCoordsXY{ kListRowHeight, 0 }, MapLabels[i], {}); @@ -979,7 +982,7 @@ namespace OpenRCT2::Ui::Windows } } - GfxFillRect(rt, { leftTop, rightBottom }, colour); + Rectangle::fill(rt, { leftTop, rightBottom }, colour); } uint8_t GetGuestFlashColour() const @@ -1019,14 +1022,14 @@ namespace OpenRCT2::Ui::Windows auto mapCoord = TransformToMapCoords({ vehicle->x, vehicle->y }); auto pixelCoord = ScreenCoordsXY{ mapCoord.x, mapCoord.y } + offset; - GfxFillRect(rt, { pixelCoord, pixelCoord }, PaletteIndex::pi171); + Rectangle::fill(rt, { pixelCoord, pixelCoord }, PaletteIndex::pi171); } } } /** - * The call to GfxFillRect was originally wrapped in Sub68DABD which made sure that arguments were ordered correctly, - * but it doesn't look like it's ever necessary here so the call was removed. + * The call to Rectangle::fill was originally wrapped in Sub68DABD which made sure that arguments were ordered + * correctly, but it doesn't look like it's ever necessary here so the call was removed. */ void PaintHudRectangle(RenderTarget& rt, const ScreenCoordsXY& widgetOffset) { @@ -1050,20 +1053,20 @@ namespace OpenRCT2::Ui::Windows auto leftBottom = ScreenCoordsXY{ leftTop.x, rightBottom.y }; // top horizontal lines - GfxFillRect(rt, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PaletteIndex::pi56); - GfxFillRect(rt, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PaletteIndex::pi56); + Rectangle::fill(rt, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PaletteIndex::pi56); + Rectangle::fill(rt, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PaletteIndex::pi56); // left vertical lines - GfxFillRect(rt, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PaletteIndex::pi56); - GfxFillRect(rt, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PaletteIndex::pi56); + Rectangle::fill(rt, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PaletteIndex::pi56); + Rectangle::fill(rt, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PaletteIndex::pi56); // bottom horizontal lines - GfxFillRect(rt, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PaletteIndex::pi56); - GfxFillRect(rt, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PaletteIndex::pi56); + Rectangle::fill(rt, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PaletteIndex::pi56); + Rectangle::fill(rt, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PaletteIndex::pi56); // right vertical lines - GfxFillRect(rt, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PaletteIndex::pi56); - GfxFillRect(rt, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PaletteIndex::pi56); + Rectangle::fill(rt, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PaletteIndex::pi56); + Rectangle::fill(rt, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PaletteIndex::pi56); } void DrawTabImages(RenderTarget& rt) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index b8c0e43cc7..19f2443e19 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -1480,7 +1480,7 @@ namespace OpenRCT2::Ui::Windows int32_t rawValue = value; if (page != WINDOW_MAPGEN_PAGE_BASE) { - switch (Config::Get().general.MeasurementFormat) + switch (Config::Get().general.measurementFormat) { case MeasurementFormat::Imperial: value = FeetToMetres(value); diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 4566d6d2a5..17b58364d1 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -17,10 +17,13 @@ #include #include #include +#include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum @@ -137,7 +140,7 @@ namespace OpenRCT2::Ui::Windows static bool IsServerPlayerInvisible() { - return Network::IsServerPlayerInvisible() && !Config::Get().general.DebuggingTools; + return Network::IsServerPlayerInvisible() && !Config::Get().general.debuggingTools; } class MultiplayerWindow final : public Window @@ -267,7 +270,7 @@ namespace OpenRCT2::Ui::Windows auto colour = ColourWithFlags{ COLOUR_BLACK }; if (listPosition == selectedListItem) { - GfxFilterRect( + Rectangle::filter( rt, { 0, screenCoords.y, 800, screenCoords.y + kScrollableRowHeight - 1 }, FilterPaletteID::paletteDarken1); _buffer += Network::GetPlayerName(player); @@ -367,9 +370,9 @@ namespace OpenRCT2::Ui::Windows screenPos.y += 20; - GfxFillRectInset( + Rectangle::fillInset( rt, { screenPos - ScreenCoordsXY{ 0, 6 }, screenPos + ScreenCoordsXY{ 310, -5 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); + Rectangle::BorderStyle::inset); widget = &widgets[WIDX_SELECTED_GROUP]; group = Network::GetGroupIndex(_selectedGroup); @@ -390,7 +393,7 @@ namespace OpenRCT2::Ui::Windows auto screenCoords = ScreenCoordsXY{ 0, 0 }; auto rtCoords = ScreenCoordsXY{ rt.x, rt.y }; - GfxFillRect( + Rectangle::fill( rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); @@ -398,7 +401,7 @@ namespace OpenRCT2::Ui::Windows { if (i == selectedListItem) { - GfxFilterRect( + Rectangle::filter( rt, { 0, screenCoords.y, 800, screenCoords.y + kScrollableRowHeight - 1 }, FilterPaletteID::paletteDarken1); } @@ -589,15 +592,15 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_LOG_CHAT_CHECKBOX: - Config::Get().network.LogChat = !Config::Get().network.LogChat; + Config::Get().network.logChat = !Config::Get().network.logChat; Config::Save(); break; case WIDX_LOG_SERVER_ACTIONS_CHECKBOX: - Config::Get().network.LogServerActions = !Config::Get().network.LogServerActions; + Config::Get().network.logServerActions = !Config::Get().network.logServerActions; Config::Save(); break; case WIDX_KNOWN_KEYS_ONLY_CHECKBOX: - Config::Get().network.KnownKeysOnly = !Config::Get().network.KnownKeysOnly; + Config::Get().network.knownKeysOnly = !Config::Get().network.knownKeysOnly; Config::Save(); break; } @@ -692,9 +695,9 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_KNOWN_KEYS_ONLY_CHECKBOX].type = WidgetType::empty; } - setCheckboxValue(WIDX_LOG_CHAT_CHECKBOX, Config::Get().network.LogChat); - setCheckboxValue(WIDX_LOG_SERVER_ACTIONS_CHECKBOX, Config::Get().network.LogServerActions); - setCheckboxValue(WIDX_KNOWN_KEYS_ONLY_CHECKBOX, Config::Get().network.KnownKeysOnly); + setCheckboxValue(WIDX_LOG_CHAT_CHECKBOX, Config::Get().network.logChat); + setCheckboxValue(WIDX_LOG_SERVER_ACTIONS_CHECKBOX, Config::Get().network.logServerActions); + setCheckboxValue(WIDX_KNOWN_KEYS_ONLY_CHECKBOX, Config::Get().network.knownKeysOnly); break; } } diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index a84522fcf3..8e8168df88 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -111,7 +111,7 @@ namespace OpenRCT2::Ui::Windows */ void GetShopItems() { - BitSet items = {}; + BitSet items = {}; const auto& gameState = getGameState(); for (auto& curRide : RideManager(gameState)) { @@ -120,7 +120,7 @@ namespace OpenRCT2::Ui::Windows { for (const auto itemType : rideEntry->shop_item) { - if (itemType != ShopItem::None && GetShopItemDescriptor(itemType).IsFoodOrDrink()) + if (itemType != ShopItem::none && GetShopItemDescriptor(itemType).IsFoodOrDrink()) { items[EnumValue(itemType)] = true; } @@ -129,7 +129,7 @@ namespace OpenRCT2::Ui::Windows } ShopItems.clear(); - for (auto i = 0; i < EnumValue(ShopItem::Count); i++) + for (auto i = 0; i < EnumValue(ShopItem::count); i++) { if (items[i]) { diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 1f7fe749b4..8f7525c993 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include #include +using namespace OpenRCT2::Drawing; using namespace OpenRCT2::TrackMetaData; namespace OpenRCT2::Ui::Windows @@ -366,7 +368,7 @@ namespace OpenRCT2::Ui::Windows ContextOpenWindowView(WindowView::financesResearch); break; case WIDX_GROUP_BY_TRACK_TYPE: - Config::Get().interface.ListRideVehiclesSeparately = !Config::Get().interface.ListRideVehiclesSeparately; + Config::Get().interface.listRideVehiclesSeparately = !Config::Get().interface.listRideVehiclesSeparately; Config::Save(); PopulateRideList(); invalidate(); @@ -394,7 +396,7 @@ namespace OpenRCT2::Ui::Windows { SetPressedTab(); - if (!Config::Get().interface.ListRideVehiclesSeparately) + if (!Config::Get().interface.listRideVehiclesSeparately) pressedWidgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE); else pressedWidgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE); @@ -489,13 +491,14 @@ namespace OpenRCT2::Ui::Windows while (listItem->Type != kRideTypeNull || listItem->EntryIndex != kObjectEntryIndexNull) { // Draw flat button rectangle - int32_t buttonFlags = 0; - if (_newRideVars.SelectedRide == *listItem) - buttonFlags |= INSET_RECT_FLAG_BORDER_INSET; - if (_newRideVars.HighlightedRide == *listItem || buttonFlags != 0) - GfxFillRectInset( - rt, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1], - INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags); + const bool isSelected = _newRideVars.SelectedRide == *listItem; + if (_newRideVars.HighlightedRide == *listItem || isSelected) + { + const auto borderStyle = isSelected ? Rectangle::BorderStyle::inset : Rectangle::BorderStyle::outset; + Rectangle::fillInset( + rt, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1], borderStyle, + Rectangle::FillBrightness::dark); + } // Draw ride image with feathered border auto mask = ImageId(SPR_NEW_RIDE_MASK); @@ -695,7 +698,7 @@ namespace OpenRCT2::Ui::Windows auto* rideObj = objMgr.GetLoadedObject(rideEntryIndex); // Skip if the vehicle isn't the preferred vehicle for this generic track type - if (!Config::Get().interface.ListRideVehiclesSeparately + if (!Config::Get().interface.listRideVehiclesSeparately && !GetRideTypeDescriptor(rideType).HasFlag(RtdFlag::listVehiclesSeparately) && highestVehiclePriority > rideObj->GetEntry().BuildMenuPriority) { @@ -710,7 +713,7 @@ namespace OpenRCT2::Ui::Windows highestVehiclePriority = rideObj->GetEntry().BuildMenuPriority; // Determines how and where to draw a button for this ride type/vehicle. - if (Config::Get().interface.ListRideVehiclesSeparately + if (Config::Get().interface.listRideVehiclesSeparately || GetRideTypeDescriptor(rideType).HasFlag(RtdFlag::listVehiclesSeparately)) { // Separate, draw apart @@ -763,7 +766,7 @@ namespace OpenRCT2::Ui::Windows bool IsFilterInRideType(const RideObjectEntry& rideEntry) { - auto rideTypeName = GetRideNaming(rideEntry.ride_type[0], rideEntry).Name; + auto rideTypeName = GetRideNaming(rideEntry.ride_type[0], &rideEntry).Name; return String::contains(u8string_view(LanguageGetString(rideTypeName)), _filter, true); } @@ -921,7 +924,7 @@ namespace OpenRCT2::Ui::Windows auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); const auto* rideObj = objMgr.GetLoadedObject(item.EntryIndex); const auto& rideEntry = rideObj->GetEntry(); - RideNaming rideNaming = GetRideNaming(item.Type, rideEntry); + RideNaming rideNaming = GetRideNaming(item.Type, &rideEntry); auto ft = Formatter(); UpdateVehicleAvailability(item.Type); @@ -933,7 +936,7 @@ namespace OpenRCT2::Ui::Windows if (!_vehicleAvailability.empty()) { - if (Config::Get().interface.ListRideVehiclesSeparately) + if (Config::Get().interface.listRideVehiclesSeparately) { ft = Formatter(); ft.Add(rideEntry.naming.Name); @@ -979,7 +982,7 @@ namespace OpenRCT2::Ui::Windows } // Draw object author(s) if debugging tools are active - if (Config::Get().general.DebuggingTools && !rideObj->GetAuthors().empty()) + if (Config::Get().general.debuggingTools && !rideObj->GetAuthors().empty()) { const auto& authors = rideObj->GetAuthors(); diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 708f4dd5f3..394800e40e 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -25,9 +26,12 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr ScreenSize kWindowSize = { 400, 300 }; + static constexpr uint8_t kItemSeparatorHeight = 2; enum WindowNewsWidgetIdx { @@ -80,24 +84,24 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr NewsOption kNewsItemOptionDefinitions[] = { - { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(Config::Notification, ParkAward) }, - { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(Config::Notification, ParkMarketingCampaignFinished) }, - { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(Config::Notification, ParkWarnings) }, - { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(Config::Notification, ParkRatingWarnings) }, - { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(Config::Notification, RideBrokenDown) }, - { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(Config::Notification, RideCrashed) }, - { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CASUALTIES, offsetof(Config::Notification, RideCasualties) }, - { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(Config::Notification, RideWarnings) }, - { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(Config::Notification, RideResearched) }, - { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_VEHICLE_STALLED, offsetof(Config::Notification, RideStalledVehicles) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(Config::Notification, GuestWarnings) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(Config::Notification, GuestLeftPark) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(Config::Notification, GuestQueuingForRide) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(Config::Notification, GuestOnRide) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(Config::Notification, GuestLeftRide) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(Config::Notification, GuestBoughtItem) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(Config::Notification, GuestUsedFacility) }, - { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(Config::Notification, GuestDied) }, + { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(Config::Notification, parkAward) }, + { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(Config::Notification, parkMarketingCampaignFinished) }, + { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(Config::Notification, parkWarnings) }, + { STR_NEWS_GROUP_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(Config::Notification, parkRatingWarnings) }, + { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(Config::Notification, rideBrokenDown) }, + { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(Config::Notification, rideCrashed) }, + { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_CASUALTIES, offsetof(Config::Notification, rideCasualties) }, + { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(Config::Notification, rideWarnings) }, + { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(Config::Notification, rideResearched) }, + { STR_NEWS_GROUP_RIDE, STR_NOTIFICATION_RIDE_VEHICLE_STALLED, offsetof(Config::Notification, rideStalledVehicles) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(Config::Notification, guestWarnings) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(Config::Notification, guestLeftPark) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(Config::Notification, guestQueuingForRide) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(Config::Notification, guestOnRide) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(Config::Notification, guestLeftRide) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(Config::Notification, guestBoughtItem) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(Config::Notification, guestUsedFacility) }, + { STR_NEWS_GROUP_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(Config::Notification, guestDied) }, }; // clang-format on @@ -391,7 +395,8 @@ namespace OpenRCT2::Ui::Windows ScreenSize onScrollGetSize(int32_t scrollIndex) override { int32_t scrollHeight = static_cast(getGameState().newsItems.GetArchived().size()) - * CalculateNewsItemHeight(); + * CalculateNewsItemHeight() + - kItemSeparatorHeight; return { kWindowSize.width, scrollHeight }; } @@ -443,6 +448,11 @@ namespace OpenRCT2::Ui::Windows int32_t y = 0; int32_t i = 0; + const auto backgroundPaletteIndex = ColourMapA[colours[3].colour].light; + // Fill the scrollbar gap if no scrollbar is visible + const bool scrollbarVisible = scrolls[0].contentHeight > widgets[WIDX_SCROLL].height(); + const auto scrollbarFill = scrollbarVisible ? 0 : kScrollBarWidth; + for (const auto& newsItem : getGameState().newsItems.GetArchived()) { if (y >= rt.y + rt.height) @@ -454,10 +464,12 @@ namespace OpenRCT2::Ui::Windows continue; } + // Outer frame + Rectangle::fillInset( + rt, { -1, y, 383 + scrollbarFill, y + itemHeight - 1 }, colours[1], Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::light, Rectangle::FillMode::none); // Background - GfxFillRectInset( - rt, { -1, y, 383, y + itemHeight - 1 }, colours[1], - (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_GREY)); + Rectangle::fill(rt, { 0, y + 1, 381 + scrollbarFill, y + itemHeight - 2 }, backgroundPaletteIndex); // Date text { @@ -477,18 +489,19 @@ namespace OpenRCT2::Ui::Windows // Subject button if ((newsItem.typeHasSubject()) && !(newsItem.hasButton())) { - auto screenCoords = ScreenCoordsXY{ 328, y + lineHeight + 4 }; + auto screenCoords = ScreenCoordsXY{ 328 + scrollbarFill, y + lineHeight + 4 }; - int32_t press = 0; + auto borderStyle = Rectangle::BorderStyle::outset; if (_pressedNewsItemIndex != -1) { News::IsValidIndex(_pressedNewsItemIndex + News::ItemHistoryStart); if (i == _pressedNewsItemIndex && _pressedButtonIndex == 1) { - press = INSET_RECT_FLAG_BORDER_INSET; + borderStyle = Rectangle::BorderStyle::inset; } } - GfxFillRectInset(rt, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press); + Rectangle::fillInset( + rt, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], borderStyle); switch (newsItem.type) { @@ -514,7 +527,7 @@ namespace OpenRCT2::Ui::Windows // If normal peep set sprite to normal (no food) // If staff set sprite to staff sprite - auto spriteType = PeepAnimationGroup::Normal; + auto spriteType = PeepAnimationGroup::normal; if (auto* staff = peep->As(); staff != nullptr) { spriteType = staff->AnimationGroup; @@ -527,7 +540,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - ImageIndex imageId = animObj->GetPeepAnimation(spriteType).base_image + 1; + ImageIndex imageId = animObj->GetPeepAnimation(spriteType).baseImage + 1; auto image = ImageId(imageId, peep->TshirtColour, peep->TrousersColour); GfxDrawSprite(clippedRT, image, clipCoords); break; @@ -558,16 +571,17 @@ namespace OpenRCT2::Ui::Windows // Location button if ((newsItem.typeHasLocation()) && !(newsItem.hasButton())) { - auto screenCoords = ScreenCoordsXY{ 352, y + lineHeight + 4 }; + auto screenCoords = ScreenCoordsXY{ 352 + scrollbarFill, y + lineHeight + 4 }; - int32_t press = 0; + auto borderStyle = Rectangle::BorderStyle::outset; if (_pressedNewsItemIndex != -1) { News::IsValidIndex(_pressedNewsItemIndex + News::ItemHistoryStart); if (i == _pressedNewsItemIndex && _pressedButtonIndex == 2) - press = 0x20; + borderStyle = Rectangle::BorderStyle::inset; } - GfxFillRectInset(rt, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press); + Rectangle::fillInset( + rt, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], borderStyle); GfxDrawSprite(rt, ImageId(SPR_LOCATE), screenCoords); } diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index cfd5dcc105..aa9d04ec0f 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { #ifndef DISABLE_HTTP @@ -510,7 +513,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDraw(const int32_t scrollIndex, RenderTarget& rt) override { auto rtCoords = ScreenCoordsXY{ rt.x, rt.y }; - GfxFillRect( + Rectangle::fill( rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); const int32_t listWidth = widgets[WIDX_SCROLL].width(); @@ -529,11 +532,11 @@ namespace OpenRCT2::Ui::Windows { listWidth, screenCoords.y + kScrollableRowHeight - 1 } }; // If hovering over item, change the color and fill the backdrop. if (i == selectedListItem) - GfxFillRect(rt, screenRect, ColourMapA[colours[1].colour].darker); + Rectangle::fill(rt, screenRect, ColourMapA[colours[1].colour].darker); else if (i == _highlightedIndex) - GfxFillRect(rt, screenRect, ColourMapA[colours[1].colour].mid_dark); + Rectangle::fill(rt, screenRect, ColourMapA[colours[1].colour].mid_dark); else if ((i & 1) != 0) // odd / even check - GfxFillRect(rt, screenRect, ColourMapA[colours[1].colour].light); + Rectangle::fill(rt, screenRect, ColourMapA[colours[1].colour].light); // Draw the actual object entry's name... screenCoords.x = kNameColLeft - 3; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 982b7401cf..471e03e2b0 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -785,22 +785,22 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_SHOW_FPS_CHECKBOX: - Config::Get().general.ShowFPS ^= 1; + Config::Get().general.showFPS ^= 1; Config::Save(); invalidate(); break; case WIDX_MULTITHREADING_CHECKBOX: - Config::Get().general.MultiThreading ^= 1; + Config::Get().general.multiThreading ^= 1; Config::Save(); invalidate(); break; case WIDX_MINIMIZE_FOCUS_LOSS: - Config::Get().general.MinimizeFullscreenFocusLoss ^= 1; + Config::Get().general.minimizeFullscreenFocusLoss ^= 1; Config::Save(); invalidate(); break; case WIDX_DISABLE_SCREENSAVER_LOCK: - Config::Get().general.DisableScreensaver ^= 1; + Config::Get().general.disableScreensaver ^= 1; ApplyScreenSaverLockSetting(); Config::Save(); invalidate(); @@ -828,8 +828,8 @@ namespace OpenRCT2::Ui::Windows ft.Add(resolution.Height); gDropdown.items[i] = Dropdown::MenuLabel(STR_RESOLUTION_X_BY_Y, ft); - if (resolution.Width == Config::Get().general.FullscreenWidth - && resolution.Height == Config::Get().general.FullscreenHeight) + if (resolution.Width == Config::Get().general.fullscreenWidth + && resolution.Height == Config::Get().general.fullscreenHeight) { selectedResolution = static_cast(i); } @@ -851,7 +851,7 @@ namespace OpenRCT2::Ui::Windows ShowDropdown(widget, 3); - gDropdown.items[Config::Get().general.FullscreenMode].setChecked(true); + gDropdown.items[Config::Get().general.fullscreenMode].setChecked(true); break; case WIDX_DRAWING_ENGINE_DROPDOWN: { @@ -861,19 +861,19 @@ namespace OpenRCT2::Ui::Windows gDropdown.items[i] = Dropdown::MenuLabel(kDrawingEngineStringIds[i]); } ShowDropdown(widget, numItems); - gDropdown.items[EnumValue(Config::Get().general.DrawingEngine)].setChecked(true); + gDropdown.items[EnumValue(Config::Get().general.drawingEngine)].setChecked(true); break; } case WIDX_SCALE_UP: - Config::Get().general.WindowScale += 0.25f; + Config::Get().general.windowScale += 0.25f; Config::Save(); GfxInvalidateScreen(); ContextTriggerResize(); ContextUpdateCursorScale(); break; case WIDX_SCALE_DOWN: - Config::Get().general.WindowScale -= 0.25f; - Config::Get().general.WindowScale = std::max(0.5f, Config::Get().general.WindowScale); + Config::Get().general.windowScale -= 0.25f; + Config::Get().general.windowScale = std::max(0.5f, Config::Get().general.windowScale); Config::Save(); GfxInvalidateScreen(); ContextTriggerResize(); @@ -889,9 +889,9 @@ namespace OpenRCT2::Ui::Windows auto& config = Config::Get().general; auto activeItem = 0; - if (config.UncapFPS) + if (config.uncapFPS) { - activeItem = config.UseVSync ? 1 : 2; + activeItem = config.useVSync ? 1 : 2; } gDropdown.items[activeItem].setChecked(true); @@ -909,13 +909,13 @@ namespace OpenRCT2::Ui::Windows const auto& resolutions = OpenRCT2::GetContext()->GetUiContext().GetFullscreenResolutions(); const Resolution& resolution = resolutions[dropdownIndex]; - if (resolution.Width != Config::Get().general.FullscreenWidth - || resolution.Height != Config::Get().general.FullscreenHeight) + if (resolution.Width != Config::Get().general.fullscreenWidth + || resolution.Height != Config::Get().general.fullscreenHeight) { - Config::Get().general.FullscreenWidth = resolution.Width; - Config::Get().general.FullscreenHeight = resolution.Height; + Config::Get().general.fullscreenWidth = resolution.Width; + Config::Get().general.fullscreenHeight = resolution.Height; - if (Config::Get().general.FullscreenMode + if (Config::Get().general.fullscreenMode == static_cast(OpenRCT2::Ui::FullscreenMode::fullscreen)) ContextSetFullscreenMode(static_cast(OpenRCT2::Ui::FullscreenMode::fullscreen)); @@ -925,21 +925,21 @@ namespace OpenRCT2::Ui::Windows break; } case WIDX_FULLSCREEN_DROPDOWN: - if (dropdownIndex != Config::Get().general.FullscreenMode) + if (dropdownIndex != Config::Get().general.fullscreenMode) { ContextSetFullscreenMode(dropdownIndex); - Config::Get().general.FullscreenMode = static_cast(dropdownIndex); + Config::Get().general.fullscreenMode = static_cast(dropdownIndex); Config::Save(); GfxInvalidateScreen(); } break; case WIDX_DRAWING_ENGINE_DROPDOWN: - if (dropdownIndex != EnumValue(Config::Get().general.DrawingEngine)) + if (dropdownIndex != EnumValue(Config::Get().general.drawingEngine)) { DrawingEngine dstEngine = static_cast(dropdownIndex); - Config::Get().general.DrawingEngine = dstEngine; + Config::Get().general.drawingEngine = dstEngine; RefreshVideo(); Config::Save(); invalidate(); @@ -951,20 +951,20 @@ namespace OpenRCT2::Ui::Windows switch (dropdownIndex) { case 0: // vanilla - config.UncapFPS = 0; - config.UseVSync = 0; + config.uncapFPS = 0; + config.useVSync = 0; break; case 1: // vsync - config.UncapFPS = 1; - config.UseVSync = 1; + config.uncapFPS = 1; + config.useVSync = 1; break; case 2: // uncapped - config.UncapFPS = 1; - config.UseVSync = 0; + config.uncapFPS = 1; + config.useVSync = 0; break; } - DrawingEngineSetVSync(config.UseVSync); + DrawingEngineSetVSync(config.useVSync); Config::Save(); invalidate(); break; @@ -977,11 +977,11 @@ namespace OpenRCT2::Ui::Windows // Resolution dropdown caption. auto ft = Formatter::Common(); ft.Increment(16); - ft.Add(static_cast(Config::Get().general.FullscreenWidth)); - ft.Add(static_cast(Config::Get().general.FullscreenHeight)); + ft.Add(static_cast(Config::Get().general.fullscreenWidth)); + ft.Add(static_cast(Config::Get().general.fullscreenHeight)); // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" - if (Config::Get().general.FullscreenMode != static_cast(OpenRCT2::Ui::FullscreenMode::fullscreen)) + if (Config::Get().general.fullscreenMode != static_cast(OpenRCT2::Ui::FullscreenMode::fullscreen)) { disabledWidgets |= (1uLL << WIDX_RESOLUTION_DROPDOWN); disabledWidgets |= (1uLL << WIDX_RESOLUTION); @@ -994,14 +994,14 @@ namespace OpenRCT2::Ui::Windows disabledWidgets &= ~(1uLL << WIDX_RESOLUTION_LABEL); } - setCheckboxValue(WIDX_SHOW_FPS_CHECKBOX, Config::Get().general.ShowFPS); - setCheckboxValue(WIDX_MULTITHREADING_CHECKBOX, Config::Get().general.MultiThreading); - setCheckboxValue(WIDX_MINIMIZE_FOCUS_LOSS, Config::Get().general.MinimizeFullscreenFocusLoss); - setCheckboxValue(WIDX_DISABLE_SCREENSAVER_LOCK, Config::Get().general.DisableScreensaver); + setCheckboxValue(WIDX_SHOW_FPS_CHECKBOX, Config::Get().general.showFPS); + setCheckboxValue(WIDX_MULTITHREADING_CHECKBOX, Config::Get().general.multiThreading); + setCheckboxValue(WIDX_MINIMIZE_FOCUS_LOSS, Config::Get().general.minimizeFullscreenFocusLoss); + setCheckboxValue(WIDX_DISABLE_SCREENSAVER_LOCK, Config::Get().general.disableScreensaver); // Dropdown captions for straightforward strings. - widgets[WIDX_FULLSCREEN].text = FullscreenModeNames[Config::Get().general.FullscreenMode]; - widgets[WIDX_DRAWING_ENGINE].text = kDrawingEngineStringIds[EnumValue(Config::Get().general.DrawingEngine)]; + widgets[WIDX_FULLSCREEN].text = FullscreenModeNames[Config::Get().general.fullscreenMode]; + widgets[WIDX_DRAWING_ENGINE].text = kDrawingEngineStringIds[EnumValue(Config::Get().general.drawingEngine)]; static constexpr StringId kFrameRateLimitStringIds[] = { STR_FRAME_RATE_LIMIT_DEFAULT, @@ -1011,9 +1011,9 @@ namespace OpenRCT2::Ui::Windows auto& config = Config::Get().general; auto activeItem = 0; - if (config.UncapFPS) + if (config.uncapFPS) { - activeItem = config.UseVSync ? 1 : 2; + activeItem = config.useVSync ? 1 : 2; } widgets[WIDX_FRAME_RATE_LIMIT].text = kFrameRateLimitStringIds[activeItem]; } @@ -1021,7 +1021,7 @@ namespace OpenRCT2::Ui::Windows void DisplayDraw(RenderTarget& rt) { auto ft = Formatter(); - ft.Add(static_cast(Config::Get().general.WindowScale * 100)); + ft.Add(static_cast(Config::Get().general.windowScale * 100)); DrawTextBasic( rt, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 }, STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { colours[1] }); @@ -1034,19 +1034,19 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_TILE_SMOOTHING_CHECKBOX: - Config::Get().general.LandscapeSmoothing ^= 1; + Config::Get().general.landscapeSmoothing ^= 1; Config::Save(); GfxInvalidateScreen(); break; case WIDX_GRIDLINES_CHECKBOX: { - Config::Get().general.AlwaysShowGridlines ^= 1; + Config::Get().general.alwaysShowGridlines ^= 1; Config::Save(); GfxInvalidateScreen(); WindowBase* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - if (Config::Get().general.AlwaysShowGridlines) + if (Config::Get().general.alwaysShowGridlines) mainWindow->viewport->flags |= VIEWPORT_FLAG_GRIDLINES; else mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; @@ -1054,45 +1054,45 @@ namespace OpenRCT2::Ui::Windows break; } case WIDX_DAY_NIGHT_CHECKBOX: - Config::Get().general.DayNightCycle ^= 1; + Config::Get().general.dayNightCycle ^= 1; Config::Save(); invalidate(); break; case WIDX_ENABLE_LIGHT_FX_CHECKBOX: - Config::Get().general.EnableLightFx ^= 1; + Config::Get().general.enableLightFx ^= 1; Config::Save(); invalidate(); break; case WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX: - Config::Get().general.EnableLightFxForVehicles ^= 1; + Config::Get().general.enableLightFxForVehicles ^= 1; Config::Save(); invalidate(); break; case WIDX_UPPER_CASE_BANNERS_CHECKBOX: - Config::Get().general.UpperCaseBanners ^= 1; + Config::Get().general.upperCaseBanners ^= 1; Config::Save(); invalidate(); ScrollingTextInvalidate(); break; case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX: - Config::Get().general.DisableLightningEffect ^= 1; + Config::Get().general.disableLightningEffect ^= 1; Config::Save(); invalidate(); break; case WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX: - Config::Get().general.RenderWeatherEffects ^= 1; - Config::Get().general.RenderWeatherGloom = Config::Get().general.RenderWeatherEffects; + Config::Get().general.renderWeatherEffects ^= 1; + Config::Get().general.renderWeatherGloom = Config::Get().general.renderWeatherEffects; Config::Save(); invalidate(); GfxInvalidateScreen(); break; case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX: - Config::Get().general.ShowGuestPurchases ^= 1; + Config::Get().general.showGuestPurchases ^= 1; Config::Save(); invalidate(); break; case WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX: - Config::Get().general.TransparentScreenshot ^= 1; + Config::Get().general.transparentScreenshot ^= 1; Config::Save(); invalidate(); break; @@ -1111,7 +1111,7 @@ namespace OpenRCT2::Ui::Windows Widget* widget = &widgets[widgetIndex - 1]; ShowDropdown(widget, 3); - gDropdown.items[static_cast(Config::Get().general.VirtualFloorStyle)].setChecked(true); + gDropdown.items[static_cast(Config::Get().general.virtualFloorStyle)].setChecked(true); break; } } @@ -1121,7 +1121,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_VIRTUAL_FLOOR_DROPDOWN: - Config::Get().general.VirtualFloorStyle = static_cast(dropdownIndex); + Config::Get().general.virtualFloorStyle = static_cast(dropdownIndex); Config::Save(); break; } @@ -1129,12 +1129,12 @@ namespace OpenRCT2::Ui::Windows void RenderingPrepareDraw() { - setCheckboxValue(WIDX_TILE_SMOOTHING_CHECKBOX, Config::Get().general.LandscapeSmoothing); - setCheckboxValue(WIDX_GRIDLINES_CHECKBOX, Config::Get().general.AlwaysShowGridlines); - setCheckboxValue(WIDX_DAY_NIGHT_CHECKBOX, Config::Get().general.DayNightCycle); - setCheckboxValue(WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, Config::Get().general.ShowGuestPurchases); - setCheckboxValue(WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, Config::Get().general.TransparentScreenshot); - setCheckboxValue(WIDX_UPPER_CASE_BANNERS_CHECKBOX, Config::Get().general.UpperCaseBanners); + setCheckboxValue(WIDX_TILE_SMOOTHING_CHECKBOX, Config::Get().general.landscapeSmoothing); + setCheckboxValue(WIDX_GRIDLINES_CHECKBOX, Config::Get().general.alwaysShowGridlines); + setCheckboxValue(WIDX_DAY_NIGHT_CHECKBOX, Config::Get().general.dayNightCycle); + setCheckboxValue(WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, Config::Get().general.showGuestPurchases); + setCheckboxValue(WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, Config::Get().general.transparentScreenshot); + setCheckboxValue(WIDX_UPPER_CASE_BANNERS_CHECKBOX, Config::Get().general.upperCaseBanners); static constexpr StringId _virtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED, @@ -1142,38 +1142,38 @@ namespace OpenRCT2::Ui::Windows STR_VIRTUAL_FLOOR_STYLE_GLASSY, }; - widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[EnumValue(Config::Get().general.VirtualFloorStyle)]; + widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[EnumValue(Config::Get().general.virtualFloorStyle)]; - setCheckboxValue(WIDX_ENABLE_LIGHT_FX_CHECKBOX, Config::Get().general.EnableLightFx); - if (Config::Get().general.DayNightCycle - && Config::Get().general.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay) + setCheckboxValue(WIDX_ENABLE_LIGHT_FX_CHECKBOX, Config::Get().general.enableLightFx); + if (Config::Get().general.dayNightCycle + && Config::Get().general.drawingEngine == DrawingEngine::SoftwareWithHardwareDisplay) { disabledWidgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); } else { disabledWidgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); - Config::Get().general.EnableLightFx = false; + Config::Get().general.enableLightFx = false; } - setCheckboxValue(WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, Config::Get().general.EnableLightFxForVehicles); - if (Config::Get().general.DayNightCycle - && Config::Get().general.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay - && Config::Get().general.EnableLightFx) + setCheckboxValue(WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, Config::Get().general.enableLightFxForVehicles); + if (Config::Get().general.dayNightCycle + && Config::Get().general.drawingEngine == DrawingEngine::SoftwareWithHardwareDisplay + && Config::Get().general.enableLightFx) { disabledWidgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); } else { disabledWidgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); - Config::Get().general.EnableLightFxForVehicles = false; + Config::Get().general.enableLightFxForVehicles = false; } setCheckboxValue( WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX, - Config::Get().general.RenderWeatherEffects || Config::Get().general.RenderWeatherGloom); - setCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, Config::Get().general.DisableLightningEffect); - if (!Config::Get().general.RenderWeatherEffects && !Config::Get().general.RenderWeatherGloom) + Config::Get().general.renderWeatherEffects || Config::Get().general.renderWeatherGloom); + setCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, Config::Get().general.disableLightningEffect); + if (!Config::Get().general.renderWeatherEffects && !Config::Get().general.renderWeatherGloom) { setCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, true); disabledWidgets |= (1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); @@ -1199,15 +1199,15 @@ namespace OpenRCT2::Ui::Windows ShowDropdown(widget, 2); - gDropdown.items[Config::Get().general.ShowHeightAsUnits ? 0 : 1].setChecked(true); + gDropdown.items[Config::Get().general.showHeightAsUnits ? 0 : 1].setChecked(true); break; case WIDX_CURRENCY_DROPDOWN: { // All the currencies plus the separator - constexpr auto numItems = EnumValue(CurrencyType::Count) + 1; + constexpr auto numItems = EnumValue(CurrencyType::count) + 1; // All the currencies except custom currency - constexpr size_t numOrdinaryCurrencies = EnumValue(CurrencyType::Count) - 1; + constexpr size_t numOrdinaryCurrencies = EnumValue(CurrencyType::count) - 1; for (size_t i = 0; i < numOrdinaryCurrencies; i++) { @@ -1217,17 +1217,17 @@ namespace OpenRCT2::Ui::Windows gDropdown.items[numOrdinaryCurrencies] = Dropdown::Separator(); gDropdown.items[numOrdinaryCurrencies + 1] = Dropdown::MenuLabel( - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].stringId); + CurrencyDescriptors[EnumValue(CurrencyType::custom)].stringId); ShowDropdown(widget, numItems); - if (Config::Get().general.CurrencyFormat == CurrencyType::Custom) + if (Config::Get().general.currencyFormat == CurrencyType::custom) { - gDropdown.items[EnumValue(Config::Get().general.CurrencyFormat) + 1].setChecked(true); + gDropdown.items[EnumValue(Config::Get().general.currencyFormat) + 1].setChecked(true); } else { - gDropdown.items[EnumValue(Config::Get().general.CurrencyFormat)].setChecked(true); + gDropdown.items[EnumValue(Config::Get().general.currencyFormat)].setChecked(true); } break; } @@ -1238,7 +1238,7 @@ namespace OpenRCT2::Ui::Windows ShowDropdown(widget, 3); - gDropdown.items[static_cast(Config::Get().general.MeasurementFormat)].setChecked(true); + gDropdown.items[static_cast(Config::Get().general.measurementFormat)].setChecked(true); break; case WIDX_TEMPERATURE_DROPDOWN: gDropdown.items[0] = Dropdown::MenuLabel(STR_CELSIUS); @@ -1246,7 +1246,7 @@ namespace OpenRCT2::Ui::Windows ShowDropdown(widget, 2); - gDropdown.items[static_cast(Config::Get().general.TemperatureFormat)].setChecked(true); + gDropdown.items[static_cast(Config::Get().general.temperatureFormat)].setChecked(true); break; case WIDX_LANGUAGE_DROPDOWN: for (size_t i = 1; i < LANGUAGE_COUNT; i++) @@ -1262,7 +1262,7 @@ namespace OpenRCT2::Ui::Windows gDropdown.items[i] = Dropdown::MenuLabel(DateFormatStringIDs[i]); } ShowDropdown(widget, 4); - gDropdown.items[Config::Get().general.DateFormat].setChecked(true); + gDropdown.items[Config::Get().general.dateFormat].setChecked(true); break; } } @@ -1273,37 +1273,37 @@ namespace OpenRCT2::Ui::Windows { case WIDX_HEIGHT_LABELS_DROPDOWN: // reset flag and set it to 1 if height as units is selected - Config::Get().general.ShowHeightAsUnits = 0; + Config::Get().general.showHeightAsUnits = 0; if (dropdownIndex == 0) { - Config::Get().general.ShowHeightAsUnits = 1; + Config::Get().general.showHeightAsUnits = 1; } Config::Save(); UpdateHeightMarkers(); break; case WIDX_CURRENCY_DROPDOWN: - if (dropdownIndex == EnumValue(CurrencyType::Custom) + 1) + if (dropdownIndex == EnumValue(CurrencyType::custom) + 1) { // Add 1 because the separator occupies a position - Config::Get().general.CurrencyFormat = static_cast(dropdownIndex - 1); + Config::Get().general.currencyFormat = static_cast(dropdownIndex - 1); ContextOpenWindow(WindowClass::customCurrencyConfig); } else { - Config::Get().general.CurrencyFormat = static_cast(dropdownIndex); + Config::Get().general.currencyFormat = static_cast(dropdownIndex); } Config::Save(); GfxInvalidateScreen(); break; case WIDX_DISTANCE_DROPDOWN: - Config::Get().general.MeasurementFormat = static_cast(dropdownIndex); + Config::Get().general.measurementFormat = static_cast(dropdownIndex); Config::Save(); UpdateHeightMarkers(); break; case WIDX_TEMPERATURE_DROPDOWN: - if (dropdownIndex != static_cast(Config::Get().general.TemperatureFormat)) + if (dropdownIndex != static_cast(Config::Get().general.temperatureFormat)) { - Config::Get().general.TemperatureFormat = static_cast(dropdownIndex); + Config::Get().general.temperatureFormat = static_cast(dropdownIndex); Config::Save(); GfxInvalidateScreen(); } @@ -1327,7 +1327,7 @@ namespace OpenRCT2::Ui::Windows } else { - Config::Get().general.Language = dropdownIndex + 1; + Config::Get().general.language = dropdownIndex + 1; Config::Save(); GfxInvalidateScreen(); } @@ -1335,9 +1335,9 @@ namespace OpenRCT2::Ui::Windows } break; case WIDX_DATE_FORMAT_DROPDOWN: - if (dropdownIndex != Config::Get().general.DateFormat) + if (dropdownIndex != Config::Get().general.dateFormat) { - Config::Get().general.DateFormat = static_cast(dropdownIndex); + Config::Get().general.dateFormat = static_cast(dropdownIndex); Config::Save(); GfxInvalidateScreen(); } @@ -1352,12 +1352,12 @@ namespace OpenRCT2::Ui::Windows ft.Add(LanguagesDescriptors[LocalisationService_GetCurrentLanguage()].native_name); // Currency: pounds, dollars, etc. (10 total) - widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)].stringId; + widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)].stringId; // Distance: metric / imperial / si { StringId stringId = kStringIdNone; - switch (Config::Get().general.MeasurementFormat) + switch (Config::Get().general.measurementFormat) { case MeasurementFormat::Imperial: stringId = STR_IMPERIAL; @@ -1373,15 +1373,15 @@ namespace OpenRCT2::Ui::Windows } // Date format - widgets[WIDX_DATE_FORMAT].text = DateFormatStringIDs[Config::Get().general.DateFormat]; + widgets[WIDX_DATE_FORMAT].text = DateFormatStringIDs[Config::Get().general.dateFormat]; // Temperature: celsius/fahrenheit - widgets[WIDX_TEMPERATURE].text = Config::Get().general.TemperatureFormat == TemperatureUnit::Fahrenheit + widgets[WIDX_TEMPERATURE].text = Config::Get().general.temperatureFormat == TemperatureUnit::Fahrenheit ? STR_FAHRENHEIT : STR_CELSIUS; // Height: units/real values - widgets[WIDX_HEIGHT_LABELS].text = Config::Get().general.ShowHeightAsUnits ? STR_HEIGHT_IN_UNITS : STR_REAL_VALUES; + widgets[WIDX_HEIGHT_LABELS].text = Config::Get().general.showHeightAsUnits ? STR_HEIGHT_IN_UNITS : STR_REAL_VALUES; } #pragma endregion @@ -1392,15 +1392,15 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_SOUND_CHECKBOX: - Config::Get().sound.SoundEnabled = !Config::Get().sound.SoundEnabled; + Config::Get().sound.soundEnabled = !Config::Get().sound.soundEnabled; Config::Save(); invalidate(); break; case WIDX_MASTER_SOUND_CHECKBOX: { - Config::Get().sound.MasterSoundEnabled = !Config::Get().sound.MasterSoundEnabled; - if (!Config::Get().sound.MasterSoundEnabled) + Config::Get().sound.masterSoundEnabled = !Config::Get().sound.masterSoundEnabled; + if (!Config::Get().sound.masterSoundEnabled) OpenRCT2::Audio::Pause(); else OpenRCT2::Audio::Resume(); @@ -1413,8 +1413,8 @@ namespace OpenRCT2::Ui::Windows } case WIDX_MUSIC_CHECKBOX: - Config::Get().sound.RideMusicEnabled = !Config::Get().sound.RideMusicEnabled; - if (!Config::Get().sound.RideMusicEnabled) + Config::Get().sound.rideMusicEnabled = !Config::Get().sound.rideMusicEnabled; + if (!Config::Get().sound.rideMusicEnabled) { OpenRCT2::RideAudio::StopAllChannels(); } @@ -1423,7 +1423,7 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_AUDIO_FOCUS_CHECKBOX: - Config::Get().sound.audio_focus = !Config::Get().sound.audio_focus; + Config::Get().sound.audioFocus = !Config::Get().sound.audioFocus; Config::Save(); invalidate(); break; @@ -1459,7 +1459,7 @@ namespace OpenRCT2::Ui::Windows if (theme.Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable) continue; - if (Config::Get().sound.TitleMusic == theme.Kind) + if (Config::Get().sound.titleMusic == theme.Kind) checkedIndex = numItems; gDropdown.items[numItems++] = Dropdown::MenuLabel(theme.Name); @@ -1483,13 +1483,13 @@ namespace OpenRCT2::Ui::Windows if (dropdownIndex == 0) { audioContext.SetOutputDevice(""); - Config::Get().sound.Device = ""; + Config::Get().sound.device = ""; } else { const auto& deviceName = GetDeviceName(dropdownIndex); audioContext.SetOutputDevice(deviceName); - Config::Get().sound.Device = deviceName; + Config::Get().sound.device = deviceName; } Config::Save(); OpenRCT2::Audio::PlayTitleMusic(); @@ -1507,12 +1507,12 @@ namespace OpenRCT2::Ui::Windows dropdownIndex++; } - Config::Get().sound.TitleMusic = TitleThemeOptions[dropdownIndex].Kind; + Config::Get().sound.titleMusic = TitleThemeOptions[dropdownIndex].Kind; Config::Save(); invalidate(); OpenRCT2::Audio::StopTitleMusic(); - if (Config::Get().sound.TitleMusic != TitleMusicKind::None) + if (Config::Get().sound.titleMusic != TitleMusicKind::None) { OpenRCT2::Audio::PlayTitleMusic(); } @@ -1526,9 +1526,9 @@ namespace OpenRCT2::Ui::Windows const auto& masterVolumeWidget = widgets[WIDX_MASTER_VOLUME]; const auto& masterVolumeScroll = scrolls[0]; uint8_t masterVolume = GetScrollPercentage(masterVolumeWidget, masterVolumeScroll); - if (masterVolume != Config::Get().sound.MasterVolume) + if (masterVolume != Config::Get().sound.masterVolume) { - Config::Get().sound.MasterVolume = masterVolume; + Config::Get().sound.masterVolume = masterVolume; Config::Save(); invalidateWidget(WIDX_MASTER_VOLUME); } @@ -1536,9 +1536,9 @@ namespace OpenRCT2::Ui::Windows const auto& soundVolumeWidget = widgets[WIDX_MASTER_VOLUME]; const auto& soundVolumeScroll = scrolls[1]; uint8_t soundVolume = GetScrollPercentage(soundVolumeWidget, soundVolumeScroll); - if (soundVolume != Config::Get().sound.SoundVolume) + if (soundVolume != Config::Get().sound.soundVolume) { - Config::Get().sound.SoundVolume = soundVolume; + Config::Get().sound.soundVolume = soundVolume; Config::Save(); invalidateWidget(WIDX_SOUND_VOLUME); } @@ -1546,9 +1546,9 @@ namespace OpenRCT2::Ui::Windows const auto& musicVolumeWidget = widgets[WIDX_MASTER_VOLUME]; const auto& musicVolumeScroll = scrolls[2]; uint8_t rideMusicVolume = GetScrollPercentage(musicVolumeWidget, musicVolumeScroll); - if (rideMusicVolume != Config::Get().sound.AudioFocus) + if (rideMusicVolume != Config::Get().sound.rideMusicVolume) { - Config::Get().sound.AudioFocus = rideMusicVolume; + Config::Get().sound.rideMusicVolume = rideMusicVolume; Config::Save(); invalidateWidget(WIDX_MUSIC_VOLUME); } @@ -1598,7 +1598,7 @@ namespace OpenRCT2::Ui::Windows StringId GetTitleMusicName() const { auto theme = std::find_if(std::begin(TitleThemeOptions), std::end(TitleThemeOptions), [](auto&& option) { - return Config::Get().sound.TitleMusic == option.Kind; + return Config::Get().sound.titleMusic == option.Kind; }); if (theme != std::end(TitleThemeOptions)) return theme->Name; @@ -1636,19 +1636,19 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_TITLE_MUSIC].text = GetTitleMusicName(); - setCheckboxValue(WIDX_SOUND_CHECKBOX, Config::Get().sound.SoundEnabled); - setCheckboxValue(WIDX_MASTER_SOUND_CHECKBOX, Config::Get().sound.MasterSoundEnabled); - setCheckboxValue(WIDX_MUSIC_CHECKBOX, Config::Get().sound.RideMusicEnabled); - setCheckboxValue(WIDX_AUDIO_FOCUS_CHECKBOX, Config::Get().sound.audio_focus); - widgetSetEnabled(*this, WIDX_SOUND_CHECKBOX, Config::Get().sound.MasterSoundEnabled); - widgetSetEnabled(*this, WIDX_MUSIC_CHECKBOX, Config::Get().sound.MasterSoundEnabled); + setCheckboxValue(WIDX_SOUND_CHECKBOX, Config::Get().sound.soundEnabled); + setCheckboxValue(WIDX_MASTER_SOUND_CHECKBOX, Config::Get().sound.masterSoundEnabled); + setCheckboxValue(WIDX_MUSIC_CHECKBOX, Config::Get().sound.rideMusicEnabled); + setCheckboxValue(WIDX_AUDIO_FOCUS_CHECKBOX, Config::Get().sound.audioFocus); + widgetSetEnabled(*this, WIDX_SOUND_CHECKBOX, Config::Get().sound.masterSoundEnabled); + widgetSetEnabled(*this, WIDX_MUSIC_CHECKBOX, Config::Get().sound.masterSoundEnabled); // Initialize only on first frame, otherwise the scrollbars won't be able to be modified if (currentFrame == 0) { - initialiseScrollPosition(WIDX_MASTER_VOLUME, 0, Config::Get().sound.MasterVolume); - initialiseScrollPosition(WIDX_SOUND_VOLUME, 1, Config::Get().sound.SoundVolume); - initialiseScrollPosition(WIDX_MUSIC_VOLUME, 2, Config::Get().sound.AudioFocus); + initialiseScrollPosition(WIDX_MASTER_VOLUME, 0, Config::Get().sound.masterVolume); + initialiseScrollPosition(WIDX_SOUND_VOLUME, 1, Config::Get().sound.soundVolume); + initialiseScrollPosition(WIDX_MUSIC_VOLUME, 2, Config::Get().sound.rideMusicVolume); } } @@ -1665,45 +1665,45 @@ namespace OpenRCT2::Ui::Windows ContextOpenWindow(WindowClass::keyboardShortcutList); break; case WIDX_SCREEN_EDGE_SCROLLING: - Config::Get().general.EdgeScrolling ^= 1; + Config::Get().general.edgeScrolling ^= 1; Config::Save(); invalidate(); break; case WIDX_TRAP_CURSOR: - Config::Get().general.TrapCursor ^= 1; + Config::Get().general.trapCursor ^= 1; Config::Save(); - ContextSetCursorTrap(Config::Get().general.TrapCursor); + ContextSetCursorTrap(Config::Get().general.trapCursor); invalidate(); break; case WIDX_ZOOM_TO_CURSOR: - Config::Get().general.ZoomToCursor ^= 1; + Config::Get().general.zoomToCursor ^= 1; Config::Save(); invalidate(); break; case WIDX_WINDOW_BUTTONS_ON_THE_LEFT: - Config::Get().interface.WindowButtonsOnTheLeft ^= 1; + Config::Get().interface.windowButtonsOnTheLeft ^= 1; Config::Save(); invalidate(); windowMgr->InvalidateAll(); WindowVisitEach([](WindowBase* w) { w->resizeFrame(); }); break; case WIDX_ENLARGED_UI: - Config::Get().interface.EnlargedUi ^= 1; - if (Config::Get().interface.EnlargedUi == false) - Config::Get().interface.TouchEnhancements = false; + Config::Get().interface.enlargedUi ^= 1; + if (Config::Get().interface.enlargedUi == false) + Config::Get().interface.touchEnhancements = false; Config::Save(); invalidate(); windowMgr->InvalidateAll(); WindowVisitEach([](WindowBase* w) { w->resizeFrame(); }); break; case WIDX_TOUCH_ENHANCEMENTS: - Config::Get().interface.TouchEnhancements ^= 1; + Config::Get().interface.touchEnhancements ^= 1; Config::Save(); invalidate(); windowMgr->InvalidateAll(); break; case WIDX_INVERT_DRAG: - Config::Get().general.InvertViewportDrag ^= 1; + Config::Get().general.invertViewportDrag ^= 1; Config::Save(); invalidate(); break; @@ -1712,15 +1712,15 @@ namespace OpenRCT2::Ui::Windows void ControlsPrepareDraw() { - setCheckboxValue(WIDX_SCREEN_EDGE_SCROLLING, Config::Get().general.EdgeScrolling); - setCheckboxValue(WIDX_TRAP_CURSOR, Config::Get().general.TrapCursor); - setCheckboxValue(WIDX_INVERT_DRAG, Config::Get().general.InvertViewportDrag); - setCheckboxValue(WIDX_ZOOM_TO_CURSOR, Config::Get().general.ZoomToCursor); - setCheckboxValue(WIDX_WINDOW_BUTTONS_ON_THE_LEFT, Config::Get().interface.WindowButtonsOnTheLeft); - setCheckboxValue(WIDX_ENLARGED_UI, Config::Get().interface.EnlargedUi); - setCheckboxValue(WIDX_TOUCH_ENHANCEMENTS, Config::Get().interface.TouchEnhancements); + setCheckboxValue(WIDX_SCREEN_EDGE_SCROLLING, Config::Get().general.edgeScrolling); + setCheckboxValue(WIDX_TRAP_CURSOR, Config::Get().general.trapCursor); + setCheckboxValue(WIDX_INVERT_DRAG, Config::Get().general.invertViewportDrag); + setCheckboxValue(WIDX_ZOOM_TO_CURSOR, Config::Get().general.zoomToCursor); + setCheckboxValue(WIDX_WINDOW_BUTTONS_ON_THE_LEFT, Config::Get().interface.windowButtonsOnTheLeft); + setCheckboxValue(WIDX_ENLARGED_UI, Config::Get().interface.enlargedUi); + setCheckboxValue(WIDX_TOUCH_ENHANCEMENTS, Config::Get().interface.touchEnhancements); - widgetSetEnabled(*this, WIDX_TOUCH_ENHANCEMENTS, Config::Get().interface.EnlargedUi); + widgetSetEnabled(*this, WIDX_TOUCH_ENHANCEMENTS, Config::Get().interface.enlargedUi); // Initialize scroll positions for sliders only on first frame if (currentFrame == 0) @@ -1754,31 +1754,31 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_TOOLBAR_BUTTONS_CENTRED: - ToggleToolbarSetting(Config::Get().interface.ToolbarButtonsCentred); + ToggleToolbarSetting(Config::Get().interface.toolbarButtonsCentred); break; case WIDX_TOOLBAR_SHOW_FINANCES: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowFinances); + ToggleToolbarSetting(Config::Get().interface.toolbarShowFinances); break; case WIDX_TOOLBAR_SHOW_RESEARCH: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowResearch); + ToggleToolbarSetting(Config::Get().interface.toolbarShowResearch); break; case WIDX_TOOLBAR_SHOW_CHEATS: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowCheats); + ToggleToolbarSetting(Config::Get().interface.toolbarShowCheats); break; case WIDX_TOOLBAR_SHOW_NEWS: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowNews); + ToggleToolbarSetting(Config::Get().interface.toolbarShowNews); break; case WIDX_TOOLBAR_SHOW_MUTE: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowMute); + ToggleToolbarSetting(Config::Get().interface.toolbarShowMute); break; case WIDX_TOOLBAR_SHOW_CHAT: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowChat); + ToggleToolbarSetting(Config::Get().interface.toolbarShowChat); break; case WIDX_TOOLBAR_SHOW_ZOOM: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowZoom); + ToggleToolbarSetting(Config::Get().interface.toolbarShowZoom); break; case WIDX_TOOLBAR_SHOW_ROTATE_ANTI_CLOCKWISE: - ToggleToolbarSetting(Config::Get().interface.ToolbarShowRotateAnticlockwise); + ToggleToolbarSetting(Config::Get().interface.toolbarShowRotateAnticlockwise); break; case WIDX_THEMES_BUTTON: ContextOpenWindow(WindowClass::themes); @@ -1827,15 +1827,15 @@ namespace OpenRCT2::Ui::Windows void InterfacePrepareDraw() { - setCheckboxValue(WIDX_TOOLBAR_BUTTONS_CENTRED, Config::Get().interface.ToolbarButtonsCentred); - setCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, Config::Get().interface.ToolbarShowFinances); - setCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, Config::Get().interface.ToolbarShowResearch); - setCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, Config::Get().interface.ToolbarShowCheats); - setCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, Config::Get().interface.ToolbarShowNews); - setCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, Config::Get().interface.ToolbarShowMute); - setCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, Config::Get().interface.ToolbarShowChat); - setCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, Config::Get().interface.ToolbarShowZoom); - setCheckboxValue(WIDX_TOOLBAR_SHOW_ROTATE_ANTI_CLOCKWISE, Config::Get().interface.ToolbarShowRotateAnticlockwise); + setCheckboxValue(WIDX_TOOLBAR_BUTTONS_CENTRED, Config::Get().interface.toolbarButtonsCentred); + setCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, Config::Get().interface.toolbarShowFinances); + setCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, Config::Get().interface.toolbarShowResearch); + setCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, Config::Get().interface.toolbarShowCheats); + setCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, Config::Get().interface.toolbarShowNews); + setCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, Config::Get().interface.toolbarShowMute); + setCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, Config::Get().interface.toolbarShowChat); + setCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, Config::Get().interface.toolbarShowZoom); + setCheckboxValue(WIDX_TOOLBAR_SHOW_ROTATE_ANTI_CLOCKWISE, Config::Get().interface.toolbarShowRotateAnticlockwise); size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); @@ -1851,43 +1851,43 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_REAL_NAMES_GUESTS_CHECKBOX: - Config::Get().general.ShowRealNamesOfGuests ^= 1; + Config::Get().general.showRealNamesOfGuests ^= 1; Config::Save(); invalidate(); PeepUpdateNames(); break; case WIDX_REAL_NAMES_STAFF_CHECKBOX: - Config::Get().general.ShowRealNamesOfStaff ^= 1; + Config::Get().general.showRealNamesOfStaff ^= 1; Config::Save(); invalidate(); PeepUpdateNames(); break; case WIDX_AUTO_STAFF_PLACEMENT: - Config::Get().general.AutoStaffPlacement ^= 1; + Config::Get().general.autoStaffPlacement ^= 1; Config::Save(); invalidate(); break; case WIDX_SCENARIO_UNLOCKING: { - Config::Get().general.ScenarioUnlockingEnabled ^= 1; + Config::Get().general.scenarioUnlockingEnabled ^= 1; Config::Save(); auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByClass(WindowClass::scenarioSelect); break; } case WIDX_AUTO_OPEN_SHOPS: - Config::Get().general.AutoOpenShops = !Config::Get().general.AutoOpenShops; + Config::Get().general.autoOpenShops = !Config::Get().general.autoOpenShops; Config::Save(); invalidate(); break; case WIDX_ALLOW_EARLY_COMPLETION: - Config::Get().general.AllowEarlyCompletion ^= 1; + Config::Get().general.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::GetMode() == Network::Mode::server) { auto setAllowEarlyCompletionAction = GameActions::ScenarioSetSettingAction( - GameActions::ScenarioSetSetting::AllowEarlyCompletion, Config::Get().general.AllowEarlyCompletion); + GameActions::ScenarioSetSetting::AllowEarlyCompletion, Config::Get().general.allowEarlyCompletion); GameActions::Execute(&setAllowEarlyCompletionAction, getGameState()); } Config::Save(); @@ -1919,7 +1919,7 @@ namespace OpenRCT2::Ui::Windows { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], Dropdown::Flag::StayOpen, numItems); - auto selectedIndex = Config::Get().interface.RandomTitleSequence + auto selectedIndex = Config::Get().interface.randomTitleSequence ? numItems - 1 : static_cast(TitleGetCurrentSequence()); gDropdown.items[selectedIndex].setChecked(true); @@ -1946,7 +1946,7 @@ namespace OpenRCT2::Ui::Windows } ShowDropdown(widget, 7); - gDropdown.items[Config::Get().general.DefaultInspectionInterval].setChecked(true); + gDropdown.items[Config::Get().general.defaultInspectionInterval].setChecked(true); break; } } @@ -1960,23 +1960,23 @@ namespace OpenRCT2::Ui::Windows auto numItems = static_cast(TitleSequenceManager::GetCount()); if (dropdownIndex < numItems && dropdownIndex != static_cast(TitleGetCurrentSequence())) { - Config::Get().interface.RandomTitleSequence = false; + Config::Get().interface.randomTitleSequence = false; TitleSequenceChangePreset(static_cast(dropdownIndex)); Config::Save(); invalidate(); } else if (dropdownIndex == numItems + 1) { - Config::Get().interface.RandomTitleSequence = true; + Config::Get().interface.randomTitleSequence = true; Config::Save(); invalidate(); } break; } case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: - if (dropdownIndex != Config::Get().general.DefaultInspectionInterval) + if (dropdownIndex != Config::Get().general.defaultInspectionInterval) { - Config::Get().general.DefaultInspectionInterval = static_cast(dropdownIndex); + Config::Get().general.defaultInspectionInterval = static_cast(dropdownIndex); Config::Save(); invalidate(); } @@ -1997,7 +1997,7 @@ namespace OpenRCT2::Ui::Windows void MiscPrepareDraw() { auto ft = Formatter::Common(); - if (Config::Get().interface.RandomTitleSequence) + if (Config::Get().interface.randomTitleSequence) { ft.Add(STR_TITLE_SEQUENCE_RANDOM); } @@ -2026,21 +2026,21 @@ namespace OpenRCT2::Ui::Windows } } - setCheckboxValue(WIDX_REAL_NAMES_GUESTS_CHECKBOX, Config::Get().general.ShowRealNamesOfGuests); - setCheckboxValue(WIDX_REAL_NAMES_STAFF_CHECKBOX, Config::Get().general.ShowRealNamesOfStaff); - setCheckboxValue(WIDX_AUTO_STAFF_PLACEMENT, Config::Get().general.AutoStaffPlacement); - setCheckboxValue(WIDX_AUTO_OPEN_SHOPS, Config::Get().general.AutoOpenShops); - setCheckboxValue(WIDX_ALLOW_EARLY_COMPLETION, Config::Get().general.AllowEarlyCompletion); + setCheckboxValue(WIDX_REAL_NAMES_GUESTS_CHECKBOX, Config::Get().general.showRealNamesOfGuests); + setCheckboxValue(WIDX_REAL_NAMES_STAFF_CHECKBOX, Config::Get().general.showRealNamesOfStaff); + setCheckboxValue(WIDX_AUTO_STAFF_PLACEMENT, Config::Get().general.autoStaffPlacement); + setCheckboxValue(WIDX_AUTO_OPEN_SHOPS, Config::Get().general.autoOpenShops); + setCheckboxValue(WIDX_ALLOW_EARLY_COMPLETION, Config::Get().general.allowEarlyCompletion); if (Config::Get().interface.scenarioPreviewScreenshots) widgets[WIDX_SCENARIO_PREVIEWS].text = STR_SCENARIO_PREVIEWS_SCREENSHOTS; else widgets[WIDX_SCENARIO_PREVIEWS].text = STR_SCENARIO_PREVIEWS_MINIMAPS; - setCheckboxValue(WIDX_SCENARIO_UNLOCKING, Config::Get().general.ScenarioUnlockingEnabled); + setCheckboxValue(WIDX_SCENARIO_UNLOCKING, Config::Get().general.scenarioUnlockingEnabled); widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = kRideInspectionIntervalNames - [Config::Get().general.DefaultInspectionInterval]; + [Config::Get().general.defaultInspectionInterval]; } #pragma endregion @@ -2051,22 +2051,22 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_DEBUGGING_TOOLS: - Config::Get().general.DebuggingTools ^= 1; + Config::Get().general.debuggingTools ^= 1; Config::Save(); GfxInvalidateScreen(); break; case WIDX_EXPORT_CUSTOM_OBJECTS_CHECKBOX: - Config::Get().general.SavePluginData ^= 1; + Config::Get().general.savePluginData ^= 1; Config::Save(); invalidate(); break; case WIDX_STAY_CONNECTED_AFTER_DESYNC: - Config::Get().network.StayConnected = !Config::Get().network.StayConnected; + Config::Get().network.stayConnected = !Config::Get().network.stayConnected; Config::Save(); invalidate(); break; case WIDX_ALWAYS_NATIVE_LOADSAVE: - Config::Get().general.UseNativeBrowseDialog = !Config::Get().general.UseNativeBrowseDialog; + Config::Get().general.useNativeBrowseDialog = !Config::Get().general.useNativeBrowseDialog; Config::Save(); invalidate(); break; @@ -2083,7 +2083,7 @@ namespace OpenRCT2::Ui::Windows { if (CsgAtLocationIsUsable(rct1path)) { - Config::Get().general.RCT1Path = std::move(rct1path); + Config::Get().general.rct1Path = std::move(rct1path); Config::Get().interface.scenarioSelectLastTab = 0; Config::Save(); ContextShowError(STR_RESTART_REQUIRED, kStringIdNone, {}); @@ -2107,9 +2107,9 @@ namespace OpenRCT2::Ui::Windows break; } case WIDX_PATH_TO_RCT1_CLEAR: - if (!Config::Get().general.RCT1Path.empty()) + if (!Config::Get().general.rct1Path.empty()) { - Config::Get().general.RCT1Path.clear(); + Config::Get().general.rct1Path.clear(); Config::Save(); } invalidate(); @@ -2141,19 +2141,19 @@ namespace OpenRCT2::Ui::Windows } ShowDropdown(widget, AUTOSAVE_NEVER + 1); - gDropdown.items[Config::Get().general.AutosaveFrequency].setChecked(true); + gDropdown.items[Config::Get().general.autosaveFrequency].setChecked(true); break; case WIDX_AUTOSAVE_AMOUNT_UP: - Config::Get().general.AutosaveAmount += 1; + Config::Get().general.autosaveAmount += 1; Config::Save(); invalidateWidget(WIDX_AUTOSAVE_FREQUENCY); invalidateWidget(WIDX_AUTOSAVE_FREQUENCY_DROPDOWN); invalidateWidget(WIDX_AUTOSAVE_AMOUNT); break; case WIDX_AUTOSAVE_AMOUNT_DOWN: - if (Config::Get().general.AutosaveAmount > 1) + if (Config::Get().general.autosaveAmount > 1) { - Config::Get().general.AutosaveAmount -= 1; + Config::Get().general.autosaveAmount -= 1; Config::Save(); invalidateWidget(WIDX_AUTOSAVE_FREQUENCY); invalidateWidget(WIDX_AUTOSAVE_FREQUENCY_DROPDOWN); @@ -2167,9 +2167,9 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_AUTOSAVE_FREQUENCY_DROPDOWN: - if (dropdownIndex != Config::Get().general.AutosaveFrequency) + if (dropdownIndex != Config::Get().general.autosaveFrequency) { - Config::Get().general.AutosaveFrequency = static_cast(dropdownIndex); + Config::Get().general.autosaveFrequency = static_cast(dropdownIndex); Config::Save(); invalidate(); } @@ -2179,7 +2179,7 @@ namespace OpenRCT2::Ui::Windows void AdvancedPrepareDraw() { - if (!Config::Get().general.RCT1Path.empty()) + if (!Config::Get().general.rct1Path.empty()) { widgets[WIDX_PATH_TO_RCT1_PATH].type = WidgetType::label; widgets[WIDX_PATH_TO_RCT1_BROWSE].type = WidgetType::empty; @@ -2206,12 +2206,12 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_PATH_TO_RCT1_BROWSE].left = widgets[WIDX_PATH_TO_RCT1_BROWSE].right - browseLabelWidth; } - setCheckboxValue(WIDX_EXPORT_CUSTOM_OBJECTS_CHECKBOX, Config::Get().general.SavePluginData); - setCheckboxValue(WIDX_ALWAYS_NATIVE_LOADSAVE, Config::Get().general.UseNativeBrowseDialog); - widgets[WIDX_AUTOSAVE_FREQUENCY].text = AutosaveNames[Config::Get().general.AutosaveFrequency]; + setCheckboxValue(WIDX_EXPORT_CUSTOM_OBJECTS_CHECKBOX, Config::Get().general.savePluginData); + setCheckboxValue(WIDX_ALWAYS_NATIVE_LOADSAVE, Config::Get().general.useNativeBrowseDialog); + widgets[WIDX_AUTOSAVE_FREQUENCY].text = AutosaveNames[Config::Get().general.autosaveFrequency]; - setCheckboxValue(WIDX_DEBUGGING_TOOLS, Config::Get().general.DebuggingTools); - setCheckboxValue(WIDX_STAY_CONNECTED_AFTER_DESYNC, Config::Get().network.StayConnected); + setCheckboxValue(WIDX_DEBUGGING_TOOLS, Config::Get().general.debuggingTools); + setCheckboxValue(WIDX_STAY_CONNECTED_AFTER_DESYNC, Config::Get().network.stayConnected); #ifdef __EMSCRIPTEN__ widgets[WIDX_GROUP_ADVANCED].bottom = kAdvancedStart + 84 + getTitleBarDiffNormal(); @@ -2226,13 +2226,13 @@ namespace OpenRCT2::Ui::Windows void AdvancedDraw(RenderTarget& rt) { auto ft = Formatter(); - ft.Add(static_cast(Config::Get().general.AutosaveAmount)); + ft.Add(static_cast(Config::Get().general.autosaveAmount)); DrawTextBasic( rt, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, STR_WINDOW_COLOUR_2_COMMA32, ft, { colours[1] }); // Format RCT1 path - const auto normalisedPath = Platform::StrDecompToPrecomp(Config::Get().general.RCT1Path); + const auto normalisedPath = Platform::StrDecompToPrecomp(Config::Get().general.rct1Path); ft = Formatter(); ft.Add(STR_STRING); ft.Add(normalisedPath.c_str()); @@ -2252,14 +2252,14 @@ namespace OpenRCT2::Ui::Windows { if (widgetIndex == WIDX_PATH_TO_RCT1_PATH) { - if (Config::Get().general.RCT1Path.empty()) + if (Config::Get().general.rct1Path.empty()) { // No tooltip if the path is empty return { kStringIdNone, {} }; } auto ft = Formatter(); - ft.Add(Config::Get().general.RCT1Path.c_str()); + ft.Add(Config::Get().general.rct1Path.c_str()); return { fallback, ft }; } return { fallback, {} }; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 282d3c16a6..b7538e7dd8 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr StringId kWindowTitle = STR_STRINGID; @@ -622,7 +625,7 @@ namespace OpenRCT2::Ui::Windows int32_t viewportFlags{}; if (viewport == nullptr) { - viewportFlags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; + viewportFlags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; } else { @@ -710,13 +713,15 @@ namespace OpenRCT2::Ui::Windows DrawTextBasic(rt, windowPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft); // Graph border - GfxFillRectInset(rt, _ratingGraphBounds, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, _ratingGraphBounds, colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); // hide resize widget on graph area constexpr ScreenCoordsXY offset{ 1, 1 }; constexpr ScreenCoordsXY bigOffset{ 5, 5 }; - GfxFillRectInset( + Rectangle::fillInset( rt, { _ratingGraphBounds.Point2 - bigOffset, _ratingGraphBounds.Point2 - offset }, colours[1], - INSET_RECT_FLAG_FILL_DONT_LIGHTEN | INSET_RECT_FLAG_BORDER_NONE); + Rectangle::BorderStyle::none, Rectangle::FillBrightness::light, Rectangle::FillMode::dontLightenWhenInset); Graph::DrawRatingGraph(rt, _ratingProps); } @@ -789,13 +794,15 @@ namespace OpenRCT2::Ui::Windows DrawTextBasic(rt, windowPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft); // Graph border - GfxFillRectInset(rt, _guestGraphBounds, colours[1], INSET_RECT_F_30); + Rectangle::fillInset( + rt, _guestGraphBounds, colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::none); // hide resize widget on graph area constexpr ScreenCoordsXY offset{ 1, 1 }; constexpr ScreenCoordsXY bigOffset{ 5, 5 }; - GfxFillRectInset( + Rectangle::fillInset( rt, { _guestGraphBounds.Point2 - bigOffset, _guestGraphBounds.Point2 - offset }, colours[1], - INSET_RECT_FLAG_FILL_DONT_LIGHTEN | INSET_RECT_FLAG_BORDER_NONE); + Rectangle::BorderStyle::none, Rectangle::FillBrightness::light, Rectangle::FillMode::dontLightenWhenInset); Graph::DrawGuestGraph(rt, _guestProps); } @@ -947,7 +954,7 @@ namespace OpenRCT2::Ui::Windows // Draw park size auto parkSize = gameState.park.size * 10; auto stringIndex = STR_PARK_SIZE_METRIC_LABEL; - if (Config::Get().general.MeasurementFormat == MeasurementFormat::Imperial) + if (Config::Get().general.measurementFormat == MeasurementFormat::Imperial) { stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL; parkSize = SquaredMetresToSquaredFeet(parkSize); @@ -1234,9 +1241,9 @@ namespace OpenRCT2::Ui::Windows spriteIdx = spriteIdx.WithIndexOffset((currentFrame / 8) % 8); GfxDrawSprite(rt, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); - auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest); + auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest); ImageId peepImage( - animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL); + animObj->GetPeepAnimation(PeepAnimationGroup::normal).baseImage + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL); if (page == WINDOW_PARK_PAGE_GUESTS) peepImage = peepImage.WithIndexOffset(_peepAnimationFrame & 0xFFFFFFFC); diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 05c8393c74..a1fe1a599e 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -409,7 +409,7 @@ namespace OpenRCT2::Ui::Windows // only enable kick button for other players const bool canKick = Network::CanPerformAction( - Network::GetCurrentPlayerGroupIndex(), Network::Permission::KickPlayer); + Network::GetCurrentPlayerGroupIndex(), Network::Permission::kickPlayer); const bool isServer = Network::GetPlayerFlags(playerIndex) & Network::PlayerFlags::kIsServer; const bool isOwnWindow = (Network::GetCurrentPlayerId() == number); widgetSetEnabled(*this, WIDX_KICK, canKick && !isOwnWindow && !isServer); diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 0ba864208d..4fd933ffe6 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -335,7 +335,7 @@ namespace OpenRCT2::Ui::Windows { auto type = gameState.researchLastItem->type; w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WidgetType::flatBtn; - const auto image = type == Research::EntryType::Ride ? SPR_NEW_RIDE : SPR_NEW_SCENERY; + const auto image = type == Research::EntryType::ride ? SPR_NEW_RIDE : SPR_NEW_SCENERY; w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].image = ImageId(image); } } @@ -380,7 +380,7 @@ namespace OpenRCT2::Ui::Windows { ft.Add(gameState.researchNextItem->GetCategoryName()); } - else if (gameState.researchNextItem->type == Research::EntryType::Ride) + else if (gameState.researchNextItem->type == Research::EntryType::ride) { const auto& rtd = GetRideTypeDescriptor(gameState.researchNextItem->baseRideType); if (rtd.HasFlag(RtdFlag::listVehiclesSeparately)) @@ -434,7 +434,7 @@ namespace OpenRCT2::Ui::Windows { StringId lastDevelopmentFormat = kStringIdEmpty; auto ft = Formatter(); - if (gameState.researchLastItem->type == Research::EntryType::Scenery) + if (gameState.researchLastItem->type == Research::EntryType::scenery) { lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; ft.Add(gameState.researchLastItem->GetName()); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 975a8f6f8b..877dd5d086 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +77,7 @@ #include #include +using namespace OpenRCT2::Drawing; using namespace OpenRCT2::TrackMetaData; namespace OpenRCT2::Ui::Windows @@ -1326,8 +1328,8 @@ namespace OpenRCT2::Ui::Windows if (page == WINDOW_RIDE_PAGE_CUSTOMER) spriteIndex = pickedPeepFrame & ~3; - auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest); - spriteIndex += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1; + auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest); + spriteIndex += animObj->GetPeepAnimation(PeepAnimationGroup::normal).baseImage + 1; GfxDrawSprite( rt, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL), @@ -1565,7 +1567,7 @@ namespace OpenRCT2::Ui::Windows newViewportFlags = viewport->flags; removeViewport(); } - else if (Config::Get().general.AlwaysShowGridlines) + else if (Config::Get().general.alwaysShowGridlines) { newViewportFlags |= VIEWPORT_FLAG_GRIDLINES; } @@ -2952,7 +2954,7 @@ namespace OpenRCT2::Ui::Windows const auto* rideEntry = ride->getRideEntry(); // Background - GfxFillRect(rt, { { rt.x, rt.y }, { rt.x + rt.width, rt.y + rt.height } }, PaletteIndex::pi12); + Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width, rt.y + rt.height } }, PaletteIndex::pi12); Widget* widget = &widgets[WIDX_VEHICLE_TRAINS_PREVIEW]; int32_t startX = std::max(2, (widget->width() - ((ride->numTrains - 1) * 36)) / 2 - 25); @@ -3690,11 +3692,11 @@ namespace OpenRCT2::Ui::Windows // Horizontal rule between mode settings and depart settings auto ruleStart = widgets[WIDX_LOAD_DROPDOWN].top - 8; - GfxFillRectInset( + Rectangle::fillInset( rt, { windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, ruleStart }, windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].right - 5, ruleStart + 1 } }, - colours[1], INSET_RECT_FLAG_BORDER_INSET); + colours[1], Rectangle::BorderStyle::inset); // Number of block sections if (ride->isBlockSectioned()) @@ -3997,7 +3999,7 @@ namespace OpenRCT2::Ui::Windows WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - if (Config::Get().general.DebuggingTools && Network::GetMode() == Network::Mode::none) + if (Config::Get().general.debuggingTools && Network::GetMode() == Network::Mode::none) { widgets[WIDX_FORCE_BREAKDOWN].type = WidgetType::flatBtn; } @@ -4823,7 +4825,7 @@ namespace OpenRCT2::Ui::Windows // Track / shop item preview const auto& trackPreviewWidget = widgets[WIDX_TRACK_PREVIEW]; if (trackPreviewWidget.type != WidgetType::empty) - GfxFillRect( + Rectangle::fill( rt, { { windowPos + ScreenCoordsXY{ trackPreviewWidget.left + 1, trackPreviewWidget.top + 1 } }, { windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } }, @@ -4833,7 +4835,7 @@ namespace OpenRCT2::Ui::Windows // auto rideEntry = ride->getRideEntry(); - if (rideEntry == nullptr || rideEntry->shop_item[0] == ShopItem::None) + if (rideEntry == nullptr || rideEntry->shop_item[0] == ShopItem::none) { auto screenCoords = windowPos + ScreenCoordsXY{ trackPreviewWidget.left, trackPreviewWidget.top }; @@ -4866,7 +4868,7 @@ namespace OpenRCT2::Ui::Windows + ScreenCoordsXY{ (trackPreviewWidget.left + trackPreviewWidget.right) / 2 - 8, (trackPreviewWidget.bottom + trackPreviewWidget.top) / 2 - 6 }; - ShopItem shopItem = rideEntry->shop_item[1] == ShopItem::None ? rideEntry->shop_item[0] + ShopItem shopItem = rideEntry->shop_item[1] == ShopItem::none ? rideEntry->shop_item[0] : rideEntry->shop_item[1]; if (ride->hasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) { @@ -4931,7 +4933,7 @@ namespace OpenRCT2::Ui::Windows auto vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); // Background colour - GfxFillRect(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, PaletteIndex::pi12); + Rectangle::fill(rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, PaletteIndex::pi12); // ? auto screenCoords = ScreenCoordsXY{ vehiclePreviewWidget->width() / 2, vehiclePreviewWidget->height() - 15 }; @@ -5618,8 +5620,8 @@ namespace OpenRCT2::Ui::Windows widgetCoords.x = windowPos.x + 4; widgetCoords.y = windowPos.y + widgets[WIDX_SELECT_NEARBY_SCENERY].bottom + 17; - GfxFillRectInset( - rt, { widgetCoords, { windowPos.x + 312, widgetCoords.y + 1 } }, colours[1], INSET_RECT_FLAG_BORDER_INSET); + Rectangle::fillInset( + rt, { widgetCoords, { windowPos.x + 312, widgetCoords.y + 1 } }, colours[1], Rectangle::BorderStyle::inset); } else { @@ -5667,9 +5669,9 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += 2 * kListRowHeight; // Horizontal rule - GfxFillRectInset( + Rectangle::fillInset( rt, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); + Rectangle::BorderStyle::inset); if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_NO_RAW_STATS)) { @@ -6086,11 +6088,11 @@ namespace OpenRCT2::Ui::Windows { auto coord1 = ScreenCoordsXY{ x, rt.y }; auto coord2 = ScreenCoordsXY{ x, rt.y + rt.height - 1 }; - GfxFillRect(rt, { coord1, coord2 }, lightColour); - GfxFillRect(rt, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour); - GfxFillRect(rt, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour); - GfxFillRect(rt, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour); - GfxFillRect(rt, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour); + Rectangle::fill(rt, { coord1, coord2 }, lightColour); + Rectangle::fill(rt, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour); + Rectangle::fill(rt, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour); + Rectangle::fill(rt, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour); + Rectangle::fill(rt, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour); } time += 5; } @@ -6112,7 +6114,7 @@ namespace OpenRCT2::Ui::Windows { // Minor / major line int32_t colour = yUnit == 0 ? lightColour : darkColour; - GfxFillRect(rt, { { rt.x, y }, { rt.x + rt.width - 1, y } }, colour); + Rectangle::fill(rt, { { rt.x, y }, { rt.x + rt.width - 1, y } }, colour); int16_t scaled_yUnit = yUnit; // Scale modifier @@ -6196,7 +6198,7 @@ namespace OpenRCT2::Ui::Windows const bool previousMeasurement = x > measurement->current_item; // Draw the current line in grey. - GfxFillRect( + Rectangle::fill( rt, { { x, firstPoint }, { x, secondPoint } }, previousMeasurement ? PaletteIndex::pi17 : PaletteIndex::pi21); @@ -6210,7 +6212,7 @@ namespace OpenRCT2::Ui::Windows { const auto redLineTop = ScreenCoordsXY{ x, std::max(firstPoint, intensityThresholdNegative) }; const auto redLineBottom = ScreenCoordsXY{ x, std::max(secondPoint, intensityThresholdNegative) }; - GfxFillRect(rt, { redLineTop, redLineBottom }, redLineColour); + Rectangle::fill(rt, { redLineTop, redLineBottom }, redLineColour); } // Line exceeds positive threshold (at top of graph). @@ -6218,7 +6220,7 @@ namespace OpenRCT2::Ui::Windows { const auto redLineTop = ScreenCoordsXY{ x, std::min(firstPoint, intensityThresholdPositive) }; const auto redLineBottom = ScreenCoordsXY{ x, std::min(secondPoint, intensityThresholdPositive) }; - GfxFillRect(rt, { redLineTop, redLineBottom }, redLineColour); + Rectangle::fill(rt, { redLineTop, redLineBottom }, redLineColour); } } } @@ -6237,9 +6239,9 @@ namespace OpenRCT2::Ui::Windows if (GetShopItemDescriptor(shop_item).IsPhoto()) { if (existingFlags & EnumToFlag(shop_item)) - newFlags &= ~EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); + newFlags &= ~EnumsToFlags(ShopItem::photo, ShopItem::photo2, ShopItem::photo3, ShopItem::photo4); else - newFlags |= EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); + newFlags |= EnumsToFlags(ShopItem::photo, ShopItem::photo2, ShopItem::photo3, ShopItem::photo4); } else { @@ -6260,7 +6262,7 @@ namespace OpenRCT2::Ui::Windows const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::toilet) { - shopItem = ShopItem::Admission; + shopItem = ShopItem::admission; } else { @@ -6268,7 +6270,7 @@ namespace OpenRCT2::Ui::Windows if (rideEntry != nullptr) { shopItem = rideEntry->shop_item[0]; - if (shopItem == ShopItem::None) + if (shopItem == ShopItem::none) return; } else @@ -6294,7 +6296,7 @@ namespace OpenRCT2::Ui::Windows return; auto shop_item = rideEntry->shop_item[1]; - if (shop_item == ShopItem::None) + if (shop_item == ShopItem::none) shop_item = ride->getRideTypeDescriptor().PhotoItem; UpdateSamePriceThroughoutFlags(shop_item); @@ -6365,7 +6367,7 @@ namespace OpenRCT2::Ui::Windows auto rideEntry = ride->getRideEntry(); const auto& rtd = ride->getRideTypeDescriptor(); return Park::RidePricesUnlocked() || rtd.specialType == RtdSpecialType::toilet - || (rideEntry != nullptr && rideEntry->shop_item[0] != ShopItem::None); + || (rideEntry != nullptr && rideEntry->shop_item[0] != ShopItem::none); } void IncomeIncreaseSecondaryPrice() @@ -6533,7 +6535,7 @@ namespace OpenRCT2::Ui::Windows // 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::RidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::None + if (!Park::RidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::none && rtd.specialType != RtdSpecialType::toilet) { disabledWidgets |= (1uLL << WIDX_PRIMARY_PRICE); @@ -6552,8 +6554,8 @@ namespace OpenRCT2::Ui::Windows if (ridePrimaryPrice == 0) widgets[WIDX_PRIMARY_PRICE].text = STR_FREE; - ShopItem primaryItem = ShopItem::Admission; - if (rtd.specialType == RtdSpecialType::toilet || ((primaryItem = rideEntry->shop_item[0]) != ShopItem::None)) + ShopItem primaryItem = ShopItem::admission; + if (rtd.specialType == RtdSpecialType::toilet || ((primaryItem = rideEntry->shop_item[0]) != ShopItem::none)) { widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WidgetType::checkbox; @@ -6567,13 +6569,13 @@ namespace OpenRCT2::Ui::Windows auto secondaryItem = ride->getRideTypeDescriptor().PhotoItem; if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) { - if ((secondaryItem = rideEntry->shop_item[1]) != ShopItem::None) + if ((secondaryItem = rideEntry->shop_item[1]) != ShopItem::none) { widgets[WIDX_SECONDARY_PRICE_LABEL].text = GetShopItemDescriptor(secondaryItem).Naming.PriceLabel; } } - if (secondaryItem == ShopItem::None) + if (secondaryItem == ShopItem::none) { // Hide secondary item widgets widgets[WIDX_SECONDARY_PRICE_LABEL].type = WidgetType::empty; @@ -6630,7 +6632,7 @@ namespace OpenRCT2::Ui::Windows // Primary item profit / loss per item sold primaryItem = rideEntry->shop_item[0]; - if (primaryItem != ShopItem::None) + if (primaryItem != ShopItem::none) { profit = ride->price[0]; @@ -6654,7 +6656,7 @@ namespace OpenRCT2::Ui::Windows if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) secondaryItem = rideEntry->shop_item[1]; - if (secondaryItem != ShopItem::None) + if (secondaryItem != ShopItem::none) { profit = ride->price[1]; @@ -6883,7 +6885,7 @@ namespace OpenRCT2::Ui::Windows // Primary shop items sold shopItem = ride->getRideEntry()->shop_item[0]; - if (shopItem != ShopItem::None) + if (shopItem != ShopItem::none) { ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); @@ -6895,7 +6897,7 @@ namespace OpenRCT2::Ui::Windows // Secondary shop items sold / on-ride photos sold shopItem = (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ride->getRideTypeDescriptor().PhotoItem : ride->getRideEntry()->shop_item[1]; - if (shopItem != ShopItem::None) + if (shopItem != ShopItem::none) { ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 96f2bff5b5..f9a4d9e45b 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -311,7 +311,7 @@ namespace OpenRCT2::Ui::Windows if (RideTryGetOriginElement(*currentRide, nullptr)) { // Auto open shops if required. - if (currentRide->mode == RideMode::shopStall && Config::Get().general.AutoOpenShops) + if (currentRide->mode == RideMode::shopStall && Config::Get().general.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 diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index c013567713..8f1e4655f3 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -20,15 +20,19 @@ #include #include #include +#include #include #include #include +#include #include #include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr StringId kWindowTitle = kStringIdNone; @@ -86,6 +90,7 @@ namespace OpenRCT2::Ui::Windows enum InformationType { INFORMATION_TYPE_STATUS, + INFORMATION_TYPE_RIDETYPE, INFORMATION_TYPE_POPULARITY, INFORMATION_TYPE_SATISFACTION, INFORMATION_TYPE_PROFIT, @@ -109,6 +114,7 @@ namespace OpenRCT2::Ui::Windows static constexpr StringId ride_info_type_string_mapping[DROPDOWN_LIST_COUNT] = { STR_STATUS, + STR_RIDE_LIST_RIDETYPE, STR_POPULARITY, STR_SATISFACTION, STR_PROFIT, @@ -137,6 +143,7 @@ namespace OpenRCT2::Ui::Windows static constexpr bool ride_info_type_money_mapping[DROPDOWN_LIST_COUNT] = { false, // Status + false, // Ride Type false, // Popularity false, // Satisfaction true, // Profit @@ -620,7 +627,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { auto rtCoords = ScreenCoordsXY{ rt.x, rt.y }; - GfxFillRect( + Rectangle::fill( rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width, rt.height } }, ColourMapA[colours[1].colour].mid_light); auto y = 0; @@ -636,7 +643,7 @@ namespace OpenRCT2::Ui::Windows if (i == static_cast(selectedListItem)) { // Background highlight - GfxFilterRect(rt, { 0, y, 800, y + kScrollableRowHeight - 1 }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, 800, y + kScrollableRowHeight - 1 }, FilterPaletteID::paletteDarken1); format = STR_WINDOW_COLOUR_2_STRINGID; if (_quickDemolishMode) format = STR_LIGHTPINK_STRINGID; @@ -833,6 +840,13 @@ namespace OpenRCT2::Ui::Windows ft.Add(ridePtr->ratings.intensity); } break; + case INFORMATION_TYPE_RIDETYPE: + { + const auto rideTypeName = ridePtr->getTypeNaming().Name; + formatSecondary = STR_STRINGID; + ft.Add(rideTypeName); + break; + } case INFORMATION_TYPE_NAUSEA: formatSecondary = STR_RATING_UKNOWN_LABEL; if (RideHasRatings(*ridePtr)) @@ -1085,6 +1099,19 @@ namespace OpenRCT2::Ui::Windows return leftValue < rightValue; }); break; + case INFORMATION_TYPE_RIDETYPE: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + auto* ridePtrLhs = GetRide(thisRide.id); + auto* ridePtrRhs = GetRide(otherRide.id); + if (!ridePtrLhs || !ridePtrRhs) + return ridePtrLhs != nullptr; + + auto rideTypeNameLhs = LanguageGetString(ridePtrLhs->getTypeNaming().Name); + auto rideTypeNameRhs = LanguageGetString(ridePtrRhs->getTypeNaming().Name); + + return String::logicalCmp(rideTypeNameLhs, rideTypeNameRhs) > 0; + }); + break; case INFORMATION_TYPE_NAUSEA: SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { const auto leftValue = thisRide.ratings.isNull() ? RideRating::kUndefined : thisRide.ratings.nausea; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 413f99ffb2..b92126bc5a 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -211,7 +211,7 @@ namespace OpenRCT2::Ui::Windows return nullptr; } - if (!Config::Get().general.ConfirmationPrompt) + if (!Config::Get().general.confirmationPrompt) { /* game_load_or_quit_no_save_prompt() will exec requested task and close this window * immediately again. diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index ba884d1429..bfecda1e51 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr int32_t kInitialNumUnlockedScenarios = 5; @@ -287,7 +290,9 @@ namespace OpenRCT2::Ui::Windows auto startFrameX = width - (GetPreviewPaneWidth() / 2) - (image->width / 2) - kPadding; auto frameStartPos = ScreenCoordsXY(windowPos.x + startFrameX, screenPos.y + 15); auto frameEndPos = frameStartPos + ScreenCoordsXY(image->width + 1, image->height + 1); - GfxFillRectInset(rt, { frameStartPos, frameEndPos }, colours[1], INSET_RECT_F_60 | INSET_RECT_FLAG_FILL_MID_LIGHT); + Rectangle::fillInset( + rt, { frameStartPos, frameEndPos }, colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::dark, + Rectangle::FillMode::dontLightenWhenInset); // Draw image, if available auto imagePos = frameStartPos + ScreenCoordsXY(1, 1); @@ -352,7 +357,7 @@ namespace OpenRCT2::Ui::Windows } // Scenario path - if (Config::Get().general.DebuggingTools) + if (Config::Get().general.debuggingTools) { const auto shortPath = ShortenPath(scenario->Path, width - 6 - kTabWidth, FontStyle::Medium); @@ -429,7 +434,7 @@ namespace OpenRCT2::Ui::Windows pressedWidgets |= 1LL << (selectedTab + WIDX_TAB1); - const int32_t bottomMargin = Config::Get().general.DebuggingTools ? 17 : 5; + const int32_t bottomMargin = Config::Get().general.debuggingTools ? 17 : 5; widgets[WIDX_SCENARIOLIST].right = width - GetPreviewPaneWidth() - 2 * kPadding; widgets[WIDX_SCENARIOLIST].bottom = height - bottomMargin; } @@ -580,7 +585,7 @@ namespace OpenRCT2::Ui::Windows bool isHighlighted = _highlightedScenario == scenario; if (isHighlighted) { - GfxFilterRect(rt, { 0, y, width, y + scenarioItemHeight - 1 }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, width, y + scenarioItemHeight - 1 }, FilterPaletteID::paletteDarken1); } bool isCompleted = scenario->Highscore != nullptr; @@ -748,7 +753,7 @@ namespace OpenRCT2::Ui::Windows bool megaParkLocked = (rct1CompletedScenarios & rct1RequiredCompletedScenarios) != rct1RequiredCompletedScenarios; _listItems[megaParkListItemIndex.value()].scenario.is_locked = megaParkLocked; - if (megaParkLocked && Config::Get().general.ScenarioHideMegaPark) + if (megaParkLocked && Config::Get().general.scenarioHideMegaPark) { // Remove mega park _listItems.pop_back(); @@ -784,7 +789,7 @@ namespace OpenRCT2::Ui::Windows bool IsLockingEnabled() const { - if (!Config::Get().general.ScenarioUnlockingEnabled) + if (!Config::Get().general.scenarioUnlockingEnabled) return false; if (selectedTab >= 6) return false; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 952de74eb9..d6da13d082 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -64,7 +65,7 @@ #include #include -using namespace Numerics; +using namespace OpenRCT2::Drawing; namespace OpenRCT2::Ui::Windows { @@ -597,31 +598,6 @@ namespace OpenRCT2::Ui::Windows invalidate(); } - ScreenSize onScrollGetSize(int32_t scrollIndex) override - { - if (scrollIndex == kSceneryContentScrollIndex) - { - return ContentScrollGetSize(); - } - return {}; - } - - void onScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (scrollIndex == kSceneryContentScrollIndex) - { - ContentScrollMouseDown(screenCoords); - } - } - - void onScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (scrollIndex == kSceneryContentScrollIndex) - { - ContentScrollMouseOver(screenCoords); - } - } - OpenRCT2String onTooltip(const WidgetIndex widgetIndex, const StringId fallback) override { if (widgetIndex >= WIDX_SCENERY_TAB_1) @@ -881,7 +857,7 @@ namespace OpenRCT2::Ui::Windows DrawTextEllipsised(rt, { windowPos.x + 3, windowPos.y + height - 23 }, width - 19, STR_BLACK_STRING, ft); // Draw object author(s) if debugging tools are active - if (Config::Get().general.DebuggingTools) + if (Config::Get().general.debuggingTools) { auto sceneryObjectType = GetObjectTypeFromSceneryType(selectedSceneryEntry.SceneryType); auto& objManager = GetContext()->GetObjectManager(); @@ -907,47 +883,6 @@ namespace OpenRCT2::Ui::Windows } } - void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override - { - if (scrollIndex == kSceneryContentScrollIndex) - { - ContentScrollDraw(rt); - } - } - - void onToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_SCENERY_BACKGROUND: - ToolUpdateScenery(screenCoords); - break; - } - } - - void onToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_SCENERY_BACKGROUND: - SceneryToolDown(screenCoords, widgetIndex); - break; - } - } - - void onToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_SCENERY_BACKGROUND: - if (_sceneryPaintEnabled) - SceneryToolDown(screenCoords, widgetIndex); - if (gWindowSceneryEyedropperEnabled) - SceneryToolDown(screenCoords, widgetIndex); - break; - } - } - void setSelectedItem( const ScenerySelection& scenery, const std::optional primary, const std::optional secondary, const std::optional tertiary, const std::optional rotation) @@ -1499,13 +1434,13 @@ namespace OpenRCT2::Ui::Windows return scenery; } - ScreenSize ContentScrollGetSize() const + ScreenSize onScrollGetSize(int32_t scrollIndex) override { auto rows = CountRows(); return { 0, ContentRowsHeight(rows) }; } - void ContentScrollMouseDown(const ScreenCoordsXY& screenCoords) + void onScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { const auto scenery = GetSceneryIdByCursorPos(screenCoords); if (scenery.IsUndefined()) @@ -1527,7 +1462,7 @@ namespace OpenRCT2::Ui::Windows invalidate(); } - void ContentScrollMouseOver(const ScreenCoordsXY& screenCoords) + void onScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { ScenerySelection scenery = GetSceneryIdByCursorPos(screenCoords); if (!scenery.IsUndefined() && _selectedScenery != scenery) @@ -1537,70 +1472,51 @@ namespace OpenRCT2::Ui::Windows } } - std::pair GetNameAndPrice(ScenerySelection selectedScenery) + template + std::pair GetNameAndPriceByType(const ScenerySelection& selectedScenery) { - StringId name = STR_UNKNOWN_OBJECT_TYPE; - money64 price = kMoney64Undefined; - if (selectedScenery.IsUndefined() && gSceneryPlaceCost != kMoney64Undefined) + auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) { - price = gSceneryPlaceCost; + return { sceneryEntry->name, sceneryEntry->price }; } else + { + return { STR_UNKNOWN_OBJECT_TYPE, kMoney64Undefined }; + } + } + + std::pair GetNameAndPrice(const ScenerySelection& selectedScenery) + { + if (!selectedScenery.IsUndefined()) { switch (selectedScenery.SceneryType) { case SCENERY_TYPE_SMALL: { - auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; + return GetNameAndPriceByType(selectedScenery); } case SCENERY_TYPE_PATH_ITEM: { - auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; + return GetNameAndPriceByType(selectedScenery); } case SCENERY_TYPE_WALL: { - auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; + return GetNameAndPriceByType(selectedScenery); } case SCENERY_TYPE_LARGE: { - auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; + return GetNameAndPriceByType(selectedScenery); } case SCENERY_TYPE_BANNER: { - auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; + return GetNameAndPriceByType(selectedScenery); } } } + + StringId name = STR_UNKNOWN_OBJECT_TYPE; + money64 price = gSceneryPlaceCost != kMoney64Undefined ? gSceneryPlaceCost : kMoney64Undefined; return { name, price }; } @@ -1722,7 +1638,7 @@ namespace OpenRCT2::Ui::Windows } } - void ContentScrollDraw(RenderTarget& rt) + void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { GfxClear(rt, ColourMapA[colours[1].colour].mid_light); @@ -1744,24 +1660,24 @@ namespace OpenRCT2::Ui::Windows { if (_selectedScenery == currentSceneryGlobal) { - GfxFillRectInset( + Rectangle::fillInset( rt, { topLeft, topLeft + ScreenCoordsXY{ kSceneryButtonWidth - 1, kSceneryButtonHeight - 1 } }, - colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT); + colours[1], Rectangle::BorderStyle::outset, Rectangle::FillBrightness::dark); } } else { if (tabSelectedScenery == currentSceneryGlobal) { - GfxFillRectInset( + Rectangle::fillInset( rt, { topLeft, topLeft + ScreenCoordsXY{ kSceneryButtonWidth - 1, kSceneryButtonHeight - 1 } }, - colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT)); + colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::dark); } else if (_selectedScenery == currentSceneryGlobal) { - GfxFillRectInset( + Rectangle::fillInset( rt, { topLeft, topLeft + ScreenCoordsXY{ kSceneryButtonWidth - 1, kSceneryButtonHeight - 1 } }, - colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT); + colours[1], Rectangle::BorderStyle::outset, Rectangle::FillBrightness::dark); } } @@ -1781,11 +1697,283 @@ namespace OpenRCT2::Ui::Windows } } + void onToolUpdateSmallScenery(WidgetIndex widgetIndex, const ScreenCoordsXY& screenPos, ScenerySelection selection) + { + CoordsXY mapTile = {}; + uint8_t quadrant; + Direction rotation; + + Sub6E1F34SmallScenery(screenPos, selection.EntryIndex, mapTile, &quadrant, &rotation); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + gMapSelectFlags.set(MapSelectFlag::enable); + if (gWindowSceneryScatterEnabled) + { + uint16_t cluster_size = (gWindowSceneryScatterSize - 1) * kCoordsXYStep; + gMapSelectPositionA.x = mapTile.x - cluster_size / 2; + gMapSelectPositionA.y = mapTile.y - cluster_size / 2; + gMapSelectPositionB.x = mapTile.x + cluster_size / 2; + gMapSelectPositionB.y = mapTile.y + cluster_size / 2; + if (gWindowSceneryScatterSize % 2 == 0) + { + gMapSelectPositionB.x += kCoordsXYStep; + gMapSelectPositionB.y += kCoordsXYStep; + } + } + else + { + gMapSelectPositionA.x = mapTile.x; + gMapSelectPositionA.y = mapTile.y; + gMapSelectPositionB.x = mapTile.x; + gMapSelectPositionB.y = mapTile.y; + } + + auto* sceneryEntry = ObjectManager::GetObjectEntry(selection.EntryIndex); + + gMapSelectType = MapSelectType::full; + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) + { + gMapSelectType = getMapSelectQuarter((quadrant ^ 2)); + } + + MapInvalidateSelectionRect(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_0) && mapTile == gSceneryGhostPosition && quadrant == _unkF64F0E + && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_SMALL + && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + _unkF64F0E = quadrant; + _unkF64F0A = gSceneryPlaceZ; + + uint8_t attemptsLeft = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + attemptsLeft = 20; + } + + money64 cost = 0; + for (; attemptsLeft != 0; attemptsLeft--) + { + cost = TryPlaceGhostSmallScenery( + { mapTile, gSceneryPlaceZ, rotation }, quadrant, selection.EntryIndex, _sceneryPrimaryColour, + _scenerySecondaryColour, _sceneryTertiaryColour); + + if (cost != kMoney64Undefined) + break; + gSceneryPlaceZ += 8; + } + + gSceneryPlaceCost = cost; + } + + void onToolUpdatePathItem(WidgetIndex widgetIndex, const ScreenCoordsXY& screenPos, ScenerySelection selection) + { + CoordsXY mapTile = {}; + int32_t z; + + Sub6E1F34PathItem(screenPos, selection.EntryIndex, mapTile, &z); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + gMapSelectFlags.set(MapSelectFlag::enable); + gMapSelectPositionA.x = mapTile.x; + gMapSelectPositionA.y = mapTile.y; + gMapSelectPositionB.x = mapTile.x; + gMapSelectPositionB.y = mapTile.y; + gMapSelectType = MapSelectType::full; + + MapInvalidateSelectionRect(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_1) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + money64 cost = TryPlaceGhostPathAddition({ mapTile, z }, selection.EntryIndex); + + gSceneryPlaceCost = cost; + } + + void onToolUpdateWall(WidgetIndex widgetIndex, const ScreenCoordsXY& screenPos, ScenerySelection selection) + { + CoordsXY mapTile = {}; + uint8_t edge; + + Sub6E1F34Wall(screenPos, selection.EntryIndex, mapTile, &edge); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + gMapSelectFlags.set(MapSelectFlag::enable); + gMapSelectPositionA.x = mapTile.x; + gMapSelectPositionA.y = mapTile.y; + gMapSelectPositionB.x = mapTile.x; + gMapSelectPositionB.y = mapTile.y; + gMapSelectType = getMapSelectEdge(edge); + + MapInvalidateSelectionRect(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_2) && mapTile == gSceneryGhostPosition + && edge == gSceneryGhostWallRotation && gSceneryPlaceZ == _unkF64F0A) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + gSceneryGhostWallRotation = edge; + _unkF64F0A = gSceneryPlaceZ; + + uint8_t attemptsLeft = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + attemptsLeft = 20; + } + + money64 cost = 0; + for (; attemptsLeft != 0; attemptsLeft--) + { + cost = TryPlaceGhostWall( + { mapTile, gSceneryPlaceZ }, edge, selection.EntryIndex, _sceneryPrimaryColour, _scenerySecondaryColour, + _sceneryTertiaryColour); + + if (cost != kMoney64Undefined) + break; + gSceneryPlaceZ += 8; + } + + gSceneryPlaceCost = cost; + } + + void onToolUpdateLargeScenery(WidgetIndex widgetIndex, const ScreenCoordsXY& screenPos, ScenerySelection selection) + { + CoordsXY mapTile = {}; + Direction direction; + + Sub6E1F34LargeScenery(screenPos, selection.EntryIndex, mapTile, &direction); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + auto* sceneryEntry = ObjectManager::GetObjectEntry(selection.EntryIndex); + gMapSelectionTiles.clear(); + + for (auto& tile : sceneryEntry->tiles) + { + CoordsXY tileLocation = { tile.offset }; + auto rotatedTileCoords = tileLocation.Rotate(direction); + + rotatedTileCoords.x += mapTile.x; + rotatedTileCoords.y += mapTile.y; + + gMapSelectionTiles.push_back(rotatedTileCoords); + } + + gMapSelectFlags.set(MapSelectFlag::enableConstruct); + MapInvalidateMapSelectionTiles(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_3) && mapTile == gSceneryGhostPosition && gSceneryPlaceZ == _unkF64F0A + && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_LARGE + && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + gSceneryPlaceObject.SceneryType = SCENERY_TYPE_LARGE; + gSceneryPlaceObject.EntryIndex = selection.EntryIndex; + _unkF64F0A = gSceneryPlaceZ; + + uint8_t attemptsLeft = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + attemptsLeft = 20; + } + + money64 cost = 0; + for (; attemptsLeft != 0; attemptsLeft--) + { + cost = TryPlaceGhostLargeScenery( + { mapTile, gSceneryPlaceZ, direction }, selection.EntryIndex, _sceneryPrimaryColour, + _scenerySecondaryColour, _sceneryTertiaryColour); + + if (cost != kMoney64Undefined) + break; + gSceneryPlaceZ += kCoordsZStep; + } + + gSceneryPlaceCost = cost; + } + + void onToolUpdateBanner(WidgetIndex widgetIndex, const ScreenCoordsXY& screenPos, ScenerySelection selection) + { + CoordsXY mapTile = {}; + Direction direction; + int32_t z; + + Sub6E1F34Banner(screenPos, selection.EntryIndex, mapTile, &z, &direction); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + gMapSelectFlags.set(MapSelectFlag::enable); + gMapSelectPositionA.x = mapTile.x; + gMapSelectPositionA.y = mapTile.y; + gMapSelectPositionB.x = mapTile.x; + gMapSelectPositionB.y = mapTile.y; + gMapSelectType = MapSelectType::full; + + MapInvalidateSelectionRect(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_4) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z + && direction == gSceneryPlaceRotation) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + money64 cost = TryPlaceGhostBanner({ mapTile, z, direction }, selection.EntryIndex); + + gSceneryPlaceCost = cost; + } + /** * * rct2: 0x006E287B */ - void ToolUpdateScenery(const ScreenCoordsXY& screenPos) + void onToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenPos) override { MapInvalidateSelectionRect(); MapInvalidateMapSelectionTiles(); @@ -1805,281 +1993,27 @@ namespace OpenRCT2::Ui::Windows return; } - money64 cost = 0; - switch (selection.SceneryType) { case SCENERY_TYPE_SMALL: { - CoordsXY mapTile = {}; - uint8_t quadrant; - Direction rotation; - - Sub6E1F34SmallScenery(screenPos, selection.EntryIndex, mapTile, &quadrant, &rotation); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - gMapSelectFlags.set(MapSelectFlag::enable); - if (gWindowSceneryScatterEnabled) - { - uint16_t cluster_size = (gWindowSceneryScatterSize - 1) * kCoordsXYStep; - gMapSelectPositionA.x = mapTile.x - cluster_size / 2; - gMapSelectPositionA.y = mapTile.y - cluster_size / 2; - gMapSelectPositionB.x = mapTile.x + cluster_size / 2; - gMapSelectPositionB.y = mapTile.y + cluster_size / 2; - if (gWindowSceneryScatterSize % 2 == 0) - { - gMapSelectPositionB.x += kCoordsXYStep; - gMapSelectPositionB.y += kCoordsXYStep; - } - } - else - { - gMapSelectPositionA.x = mapTile.x; - gMapSelectPositionA.y = mapTile.y; - gMapSelectPositionB.x = mapTile.x; - gMapSelectPositionB.y = mapTile.y; - } - - auto* sceneryEntry = ObjectManager::GetObjectEntry(selection.EntryIndex); - - gMapSelectType = MapSelectType::full; - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) - { - gMapSelectType = getMapSelectQuarter((quadrant ^ 2)); - } - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_0) && mapTile == gSceneryGhostPosition && quadrant == _unkF64F0E - && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_SMALL - && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - _unkF64F0E = quadrant; - _unkF64F0A = gSceneryPlaceZ; - - uint8_t attemptsLeft = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - attemptsLeft = 20; - } - - for (; attemptsLeft != 0; attemptsLeft--) - { - cost = TryPlaceGhostSmallScenery( - { mapTile, gSceneryPlaceZ, rotation }, quadrant, selection.EntryIndex, _sceneryPrimaryColour, - _scenerySecondaryColour, _sceneryTertiaryColour); - - if (cost != kMoney64Undefined) - break; - gSceneryPlaceZ += 8; - } - - gSceneryPlaceCost = cost; - break; + return onToolUpdateSmallScenery(widgetIndex, screenPos, selection); } case SCENERY_TYPE_PATH_ITEM: { - CoordsXY mapTile = {}; - int32_t z; - - Sub6E1F34PathItem(screenPos, selection.EntryIndex, mapTile, &z); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - gMapSelectFlags.set(MapSelectFlag::enable); - gMapSelectPositionA.x = mapTile.x; - gMapSelectPositionA.y = mapTile.y; - gMapSelectPositionB.x = mapTile.x; - gMapSelectPositionB.y = mapTile.y; - gMapSelectType = MapSelectType::full; - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_1) && mapTile == gSceneryGhostPosition - && z == gSceneryGhostPosition.z) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - cost = TryPlaceGhostPathAddition({ mapTile, z }, selection.EntryIndex); - - gSceneryPlaceCost = cost; - break; + return onToolUpdatePathItem(widgetIndex, screenPos, selection); } case SCENERY_TYPE_WALL: { - CoordsXY mapTile = {}; - uint8_t edge; - - Sub6E1F34Wall(screenPos, selection.EntryIndex, mapTile, &edge); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - gMapSelectFlags.set(MapSelectFlag::enable); - gMapSelectPositionA.x = mapTile.x; - gMapSelectPositionA.y = mapTile.y; - gMapSelectPositionB.x = mapTile.x; - gMapSelectPositionB.y = mapTile.y; - gMapSelectType = getMapSelectEdge(edge); - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_2) && mapTile == gSceneryGhostPosition - && edge == gSceneryGhostWallRotation && gSceneryPlaceZ == _unkF64F0A) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - gSceneryGhostWallRotation = edge; - _unkF64F0A = gSceneryPlaceZ; - - uint8_t attemptsLeft = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - attemptsLeft = 20; - } - - cost = 0; - for (; attemptsLeft != 0; attemptsLeft--) - { - cost = TryPlaceGhostWall( - { mapTile, gSceneryPlaceZ }, edge, selection.EntryIndex, _sceneryPrimaryColour, - _scenerySecondaryColour, _sceneryTertiaryColour); - - if (cost != kMoney64Undefined) - break; - gSceneryPlaceZ += 8; - } - - gSceneryPlaceCost = cost; - break; + return onToolUpdateWall(widgetIndex, screenPos, selection); } case SCENERY_TYPE_LARGE: { - CoordsXY mapTile = {}; - Direction direction; - - Sub6E1F34LargeScenery(screenPos, selection.EntryIndex, mapTile, &direction); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - auto* sceneryEntry = ObjectManager::GetObjectEntry(selection.EntryIndex); - gMapSelectionTiles.clear(); - - for (auto& tile : sceneryEntry->tiles) - { - CoordsXY tileLocation = { tile.offset }; - auto rotatedTileCoords = tileLocation.Rotate(direction); - - rotatedTileCoords.x += mapTile.x; - rotatedTileCoords.y += mapTile.y; - - gMapSelectionTiles.push_back(rotatedTileCoords); - } - - gMapSelectFlags.set(MapSelectFlag::enableConstruct); - MapInvalidateMapSelectionTiles(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_3) && mapTile == gSceneryGhostPosition - && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_LARGE - && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - gSceneryPlaceObject.SceneryType = SCENERY_TYPE_LARGE; - gSceneryPlaceObject.EntryIndex = selection.EntryIndex; - _unkF64F0A = gSceneryPlaceZ; - - uint8_t attemptsLeft = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - attemptsLeft = 20; - } - - cost = 0; - for (; attemptsLeft != 0; attemptsLeft--) - { - cost = TryPlaceGhostLargeScenery( - { mapTile, gSceneryPlaceZ, direction }, selection.EntryIndex, _sceneryPrimaryColour, - _scenerySecondaryColour, _sceneryTertiaryColour); - - if (cost != kMoney64Undefined) - break; - gSceneryPlaceZ += kCoordsZStep; - } - - gSceneryPlaceCost = cost; - break; + return onToolUpdateLargeScenery(widgetIndex, screenPos, selection); } case SCENERY_TYPE_BANNER: { - CoordsXY mapTile = {}; - Direction direction; - int32_t z; - - Sub6E1F34Banner(screenPos, selection.EntryIndex, mapTile, &z, &direction); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - gMapSelectFlags.set(MapSelectFlag::enable); - gMapSelectPositionA.x = mapTile.x; - gMapSelectPositionA.y = mapTile.y; - gMapSelectPositionB.x = mapTile.x; - gMapSelectPositionB.y = mapTile.y; - gMapSelectType = MapSelectType::full; - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_4) && mapTile == gSceneryGhostPosition - && z == gSceneryGhostPosition.z && direction == gSceneryPlaceRotation) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - cost = TryPlaceGhostBanner({ mapTile, z, direction }, selection.EntryIndex); - - gSceneryPlaceCost = cost; - break; + return onToolUpdateBanner(widgetIndex, screenPos, selection); } } } @@ -2453,7 +2387,7 @@ namespace OpenRCT2::Ui::Windows { gSceneryShiftPressZOffset = mainWnd->viewport->zoom.ApplyTo(gSceneryShiftPressZOffset); } - gSceneryShiftPressZOffset = floor2(gSceneryShiftPressZOffset, 8); + gSceneryShiftPressZOffset = Numerics::floor2(gSceneryShiftPressZOffset, 8); screenPos.x = gSceneryShiftPressX; screenPos.y = gSceneryShiftPressY; @@ -2573,7 +2507,7 @@ namespace OpenRCT2::Ui::Windows rotation -= GetCurrentRotation(); rotation &= 0x3; - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { VirtualFloorSetHeight(gSceneryPlaceZ); } @@ -2657,7 +2591,7 @@ namespace OpenRCT2::Ui::Windows rotation -= GetCurrentRotation(); rotation &= 0x3; - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { VirtualFloorSetHeight(gSceneryPlaceZ); } @@ -2692,7 +2626,7 @@ namespace OpenRCT2::Ui::Windows return; } - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { VirtualFloorSetHeight(gSceneryPlaceZ); } @@ -2783,7 +2717,7 @@ namespace OpenRCT2::Ui::Windows if (gridPos.IsNull()) return; - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { VirtualFloorSetHeight(gSceneryPlaceZ); } @@ -2884,7 +2818,7 @@ namespace OpenRCT2::Ui::Windows rotation -= GetCurrentRotation(); rotation &= 0x3; - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { VirtualFloorSetHeight(gSceneryPlaceZ); } @@ -2933,7 +2867,7 @@ namespace OpenRCT2::Ui::Windows } } - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { VirtualFloorSetHeight(gSceneryPlaceZ); } @@ -2942,11 +2876,304 @@ namespace OpenRCT2::Ui::Windows *outZ = z; } + void onToolDownSmallScenery(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, uint16_t selectedScenery) + { + CoordsXY gridPos; + uint8_t quadrant; + Direction rotation; + + Sub6E1F34SmallScenery(screenCoords, selectedScenery, gridPos, &quadrant, &rotation); + if (gridPos.IsNull()) + return; + + int32_t quantity = 1; + bool isCluster = gWindowSceneryScatterEnabled + && (Network::GetMode() != Network::Mode::client + || Network::CanPerformCommand(Network::GetCurrentPlayerGroupIndex(), -2)); + + if (isCluster) + { + switch (gWindowSceneryScatterDensity) + { + case ScatterToolDensity::LowDensity: + quantity = gWindowSceneryScatterSize; + break; + + case ScatterToolDensity::MediumDensity: + quantity = gWindowSceneryScatterSize * 2; + break; + + case ScatterToolDensity::HighDensity: + quantity = gWindowSceneryScatterSize * 3; + break; + } + } + + bool forceError = true; + for (int32_t q = 0; q < quantity; q++) + { + int32_t zCoordinate = gSceneryPlaceZ; + auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery); + + int16_t cur_grid_x = gridPos.x; + int16_t cur_grid_y = gridPos.y; + + if (isCluster) + { + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) + { + quadrant = UtilRand() & 3; + } + + int16_t grid_x_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); + int16_t grid_y_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); + if (gWindowSceneryScatterSize % 2 == 0) + { + grid_x_offset += 1; + grid_y_offset += 1; + } + cur_grid_x += grid_x_offset * kCoordsXYStep; + cur_grid_y += grid_y_offset * kCoordsXYStep; + + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) + { + gSceneryPlaceRotation = (gSceneryPlaceRotation + 1) & 3; + } + } + + uint8_t zAttemptRange = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + zAttemptRange = 20; + } + + auto success = GameActions::Status::Unknown; + // Try find a valid z coordinate + for (; zAttemptRange != 0; zAttemptRange--) + { + auto smallSceneryPlaceAction = GameActions::SmallSceneryPlaceAction( + { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, + _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); + + auto& gameState = getGameState(); + auto res = GameActions::Query(&smallSceneryPlaceAction, gameState); + success = res.Error; + if (res.Error == GameActions::Status::Ok) + { + break; + } + + if (res.Error == GameActions::Status::InsufficientFunds) + { + break; + } + if (zAttemptRange != 1) + { + gSceneryPlaceZ += 8; + } + } + + // Actually place + if (success == GameActions::Status::Ok || ((q + 1 == quantity) && forceError)) + { + auto smallSceneryPlaceAction = GameActions::SmallSceneryPlaceAction( + { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, + _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); + + smallSceneryPlaceAction.SetCallback( + [=](const GameActions::GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + Audio::Play3D(Audio::SoundId::placeItem, result->Position); + } + }); + + auto& gameState = getGameState(); + auto res = GameActions::Execute(&smallSceneryPlaceAction, gameState); + if (res.Error == GameActions::Status::Ok) + { + forceError = false; + } + + if (res.Error == GameActions::Status::InsufficientFunds) + { + break; + } + } + gSceneryPlaceZ = zCoordinate; + } + } + + void onToolDownPathItem(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, uint16_t selectedScenery) + { + CoordsXY gridPos; + int32_t z; + + Sub6E1F34PathItem(screenCoords, selectedScenery, gridPos, &z); + if (gridPos.IsNull()) + return; + + auto footpathAdditionPlaceAction = GameActions::FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery); + + footpathAdditionPlaceAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + { + return; + } + Audio::Play3D(Audio::SoundId::placeItem, result->Position); + }); + + auto& gameState = getGameState(); + auto res = GameActions::Execute(&footpathAdditionPlaceAction, gameState); + } + + void onToolDownWall(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, uint16_t selectedScenery) + { + CoordsXY gridPos; + uint8_t edges; + Sub6E1F34Wall(screenCoords, selectedScenery, gridPos, &edges); + if (gridPos.IsNull()) + return; + + uint8_t zAttemptRange = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + zAttemptRange = 20; + } + + for (; zAttemptRange != 0; zAttemptRange--) + { + auto wallPlaceAction = GameActions::WallPlaceAction( + selectedScenery, { gridPos, gSceneryPlaceZ }, edges, _sceneryPrimaryColour, _scenerySecondaryColour, + _sceneryTertiaryColour); + + auto& gameState = getGameState(); + auto res = GameActions::Query(&wallPlaceAction, gameState); + if (res.Error == GameActions::Status::Ok) + { + break; + } + + if (const auto* message = std::get_if(&res.ErrorMessage)) + { + if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) + { + break; + } + } + + if (zAttemptRange != 1) + { + gSceneryPlaceZ += 8; + } + } + + auto wallPlaceAction = GameActions::WallPlaceAction( + selectedScenery, { gridPos, gSceneryPlaceZ }, edges, _sceneryPrimaryColour, _scenerySecondaryColour, + _sceneryTertiaryColour); + + wallPlaceAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + Audio::Play3D(Audio::SoundId::placeItem, result->Position); + } + }); + + auto& gameState = getGameState(); + auto res = GameActions::Execute(&wallPlaceAction, gameState); + } + + void onToolDownLargeScenery(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, uint16_t selectedScenery) + { + CoordsXY gridPos; + Direction direction; + Sub6E1F34LargeScenery(screenCoords, selectedScenery, gridPos, &direction); + if (gridPos.IsNull()) + return; + + uint8_t zAttemptRange = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + zAttemptRange = 20; + } + + for (; zAttemptRange != 0; zAttemptRange--) + { + CoordsXYZD loc = { gridPos, gSceneryPlaceZ, direction }; + + auto sceneryPlaceAction = GameActions::LargeSceneryPlaceAction( + loc, selectedScenery, _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); + + auto& gameState = getGameState(); + auto res = GameActions::Query(&sceneryPlaceAction, gameState); + if (res.Error == GameActions::Status::Ok) + { + break; + } + + if (const auto* message = std::get_if(&res.ErrorMessage)) + { + if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) + { + break; + } + } + + if (zAttemptRange != 1) + { + gSceneryPlaceZ += 8; + } + } + + CoordsXYZD loc = { gridPos, gSceneryPlaceZ, direction }; + + auto sceneryPlaceAction = GameActions::LargeSceneryPlaceAction( + loc, selectedScenery, _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); + sceneryPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + Audio::Play3D(Audio::SoundId::placeItem, result->Position); + } + else + { + Audio::Play3D(Audio::SoundId::error, { loc.x, loc.y, gSceneryPlaceZ }); + } + }); + + auto& gameState = getGameState(); + auto res = GameActions::Execute(&sceneryPlaceAction, gameState); + } + + void onToolDownBanner(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, uint16_t selectedScenery) + { + CoordsXY gridPos; + int32_t z; + Direction direction; + Sub6E1F34Banner(screenCoords, selectedScenery, gridPos, &z, &direction); + if (gridPos.IsNull()) + return; + + CoordsXYZD loc{ gridPos, z, direction }; + auto primaryColour = _sceneryPrimaryColour; + auto bannerPlaceAction = GameActions::BannerPlaceAction(loc, selectedScenery, primaryColour); + bannerPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + auto data = result->GetData(); + Audio::Play3D(Audio::SoundId::placeItem, result->Position); + ContextOpenDetailWindow(WindowDetail::banner, data.bannerId.ToUnderlying()); + } + }); + + auto& gameState = getGameState(); + GameActions::Execute(&bannerPlaceAction, gameState); + } + /** * * rct2: 0x006E2CC6 */ - void SceneryToolDown(const ScreenCoordsXY& screenCoords, WidgetIndex widgetIndex) + void onToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { SceneryRemoveGhostToolPlacement(); @@ -2965,288 +3192,38 @@ namespace OpenRCT2::Ui::Windows auto tabSelection = WindowSceneryGetTabSelection(); uint8_t sceneryType = tabSelection.SceneryType; uint16_t selectedScenery = tabSelection.EntryIndex; - CoordsXY gridPos; - - auto& gameState = getGameState(); switch (sceneryType) { case SCENERY_TYPE_SMALL: { - uint8_t quadrant; - Direction rotation; - Sub6E1F34SmallScenery(screenCoords, selectedScenery, gridPos, &quadrant, &rotation); - if (gridPos.IsNull()) - return; - - int32_t quantity = 1; - bool isCluster = gWindowSceneryScatterEnabled - && (Network::GetMode() != Network::Mode::client - || Network::CanPerformCommand(Network::GetCurrentPlayerGroupIndex(), -2)); - - if (isCluster) - { - switch (gWindowSceneryScatterDensity) - { - case ScatterToolDensity::LowDensity: - quantity = gWindowSceneryScatterSize; - break; - - case ScatterToolDensity::MediumDensity: - quantity = gWindowSceneryScatterSize * 2; - break; - - case ScatterToolDensity::HighDensity: - quantity = gWindowSceneryScatterSize * 3; - break; - } - } - - bool forceError = true; - for (int32_t q = 0; q < quantity; q++) - { - int32_t zCoordinate = gSceneryPlaceZ; - auto* sceneryEntry = ObjectManager::GetObjectEntry(selectedScenery); - - int16_t cur_grid_x = gridPos.x; - int16_t cur_grid_y = gridPos.y; - - if (isCluster) - { - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) - { - quadrant = UtilRand() & 3; - } - - int16_t grid_x_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); - int16_t grid_y_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); - if (gWindowSceneryScatterSize % 2 == 0) - { - grid_x_offset += 1; - grid_y_offset += 1; - } - cur_grid_x += grid_x_offset * kCoordsXYStep; - cur_grid_y += grid_y_offset * kCoordsXYStep; - - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) - { - gSceneryPlaceRotation = (gSceneryPlaceRotation + 1) & 3; - } - } - - uint8_t zAttemptRange = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - zAttemptRange = 20; - } - - auto success = GameActions::Status::Unknown; - // Try find a valid z coordinate - for (; zAttemptRange != 0; zAttemptRange--) - { - auto smallSceneryPlaceAction = GameActions::SmallSceneryPlaceAction( - { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, - _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); - auto res = GameActions::Query(&smallSceneryPlaceAction, gameState); - success = res.Error; - if (res.Error == GameActions::Status::Ok) - { - break; - } - - if (res.Error == GameActions::Status::InsufficientFunds) - { - break; - } - if (zAttemptRange != 1) - { - gSceneryPlaceZ += 8; - } - } - - // Actually place - if (success == GameActions::Status::Ok || ((q + 1 == quantity) && forceError)) - { - auto smallSceneryPlaceAction = GameActions::SmallSceneryPlaceAction( - { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, - _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); - - smallSceneryPlaceAction.SetCallback( - [=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - Audio::Play3D(Audio::SoundId::placeItem, result->Position); - } - }); - auto res = GameActions::Execute(&smallSceneryPlaceAction, gameState); - if (res.Error == GameActions::Status::Ok) - { - forceError = false; - } - - if (res.Error == GameActions::Status::InsufficientFunds) - { - break; - } - } - gSceneryPlaceZ = zCoordinate; - } - break; + return onToolDownSmallScenery(widgetIndex, screenCoords, selectedScenery); } + case SCENERY_TYPE_PATH_ITEM: { - int32_t z; - Sub6E1F34PathItem(screenCoords, selectedScenery, gridPos, &z); - if (gridPos.IsNull()) - return; - - auto footpathAdditionPlaceAction = GameActions::FootpathAdditionPlaceAction( - { gridPos, z }, selectedScenery); - - footpathAdditionPlaceAction.SetCallback( - [](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - { - return; - } - Audio::Play3D(Audio::SoundId::placeItem, result->Position); - }); - auto res = GameActions::Execute(&footpathAdditionPlaceAction, gameState); - break; + return onToolDownPathItem(widgetIndex, screenCoords, selectedScenery); } case SCENERY_TYPE_WALL: { - uint8_t edges; - Sub6E1F34Wall(screenCoords, selectedScenery, gridPos, &edges); - if (gridPos.IsNull()) - return; - - uint8_t zAttemptRange = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - zAttemptRange = 20; - } - - for (; zAttemptRange != 0; zAttemptRange--) - { - auto wallPlaceAction = GameActions::WallPlaceAction( - selectedScenery, { gridPos, gSceneryPlaceZ }, edges, _sceneryPrimaryColour, _scenerySecondaryColour, - _sceneryTertiaryColour); - - auto res = GameActions::Query(&wallPlaceAction, gameState); - if (res.Error == GameActions::Status::Ok) - { - break; - } - - if (const auto* message = std::get_if(&res.ErrorMessage)) - { - if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) - { - break; - } - } - - if (zAttemptRange != 1) - { - gSceneryPlaceZ += 8; - } - } - - auto wallPlaceAction = GameActions::WallPlaceAction( - selectedScenery, { gridPos, gSceneryPlaceZ }, edges, _sceneryPrimaryColour, _scenerySecondaryColour, - _sceneryTertiaryColour); - - wallPlaceAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - Audio::Play3D(Audio::SoundId::placeItem, result->Position); - } - }); - auto res = GameActions::Execute(&wallPlaceAction, gameState); - break; + return onToolDownWall(widgetIndex, screenCoords, selectedScenery); } case SCENERY_TYPE_LARGE: { - Direction direction; - Sub6E1F34LargeScenery(screenCoords, selectedScenery, gridPos, &direction); - if (gridPos.IsNull()) - return; - - uint8_t zAttemptRange = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - zAttemptRange = 20; - } - - for (; zAttemptRange != 0; zAttemptRange--) - { - CoordsXYZD loc = { gridPos, gSceneryPlaceZ, direction }; - - auto sceneryPlaceAction = GameActions::LargeSceneryPlaceAction( - loc, selectedScenery, _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); - - auto res = GameActions::Query(&sceneryPlaceAction, gameState); - if (res.Error == GameActions::Status::Ok) - { - break; - } - - if (const auto* message = std::get_if(&res.ErrorMessage)) - { - if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) - { - break; - } - } - - if (zAttemptRange != 1) - { - gSceneryPlaceZ += 8; - } - } - - CoordsXYZD loc = { gridPos, gSceneryPlaceZ, direction }; - - auto sceneryPlaceAction = GameActions::LargeSceneryPlaceAction( - loc, selectedScenery, _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); - sceneryPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - Audio::Play3D(Audio::SoundId::placeItem, result->Position); - } - else - { - Audio::Play3D(Audio::SoundId::error, { loc.x, loc.y, gSceneryPlaceZ }); - } - }); - auto res = GameActions::Execute(&sceneryPlaceAction, gameState); - break; + return onToolDownLargeScenery(widgetIndex, screenCoords, selectedScenery); } case SCENERY_TYPE_BANNER: { - int32_t z; - Direction direction; - Sub6E1F34Banner(screenCoords, selectedScenery, gridPos, &z, &direction); - if (gridPos.IsNull()) - return; - - CoordsXYZD loc{ gridPos, z, direction }; - auto primaryColour = _sceneryPrimaryColour; - auto bannerPlaceAction = GameActions::BannerPlaceAction(loc, selectedScenery, primaryColour); - bannerPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - auto data = result->GetData(); - Audio::Play3D(Audio::SoundId::placeItem, result->Position); - ContextOpenDetailWindow(WindowDetail::banner, data.bannerId.ToUnderlying()); - } - }); - GameActions::Execute(&bannerPlaceAction, gameState); - break; + return onToolDownBanner(widgetIndex, screenCoords, selectedScenery); } } } + + void onToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (_sceneryPaintEnabled || gWindowSceneryEyedropperEnabled) + onToolDown(widgetIndex, screenCoords); + } }; WindowBase* SceneryOpen() diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index e6568f89de..8297e5aa96 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -19,6 +19,7 @@ #include #include #include + #include #include #include #include @@ -28,6 +29,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr ScreenSize kMinimumWindowSize = { 500, 288 }; @@ -91,7 +94,7 @@ namespace OpenRCT2::Ui::Windows void onOpen() override { - _playerName = Config::Get().network.PlayerName; + _playerName = Config::Get().network.playerName; setWidgets(_serverListWidgets); widgets[WIDX_PLAYER_NAME_INPUT].string = const_cast(_playerName.c_str()); initScrollWidgets(); @@ -275,7 +278,7 @@ namespace OpenRCT2::Ui::Windows return; _playerName = temp; - Config::Get().network.PlayerName = _playerName; + Config::Get().network.playerName = _playerName; widgets[WIDX_PLAYER_NAME_INPUT].string = const_cast(_playerName.c_str()); invalidateWidget(WIDX_PLAYER_NAME_INPUT); @@ -344,7 +347,7 @@ namespace OpenRCT2::Ui::Windows // Draw hover highlight if (highlighted) { - GfxFilterRect( + Rectangle::filter( rt, { 0, screenCoords.y, listWidgetWidth, screenCoords.y + kItemHeight }, FilterPaletteID::paletteDarken1); _version = serverDetails.Version; diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index 8f1781e719..e2e6806156 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -78,10 +78,10 @@ namespace OpenRCT2::Ui::Windows page = 0; listInformationType = 0; - snprintf(_port, 7, "%u", Config::Get().network.DefaultPort); - String::safeUtf8Copy(_name, Config::Get().network.ServerName.c_str(), sizeof(_name)); - String::safeUtf8Copy(_description, Config::Get().network.ServerDescription.c_str(), sizeof(_description)); - String::safeUtf8Copy(_greeting, Config::Get().network.ServerGreeting.c_str(), sizeof(_greeting)); + snprintf(_port, 7, "%u", Config::Get().network.defaultPort); + String::safeUtf8Copy(_name, Config::Get().network.serverName.c_str(), sizeof(_name)); + String::safeUtf8Copy(_description, Config::Get().network.serverDescription.c_str(), sizeof(_description)); + String::safeUtf8Copy(_greeting, Config::Get().network.serverGreeting.c_str(), sizeof(_greeting)); } void onMouseUp(WidgetIndex widgetIndex) override { @@ -106,23 +106,23 @@ namespace OpenRCT2::Ui::Windows WindowStartTextbox(*this, widgetIndex, _password, 32); break; case WIDX_MAXPLAYERS_INCREASE: - if (Config::Get().network.Maxplayers < 255) + if (Config::Get().network.maxplayers < 255) { - Config::Get().network.Maxplayers++; + Config::Get().network.maxplayers++; } Config::Save(); invalidate(); break; case WIDX_MAXPLAYERS_DECREASE: - if (Config::Get().network.Maxplayers > 1) + if (Config::Get().network.maxplayers > 1) { - Config::Get().network.Maxplayers--; + Config::Get().network.maxplayers--; } Config::Save(); invalidate(); break; case WIDX_ADVERTISE_CHECKBOX: - Config::Get().network.Advertise = !Config::Get().network.Advertise; + Config::Get().network.advertise = !Config::Get().network.advertise; Config::Save(); invalidate(); break; @@ -144,10 +144,10 @@ namespace OpenRCT2::Ui::Windows { ColourSchemeUpdateByClass(this, WindowClass::serverList); - setCheckboxValue(WIDX_ADVERTISE_CHECKBOX, Config::Get().network.Advertise); + setCheckboxValue(WIDX_ADVERTISE_CHECKBOX, Config::Get().network.advertise); auto ft = Formatter::Common(); ft.Increment(18); - ft.Add(Config::Get().network.Maxplayers); + ft.Add(Config::Get().network.maxplayers); } void onUpdate() override { @@ -177,7 +177,7 @@ namespace OpenRCT2::Ui::Windows tempPort = atoi(_port); if (tempPort > 0) { - Config::Get().network.DefaultPort = tempPort; + Config::Get().network.defaultPort = tempPort; Config::Save(); } @@ -192,7 +192,7 @@ namespace OpenRCT2::Ui::Windows // Don't allow empty server names if (_name[0] != '\0') { - Config::Get().network.ServerName = _name; + Config::Get().network.serverName = _name; Config::Save(); } @@ -203,7 +203,7 @@ namespace OpenRCT2::Ui::Windows return; String::safeUtf8Copy(_description, temp.c_str(), sizeof(_description)); - Config::Get().network.ServerDescription = _description; + Config::Get().network.serverDescription = _description; Config::Save(); invalidateWidget(WIDX_DESCRIPTION_INPUT); @@ -213,7 +213,7 @@ namespace OpenRCT2::Ui::Windows return; String::safeUtf8Copy(_greeting, temp.c_str(), sizeof(_greeting)); - Config::Get().network.ServerGreeting = _greeting; + Config::Get().network.serverGreeting = _greeting; Config::Save(); invalidateWidget(WIDX_GREETING_INPUT); @@ -257,7 +257,7 @@ namespace OpenRCT2::Ui::Windows GameNotifyMapChange(); if (GetContext()->LoadParkFromFile(path, false, true)) { - Network::BeginServer(Config::Get().network.DefaultPort, Config::Get().network.ListenAddress); + Network::BeginServer(Config::Get().network.defaultPort, Config::Get().network.listenAddress); } } @@ -267,7 +267,7 @@ namespace OpenRCT2::Ui::Windows { GameNotifyMapChange(); GetContext()->LoadParkFromFile(path); - Network::BeginServer(Config::Get().network.DefaultPort, Config::Get().network.ListenAddress); + Network::BeginServer(Config::Get().network.defaultPort, Config::Get().network.listenAddress); } } }; diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 7c1c266651..9443b9efb9 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -15,10 +15,13 @@ #include #include #include +#include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { WindowBase* ResetShortcutKeysPromptOpen(); @@ -41,9 +44,9 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr auto _shortcutWidgets = makeWidgets( makeWindowShim(kWindowTitle, kWindowSize), - makeWidget({0, 43}, {350, 287}, WidgetType::resize, WindowColour::secondary ), - makeWidget({4, 47}, {412, 215}, WidgetType::scroll, WindowColour::primary, SCROLL_VERTICAL, STR_SHORTCUT_LIST_TIP ), - makeWidget({4, kWindowSize.height - 15}, {150, 12}, WidgetType::button, WindowColour::primary, STR_SHORTCUT_ACTION_RESET, STR_SHORTCUT_ACTION_RESET_TIP) + makeWidget({0, 43}, {350, 287}, WidgetType::resize, WindowColour::secondary ), + makeWidget({4, 47}, {412, 215}, WidgetType::scroll, WindowColour::secondary, SCROLL_VERTICAL, STR_SHORTCUT_LIST_TIP ), + makeWidget({4, kWindowSize.height - 15}, {150, 12}, WidgetType::button, WindowColour::secondary, STR_SHORTCUT_ACTION_RESET, STR_SHORTCUT_ACTION_RESET_TIP) ); // clang-format on @@ -297,7 +300,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { auto rtCoords = ScreenCoordsXY{ rt.x, rt.y }; - GfxFillRect( + Rectangle::fill( rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); @@ -501,8 +504,8 @@ namespace OpenRCT2::Ui::Windows void DrawSeparator(RenderTarget& rt, int32_t y, int32_t scrollWidth) { const int32_t top = y + (kScrollableRowHeight / 2) - 1; - GfxFillRect(rt, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0].colour].mid_dark); - GfxFillRect(rt, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0].colour].lightest); + Rectangle::fill(rt, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[1].colour].mid_dark); + Rectangle::fill(rt, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[1].colour].lightest); } void DrawItem(RenderTarget& rt, int32_t y, int32_t scrollWidth, const ShortcutStringPair& shortcut, bool isHighlighted) @@ -511,7 +514,8 @@ namespace OpenRCT2::Ui::Windows if (isHighlighted) { format = STR_WINDOW_COLOUR_2_STRINGID; - GfxFilterRect(rt, { 0, y - 1, scrollWidth, y + (kScrollableRowHeight - 2) }, FilterPaletteID::paletteDarken1); + Rectangle::filter( + rt, { 0, y - 1, scrollWidth, y + (kScrollableRowHeight - 2) }, FilterPaletteID::paletteDarken1); } auto bindingOffset = (scrollWidth * 2) / 3; diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index d55d08138d..b028aca961 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -137,7 +137,7 @@ namespace OpenRCT2::Ui::Windows *this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1, viewportWidget.height() - 1, Focus(CoordsXYZ{ signViewPosition, viewZ })); - viewport->flags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; + viewport->flags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; invalidate(); return true; @@ -320,7 +320,7 @@ namespace OpenRCT2::Ui::Windows *this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1, viewportWidget->height() - 1, Focus(CoordsXYZ{ signViewPos })); if (viewport != nullptr) - viewport->flags = Config::Get().general.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; + viewport->flags = Config::Get().general.alwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; invalidate(); } }; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index b8465dc462..9352eec3c5 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -143,7 +143,7 @@ namespace OpenRCT2::Ui::Windows return; if (staff->isEntertainer()) - _availableCostumes = getAvailableCostumeStrings(AnimationPeepType::Entertainer); + _availableCostumes = getAvailableCostumeStrings(AnimationPeepType::entertainer); ViewportInit(); } @@ -165,7 +165,7 @@ namespace OpenRCT2::Ui::Windows return; if (staff->isEntertainer()) - _availableCostumes = getAvailableCostumeStrings(AnimationPeepType::Entertainer); + _availableCostumes = getAvailableCostumeStrings(AnimationPeepType::entertainer); } void onMouseUp(WidgetIndex widgetIndex) override @@ -538,14 +538,6 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_FIRE].left = width - 25; widgets[WIDX_FIRE].right = width - 2; - - if (viewport != nullptr) - { - const Widget& viewportWidget = widgets[WIDX_VIEWPORT]; - viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }; - viewport->width = widgets[WIDX_VIEWPORT].width() - 1; - viewport->height = widgets[WIDX_VIEWPORT].height() - 1; - } } void OverviewDraw(RenderTarget& rt) @@ -612,7 +604,7 @@ namespace OpenRCT2::Ui::Windows if (page == WINDOW_STAFF_OVERVIEW) animFrame = _tabAnimationOffset / 4; - auto imageIndex = anim.base_image + 1 + anim.frame_offsets[animFrame] * 4; + auto imageIndex = anim.baseImage + 1 + anim.frameOffsets[animFrame] * 4; GfxDrawSprite(clippedRT, ImageId(imageIndex, staff->TshirtColour, staff->TrousersColour), screenCoords); } @@ -620,6 +612,20 @@ namespace OpenRCT2::Ui::Windows { WindowSetResize(*this, kWindowSize, { 500, 450 }); + if (viewport != nullptr) + { + const Widget& viewportWidget = widgets[WIDX_VIEWPORT]; + const auto reqViewportWidth = viewportWidget.width() - 1; + const auto reqViewportHeight = viewportWidget.height() - 1; + + viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }; + if (viewport->width != reqViewportWidth || viewport->height != reqViewportHeight) + { + viewport->width = reqViewportWidth; + viewport->height = reqViewportHeight; + } + } + ViewportInit(); } @@ -632,16 +638,16 @@ namespace OpenRCT2::Ui::Windows auto* animObj = objManager.GetLoadedObject(staff->AnimationObjectIndex); // Get walking animation length - const auto& walkingAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::Walking); - const auto walkingAnimLength = walkingAnim.frame_offsets.size(); + const auto& walkingAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::walking); + const auto walkingAnimLength = walkingAnim.frameOffsets.size(); // Overview tab animation offset _tabAnimationOffset++; _tabAnimationOffset %= walkingAnimLength * 4; // Get pickup animation length - const auto& pickAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::Hanging); - const auto pickAnimLength = pickAnim.frame_offsets.size(); + const auto& pickAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::hanging); + const auto pickAnimLength = pickAnim.frameOffsets.size(); // Update pickup animation frame pickedPeepFrame++; @@ -649,7 +655,7 @@ namespace OpenRCT2::Ui::Windows invalidateWidget(WIDX_TAB_1); - const std::optional tempFocus = staff->State != PeepState::Picked ? std::optional(Focus(staff->Id)) + const std::optional tempFocus = staff->State != PeepState::picked ? std::optional(Focus(staff->Id)) : std::nullopt; if (focus != tempFocus) { @@ -694,8 +700,8 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(staff->AnimationObjectIndex); - auto& pickupAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::Hanging); - auto baseImageId = pickupAnim.base_image + pickupAnim.frame_offsets[pickedPeepFrame >> 2]; + auto& pickupAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::hanging); + auto baseImageId = pickupAnim.baseImage + pickupAnim.frameOffsets[pickedPeepFrame >> 2]; gPickupPeepImage = ImageId(baseImageId, staff->TshirtColour, staff->TrousersColour); } @@ -830,7 +836,7 @@ namespace OpenRCT2::Ui::Windows switch (staff->AssignedStaffType) { - case StaffType::Entertainer: + case StaffType::entertainer: { widgets[WIDX_CHECKBOX_1].type = WidgetType::empty; widgets[WIDX_CHECKBOX_2].type = WidgetType::empty; @@ -858,7 +864,7 @@ namespace OpenRCT2::Ui::Windows break; } - case StaffType::Handyman: + case StaffType::handyman: widgets[WIDX_CHECKBOX_1].type = WidgetType::checkbox; widgets[WIDX_CHECKBOX_1].text = STR_STAFF_OPTION_SWEEP_FOOTPATHS; widgets[WIDX_CHECKBOX_2].type = WidgetType::checkbox; @@ -871,7 +877,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_COSTUME_BTN].type = WidgetType::empty; OptionsSetCheckboxValues(); break; - case StaffType::Mechanic: + case StaffType::mechanic: widgets[WIDX_CHECKBOX_1].type = WidgetType::checkbox; widgets[WIDX_CHECKBOX_1].text = STR_INSPECT_RIDES; widgets[WIDX_CHECKBOX_2].type = WidgetType::checkbox; @@ -883,10 +889,10 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_COSTUME_BTN].type = WidgetType::empty; OptionsSetCheckboxValues(); break; - case StaffType::Security: + case StaffType::security: // Security guards don't have an options screen. break; - case StaffType::Count: + case StaffType::count: break; } } @@ -950,7 +956,7 @@ namespace OpenRCT2::Ui::Windows switch (staff->AssignedStaffType) { - case StaffType::Handyman: + case StaffType::handyman: ft = Formatter(); ft.Add(staff->StaffLawnsMown); DrawTextBasic(rt, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft); @@ -970,7 +976,7 @@ namespace OpenRCT2::Ui::Windows ft.Add(staff->StaffBinsEmptied); DrawTextBasic(rt, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft); break; - case StaffType::Mechanic: + case StaffType::mechanic: ft = Formatter(); ft.Add(staff->StaffRidesInspected); DrawTextBasic(rt, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft); @@ -980,13 +986,13 @@ namespace OpenRCT2::Ui::Windows ft.Add(staff->StaffRidesFixed); DrawTextBasic(rt, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft); break; - case StaffType::Security: + case StaffType::security: ft = Formatter(); ft.Add(staff->StaffVandalsStopped); DrawTextBasic(rt, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft); break; - case StaffType::Entertainer: - case StaffType::Count: + case StaffType::entertainer: + case StaffType::count: break; } } @@ -1027,7 +1033,7 @@ namespace OpenRCT2::Ui::Windows setWidgetDisabled(widgetIndex, false); } - if (staff->AssignedStaffType == StaffType::Security) + if (staff->AssignedStaffType == StaffType::security) { setWidgetDisabled(WIDX_TAB_2, true); } @@ -1043,7 +1049,7 @@ namespace OpenRCT2::Ui::Windows setWidgetDisabled(WIDX_PICKUP, true); } - setWidgetDisabled(WIDX_FIRE, staff->State == PeepState::Fixing || staff->State == PeepState::Inspecting); + setWidgetDisabled(WIDX_FIRE, staff->State == PeepState::fixing || staff->State == PeepState::inspecting); } } @@ -1119,7 +1125,7 @@ namespace OpenRCT2::Ui::Windows } std::optional tempFocus; - if (staff->State != PeepState::Picked) + if (staff->State != PeepState::picked) { tempFocus = Focus(staff->Id); } @@ -1137,7 +1143,7 @@ namespace OpenRCT2::Ui::Windows else { viewport_flags = 0; - if (Config::Get().general.AlwaysShowGridlines) + if (Config::Get().general.alwaysShowGridlines) viewport_flags |= VIEWPORT_FLAG_GRIDLINES; } @@ -1145,7 +1151,7 @@ namespace OpenRCT2::Ui::Windows focus = tempFocus; - if (staff->State != PeepState::Picked) + if (staff->State != PeepState::picked) { if (viewport == nullptr) { diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 499ee6a73e..95d1a49008 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum @@ -170,10 +173,10 @@ namespace OpenRCT2::Ui::Windows auto* animObj = findPeepAnimationsObjectForType(animPeepType); if (animObj != nullptr) { - auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::Normal); + auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::normal); _tabAnimationIndex++; - if (_tabAnimationIndex >= anim.frame_offsets.size() * 4) + if (_tabAnimationIndex >= anim.frameOffsets.size() * 4) _tabAnimationIndex = 0; invalidateWidget(WIDX_STAFF_LIST_HANDYMEN_TAB + _selectedTab); @@ -250,7 +253,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_STAFF_LIST_HIRE_BUTTON].text = GetStaffNamingConvention(GetSelectedStaffType()).ActionHire; widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WidgetType::empty; - if (GetSelectedStaffType() != StaffType::Entertainer) + if (GetSelectedStaffType() != StaffType::entertainer) { widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WidgetType::colourBtn; widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image = getColourButtonImage( @@ -283,7 +286,7 @@ namespace OpenRCT2::Ui::Windows DrawTextBasic(rt, windowPos + ScreenCoordsXY{ width - 155, y }, STR_COST_PER_MONTH, ft); } - if (GetSelectedStaffType() != StaffType::Entertainer) + if (GetSelectedStaffType() != StaffType::entertainer) { DrawTextBasic( rt, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 }, @@ -367,7 +370,7 @@ namespace OpenRCT2::Ui::Windows void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { auto rtCoords = ScreenCoordsXY{ rt.x, rt.y }; - GfxFillRect( + Rectangle::fill( rt, { rtCoords, rtCoords + ScreenCoordsXY{ rt.width - 1, rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); @@ -400,7 +403,7 @@ namespace OpenRCT2::Ui::Windows if (i == _highlightedIndex) { - GfxFilterRect(rt, { 0, y, 800, y + (kScrollableRowHeight - 1) }, FilterPaletteID::paletteDarken1); + Rectangle::filter(rt, { 0, y, 800, y + (kScrollableRowHeight - 1) }, FilterPaletteID::paletteDarken1); format = STR_WINDOW_COLOUR_2_STRINGID; if (_quickFireMode) @@ -511,7 +514,7 @@ namespace OpenRCT2::Ui::Windows */ void HireNewMember(StaffType staffType) { - bool autoPosition = Config::Get().general.AutoStaffPlacement; + bool autoPosition = Config::Get().general.autoStaffPlacement; if (GetInputManager().isModifierKeyPressed(ModifierKey::shift)) { autoPosition = autoPosition ^ 1; @@ -519,22 +522,22 @@ namespace OpenRCT2::Ui::Windows uint32_t staffOrders = 0; - if (staffType == StaffType::Handyman) + if (staffType == StaffType::handyman) { staffOrders = STAFF_ORDERS_SWEEPING | STAFF_ORDERS_WATER_FLOWERS | STAFF_ORDERS_EMPTY_BINS; - if (Config::Get().general.HandymenMowByDefault) + if (Config::Get().general.handymenMowByDefault) { staffOrders |= STAFF_ORDERS_MOWING; } } - else if (staffType == StaffType::Mechanic) + else if (staffType == StaffType::mechanic) { staffOrders = STAFF_ORDERS_INSPECT_RIDES | STAFF_ORDERS_FIX_RIDES; } auto animPeepType = AnimationPeepType(static_cast(staffType) + 1); ObjectEntryIndex costume; - if (staffType == StaffType::Entertainer) + if (staffType == StaffType::entertainer) costume = findRandomPeepAnimationsIndexForType(animPeepType); else costume = findPeepAnimationsIndexForType(animPeepType); @@ -552,7 +555,7 @@ namespace OpenRCT2::Ui::Windows return; // If autoposition of staff is disabled, pickup peep and then open the staff window - if (staff->State == PeepState::Picked) + if (staff->State == PeepState::picked) { CoordsXYZ nullLoc{}; nullLoc.SetNull(); @@ -595,10 +598,10 @@ namespace OpenRCT2::Ui::Windows void DrawTabImages(RenderTarget& rt) const { const auto& gameState = getGameState(); - DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_HANDYMEN, AnimationPeepType::Handyman, gameState.park.staffHandymanColour); - DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_MECHANICS, AnimationPeepType::Mechanic, gameState.park.staffMechanicColour); - DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_SECURITY, AnimationPeepType::Security, gameState.park.staffSecurityColour); - DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, AnimationPeepType::Entertainer); + DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_HANDYMEN, AnimationPeepType::handyman, gameState.park.staffHandymanColour); + DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_MECHANICS, AnimationPeepType::mechanic, gameState.park.staffMechanicColour); + DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_SECURITY, AnimationPeepType::security, gameState.park.staffSecurityColour); + DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, AnimationPeepType::entertainer); } void DrawTabImage(RenderTarget& rt, int32_t tabIndex, AnimationPeepType type, colour_t colour) const @@ -611,8 +614,8 @@ namespace OpenRCT2::Ui::Windows const auto& widget = widgets[widgetIndex]; auto frame = _selectedTab == tabIndex ? _tabAnimationIndex / 4 : 0; - auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::Normal); - auto imageId = anim.base_image + 1 + anim.frame_offsets[frame] * 4; + auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::normal); + auto imageId = anim.baseImage + 1 + anim.frameOffsets[frame] * 4; GfxDrawSprite( rt, ImageId(imageId, colour), @@ -634,8 +637,8 @@ namespace OpenRCT2::Ui::Windows widget.right - widget.left - 1, widget.bottom - widget.top - 1)) { auto frame = _selectedTab == tabIndex ? _tabAnimationIndex / 4 : 0; - auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::Normal); - auto imageId = anim.base_image + 1 + anim.frame_offsets[frame] * 4; + auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::normal); + auto imageId = anim.baseImage + 1 + anim.frameOffsets[frame] * 4; GfxDrawSprite(clippedDpi, ImageId(imageId), { 15, 23 }); } @@ -696,13 +699,13 @@ namespace OpenRCT2::Ui::Windows switch (type) { default: - case StaffType::Handyman: + case StaffType::handyman: return { STR_HANDYMAN_PLURAL, STR_HANDYMAN_SINGULAR, STR_HIRE_HANDYMAN }; - case StaffType::Mechanic: + case StaffType::mechanic: return { STR_MECHANIC_PLURAL, STR_MECHANIC_SINGULAR, STR_HIRE_MECHANIC }; - case StaffType::Security: + case StaffType::security: return { STR_SECURITY_GUARD_PLURAL, STR_SECURITY_GUARD_SINGULAR, STR_HIRE_SECURITY_GUARD }; - case StaffType::Entertainer: + case StaffType::entertainer: return { STR_ENTERTAINER_PLURAL, STR_ENTERTAINER_SINGULAR, STR_HIRE_ENTERTAINER }; } } @@ -711,9 +714,9 @@ namespace OpenRCT2::Ui::Windows { switch (type) { - case StaffType::Handyman: + case StaffType::handyman: return SPR_STAFF_ORDERS_SWEEPING; - case StaffType::Mechanic: + case StaffType::mechanic: return SPR_STAFF_ORDERS_INSPECT_RIDES; default: return 0; diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index cddd4dc901..d38ca289c3 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -17,10 +17,13 @@ #include #include #include +#include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr ScreenSize kWindowSize = { 250, 90 }; @@ -223,11 +226,12 @@ namespace OpenRCT2::Ui::Windows u8string_view{ _buffer.data(), _buffer.size() }, kWindowSize.width - (24 + 13), FontStyle::Medium, &wrappedString, &no_lines); - GfxFillRectInset( + Rectangle::fillInset( rt, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + kWindowSize.width - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } }, - colours[1], INSET_RECT_F_60); + colours[1], Rectangle::BorderStyle::inset, Rectangle::FillBrightness::light, + Rectangle::FillMode::dontLightenWhenInset); screenCoords.y += 1; @@ -267,7 +271,7 @@ namespace OpenRCT2::Ui::Windows { uint8_t colour = ColourMapA[colours[1].colour].mid_light; // TODO: palette index addition - GfxFillRect( + Rectangle::fill( rt, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } }, colour + 5); } diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index ee9a7d015b..8321fc1b1b 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum @@ -67,7 +70,8 @@ namespace OpenRCT2::Ui::Windows WIDX_THEMES_RCT1_RIDE_LIGHTS, WIDX_THEMES_RCT1_PARK_LIGHTS, WIDX_THEMES_RCT1_SCENARIO_FONT, - WIDX_THEMES_RCT1_BOTTOM_TOOLBAR + WIDX_THEMES_RCT1_BOTTOM_TOOLBAR, + WIDX_THEMES_USE_3D_IMAGE_BUTTONS, }; static constexpr StringId kWindowTitle = STR_THEMES_TITLE; @@ -101,7 +105,8 @@ namespace OpenRCT2::Ui::Windows makeWidget({ 10, 54}, {290, 12}, WidgetType::checkbox, WindowColour::secondary, STR_THEMES_OPTION_RCT1_RIDE_CONTROLS ), // rct1 ride lights makeWidget({ 10, 69}, {290, 12}, WidgetType::checkbox, WindowColour::secondary, STR_THEMES_OPTION_RCT1_PARK_CONTROLS ), // rct1 park lights makeWidget({ 10, 84}, {290, 12}, WidgetType::checkbox, WindowColour::secondary, STR_THEMES_OPTION_RCT1_SCENARIO_SELECTION_FONT ), // rct1 scenario font - makeWidget({ 10, 99}, {290, 12}, WidgetType::checkbox, WindowColour::secondary, STR_THEMES_OPTION_RCT1_BOTTOM_TOOLBAR ) // rct1 bottom toolbar + makeWidget({ 10, 99}, {290, 12}, WidgetType::checkbox, WindowColour::secondary, STR_THEMES_OPTION_RCT1_BOTTOM_TOOLBAR ), // rct1 bottom toolbar + makeWidget({ 10,114}, {290, 12}, WidgetType::checkbox, WindowColour::secondary, STR_THEMES_OPTION_USE_3D_IMAGE_BUTTONS ) // use 3D image buttons ); // clang-format on @@ -281,7 +286,7 @@ namespace OpenRCT2::Ui::Windows } else if (_selectedTab == WINDOW_THEMES_TAB_FEATURES) { - if (WindowSetResize(*this, { 320, 122 }, { 320, 122 })) + if (WindowSetResize(*this, { 320, 137 }, { 320, 137 })) GfxInvalidateScreen(); } else @@ -329,6 +334,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WidgetType::empty; widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WidgetType::empty; widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WidgetType::empty; + widgets[WIDX_THEMES_USE_3D_IMAGE_BUTTONS].type = WidgetType::empty; widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WidgetType::button; widgets[WIDX_THEMES_DELETE_BUTTON].type = WidgetType::button; widgets[WIDX_THEMES_RENAME_BUTTON].type = WidgetType::button; @@ -346,6 +352,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WidgetType::checkbox; widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WidgetType::checkbox; widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WidgetType::checkbox; + widgets[WIDX_THEMES_USE_3D_IMAGE_BUTTONS].type = WidgetType::checkbox; widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WidgetType::empty; widgets[WIDX_THEMES_DELETE_BUTTON].type = WidgetType::empty; widgets[WIDX_THEMES_RENAME_BUTTON].type = WidgetType::empty; @@ -358,6 +365,7 @@ namespace OpenRCT2::Ui::Windows setCheckboxValue( WIDX_THEMES_RCT1_SCENARIO_FONT, ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT); setCheckboxValue(WIDX_THEMES_RCT1_BOTTOM_TOOLBAR, ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR); + setCheckboxValue(WIDX_THEMES_USE_3D_IMAGE_BUTTONS, ThemeGetFlags() & UITHEME_FLAG_USE_3D_IMAGE_BUTTONS); } else { @@ -369,6 +377,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WidgetType::empty; widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WidgetType::empty; widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WidgetType::empty; + widgets[WIDX_THEMES_USE_3D_IMAGE_BUTTONS].type = WidgetType::empty; widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WidgetType::empty; widgets[WIDX_THEMES_DELETE_BUTTON].type = WidgetType::empty; widgets[WIDX_THEMES_RENAME_BUTTON].type = WidgetType::empty; @@ -497,6 +506,19 @@ namespace OpenRCT2::Ui::Windows ThemeSave(); windowMgr->InvalidateAll(); } + break; + case WIDX_THEMES_USE_3D_IMAGE_BUTTONS: + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); + } + else + { + ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_3D_IMAGE_BUTTONS)); + ThemeSave(); + windowMgr->InvalidateAll(); + } + break; } } @@ -700,7 +722,7 @@ namespace OpenRCT2::Ui::Windows return; if (!colours[1].hasFlag(ColourFlag::translucent)) - // GfxFillRect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, + // Rectangle::fill(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, // ColourMapA[colours[1].colour].mid_light); GfxClear(rt, ColourMapA[colours[1].colour].mid_light); screenCoords.y = 0; @@ -741,16 +763,16 @@ namespace OpenRCT2::Ui::Windows { TranslucentWindowPalette windowPalette = kTranslucentWindowPalettes[colour.colour]; - GfxFilterRect(rt, { leftTop, rightBottom }, windowPalette.highlight); - GfxFilterRect(rt, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow); + Rectangle::filter(rt, { leftTop, rightBottom }, windowPalette.highlight); + Rectangle::filter(rt, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow); } else { colour = ColourMapA[colours[1].colour].mid_dark; - GfxFillRect(rt, { leftTop, rightBottom }, colour.colour); + Rectangle::fill(rt, { leftTop, rightBottom }, colour.colour); colour = ColourMapA[colours[1].colour].lightest; - GfxFillRect(rt, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour.colour); + Rectangle::fill(rt, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour.colour); } } @@ -774,7 +796,9 @@ namespace OpenRCT2::Ui::Windows ScreenCoordsXY topLeft{ _check_offset_x, screenCoords.y + _check_offset_y + _button_size * j }; ScreenCoordsXY bottomRight{ _check_offset_x + 10, screenCoords.y + _check_offset_y + 11 + _button_size * j }; - GfxFillRectInset(rt, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0); + Rectangle::fillInset( + rt, { topLeft, bottomRight }, colours[1], Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::dark, Rectangle::FillMode::dontLightenWhenInset); if (colour.hasFlag(ColourFlag::translucent)) { DrawText( diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 10dec74619..d89e42f878 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -54,6 +55,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr StringId EntranceTypeStringIds[] = { @@ -1584,7 +1587,7 @@ static uint64_t PageDisabledWidgets[] = { void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override { const int32_t listWidth = widgets[WIDX_LIST].width(); - GfxFillRect( + Rectangle::fill( rt, { { rt.x, rt.y }, { rt.x + rt.width - 1, rt.y + rt.height - 1 } }, ColourMapA[colours[1].colour].mid_light); // Show usage hint when nothing is selected @@ -1619,12 +1622,12 @@ static uint64_t PageDisabledWidgets[] = { auto fillRectangle = ScreenRect{ { 0, screenCoords.y }, { listWidth, screenCoords.y + kScrollableRowHeight - 1 } }; if (selectedRow) - GfxFillRect(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark); + Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark); else if (hoveredRow) - GfxFillRect(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark | 0x1000000); + Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].mid_dark | 0x1000000); // Zebra stripes else if (((windowTileInspectorElementCount - i) & 1) == 0) - GfxFillRect(rt, fillRectangle, ColourMapA[colours[1].colour].light | 0x1000000); + Rectangle::fill(rt, fillRectangle, ColourMapA[colours[1].colour].light | 0x1000000); StringId stringFormat = STR_WINDOW_COLOUR_2_STRINGID; if (selectedRow || hoveredRow) @@ -1635,7 +1638,9 @@ static uint64_t PageDisabledWidgets[] = { checkboxFormatter.Add(kCheckMarkString); // Draw checkbox and check if visible - GfxFillRectInset(rt, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], INSET_RECT_F_E0); + Rectangle::fillInset( + rt, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], Rectangle::BorderStyle::inset, + Rectangle::FillBrightness::dark, Rectangle::FillMode::dontLightenWhenInset); if (!tileElement->IsInvisible()) { auto eyeFormatter = Formatter(); diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index f13e82ea88..1df47588f6 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -19,11 +19,14 @@ #include #include #include +#include #include #include namespace OpenRCT2::Ui::Windows { + using namespace OpenRCT2::Drawing; + enum { WIDX_START_NEW_GAME, @@ -273,7 +276,7 @@ namespace OpenRCT2::Ui::Windows void onDraw(RenderTarget& rt) override { - GfxFilterRect(rt, _filterRect, FilterPaletteID::palette51); + Rectangle::filter(rt, _filterRect, FilterPaletteID::palette51); drawWidgets(rt); } }; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index b632388334..ddcc86ffdd 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -14,10 +14,13 @@ #include #include #include +#include #include #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { enum @@ -108,14 +111,15 @@ namespace OpenRCT2::Ui::Windows int32_t bottom = windowPos.y + height - 1; // Background - GfxFilterRect(rt, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::palette45); - GfxFilterRect(rt, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::paletteGlassLightOrange); + Rectangle::filter(rt, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::palette45); + Rectangle::filter( + rt, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::paletteGlassLightOrange); // Sides - GfxFilterRect(rt, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::paletteDarken3); - GfxFilterRect(rt, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::paletteDarken3); - GfxFilterRect(rt, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::paletteDarken3); - GfxFilterRect(rt, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::paletteDarken3); + Rectangle::filter(rt, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::paletteDarken3); + Rectangle::filter(rt, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::paletteDarken3); + Rectangle::filter(rt, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::paletteDarken3); + Rectangle::filter(rt, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::paletteDarken3); // Corners GfxFilterPixel(rt, { left + 1, top + 1 }, FilterPaletteID::paletteDarken3); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 384a5799d3..1ea3a557e9 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -317,7 +317,7 @@ namespace OpenRCT2::Ui::Windows auto mvpFlags = WindowGetMain()->viewport->flags; gDropdown.items[DDIDX_UNDERGROUND_INSIDE].setChecked(mvpFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); - gDropdown.items[DDIDX_TRANSPARENT_WATER].setChecked(Config::Get().general.TransparentWater); + gDropdown.items[DDIDX_TRANSPARENT_WATER].setChecked(Config::Get().general.transparentWater); gDropdown.items[DDIDX_HIDE_BASE].setChecked(mvpFlags & VIEWPORT_FLAG_HIDE_BASE); gDropdown.items[DDIDX_HIDE_VERTICAL].setChecked(mvpFlags & VIEWPORT_FLAG_HIDE_VERTICAL); gDropdown.items[DDIDX_HIDE_RIDES].setChecked(mvpFlags & VIEWPORT_FLAG_HIDE_RIDES); @@ -348,7 +348,7 @@ namespace OpenRCT2::Ui::Windows w->viewport->flags ^= VIEWPORT_FLAG_UNDERGROUND_INSIDE; break; case DDIDX_TRANSPARENT_WATER: - Config::Get().general.TransparentWater ^= 1; + Config::Get().general.transparentWater ^= 1; Config::Save(); break; case DDIDX_HIDE_BASE: @@ -502,7 +502,7 @@ namespace OpenRCT2::Ui::Windows gDropdown.items[2] = Dropdown::MenuLabel(STR_SPEED_FAST); gDropdown.items[3] = Dropdown::MenuLabel(STR_SPEED_TURBO); - if (Config::Get().general.DebuggingTools) + if (Config::Get().general.debuggingTools) { num_items = 6; @@ -524,7 +524,7 @@ namespace OpenRCT2::Ui::Windows gDropdown.items[5].setChecked(true); } - if (Config::Get().general.DebuggingTools) + if (Config::Get().general.debuggingTools) { gDropdown.defaultIndex = (gGameSpeed == 8 ? 0 : gGameSpeed); } @@ -1108,35 +1108,35 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_RESEARCH].type = WidgetType::trnBtn; widgets[WIDX_FASTFORWARD].type = WidgetType::trnBtn; widgets[WIDX_CHEATS].type = WidgetType::trnBtn; - widgets[WIDX_DEBUG].type = Config::Get().general.DebuggingTools ? WidgetType::trnBtn : WidgetType::empty; + widgets[WIDX_DEBUG].type = Config::Get().general.debuggingTools ? WidgetType::trnBtn : WidgetType::empty; widgets[WIDX_NEWS].type = WidgetType::trnBtn; widgets[WIDX_NETWORK].type = WidgetType::trnBtn; } void HideDisabledButtons() { - if (!Config::Get().interface.ToolbarShowMute) + if (!Config::Get().interface.toolbarShowMute) widgets[WIDX_MUTE].type = WidgetType::empty; - if (!Config::Get().interface.ToolbarShowChat) + if (!Config::Get().interface.toolbarShowChat) widgets[WIDX_CHAT].type = WidgetType::empty; - if (!Config::Get().interface.ToolbarShowResearch) + if (!Config::Get().interface.toolbarShowResearch) widgets[WIDX_RESEARCH].type = WidgetType::empty; - if (!Config::Get().interface.ToolbarShowCheats) + if (!Config::Get().interface.toolbarShowCheats) widgets[WIDX_CHEATS].type = WidgetType::empty; - if (!Config::Get().interface.ToolbarShowNews) + if (!Config::Get().interface.toolbarShowNews) widgets[WIDX_NEWS].type = WidgetType::empty; - if (!Config::Get().interface.ToolbarShowZoom) + if (!Config::Get().interface.toolbarShowZoom) { widgets[WIDX_ZOOM_IN].type = WidgetType::empty; widgets[WIDX_ZOOM_OUT].type = WidgetType::empty; } - if (!Config::Get().interface.ToolbarShowRotateAnticlockwise) + if (!Config::Get().interface.toolbarShowRotateAnticlockwise) widgets[WIDX_ROTATE_ANTI_CLOCKWISE].type = WidgetType::empty; if (gLegacyScene == LegacyScene::scenarioEditor || gLegacyScene == LegacyScene::trackDesignsManager) @@ -1144,7 +1144,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_PAUSE].type = WidgetType::empty; } - if ((getGameState().park.flags & PARK_FLAGS_NO_MONEY) || !Config::Get().interface.ToolbarShowFinances) + if ((getGameState().park.flags & PARK_FLAGS_NO_MONEY) || !Config::Get().interface.toolbarShowFinances) widgets[WIDX_FINANCES].type = WidgetType::empty; } @@ -1364,7 +1364,7 @@ namespace OpenRCT2::Ui::Windows ApplyMapRotation(); ApplyFootpathPressed(); - if (!Config::Get().interface.ToolbarButtonsCentred) + if (!Config::Get().interface.toolbarButtonsCentred) AlignButtonsLeftRight(); else AlignButtonsCentre(); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 4cac2be601..70a780a9fb 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -203,7 +203,8 @@ namespace OpenRCT2::Ui::Windows if (trackLoc == _placementLoc) { TrackDesignPreviewDrawOutlines( - tds, *_trackDesign, RideGetTemporaryForPreview(), { mapCoords, 0, _currentTrackPieceDirection }); + tds, *_trackDesign, RideGetTemporaryForPreview(), { mapCoords, 0, _currentTrackPieceDirection }, + !gTrackDesignSceneryToggle); return; } @@ -216,7 +217,7 @@ namespace OpenRCT2::Ui::Windows if (res.Error == GameActions::Status::Ok) { // Valid location found. Place the ghost at the location. - auto tdAction = GameActions::TrackDesignAction(trackLoc, *_trackDesign); + auto tdAction = GameActions::TrackDesignAction(trackLoc, *_trackDesign, !gTrackDesignSceneryToggle); tdAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); tdAction.SetCallback([&](const GameActions::GameAction*, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) @@ -240,7 +241,8 @@ namespace OpenRCT2::Ui::Windows invalidateWidget(WIDX_PRICE); } - TrackDesignPreviewDrawOutlines(tds, *_trackDesign, RideGetTemporaryForPreview(), trackLoc); + TrackDesignPreviewDrawOutlines( + tds, *_trackDesign, RideGetTemporaryForPreview(), trackLoc, !gTrackDesignSceneryToggle); } void onToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override @@ -285,7 +287,8 @@ namespace OpenRCT2::Ui::Windows return; } - auto tdAction = GameActions::TrackDesignAction({ trackLoc, _currentTrackPieceDirection }, *_trackDesign); + auto tdAction = GameActions::TrackDesignAction( + { trackLoc, _currentTrackPieceDirection }, *_trackDesign, !gTrackDesignSceneryToggle); tdAction.SetCallback([&](const GameActions::GameAction*, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { @@ -381,7 +384,8 @@ namespace OpenRCT2::Ui::Windows { if (_hasPlacementGhost) { - auto tdAction = GameActions::TrackDesignAction({ _placementGhostLoc }, *_trackDesign); + auto tdAction = GameActions::TrackDesignAction( + { _placementGhostLoc }, *_trackDesign, !gTrackDesignSceneryToggle); tdAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); auto res = GameActions::Execute(&tdAction, getGameState()); if (res.Error != GameActions::Status::Ok) @@ -728,7 +732,7 @@ namespace OpenRCT2::Ui::Windows for (int32_t i = 0; i < 7; i++, loc.z += kCoordsZStep) { auto tdAction = GameActions::TrackDesignAction( - CoordsXYZD{ loc.x, loc.y, loc.z, _currentTrackPieceDirection }, *_trackDesign); + CoordsXYZD{ loc.x, loc.y, loc.z, _currentTrackPieceDirection }, *_trackDesign, !gTrackDesignSceneryToggle); tdAction.SetFlags(newFlags); res = GameActions::Query(&tdAction, getGameState()); diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 69368c6a0a..0c68ebf317 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,8 @@ #include #include +using namespace OpenRCT2::Drawing; + namespace OpenRCT2::Ui::Windows { static constexpr StringId kWindowTitle = STR_SELECT_DESIGN; @@ -201,7 +204,7 @@ namespace OpenRCT2::Ui::Windows _loadedTrackDesign = TrackDesignImport(path.c_str()); if (_loadedTrackDesign != nullptr) { - TrackDesignDrawPreview(*_loadedTrackDesign, _trackDesignPreviewPixels.data()); + TrackDesignDrawPreview(*_loadedTrackDesign, _trackDesignPreviewPixels.data(), !gTrackDesignSceneryToggle); return true; } return false; @@ -383,7 +386,7 @@ namespace OpenRCT2::Ui::Windows if (entry != nullptr) { - RideNaming rideName = GetRideNaming(_window_track_list_item.Type, *entry); + RideNaming rideName = GetRideNaming(_window_track_list_item.Type, entry); stringId = rideName.Name; } @@ -423,7 +426,7 @@ namespace OpenRCT2::Ui::Windows } // When debugging tools are on, shift everything up a bit to make room for displaying the path. - const int32_t bottomMargin = Config::Get().general.DebuggingTools ? (kWindowPadding + kDebugPathHeight) + const int32_t bottomMargin = Config::Get().general.debuggingTools ? (kWindowPadding + kDebugPathHeight) : kWindowPadding; widgets[WIDX_TRACK_LIST].bottom = height - bottomMargin; widgets[WIDX_ROTATE].bottom = height - bottomMargin; @@ -471,7 +474,7 @@ namespace OpenRCT2::Ui::Windows u8string path = _trackDesigns[trackIndex].path; // Show track file path (in debug mode) - if (Config::Get().general.DebuggingTools) + if (Config::Get().general.debuggingTools) { const auto shortPath = ShortenPath(path, width, FontStyle::Medium); auto ft = Formatter(); @@ -482,7 +485,7 @@ namespace OpenRCT2::Ui::Windows } auto screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.top + 1 }; - GfxFillRect(rt, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi + Rectangle::fill(rt, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi if (_loadedTrackDesignIndex != trackIndex) { @@ -693,7 +696,7 @@ namespace OpenRCT2::Ui::Windows if (listIndex == static_cast(selectedListItem)) { // Highlight - GfxFilterRect( + Rectangle::filter( rt, { screenCoords, { width, screenCoords.y + kScrollableRowHeight - 1 } }, FilterPaletteID::paletteDarken1); stringId = STR_WINDOW_COLOUR_2_STRINGID; @@ -718,7 +721,7 @@ namespace OpenRCT2::Ui::Windows if (listIndex == static_cast(selectedListItem)) { // Highlight - GfxFilterRect( + Rectangle::filter( rt, { screenCoords, { width, screenCoords.y + kScrollableRowHeight - 1 } }, FilterPaletteID::paletteDarken1); stringId = STR_WINDOW_COLOUR_2_STRINGID; diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 443f55a40f..0c13353dec 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -230,12 +230,12 @@ namespace OpenRCT2::Ui::Windows void SaveInConfig(uint32_t wflags) { - Config::Get().general.InvisibleRides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES; - Config::Get().general.InvisibleVehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES; - Config::Get().general.InvisibleScenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY; - Config::Get().general.InvisibleTrees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION; - Config::Get().general.InvisiblePaths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS; - Config::Get().general.InvisibleSupports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS; + Config::Get().general.invisibleRides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES; + Config::Get().general.invisibleVehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES; + Config::Get().general.invisibleScenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY; + Config::Get().general.invisibleTrees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION; + Config::Get().general.invisiblePaths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS; + Config::Get().general.invisibleSupports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS; Config::Save(); } }; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index cabcc7ec54..9c536ef8f9 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -316,7 +316,7 @@ namespace OpenRCT2::Ui::Windows case DisplayType::DisplayUnits: { // Print the value in the configured height label type: - if (Config::Get().general.ShowHeightAsUnits) + if (Config::Get().general.showHeightAsUnits) { // Height label is Units. auto ft = Formatter(); @@ -329,7 +329,7 @@ namespace OpenRCT2::Ui::Windows { // Height label is Real Values. // Print the value in the configured measurement units. - switch (Config::Get().general.MeasurementFormat) + switch (Config::Get().general.measurementFormat) { case MeasurementFormat::Metric: case MeasurementFormat::SI: diff --git a/src/openrct2/AssetPackManager.cpp b/src/openrct2/AssetPackManager.cpp index 8a8b1a9e95..9e12d400b7 100644 --- a/src/openrct2/AssetPackManager.cpp +++ b/src/openrct2/AssetPackManager.cpp @@ -164,7 +164,7 @@ namespace OpenRCT2 { // Re-order asset packs std::vector> newAssetPacks; - EnumerateCommaSeparatedList(Config::Get().general.AssetPackOrder, [&](std::string_view id) { + EnumerateCommaSeparatedList(Config::Get().general.assetPackOrder, [&](std::string_view id) { auto index = GetAssetPackIndex(id); if (index != std::numeric_limits::max()) { @@ -181,7 +181,7 @@ namespace OpenRCT2 _assetPacks = std::move(newAssetPacks); // Set which asset packs are enabled - EnumerateCommaSeparatedList(Config::Get().general.EnabledAssetPacks, [&](std::string_view id) { + EnumerateCommaSeparatedList(Config::Get().general.enabledAssetPacks, [&](std::string_view id) { auto assetPack = GetAssetPack(id); if (assetPack != nullptr) { @@ -208,8 +208,8 @@ namespace OpenRCT2 orderList.pop_back(); if (enabledList.size() > 0) enabledList.pop_back(); - Config::Get().general.AssetPackOrder = orderList; - Config::Get().general.EnabledAssetPacks = enabledList; + Config::Get().general.assetPackOrder = orderList; + Config::Get().general.enabledAssetPacks = enabledList; Config::Save(); } } // namespace OpenRCT2 diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 1a73db5da0..78867e2f83 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -409,20 +409,20 @@ namespace OpenRCT2 CrashInit(); - if (String::equals(Config::Get().general.LastRunVersion, kOpenRCT2Version)) + if (String::equals(Config::Get().general.lastRunVersion, kOpenRCT2Version)) { gOpenRCT2ShowChangelog = false; } else { gOpenRCT2ShowChangelog = true; - Config::Get().general.LastRunVersion = kOpenRCT2Version; + Config::Get().general.lastRunVersion = kOpenRCT2Version; Config::Save(); } try { - _localisationService->OpenLanguage(Config::Get().general.Language); + _localisationService->OpenLanguage(Config::Get().general.language); } catch (const std::exception& e) { @@ -518,7 +518,7 @@ namespace OpenRCT2 Audio::Init(); Audio::PopulateDevices(); Audio::InitRideSoundsAndInfo(); - Audio::gGameSoundsOff = !Config::Get().sound.MasterSoundEnabled; + Audio::gGameSoundsOff = !Config::Get().sound.masterSoundEnabled; } ChatInit(); @@ -622,7 +622,7 @@ namespace OpenRCT2 } drawingEngine->Initialise(); - drawingEngine->SetVSync(Config::Get().general.UseVSync); + drawingEngine->SetVSync(Config::Get().general.useVSync); return drawingEngine; } @@ -634,7 +634,7 @@ namespace OpenRCT2 return nullptr; }; - auto drawingEngineType = Config::Get().general.DrawingEngine; + auto drawingEngineType = Config::Get().general.drawingEngine; // Attempt to create drawing engine of the type specified in the config. { @@ -667,7 +667,7 @@ namespace OpenRCT2 _drawingEngineType = drawingEngineType; - Config::Get().general.DrawingEngine = drawingEngineType; + Config::Get().general.drawingEngine = drawingEngineType; Config::Save(); WindowCheckAllValidZoom(); @@ -1006,11 +1006,11 @@ namespace OpenRCT2 if (gCustomRCT2DataPath.empty()) { // Check install directory - if (Config::Get().general.RCT2Path.empty() || !Platform::OriginalGameDataExists(Config::Get().general.RCT2Path)) + if (Config::Get().general.rct2Path.empty() || !Platform::OriginalGameDataExists(Config::Get().general.rct2Path)) { LOG_VERBOSE( "install directory does not exist or invalid directory selected, %s", - Config::Get().general.RCT2Path.c_str()); + Config::Get().general.rct2Path.c_str()); if (!Config::FindOrBrowseInstallDirectory()) { auto path = Config::GetDefaultPath(); @@ -1019,7 +1019,7 @@ namespace OpenRCT2 return std::string(); } } - result = Config::Get().general.RCT2Path; + result = Config::Get().general.rct2Path; } else { @@ -1053,7 +1053,7 @@ namespace OpenRCT2 } else { - if ((gOpenRCT2StartupAction == StartupAction::Title) && Config::Get().general.PlayIntro) + if ((gOpenRCT2StartupAction == StartupAction::Title) && Config::Get().general.playIntro) { gOpenRCT2StartupAction = StartupAction::Intro; } @@ -1159,17 +1159,17 @@ namespace OpenRCT2 { if (gNetworkStartPort == 0) { - gNetworkStartPort = Config::Get().network.DefaultPort; + gNetworkStartPort = Config::Get().network.defaultPort; } if (gNetworkStartAddress.empty()) { - gNetworkStartAddress = Config::Get().network.ListenAddress; + gNetworkStartAddress = Config::Get().network.listenAddress; } if (gCustomPassword.empty()) { - _network.SetPassword(Config::Get().network.DefaultPassword.c_str()); + _network.SetPassword(Config::Get().network.defaultPassword.c_str()); } else { @@ -1190,7 +1190,7 @@ namespace OpenRCT2 { if (gNetworkStartPort == 0) { - gNetworkStartPort = Config::Get().network.DefaultPort; + gNetworkStartPort = Config::Get().network.defaultPort; } _network.BeginClient(gNetworkStartHost, gNetworkStartPort); } @@ -1251,7 +1251,7 @@ namespace OpenRCT2 { if (!ShouldDraw()) return false; - if (!Config::Get().general.UncapFPS) + if (!Config::Get().general.uncapFPS) return false; if (gGameSpeed > 4) return false; @@ -1608,7 +1608,7 @@ namespace OpenRCT2 void ContextUpdateCursorScale() { - GetContext()->GetUiContext().SetCursorScale(static_cast(std::round(Config::Get().general.WindowScale))); + GetContext()->GetUiContext().SetCursorScale(static_cast(std::round(Config::Get().general.windowScale))); } void ContextHideCursor() @@ -1630,8 +1630,8 @@ namespace OpenRCT2 { auto cursorCoords = ContextGetCursorPosition(); // Compensate for window scaling. - return { static_cast(std::ceil(cursorCoords.x / Config::Get().general.WindowScale)), - static_cast(std::ceil(cursorCoords.y / Config::Get().general.WindowScale)) }; + return { static_cast(std::ceil(cursorCoords.x / Config::Get().general.windowScale)), + static_cast(std::ceil(cursorCoords.y / Config::Get().general.windowScale)) }; } void ContextSetCursorPosition(const ScreenCoordsXY& cursorPosition) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index ba4a4f748b..eb0596f0b5 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -474,11 +474,11 @@ namespace OpenRCT2::Editor using OpenRCT2::AnimationPeepType; constexpr std::pair kPeepCheckPairs[] = { - { AnimationPeepType::Guest, STR_AT_LEAST_ONE_GUEST_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, - { AnimationPeepType::Handyman, STR_AT_LEAST_ONE_HANDYMAN_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, - { AnimationPeepType::Mechanic, STR_AT_LEAST_ONE_MECHANIC_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, - { AnimationPeepType::Security, STR_AT_LEAST_ONE_SECURITY_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, - { AnimationPeepType::Entertainer, STR_AT_LEAST_ONE_ENTERTAINER_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, + { AnimationPeepType::guest, STR_AT_LEAST_ONE_GUEST_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, + { AnimationPeepType::handyman, STR_AT_LEAST_ONE_HANDYMAN_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, + { AnimationPeepType::mechanic, STR_AT_LEAST_ONE_MECHANIC_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, + { AnimationPeepType::security, STR_AT_LEAST_ONE_SECURITY_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, + { AnimationPeepType::entertainer, STR_AT_LEAST_ONE_ENTERTAINER_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED }, }; for (auto& pair : kPeepCheckPairs) diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index fbab8173c4..356c3f0056 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -382,7 +382,7 @@ static void RemoveSelectedObjectsFromResearch(const ObjectEntryDescriptor& descr for (auto rideType : rideEntry->ride_type) { ResearchItem tmp = {}; - tmp.type = Research::EntryType::Ride; + tmp.type = Research::EntryType::ride; tmp.entryIndex = entryIndex; tmp.baseRideType = rideType; ResearchRemove(tmp); @@ -392,7 +392,7 @@ static void RemoveSelectedObjectsFromResearch(const ObjectEntryDescriptor& descr case ObjectType::sceneryGroup: { ResearchItem tmp = {}; - tmp.type = Research::EntryType::Scenery; + tmp.type = Research::EntryType::scenery; tmp.entryIndex = entryIndex; tmp.baseRideType = 0; ResearchRemove(tmp); diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index ee57674a09..fb037c21d6 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -115,7 +115,7 @@ void GameResetSpeed() void GameIncreaseGameSpeed() { - auto newSpeed = std::min(Config::Get().general.DebuggingTools ? 5 : 4, gGameSpeed + 1); + auto newSpeed = std::min(Config::Get().general.debuggingTools ? 5 : 4, gGameSpeed + 1); if (newSpeed == 5) newSpeed = 8; @@ -184,7 +184,7 @@ void RCT2StringToUTF8Self(char* buffer, size_t length) { if (length > 0) { - auto temp = RCT2StringToUTF8(buffer, RCT2LanguageId::EnglishUK); + auto temp = RCT2StringToUTF8(buffer, RCT2LanguageId::englishUK); String::safeUtf8Copy(buffer, temp.data(), length); } } @@ -195,7 +195,7 @@ static void FixGuestsHeadingToParkCount() for (auto* peep : EntityList()) { - if (peep->OutsideOfPark && peep->State != PeepState::LeavingPark) + if (peep->OutsideOfPark && peep->State != PeepState::leavingPark) { guestsHeadingToPark++; } @@ -451,7 +451,7 @@ void ResetAllSpriteQuadrantPlacements() for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { auto* spr = getGameState().entities.GetEntity(EntityId::FromUnderlying(i)); - if (spr != nullptr && spr->Type != EntityType::Null) + if (spr != nullptr && spr->Type != EntityType::null) { spr->MoveTo(spr->GetLocation()); } @@ -498,7 +498,7 @@ void SaveGameWithName(u8string_view name) LOG_VERBOSE("Saving to %s", u8string(name).c_str()); auto& gameState = getGameState(); - if (ScenarioSave(gameState, name, Config::Get().general.SavePluginData ? 1 : 0)) + if (ScenarioSave(gameState, name, Config::Get().general.savePluginData ? 1 : 0)) { LOG_VERBOSE("Saved to %s", u8string(name).c_str()); gCurrentLoadedPath = name; @@ -609,7 +609,7 @@ void GameAutosave() 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 = Config::Get().general.AutosaveAmount; + int32_t autosavesToKeep = Config::Get().general.autosaveAmount; LimitAutosaveCount(autosavesToKeep - 1, isInEditorMode()); auto& env = GetContext()->GetPlatformEnvironment(); diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 510f3fe54b..d8ec67127b 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -139,7 +139,7 @@ namespace OpenRCT2 } bool isPaused = GameIsPaused(); - if (Network::GetMode() == Network::Mode::server && Config::Get().network.PauseServerIfNoClients) + if (Network::GetMode() == Network::Mode::server && Config::Get().network.pauseServerIfNoClients) { // If we are headless we always have 1 player (host), pause if no one else is around. if (gOpenRCT2Headless && Network::GetNumPlayers() == 1) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 704ba3f57f..1bbfd3f1d6 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -91,7 +91,7 @@ struct GameStateSnapshot_t for (EntityId::UnderlyingType i = 0; i < numSprites; i++) { auto entity = getEntity(EntityId::FromUnderlying(i)); - if (entity == nullptr || entity->base.Type == EntityType::Null) + if (entity == nullptr || entity->base.Type == EntityType::null) continue; indexTable.push_back(static_cast(i)); } @@ -129,34 +129,34 @@ struct GameStateSnapshot_t switch (sprite.base.Type) { - case EntityType::Vehicle: + case EntityType::vehicle: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::Guest: + case EntityType::guest: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::Staff: + case EntityType::staff: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::Litter: + case EntityType::litter: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::MoneyEffect: + case EntityType::moneyEffect: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::Balloon: + case EntityType::balloon: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::Duck: + case EntityType::duck: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::SteamParticle: + case EntityType::steamParticle: reinterpret_cast(sprite).Serialise(ds); break; - case EntityType::Null: + case EntityType::null: break; default: break; @@ -221,7 +221,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots for (auto& sprite : spriteList) { // By default they don't exist. - sprite.base.Type = EntityType::Null; + sprite.base.Type = EntityType::null; } snapshot.SerialiseSprites( @@ -251,9 +251,9 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(EntityBase, y); COMPARE_FIELD(EntityBase, z); /* Only relevant for rendering, does not affect game state. - COMPARE_FIELD(SpriteBase, sprite_width); - COMPARE_FIELD(SpriteBase, sprite_height_negative); - COMPARE_FIELD(SpriteBase, sprite_height_positive); + COMPARE_FIELD(SpriteBase, spriteWidth); + COMPARE_FIELD(SpriteBase, spriteHeightNegative); + COMPARE_FIELD(SpriteBase, spriteHeightPositive); COMPARE_FIELD(SpriteBase, sprite_left); COMPARE_FIELD(SpriteBase, sprite_top); COMPARE_FIELD(SpriteBase, sprite_right); @@ -560,66 +560,66 @@ struct GameStateSnapshots final : public IGameStateSnapshots { switch (spriteBase.base.Type) { - case EntityType::Guest: + case EntityType::guest: CompareSpriteDataGuest( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::Staff: + case EntityType::staff: CompareSpriteDataStaff( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::Vehicle: + case EntityType::vehicle: CompareSpriteDataVehicle( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::Litter: + case EntityType::litter: CompareSpriteDataLitter( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::SteamParticle: + case EntityType::steamParticle: CompareSpriteDataSteamParticle( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::MoneyEffect: + case EntityType::moneyEffect: CompareSpriteDataMoneyEffect( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::CrashedVehicleParticle: + case EntityType::crashedVehicleParticle: CompareSpriteDataVehicleCrashParticle( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::ExplosionCloud: + case EntityType::explosionCloud: CompareSpriteDataExplosionCloud( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::CrashSplash: + case EntityType::crashSplash: CompareSpriteDataCrashSplash( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::ExplosionFlare: + case EntityType::explosionFlare: CompareSpriteDataExplosionFlare( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: CompareSpriteDataJumpingFountain( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::Balloon: + case EntityType::balloon: CompareSpriteDataBalloon( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::Duck: + case EntityType::duck: CompareSpriteDataDuck( static_cast(spriteBase.base), static_cast(spriteCmp.base), changeData); break; - case EntityType::Null: + case EntityType::null: break; default: break; @@ -648,19 +648,19 @@ struct GameStateSnapshots final : public IGameStateSnapshots changeData.entityType = spriteBase.base.Type; - if (spriteBase.base.Type == EntityType::Null && spriteCmp.base.Type != EntityType::Null) + if (spriteBase.base.Type == EntityType::null && spriteCmp.base.Type != EntityType::null) { // Sprite was added. changeData.changeType = GameStateSpriteChange::ADDED; changeData.entityType = spriteCmp.base.Type; } - else if (spriteBase.base.Type != EntityType::Null && spriteCmp.base.Type == EntityType::Null) + else if (spriteBase.base.Type != EntityType::null && spriteCmp.base.Type == EntityType::null) { // Sprite was removed. changeData.changeType = GameStateSpriteChange::REMOVED; changeData.entityType = spriteBase.base.Type; } - else if (spriteBase.base.Type == EntityType::Null && spriteCmp.base.Type == EntityType::Null) + else if (spriteBase.base.Type == EntityType::null && spriteCmp.base.Type == EntityType::null) { // Do nothing. changeData.changeType = GameStateSpriteChange::EQUAL; @@ -688,33 +688,33 @@ struct GameStateSnapshots final : public IGameStateSnapshots { switch (type) { - case EntityType::Null: + case EntityType::null: return "Null"; - case EntityType::Guest: + case EntityType::guest: return "Guest"; - case EntityType::Staff: + case EntityType::staff: return "Staff"; - case EntityType::Vehicle: + case EntityType::vehicle: return "Vehicle"; - case EntityType::Litter: + case EntityType::litter: return "Litter"; - case EntityType::SteamParticle: + case EntityType::steamParticle: return "Misc: Steam Particle"; - case EntityType::MoneyEffect: + case EntityType::moneyEffect: return "Misc: Money effect"; - case EntityType::CrashedVehicleParticle: + case EntityType::crashedVehicleParticle: return "Misc: Crash Vehicle Particle"; - case EntityType::ExplosionCloud: + case EntityType::explosionCloud: return "Misc: Explosion Cloud"; - case EntityType::CrashSplash: + case EntityType::crashSplash: return "Misc: Crash Splash"; - case EntityType::ExplosionFlare: + case EntityType::explosionFlare: return "Misc: Explosion Flare"; - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: return "Misc: Jumping fountain"; - case EntityType::Balloon: + case EntityType::balloon: return "Misc: Balloon"; - case EntityType::Duck: + case EntityType::duck: return "Misc: Duck"; default: break; diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index eb49c4576f..8772048703 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -285,11 +285,11 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() } if (gCustomRCT1DataPath.empty()) { - env->SetBasePath(DirBase::rct1, Config::Get().general.RCT1Path); + env->SetBasePath(DirBase::rct1, Config::Get().general.rct1Path); } if (gCustomRCT2DataPath.empty()) { - env->SetBasePath(DirBase::rct2, Config::Get().general.RCT2Path); + env->SetBasePath(DirBase::rct2, Config::Get().general.rct2Path); } // Log base paths diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 3fdb2ede3c..f20979fce2 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -645,7 +645,7 @@ namespace OpenRCT2 serialiser << park.guestGenerationProbability; serialiser << park.suggestedGuestMaximum; - serialiser << Config::Get().general.ShowRealNamesOfGuests; + serialiser << Config::Get().general.showRealNamesOfGuests; // To make this a little bit less volatile against updates // we reserve some space for future additions. diff --git a/src/openrct2/SpriteIds.h b/src/openrct2/SpriteIds.h index 48a2c17f99..02c5c98864 100644 --- a/src/openrct2/SpriteIds.h +++ b/src/openrct2/SpriteIds.h @@ -479,7 +479,7 @@ enum : ImageIndex SPR_FLOOR_TEXTURE_DIRT = SPR_FLOOR_TEXTURE_GRASS + 2, SPR_FLOOR_TEXTURE_ROCK = SPR_FLOOR_TEXTURE_GRASS + 3, SPR_FLOOR_TEXTURE_MARTIAN = SPR_FLOOR_TEXTURE_GRASS + 4, - SPR_FLOOR_TEXTURE_CHECKERBOARD = SPR_FLOOR_TEXTURE_GRASS + 5, + SPR_FLOOR_TEXTURE_CHEQUERBOARD = SPR_FLOOR_TEXTURE_GRASS + 5, SPR_FLOOR_TEXTURE_GRASS_CLUMPS = SPR_FLOOR_TEXTURE_GRASS + 6, SPR_FLOOR_TEXTURE_ICE = SPR_FLOOR_TEXTURE_GRASS + 7, SPR_FLOOR_TEXTURE_GRID_RED = SPR_FLOOR_TEXTURE_GRASS + 8, @@ -987,6 +987,10 @@ enum : ImageIndex SPR_G2_PEEP_SPAWN, SPR_G2_ICON_PALETTE_INVISIBLE, SPR_G2_ICON_PALETTE_INVISIBLE_PRESSED, + SPR_G2_ICON_PALETTE_LARGE, + SPR_G2_ICON_PALETTE_PRESSED_LARGE, + SPR_G2_ICON_PALETTE_INVISIBLE_LARGE, + SPR_G2_ICON_PALETTE_INVISIBLE_PRESSED_LARGE, SPR_G2_FOLDER, SPR_G2_FOLDER_NEW, SPR_G2_FOLDER_PARENT, @@ -1084,6 +1088,7 @@ enum : ImageIndex SPR_G2_ICON_MEDIUM_CURVE_LEFT = SPR_G2_OPAQUE_WATER_OVERLAY + 5, SPR_G2_ICON_MEDIUM_CURVE_RIGHT, SPR_G2_ICON_ROTATE_ANTI_CLOCKWISE, + SPR_G2_ICON_PATH_DRAG_TOOL, SPR_G2_END, @@ -1640,9 +1645,14 @@ enum : ImageIndex // G2 Supports - SPR_TRACKS_SUPPORT_WOODEN_TRUSS = SPR_TRACKS_GO_KARTS_END, - SPR_TRACKS_SUPPORT_WOODEN_MINE = SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 32, - SPR_TRACKS_SUPPORT_END = SPR_TRACKS_SUPPORT_WOODEN_MINE + 32, + SPR_TRACKS_SUPPORT_BEGIN = SPR_TRACKS_GO_KARTS_END, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_UP_25_EVEN = SPR_TRACKS_SUPPORT_BEGIN, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP = SPR_TRACKS_SUPPORT_WOODEN_TRUSS_UP_25_EVEN + 4, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT = SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 16, + SPR_TRACKS_SUPPORT_WOODEN_MINE_UP_25_EVEN = SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 16, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP = SPR_TRACKS_SUPPORT_WOODEN_MINE_UP_25_EVEN + 4, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT = SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 16, + SPR_TRACKS_SUPPORT_END = SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 16, // G2 New track types diff --git a/src/openrct2/Version.cpp b/src/openrct2/Version.cpp index 37dffddad7..921bd12be9 100644 --- a/src/openrct2/Version.cpp +++ b/src/openrct2/Version.cpp @@ -79,7 +79,7 @@ NewVersionInfo GetLatestVersion() NewVersionInfo verinfo{ tag, "", "" }; #if !defined(DISABLE_HTTP) && !defined(DISABLE_VERSION_CHECKER) auto now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); - auto then = Config::Get().general.LastVersionCheckTime; + auto then = Config::Get().general.lastVersionCheckTime; using namespace std::chrono_literals; if (then < now - std::chrono::seconds(24h).count()) @@ -107,7 +107,7 @@ NewVersionInfo GetLatestVersion() verinfo.name = Json::GetString(root["name"]); verinfo.changelog = Json::GetString(root["body"]); - Config::Get().general.LastVersionCheckTime = now; + Config::Get().general.lastVersionCheckTime = now; Config::Save(); } #endif diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 3a8a6bd06d..cc2e3fc1e2 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -531,7 +531,7 @@ namespace OpenRCT2::GameActions { if (ride.mechanicStatus == RIDE_MECHANIC_STATUS_FIXING) { - mechanic->RideSubState = PeepRideSubState::ApproachExit; + mechanic->RideSubState = PeepRideSubState::approachExit; } else if ( ride.mechanicStatus == RIDE_MECHANIC_STATUS_CALLING @@ -697,15 +697,15 @@ namespace OpenRCT2::GameActions peep->CashInPocket = 1000.00_GBP; break; case OBJECT_PARK_MAP: - peep->GiveItem(ShopItem::Map); + peep->GiveItem(ShopItem::map); break; case OBJECT_BALLOON: - peep->GiveItem(ShopItem::Balloon); + peep->GiveItem(ShopItem::balloon); peep->BalloonColour = ScenarioRandMax(kColourNumNormal); peep->UpdateAnimationGroup(); break; case OBJECT_UMBRELLA: - peep->GiveItem(ShopItem::Umbrella); + peep->GiveItem(ShopItem::umbrella); peep->UmbrellaColour = ScenarioRandMax(kColourNumOriginal); peep->UpdateAnimationGroup(); break; @@ -721,6 +721,7 @@ namespace OpenRCT2::GameActions for (auto& ride : RideManager(gameState)) { ride.numRiders = 0; + ride.slideInUse = 0; for (auto& station : ride.getStations()) { @@ -742,9 +743,9 @@ namespace OpenRCT2::GameActions auto peep = getGameState().entities.TryGetEntity(peepInTrainIndex); if (peep != nullptr && peep->CurrentRide == ride.id) { - if ((peep->State == PeepState::OnRide && peep->RideSubState == PeepRideSubState::OnRide) - || (peep->State == PeepState::LeavingRide - && peep->RideSubState == PeepRideSubState::LeaveVehicle)) + if ((peep->State == PeepState::onRide && peep->RideSubState == PeepRideSubState::onRide) + || (peep->State == PeepState::leavingRide + && peep->RideSubState == PeepRideSubState::leaveVehicle)) { vehicle->ApplyMass(-peep->Mass); } diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index 323fcaccc8..379a844d9a 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -67,8 +67,8 @@ namespace OpenRCT2::GameActions result.ErrorTitle = STR_UNABLE_TO_REMOVE_ALL_SCENERY_FROM_HERE; result.Expenditure = ExpenditureType::landscaping; - auto x = (_range.GetLeft() + _range.GetRight()) / 2 + 16; - auto y = (_range.GetTop() + _range.GetBottom()) / 2 + 16; + auto x = (_range.GetX1() + _range.GetX2()) / 2 + 16; + auto y = (_range.GetY1() + _range.GetY2()) / 2 + 16; auto z = TileElementHeight({ x, y }); result.Position = CoordsXYZ(x, y, z); @@ -85,9 +85,9 @@ namespace OpenRCT2::GameActions money64 totalCost = 0; auto validRange = ClampRangeWithinMap(_range); - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (LocationValid({ x, y }) && MapCanClearAt(gameState, { x, y })) { diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp index 61b38aca1a..0b6aa37e9c 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp @@ -30,7 +30,7 @@ namespace OpenRCT2::GameActions { FootpathLayoutPlaceAction::FootpathLayoutPlaceAction( - const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, uint8_t edges, + const CoordsXYZ& loc, FootpathSlope slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, uint8_t edges, PathConstructFlags constructFlags) : _loc(loc) , _slope(slope) @@ -52,7 +52,8 @@ namespace OpenRCT2::GameActions void FootpathLayoutPlaceAction::AcceptParameters(GameActionParameterVisitor& visitor) { visitor.Visit(_loc); - visitor.Visit("slope", _slope); + visitor.Visit("slopeType", _slope.type); + visitor.Visit("slopeDirection", _slope.direction); visitor.Visit("object", _type); visitor.Visit("railingsObject", _railingsType); visitor.Visit("edges", _edges); @@ -131,9 +132,9 @@ namespace OpenRCT2::GameActions QuarterTile quarterTile{ 0b1111, 0 }; auto zLow = _loc.z; auto zHigh = zLow + kPathClearance; - if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) + if (_slope.type == FootpathSlopeType::sloped) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope.direction); zHigh += kPathHeightStep; } @@ -151,8 +152,8 @@ namespace OpenRCT2::GameActions // Do not attempt to build a crossing with a queue or a sloped path. auto isQueue = _constructFlags & PathConstructFlag::IsQueue; - auto crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CreateCrossingMode::none - : CreateCrossingMode::pathOverTrack; + auto crossingMode = isQueue || (_slope.type != FootpathSlopeType::flat) ? CreateCrossingMode::none + : CreateCrossingMode::pathOverTrack; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, crossingMode); if (!entrancePath && canBuild.Error != Status::Ok) @@ -200,9 +201,9 @@ namespace OpenRCT2::GameActions QuarterTile quarterTile{ 0b1111, 0 }; auto zLow = _loc.z; auto zHigh = zLow + kPathClearance; - if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) + if (_slope.type == FootpathSlopeType::sloped) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope.direction); zHigh += kPathHeightStep; } @@ -220,8 +221,8 @@ namespace OpenRCT2::GameActions // Do not attempt to build a crossing with a queue or a sloped path. auto isQueue = _constructFlags & PathConstructFlag::IsQueue; - auto crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CreateCrossingMode::none - : CreateCrossingMode::pathOverTrack; + auto crossingMode = isQueue || (_slope.type != FootpathSlopeType::flat) ? CreateCrossingMode::none + : CreateCrossingMode::pathOverTrack; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &MapPlaceNonSceneryClearFunc, quarterTile, GAME_COMMAND_FLAG_APPLY | GetFlags(), kTileSlopeFlat, crossingMode); @@ -274,8 +275,8 @@ namespace OpenRCT2::GameActions pathElement->SetSurfaceEntryIndex(_type); pathElement->SetRailingsEntryIndex(_railingsType); } - pathElement->SetSlopeDirection(_slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK); - pathElement->SetSloped(_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED); + pathElement->SetSlopeDirection(_slope.direction); + pathElement->SetSloped(_slope.type == FootpathSlopeType::sloped); pathElement->SetIsQueue(isQueue); pathElement->SetAddition(0); pathElement->SetRideIndex(RideId::GetNull()); diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.h b/src/openrct2/actions/FootpathLayoutPlaceAction.h index 9a08ecd0a5..c971241c4d 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.h +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.h @@ -18,7 +18,7 @@ namespace OpenRCT2::GameActions { private: CoordsXYZ _loc; - uint8_t _slope{}; + FootpathSlope _slope{}; ObjectEntryIndex _type{}; ObjectEntryIndex _railingsType{}; uint8_t _edges{}; @@ -27,7 +27,7 @@ namespace OpenRCT2::GameActions public: FootpathLayoutPlaceAction() = default; FootpathLayoutPlaceAction( - const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, uint8_t edges, + const CoordsXYZ& loc, FootpathSlope slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, uint8_t edges, PathConstructFlags constructFlags = 0); void AcceptParameters(GameActionParameterVisitor&) final; diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 701f24a7c6..6883a092c8 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -39,7 +39,7 @@ namespace OpenRCT2::GameActions { FootpathPlaceAction::FootpathPlaceAction( - const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, Direction direction, + const CoordsXYZ& loc, FootpathSlope slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, Direction direction, PathConstructFlags constructFlags) : _loc(loc) , _slope(slope) @@ -56,7 +56,8 @@ namespace OpenRCT2::GameActions visitor.Visit("object", _type); visitor.Visit("railingsObject", _railingsType); visitor.Visit("direction", _direction); - visitor.Visit("slope", _slope); + visitor.Visit("slopeType", _slope.type); + visitor.Visit("slopeDirection", _slope.direction); visitor.Visit("constructFlags", _constructFlags); } @@ -92,7 +93,7 @@ namespace OpenRCT2::GameActions return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK); } - if (_slope & SLOPE_IS_IRREGULAR_FLAG) + if (_slope.type == FootpathSlopeType::irregular || _slope.type == FootpathSlopeType::raise) { return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_SLOPE_UNSUITABLE); } @@ -116,7 +117,7 @@ namespace OpenRCT2::GameActions auto intent = Intent(INTENT_ACTION_REMOVE_PROVISIONAL_FOOTPATH); ContextBroadcastIntent(&intent); - auto tileElement = MapGetFootpathElementSlope(_loc, _slope); + auto tileElement = MapGetFootpathElementWithSlope(_loc, _slope); if (tileElement == nullptr) { return ElementInsertQuery(std::move(res)); @@ -149,14 +150,15 @@ namespace OpenRCT2::GameActions auto zLow = _loc.z; auto zHigh = zLow + kPathClearance; WallRemoveIntersectingWalls( - { _loc, zLow, zHigh + ((_slope & kTileSlopeRaisedCornersMask) ? 16 : 0) }, DirectionReverse(_direction)); + { _loc, zLow, zHigh + ((_slope.type == FootpathSlopeType::sloped) ? 16 : 0) }, + DirectionReverse(_direction)); WallRemoveIntersectingWalls( { _loc.x - CoordsDirectionDelta[_direction].x, _loc.y - CoordsDirectionDelta[_direction].y, zLow, zHigh }, _direction); } } - auto tileElement = MapGetFootpathElementSlope(_loc, _slope); + auto tileElement = MapGetFootpathElementWithSlope(_loc, _slope); if (tileElement == nullptr) { return ElementInsertExecute(std::move(res)); @@ -223,7 +225,7 @@ namespace OpenRCT2::GameActions if (GetFlags() & GAME_COMMAND_FLAG_GHOST && !pathElement->IsGhost()) { - return Result(Status::Unknown, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); + return Result(Status::ItemAlreadyPlaced, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); } return res; } @@ -295,9 +297,9 @@ namespace OpenRCT2::GameActions QuarterTile quarterTile{ 0b1111, 0 }; auto zLow = _loc.z; auto zHigh = zLow + kPathClearance; - if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) + if (_slope.type == FootpathSlopeType::sloped) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope.direction); zHigh += kPathHeightStep; } @@ -315,8 +317,8 @@ namespace OpenRCT2::GameActions // Do not attempt to build a crossing with a queue or a sloped path. auto isQueue = _constructFlags & PathConstructFlag::IsQueue; - auto crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CreateCrossingMode::none - : CreateCrossingMode::pathOverTrack; + auto crossingMode = isQueue || (_slope.type != FootpathSlopeType::flat) ? CreateCrossingMode::none + : CreateCrossingMode::pathOverTrack; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, crossingMode); if (!entrancePath && canBuild.Error != Status::Ok) @@ -363,9 +365,9 @@ namespace OpenRCT2::GameActions QuarterTile quarterTile{ 0b1111, 0 }; auto zLow = _loc.z; auto zHigh = zLow + kPathClearance; - if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) + if (_slope.type == FootpathSlopeType::sloped) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope.direction); zHigh += kPathHeightStep; } @@ -383,8 +385,8 @@ namespace OpenRCT2::GameActions // Do not attempt to build a crossing with a queue or a sloped. auto isQueue = _constructFlags & PathConstructFlag::IsQueue; - auto crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CreateCrossingMode::none - : CreateCrossingMode::pathOverTrack; + auto crossingMode = isQueue || (_slope.type != FootpathSlopeType::flat) ? CreateCrossingMode::none + : CreateCrossingMode::pathOverTrack; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &MapPlaceNonSceneryClearFunc, quarterTile, GAME_COMMAND_FLAG_APPLY | GetFlags(), kTileSlopeFlat, crossingMode); @@ -436,8 +438,8 @@ namespace OpenRCT2::GameActions pathElement->SetSurfaceEntryIndex(_type); pathElement->SetRailingsEntryIndex(_railingsType); } - pathElement->SetSlopeDirection(_slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK); - pathElement->SetSloped(_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED); + pathElement->SetSlopeDirection(_slope.direction); + pathElement->SetSloped(_slope.type == FootpathSlopeType::sloped); pathElement->SetIsQueue(isQueue); pathElement->SetAddition(0); pathElement->SetRideIndex(RideId::GetNull()); @@ -525,10 +527,9 @@ namespace OpenRCT2::GameActions MapInvalidateTileFull(_loc); } - PathElement* FootpathPlaceAction::MapGetFootpathElementSlope(const CoordsXYZ& footpathPos, int32_t slope) const + PathElement* FootpathPlaceAction::MapGetFootpathElementWithSlope(const CoordsXYZ& footpathPos, FootpathSlope slope) const { - const bool isSloped = slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; - const auto slopeDirection = slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK; + const bool isSloped = slope.type == FootpathSlopeType::sloped; for (auto* pathElement : TileElementsView(footpathPos)) { @@ -536,7 +537,7 @@ namespace OpenRCT2::GameActions continue; if (pathElement->IsSloped() != isSloped) continue; - if (pathElement->GetSlopeDirection() != slopeDirection) + if (pathElement->GetSlopeDirection() != slope.direction) continue; return pathElement; } diff --git a/src/openrct2/actions/FootpathPlaceAction.h b/src/openrct2/actions/FootpathPlaceAction.h index c474acd042..325e139766 100644 --- a/src/openrct2/actions/FootpathPlaceAction.h +++ b/src/openrct2/actions/FootpathPlaceAction.h @@ -18,7 +18,7 @@ namespace OpenRCT2::GameActions { private: CoordsXYZ _loc; - uint8_t _slope{}; + FootpathSlope _slope{}; ObjectEntryIndex _type{}; ObjectEntryIndex _railingsType{}; Direction _direction{ kInvalidDirection }; @@ -27,7 +27,7 @@ namespace OpenRCT2::GameActions public: FootpathPlaceAction() = default; FootpathPlaceAction( - const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, + const CoordsXYZ& loc, FootpathSlope slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, Direction direction = kInvalidDirection, PathConstructFlags constructFlags = 0); void AcceptParameters(GameActionParameterVisitor&) final; @@ -44,7 +44,7 @@ namespace OpenRCT2::GameActions Result ElementInsertExecute(Result res) const; void AutomaticallySetPeepSpawn() const; void RemoveIntersectingWalls(PathElement* pathElement) const; - PathElement* MapGetFootpathElementSlope(const CoordsXYZ& footpathPos, int32_t slope) const; + PathElement* MapGetFootpathElementWithSlope(const CoordsXYZ& footpathPos, FootpathSlope slope) const; bool IsSameAsPathElement(const PathElement* pathElement) const; bool IsSameAsEntranceElement(const EntranceElement& entranceElement) const; }; diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index d2fc3fc2dd..072adea40c 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -19,6 +19,7 @@ #include "../world/Location.hpp" #include "../world/Map.h" #include "../world/Park.h" +#include "../world/TileElementsView.h" #include "../world/tile_element/BannerElement.h" #include "../world/tile_element/PathElement.h" #include "BannerRemoveAction.h" @@ -127,30 +128,18 @@ namespace OpenRCT2::GameActions { bool getGhostPath = GetFlags() & GAME_COMMAND_FLAG_GHOST; - // FIXME: This is a hack to get the footpath element. It should be done in a better way. - TileElement* tileElement = MapGetFootpathElement(_loc)->as(); - TileElement* footpathElement = nullptr; - if (tileElement != nullptr) + for (auto* pathElement : TileElementsView(_loc)) { - if (getGhostPath && !tileElement->IsGhost()) - { - while (!(tileElement++)->IsLastForTile()) - { - if (tileElement->GetType() != TileElementType::Path && !tileElement->IsGhost()) - { - continue; - } - footpathElement = tileElement; - break; - } - } - else - { - footpathElement = tileElement; - } + if (pathElement->IsGhost() != getGhostPath) + continue; + + if (pathElement->GetBaseZ() != _loc.z) + continue; + + return reinterpret_cast(pathElement); } - return footpathElement; + return nullptr; } money64 FootpathRemoveAction::GetRefundPrice(TileElement* footpathElement) const diff --git a/src/openrct2/actions/GameSetSpeedAction.cpp b/src/openrct2/actions/GameSetSpeedAction.cpp index b64f9b179a..d62a8090e0 100644 --- a/src/openrct2/actions/GameSetSpeedAction.cpp +++ b/src/openrct2/actions/GameSetSpeedAction.cpp @@ -70,6 +70,6 @@ namespace OpenRCT2::GameActions bool GameSetSpeedAction::IsValidSpeed(uint8_t speed) const { - return speed >= 1 && (speed <= 4 || (Config::Get().general.DebuggingTools && speed <= 8)); + return speed >= 1 && (speed <= 4 || (Config::Get().general.debuggingTools && speed <= 8)); } } // namespace OpenRCT2::GameActions diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 01e9249857..c61f5bc4f9 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -74,24 +74,24 @@ namespace OpenRCT2::GameActions MapRange normRange = _range.Normalise(); // Keep big coordinates within map boundaries auto mapSizeMaxXY = GetMapSizeMaxXY(); - auto aX = std::max(32, normRange.GetLeft()); - auto bX = std::min(mapSizeMaxXY.x, normRange.GetRight()); - auto aY = std::max(32, normRange.GetTop()); - auto bY = std::min(mapSizeMaxXY.y, normRange.GetBottom()); + auto aX = std::max(32, normRange.GetX1()); + auto bX = std::min(mapSizeMaxXY.x, normRange.GetX2()); + auto aY = std::max(32, normRange.GetY1()); + auto bY = std::min(mapSizeMaxXY.y, normRange.GetY2()); MapRange validRange = MapRange{ aX, aY, bX, bY }; - CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16, - (validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 }; + CoordsXYZ centre{ (validRange.GetX1() + validRange.GetX2()) / 2 + 16, + (validRange.GetY1() + validRange.GetY2()) / 2 + 16, 0 }; centre.z = TileElementHeight(centre); res.Position = centre; res.Expenditure = ExpenditureType::landPurchase; // Game command modified to accept selection size - for (auto y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (auto y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (auto x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (auto x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (!LocationValid({ x, y })) continue; diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index b9faee4af8..6295306819 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -87,9 +87,9 @@ namespace OpenRCT2::GameActions uint8_t maxHeight = MapGetHighestLandHeight(validRange); bool withinOwnership = false; - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (!LocationValid({ x, y })) continue; diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index eeb6652c6b..6d2237fd13 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -88,9 +88,9 @@ namespace OpenRCT2::GameActions uint8_t minHeight = MapGetLowestLandHeight(validRange); bool withinOwnership = false; - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (!LocationValid({ x, y })) continue; diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 5e41dc0328..4b47b49ad9 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -79,8 +79,8 @@ namespace OpenRCT2::GameActions auto res = Result(); auto validRange = ClampRangeWithinMap(_range.Normalise()); - CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16, - (validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 }; + CoordsXYZ centre{ (validRange.GetX1() + validRange.GetX2()) / 2 + 16, + (validRange.GetY1() + validRange.GetY2()) / 2 + 16, 0 }; centre.z = TileElementHeight(centre); res.Position = centre; @@ -92,9 +92,9 @@ namespace OpenRCT2::GameActions } // Game command modified to accept selection size - for (auto y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (auto y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (auto x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (auto x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (!LocationValid({ x, y })) continue; diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 240bc263c6..8c65e4b5bf 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -342,10 +342,10 @@ namespace OpenRCT2::GameActions auto normRange = _range.Normalise(); // Cap bounds to map - auto l = std::max(normRange.GetLeft(), 32); - auto t = std::max(normRange.GetTop(), 32); - auto r = std::clamp(normRange.GetRight(), 0, kMaximumTileStartXY); - auto b = std::clamp(normRange.GetBottom(), 0, kMaximumTileStartXY); + auto l = std::max(normRange.GetX1(), 32); + auto t = std::max(normRange.GetY1(), 32); + auto r = std::clamp(normRange.GetX2(), 0, kMaximumTileStartXY); + auto b = std::clamp(normRange.GetY2(), 0, kMaximumTileStartXY); auto validRange = MapRange{ l, t, r, b }; int32_t centreZ = TileElementHeight(_coords); @@ -365,51 +365,51 @@ namespace OpenRCT2::GameActions // Smooth the 4 corners { // top-left - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY1() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, -32, 0, 2); } } { // bottom-left - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetBottom() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY2() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 3)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetBottom() }, z, -32, 32, 1, 3); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY2() }, z, -32, 32, 1, 3); } } { // bottom-right - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetBottom() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX2(), validRange.GetY2() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 0)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetRight(), validRange.GetBottom() }, z, 32, 32, 2, 0); + gameState, isExecuting, { validRange.GetX2(), validRange.GetY2() }, z, 32, 32, 2, 0); } } { // top-right - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX2(), validRange.GetY1() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 1)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetRight(), validRange.GetTop() }, z, 32, -32, 3, 1); + gameState, isExecuting, { validRange.GetX2(), validRange.GetY1() }, z, 32, -32, 3, 1); } } // Smooth the edges int32_t z1, z2; - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), y }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -417,10 +417,10 @@ namespace OpenRCT2::GameActions z2 = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge( - gameState, isExecuting, { validRange.GetLeft(), y }, z1, z2, -32, 0, 0, 1, 3, 2); + gameState, isExecuting, { validRange.GetX1(), y }, z1, z2, -32, 0, 0, 1, 3, 2); } - surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX2(), y }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -428,13 +428,13 @@ namespace OpenRCT2::GameActions z2 = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 0)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge( - gameState, isExecuting, { validRange.GetRight(), y }, z1, z2, 32, 0, 2, 3, 1, 0); + gameState, isExecuting, { validRange.GetX2(), y }, z1, z2, 32, 0, 2, 3, 1, 0); } } - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetY1() }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -442,10 +442,10 @@ namespace OpenRCT2::GameActions z2 = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge( - gameState, isExecuting, { x, validRange.GetTop() }, z1, z2, 0, -32, 0, 3, 1, 2); + gameState, isExecuting, { x, validRange.GetY1() }, z1, z2, 0, -32, 0, 3, 1, 2); } - surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetBottom() }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetY2() }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -453,7 +453,7 @@ namespace OpenRCT2::GameActions z2 = std::clamp( static_cast(TileElementGetCornerHeight(surfaceElement, 3)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge( - gameState, isExecuting, { x, validRange.GetBottom() }, z1, z2, 0, 32, 1, 2, 0, 3); + gameState, isExecuting, { x, validRange.GetY2() }, z1, z2, 0, 32, 1, 2, 0, 3); } } break; @@ -463,7 +463,7 @@ namespace OpenRCT2::GameActions case MapSelectType::corner2: case MapSelectType::corner3: { - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY1() }); if (surfaceElement == nullptr) break; uint8_t newBaseZ = surfaceElement->BaseHeight; @@ -488,16 +488,16 @@ namespace OpenRCT2::GameActions // Smooth the corners int32_t z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, -32, 0, 2); z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 32, 2, 0); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 32, 2, 0); z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 32, 1, 3); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 32, 1, 3); z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, -32, 3, 1); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, -32, 3, 1); // Smooth the edges switch (selectionType) @@ -505,54 +505,54 @@ namespace OpenRCT2::GameActions case MapSelectType::corner0: z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 3, 0); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 3, 0); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 1, 0); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 1, 0); z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 0, 3); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 0, 3); z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 0, 1); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 0, 1); break; case MapSelectType::corner1: z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 2, 1); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 2, 1); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 0, 1); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 0, 1); z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 1, 2); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 1, 2); z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 1, 0); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 1, 0); break; case MapSelectType::corner2: z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 1, 2); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 1, 2); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 3, 2); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 3, 2); z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 2, 1); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 2, 1); z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 2, 3); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 2, 3); break; case MapSelectType::corner3: z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 0, 3); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 0, 0, 3); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 2, 3); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, 32, 2, 3); z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 3, 0); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 0, 3, 0); z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 3, 2); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 0, -32, 3, 2); break; default: break; @@ -566,7 +566,7 @@ namespace OpenRCT2::GameActions { // TODO: Handle smoothing by edge // Get the two corners to raise - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetX1(), validRange.GetY1() }); if (surfaceElement == nullptr) break; uint8_t newBaseZ = surfaceElement->BaseHeight; @@ -612,32 +612,32 @@ namespace OpenRCT2::GameActions uint8_t z4 = MapGetCornerHeight(newBaseZ, newSlope, c4); // Smooth the edge at the top of the new slope res.Cost += SmoothLandRowByEdge( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z1, z2, stepOffsets[edge].x, + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z1, z2, stepOffsets[edge].x, stepOffsets[edge].y, c3, c4, c1, c2); // Smooth the edge at the bottom of the new slope res.Cost += SmoothLandRowByEdge( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z3, z4, -stepOffsets[edge].x, + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z3, z4, -stepOffsets[edge].x, -stepOffsets[edge].y, c1, c2, c3, c4); // Smooth corners res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z1, -stepOffsets[edge].y, + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z1, -stepOffsets[edge].y, stepOffsets[edge].x, c2, c1); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z2, stepOffsets[edge].y, + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z2, stepOffsets[edge].y, -stepOffsets[edge].x, c1, c2); int32_t z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, -32, 0, 2); z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 32, 2, 0); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, 32, 2, 0); z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 32, 1, 3); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, -32, 32, 1, 3); z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( - gameState, isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, -32, 3, 1); + gameState, isExecuting, { validRange.GetX1(), validRange.GetY1() }, z, 32, -32, 3, 1); break; } default: diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 5e0b807c6f..54bc77b0c5 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -91,7 +91,7 @@ namespace OpenRCT2::GameActions auto baseHeight = _loc.z; auto clearanceHeight = _loc.z + kMazeClearanceHeight; - auto heightDifference = baseHeight - surfaceElement->GetBaseZ(); + auto heightDifference = clearanceHeight - surfaceElement->GetBaseZ(); if (heightDifference >= 0 && !gameState.cheats.disableSupportLimits) { heightDifference /= kCoordsZPerTinyZ; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 8a763acf34..0ca2fcf3e8 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -123,9 +123,9 @@ namespace OpenRCT2::GameActions } auto baseHeight = _loc.z; - auto clearanceHeight = _loc.z + 32; + auto clearanceHeight = _loc.z + kMazeClearanceHeight; - auto heightDifference = baseHeight - surfaceElement->GetBaseZ(); + auto heightDifference = clearanceHeight - surfaceElement->GetBaseZ(); if (heightDifference >= 0 && !gameState.cheats.disableSupportLimits) { heightDifference /= kCoordsZPerTinyZ; diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 68641f2124..e4c210f1ac 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -19,7 +19,6 @@ #include "../localisation/StringIds.h" #include "../object/ObjectLimits.h" #include "../object/ObjectManager.h" -#include "../rct1/RCT1.h" #include "../ride/Ride.h" #include "../ride/RideData.h" #include "../ride/ShopItem.h" @@ -205,7 +204,7 @@ namespace OpenRCT2::GameActions ride->price[i] = rtd.DefaultPrices[i]; } - if (rideEntry->shop_item[0] == ShopItem::None) + if (rideEntry->shop_item[0] == ShopItem::none) { if (!Park::RidePricesUnlocked() || gameState.park.entranceFee > 0) { @@ -216,7 +215,7 @@ namespace OpenRCT2::GameActions { ride->price[0] = GetShopItemDescriptor(rideEntry->shop_item[0]).DefaultPrice; } - if (rideEntry->shop_item[1] != ShopItem::None) + if (rideEntry->shop_item[1] != ShopItem::none) { ride->price[1] = GetShopItemDescriptor(rideEntry->shop_item[1]).DefaultPrice; } @@ -228,7 +227,7 @@ namespace OpenRCT2::GameActions if (rtd.specialType == RtdSpecialType::toilet) { - if (ShopItemHasCommonPrice(ShopItem::Admission)) + if (ShopItemHasCommonPrice(ShopItem::admission)) { auto price = RideGetCommonPrice(*ride); if (price != kMoney64Undefined) @@ -240,7 +239,7 @@ namespace OpenRCT2::GameActions for (auto i = 0; i < RCT2::ObjectLimits::kMaxShopItemsPerRideEntry; i++) { - if (rideEntry->shop_item[i] != ShopItem::None) + if (rideEntry->shop_item[i] != ShopItem::none) { if (ShopItemHasCommonPrice(rideEntry->shop_item[i])) { @@ -254,9 +253,9 @@ namespace OpenRCT2::GameActions } // Set the on-ride photo price, whether the ride has one or not (except shops). - if (!rtd.HasFlag(RtdFlag::isShopOrFacility) && ShopItemHasCommonPrice(ShopItem::Photo)) + if (!rtd.HasFlag(RtdFlag::isShopOrFacility) && ShopItemHasCommonPrice(ShopItem::photo)) { - auto price = ShopItemGetCommonPrice(ride, ShopItem::Photo); + auto price = ShopItemGetCommonPrice(ride, ShopItem::photo); if (price != kMoney64Undefined) { ride->price[1] = price; diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 497bbfae42..8889a2d433 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -111,13 +111,13 @@ namespace OpenRCT2::GameActions ShopItem shopItem; if (_primaryPrice) { - shopItem = ShopItem::Admission; + shopItem = ShopItem::admission; const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType != RtdSpecialType::toilet) { shopItem = rideEntry->shop_item[0]; - if (shopItem == ShopItem::None) + if (shopItem == ShopItem::none) { ride->price[0] = _price; windowMgr->InvalidateByClass(WindowClass::ride); @@ -135,7 +135,7 @@ namespace OpenRCT2::GameActions else { shopItem = rideEntry->shop_item[1]; - if (shopItem == ShopItem::None) + if (shopItem == ShopItem::none) { shopItem = ride->getRideTypeDescriptor().PhotoItem; if ((ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) == 0) @@ -167,7 +167,7 @@ namespace OpenRCT2::GameActions auto invalidate = false; auto rideEntry = GetRideEntryByIndex(ride.subtype); const auto& rtd = ride.getRideTypeDescriptor(); - if (rtd.specialType == RtdSpecialType::toilet && shopItem == ShopItem::Admission) + if (rtd.specialType == RtdSpecialType::toilet && shopItem == ShopItem::admission) { if (ride.price[0] != _price) { @@ -187,7 +187,7 @@ namespace OpenRCT2::GameActions { // If the shop item is the same or an on-ride photo if (rideEntry->shop_item[1] == shopItem - || (rideEntry->shop_item[1] == ShopItem::None && GetShopItemDescriptor(shopItem).IsPhoto())) + || (rideEntry->shop_item[1] == ShopItem::none && GetShopItemDescriptor(shopItem).IsPhoto())) { if (ride.price[1] != _price) { diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index 0ffa5cba6e..5117a3cfd5 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -67,7 +67,6 @@ namespace OpenRCT2::GameActions auto* entry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); if (entry == nullptr) { - LOG_ERROR("Invalid small scenery type %u", _sceneryType); return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } @@ -103,7 +102,6 @@ namespace OpenRCT2::GameActions TileElement* tileElement = FindSceneryElement(); if (tileElement == nullptr) { - LOG_ERROR("Small scenery of type %u not found at x = %d, y = %d, z = &d", _sceneryType, _loc.x, _loc.y, _loc.z); return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 621d089de3..5404ead001 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -53,11 +53,11 @@ namespace OpenRCT2::GameActions return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } - if (staff->State == PeepState::Fixing) + if (staff->State == PeepState::fixing) { return Result(Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, kStringIdNone); } - else if (staff->State == PeepState::Inspecting) + else if (staff->State == PeepState::inspecting) { return Result(Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, kStringIdNone); } diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 21efa78bae..e426427e00 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -77,7 +77,7 @@ namespace OpenRCT2::GameActions auto res = Result(); res.Expenditure = ExpenditureType::wages; - if (_staffType >= static_cast(StaffType::Count)) + if (_staffType >= static_cast(StaffType::count)) { LOG_ERROR("Invalid staff type %u", static_cast(_staffType)); return Result(Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); @@ -88,9 +88,9 @@ namespace OpenRCT2::GameActions return Result(Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); } - if (_staffType == static_cast(StaffType::Entertainer)) + if (_staffType == static_cast(StaffType::entertainer)) { - auto costumes = findAllPeepAnimationsIndexesForType(AnimationPeepType::Entertainer); + auto costumes = findAllPeepAnimationsIndexesForType(AnimationPeepType::entertainer); if (std::find(costumes.begin(), costumes.end(), _costumeIndex) == costumes.end()) { LOG_ERROR("Unavailable entertainer costume %u", static_cast(_costumeIndex)); @@ -115,11 +115,11 @@ namespace OpenRCT2::GameActions else { newPeep->WindowInvalidateFlags = 0; - newPeep->Action = PeepActionType::Walking; + newPeep->Action = PeepActionType::walking; newPeep->SpecialSprite = 0; newPeep->AnimationImageIdOffset = 0; newPeep->WalkingAnimationFrameNum = 0; - newPeep->AnimationType = PeepAnimationType::Walking; + newPeep->AnimationType = PeepAnimationType::walking; newPeep->PathCheckOptimisation = 0; newPeep->PeepFlags = 0; newPeep->StaffLawnsMown = 0; @@ -150,24 +150,24 @@ namespace OpenRCT2::GameActions auto animPeepType = AnimationPeepType(static_cast(_staffType) + 1); ObjectEntryIndex animObjectIndex = _costumeIndex; - if (animPeepType != AnimationPeepType::Entertainer) + if (animPeepType != AnimationPeepType::entertainer) animObjectIndex = findPeepAnimationsIndexForType(animPeepType); newPeep->Name = nullptr; newPeep->AnimationObjectIndex = animObjectIndex; - newPeep->AnimationGroup = PeepAnimationGroup::Normal; + newPeep->AnimationGroup = PeepAnimationGroup::normal; auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(animObjectIndex); newPeep->PeepFlags &= ~PEEP_FLAGS_SLOW_WALK; - if (animObj->IsSlowWalking(PeepAnimationGroup::Normal)) + if (animObj->IsSlowWalking(PeepAnimationGroup::normal)) newPeep->PeepFlags |= PEEP_FLAGS_SLOW_WALK; const auto& spriteBounds = animObj->GetSpriteBounds(newPeep->AnimationGroup); - newPeep->SpriteData.Width = spriteBounds.sprite_width; - newPeep->SpriteData.HeightMin = spriteBounds.sprite_height_negative; - newPeep->SpriteData.HeightMax = spriteBounds.sprite_height_positive; + newPeep->SpriteData.Width = spriteBounds.spriteWidth; + newPeep->SpriteData.HeightMin = spriteBounds.spriteHeightNegative; + newPeep->SpriteData.HeightMax = spriteBounds.spriteHeightPositive; if (_autoPosition) { @@ -176,7 +176,7 @@ namespace OpenRCT2::GameActions else { // NOTE: This state is required for the window to act. - newPeep->State = PeepState::Picked; + newPeep->State = PeepState::picked; // INVESTIGATE: x and y are LOCATION_NULL at this point. newPeep->MoveTo(newPeep->GetLocation()); @@ -224,7 +224,7 @@ namespace OpenRCT2::GameActions void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const { // Find a location to place new staff member - newPeep->State = PeepState::Falling; + newPeep->State = PeepState::falling; uint32_t count = 0; PathElement* guest_tile = nullptr; @@ -233,7 +233,7 @@ namespace OpenRCT2::GameActions { for (auto guest : EntityList()) { - if (guest->State == PeepState::Walking) + if (guest->State == PeepState::walking) { // Check the walking guest's tile. Only count them if they're on a path tile. guest_tile = MapGetPathElementAt(TileCoordsXYZ{ guest->NextLoc }); @@ -252,7 +252,7 @@ namespace OpenRCT2::GameActions for (auto guest : EntityList()) { - if (guest->State == PeepState::Walking) + if (guest->State == PeepState::walking) { guest_tile = MapGetPathElementAt(TileCoordsXYZ{ guest->NextLoc }); if (guest_tile != nullptr) @@ -274,7 +274,7 @@ namespace OpenRCT2::GameActions else { // User must pick a location - newPeep->State = PeepState::Picked; + newPeep->State = PeepState::picked; newLocation = newPeep->GetLocation(); } } @@ -295,7 +295,7 @@ namespace OpenRCT2::GameActions else { // User must pick a location - newPeep->State = PeepState::Picked; + newPeep->State = PeepState::picked; newLocation = newPeep->GetLocation(); } } diff --git a/src/openrct2/actions/StaffHireNewAction.h b/src/openrct2/actions/StaffHireNewAction.h index 3a04be0c92..0e3a635fec 100644 --- a/src/openrct2/actions/StaffHireNewAction.h +++ b/src/openrct2/actions/StaffHireNewAction.h @@ -23,7 +23,7 @@ namespace OpenRCT2::GameActions { private: bool _autoPosition{}; - uint8_t _staffType{ EnumValue(StaffType::Count) }; + uint8_t _staffType{ EnumValue(StaffType::count) }; ObjectEntryIndex _costumeIndex; uint32_t _staffOrders{}; diff --git a/src/openrct2/actions/StaffSetColourAction.cpp b/src/openrct2/actions/StaffSetColourAction.cpp index a7d8ae0f37..b8ad72c435 100644 --- a/src/openrct2/actions/StaffSetColourAction.cpp +++ b/src/openrct2/actions/StaffSetColourAction.cpp @@ -47,7 +47,7 @@ namespace OpenRCT2::GameActions Result StaffSetColourAction::Query(GameState_t& gameState) const { auto staffType = static_cast(_staffType); - if (staffType != StaffType::Handyman && staffType != StaffType::Mechanic && staffType != StaffType::Security) + if (staffType != StaffType::handyman && staffType != StaffType::mechanic && staffType != StaffType::security) { LOG_ERROR("Staff color can't be changed for staff type %d", _staffType); return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index e131b47bde..8cc1cb6f48 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -82,13 +82,13 @@ namespace OpenRCT2::GameActions } staff->AnimationObjectIndex = _costume; - staff->AnimationGroup = PeepAnimationGroup::Normal; + staff->AnimationGroup = PeepAnimationGroup::normal; auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(_costume); staff->PeepFlags &= ~PEEP_FLAGS_SLOW_WALK; - if (animObj->IsSlowWalking(PeepAnimationGroup::Normal)) + if (animObj->IsSlowWalking(PeepAnimationGroup::normal)) staff->PeepFlags |= PEEP_FLAGS_SLOW_WALK; staff->AnimationFrameNum = 0; diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index d79dab8c46..2266e41fab 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -54,7 +54,7 @@ namespace OpenRCT2::GameActions auto* staff = getGameState().entities.TryGetEntity(_spriteIndex); if (staff == nullptr - || (staff->AssignedStaffType != StaffType::Handyman && staff->AssignedStaffType != StaffType::Mechanic)) + || (staff->AssignedStaffType != StaffType::handyman && staff->AssignedStaffType != StaffType::mechanic)) { LOG_ERROR("Staff orders can't be changed for staff of type %u", _spriteIndex); return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index a366f8816a..ad0fdd7735 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -70,9 +70,9 @@ namespace OpenRCT2::GameActions } auto validRange = ClampRangeWithinMap(_range); - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (!LocationValid({ x, y })) { diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 4c3a198889..f965b1f1ee 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -76,8 +76,8 @@ namespace OpenRCT2::GameActions } } - auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16; - auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16; + auto xMid = (validRange.GetX1() + validRange.GetX2()) / 2 + 16; + auto yMid = (validRange.GetY1() + validRange.GetY2()) / 2 + 16; auto heightMid = TileElementHeight({ xMid, yMid }); res.Position.x = xMid; @@ -93,10 +93,10 @@ namespace OpenRCT2::GameActions money64 surfaceCost = 0; money64 edgeCost = 0; - for (CoordsXY coords = { validRange.GetLeft(), validRange.GetTop() }; coords.x <= validRange.GetRight(); + for (CoordsXY coords = { validRange.GetX1(), validRange.GetY1() }; coords.x <= validRange.GetX2(); coords.x += kCoordsXYStep) { - for (coords.y = validRange.GetTop(); coords.y <= validRange.GetBottom(); coords.y += kCoordsXYStep) + for (coords.y = validRange.GetY1(); coords.y <= validRange.GetY2(); coords.y += kCoordsXYStep) { if (!LocationValid(coords)) continue; @@ -150,8 +150,8 @@ namespace OpenRCT2::GameActions res.Expenditure = ExpenditureType::landscaping; auto validRange = ClampRangeWithinMap(_range.Normalise()); - auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16; - auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16; + auto xMid = (validRange.GetX1() + validRange.GetX2()) / 2 + 16; + auto yMid = (validRange.GetY1() + validRange.GetY2()) / 2 + 16; auto heightMid = TileElementHeight({ xMid, yMid }); res.Position.x = xMid; @@ -160,10 +160,10 @@ namespace OpenRCT2::GameActions money64 surfaceCost = 0; money64 edgeCost = 0; - for (CoordsXY coords = { validRange.GetLeft(), validRange.GetTop() }; coords.x <= validRange.GetRight(); + for (CoordsXY coords = { validRange.GetX1(), validRange.GetY1() }; coords.x <= validRange.GetX2(); coords.x += kCoordsXYStep) { - for (coords.y = validRange.GetTop(); coords.y <= validRange.GetBottom(); coords.y += kCoordsXYStep) + for (coords.y = validRange.GetY1(); coords.y <= validRange.GetY2(); coords.y += kCoordsXYStep) { if (!LocationValid(coords)) continue; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index d6aeb0d55a..e602e8b5b7 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -27,9 +27,10 @@ namespace OpenRCT2::GameActions { - TrackDesignAction::TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td) + TrackDesignAction::TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td, bool placeScenery) : _loc(location) , _td(td) + , _placeScenery(placeScenery) { } @@ -50,6 +51,7 @@ namespace OpenRCT2::GameActions stream << DS_TAG(_loc); _td.Serialise(stream); + stream << DS_TAG(_placeScenery); } Result TrackDesignAction::Query(GameState_t& gameState) const @@ -94,7 +96,7 @@ namespace OpenRCT2::GameActions return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); } - bool placeScenery = true; + bool placeScenery = _placeScenery; uint32_t flags = 0; if (GetFlags() & GAME_COMMAND_FLAG_GHOST) @@ -169,7 +171,7 @@ namespace OpenRCT2::GameActions // Query first, this is required again to determine if scenery is available. uint32_t flags = GetFlags() & ~GAME_COMMAND_FLAG_APPLY; - bool placeScenery = true; + bool placeScenery = _placeScenery; auto queryRes = TrackDesignPlace(_td, flags, placeScenery, *ride, _loc); if (_trackDesignPlaceStateSceneryUnavailable) @@ -236,7 +238,7 @@ namespace OpenRCT2::GameActions auto numCircuits = std::max(1, _td.operation.numCircuits); SetOperatingSettingNested(ride->id, RideSetSetting::NumCircuits, numCircuits, flags); - uint8_t defaultInspectionInterval = Config::Get().general.DefaultInspectionInterval; + uint8_t defaultInspectionInterval = Config::Get().general.defaultInspectionInterval; if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER) SetOperatingSettingNested(ride->id, RideSetSetting::InspectionInterval, defaultInspectionInterval, flags); diff --git a/src/openrct2/actions/TrackDesignAction.h b/src/openrct2/actions/TrackDesignAction.h index aa68836a7b..1b5acfa888 100644 --- a/src/openrct2/actions/TrackDesignAction.h +++ b/src/openrct2/actions/TrackDesignAction.h @@ -19,10 +19,11 @@ namespace OpenRCT2::GameActions private: CoordsXYZD _loc; TrackDesign _td; + bool _placeScenery{ false }; public: TrackDesignAction() = default; - TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td); + TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td, bool placeScenery); void AcceptParameters(GameActionParameterVisitor&) final; diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 28581c1af3..fb7af29227 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -667,21 +667,21 @@ namespace OpenRCT2::GameActions // Update ride stats and block brake count if the piece was successfully built if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - InvalidateTestResults(*ride); switch (_trackType) { case TrackElemType::OnRidePhoto: ride->lifecycleFlags |= RIDE_LIFECYCLE_ON_RIDE_PHOTO; + InvalidateTestResults(*ride); break; case TrackElemType::CableLiftHill: ride->lifecycleFlags |= RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED; ride->cableLiftLoc = originLocation; + InvalidateTestResults(*ride); break; case TrackElemType::DiagBlockBrakes: case TrackElemType::BlockBrakes: { ride->numBlockBrakes++; - ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING; auto newMode = RideModeGetBlockSectionedCounterpart(ride->mode); if (ride->mode != newMode) @@ -689,6 +689,7 @@ namespace OpenRCT2::GameActions bool canSwitch = rtd.SupportsRideMode(newMode) || getGameState().cheats.showAllOperatingModes; if (canSwitch) { + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING; auto rideSetSetting = GameActions::RideSetSettingAction( ride->id, GameActions::RideSetSetting::Mode, static_cast(newMode)); ExecuteNested(&rideSetSetting, gameState); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index ab0178ab3c..19bd8ed2c4 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -452,7 +452,6 @@ namespace OpenRCT2::GameActions ride->numBlockBrakes--; if (ride->numBlockBrakes == 0 && ride->isBlockSectioned()) { - ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING; RideMode newMode = RideMode::continuousCircuit; if (ride->mode == RideMode::poweredLaunchBlockSectioned) { @@ -460,9 +459,18 @@ namespace OpenRCT2::GameActions newMode = ride->getRideTypeDescriptor().DefaultMode; } - auto rideSetSetting = GameActions::RideSetSettingAction( - ride->id, GameActions::RideSetSetting::Mode, static_cast(newMode)); - ExecuteNested(&rideSetSetting, gameState); + if (ride->mode != newMode) + { + bool canSwitch = ride->getRideTypeDescriptor().SupportsRideMode(newMode) + || getGameState().cheats.showAllOperatingModes; + if (canSwitch) + { + ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING; + auto rideSetSetting = GameActions::RideSetSettingAction( + ride->id, GameActions::RideSetSetting::Mode, static_cast(newMode)); + ExecuteNested(&rideSetSetting, gameState); + } + } } break; diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index 13885a78e6..bbf3a65437 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -56,8 +56,8 @@ namespace OpenRCT2::GameActions auto res = Result(); auto validRange = ClampRangeWithinMap(_range); - res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16; - res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16; + res.Position.x = ((validRange.GetX1() + validRange.GetX2()) / 2) + 16; + res.Position.y = ((validRange.GetY1() + validRange.GetY2()) / 2) + 16; int16_t z = TileElementHeight(res.Position); int16_t waterHeight = TileElementWaterHeight(res.Position); if (waterHeight != 0) @@ -70,9 +70,9 @@ namespace OpenRCT2::GameActions uint8_t minHeight = GetLowestHeight(gameState, validRange); bool hasChanged = false; bool withinOwnership = false; - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (!LocationValid({ x, y })) continue; @@ -135,9 +135,9 @@ namespace OpenRCT2::GameActions { // The lowest height to lower the water to is the highest water level in the selection uint8_t minHeight{ 0 }; - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode) { diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 8fe24c3f13..2d05aa5a7a 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -56,8 +56,8 @@ namespace OpenRCT2::GameActions auto res = Result(); auto validRange = ClampRangeWithinMap(_range); - res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16; - res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16; + res.Position.x = ((validRange.GetX1() + validRange.GetX2()) / 2) + 16; + res.Position.y = ((validRange.GetY1() + validRange.GetY2()) / 2) + 16; int32_t z = TileElementHeight(res.Position); int16_t waterHeight = TileElementWaterHeight(res.Position); if (waterHeight != 0) @@ -70,9 +70,9 @@ namespace OpenRCT2::GameActions auto maxHeight = GetHighestHeight(gameState, validRange) / kCoordsZStep; bool hasChanged = false; bool withinOwnership = false; - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (!LocationValid({ x, y })) continue; @@ -148,9 +148,9 @@ namespace OpenRCT2::GameActions { // The highest height to raise the water to is the lowest water level in the selection uint16_t maxHeight = 255 * kCoordsZStep; - for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = validRange.GetY1(); y <= validRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = validRange.GetX1(); x <= validRange.GetX2(); x += kCoordsXYStep) { if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode) { diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 75e93da291..a12c789048 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -68,7 +68,7 @@ namespace OpenRCT2::Audio return false; if (gGameSoundsOff) return false; - if (!Config::Get().sound.SoundEnabled) + if (!Config::Get().sound.soundEnabled) return false; if (gOpenRCT2Headless) return false; @@ -78,19 +78,19 @@ namespace OpenRCT2::Audio void Init() { auto& audioContext = GetContext()->GetAudioContext(); - if (Config::Get().sound.Device.empty()) + if (Config::Get().sound.device.empty()) { audioContext.SetOutputDevice(""); _currentAudioDevice = 0; } else { - audioContext.SetOutputDevice(Config::Get().sound.Device); + audioContext.SetOutputDevice(Config::Get().sound.device); PopulateDevices(); for (int32_t i = 0; i < GetDeviceCount(); i++) { - if (_audioDevices[i] == Config::Get().sound.Device) + if (_audioDevices[i] == Config::Get().sound.device) { _currentAudioDevice = i; } @@ -305,7 +305,7 @@ namespace OpenRCT2::Audio } // Load title sequence audio object - auto descriptor = GetTitleMusicDescriptor(Config::Get().sound.TitleMusic); + auto descriptor = GetTitleMusicDescriptor(Config::Get().sound.titleMusic); auto& objManager = GetContext()->GetObjectManager(); auto* audioObject = static_cast(objManager.LoadObject(descriptor)); if (audioObject != nullptr) @@ -404,8 +404,8 @@ namespace OpenRCT2::Audio void ToggleAllSounds() { - Config::Get().sound.MasterSoundEnabled = !Config::Get().sound.MasterSoundEnabled; - if (Config::Get().sound.MasterSoundEnabled) + Config::Get().sound.masterSoundEnabled = !Config::Get().sound.masterSoundEnabled; + if (Config::Get().sound.masterSoundEnabled) { Resume(); } diff --git a/src/openrct2/command_line/RootCommands.cpp b/src/openrct2/command_line/RootCommands.cpp index 66e26735e8..a8f7dcd3d6 100644 --- a/src/openrct2/command_line/RootCommands.cpp +++ b/src/openrct2/command_line/RootCommands.cpp @@ -376,7 +376,7 @@ namespace OpenRCT2 auto configPath = env->GetFilePath(OpenRCT2::PathId::config); Config::SetDefaults(); Config::OpenFromPath(configPath); - Config::Get().general.RCT2Path = path; + Config::Get().general.rct2Path = path; if (Config::SaveToPath(configPath)) { Console::WriteFormat("Updating RCT2 path to '%s'.", path.c_str()); @@ -403,7 +403,7 @@ namespace OpenRCT2 auto context = OpenRCT2::CreateContext(); auto& env = context->GetPlatformEnvironment(); auto objectRepository = CreateObjectRepository(env); - objectRepository->Construct(Config::Get().general.Language); + objectRepository->Construct(Config::Get().general.language); return EXITCODE_OK; } diff --git a/src/openrct2/command_line/ScreenshotCommands.cpp b/src/openrct2/command_line/ScreenshotCommands.cpp index f4f07b6131..215f622a7e 100644 --- a/src/openrct2/command_line/ScreenshotCommands.cpp +++ b/src/openrct2/command_line/ScreenshotCommands.cpp @@ -17,17 +17,18 @@ namespace OpenRCT2 // clang-format off static constexpr CommandLineOptionDefinition kScreenshotOptionsDef[] { - { CMDLINE_TYPE_INTEGER, &_options.weather, kNAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, - { CMDLINE_TYPE_SWITCH, &_options.hide_guests, kNAC, "no-peeps", "hide peeps" }, - { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, kNAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, - { CMDLINE_TYPE_SWITCH, &_options.clear_grass, kNAC, "clear-grass", "set all grass to be clear of weeds" }, - { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, kNAC, "mowed-grass", "set all grass to be mowed" }, - { CMDLINE_TYPE_SWITCH, &_options.water_plants, kNAC, "water-plants", "water plants for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, kNAC, "fix-vandalism", "fix vandalism for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.remove_litter, kNAC, "remove-litter", "remove litter for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, kNAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, - { CMDLINE_TYPE_SWITCH, &_options.transparent, kNAC, "transparent", "make the background transparent" }, - { CMDLINE_TYPE_SWITCH, &_options.draw_bounding_boxes, kNAC, "draw-bounding-boxes", "draw bounding boxes" }, + { CMDLINE_TYPE_INTEGER, &_options.weather, kNAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, + { CMDLINE_TYPE_SWITCH, &_options.hide_guests, kNAC, "no-peeps", "hide peeps" }, + { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, kNAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, + { CMDLINE_TYPE_SWITCH, &_options.clear_grass, kNAC, "clear-grass", "set all grass to be clear of weeds" }, + { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, kNAC, "mowed-grass", "set all grass to be mowed" }, + { CMDLINE_TYPE_SWITCH, &_options.water_plants, kNAC, "water-plants", "water plants for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, kNAC, "fix-vandalism", "fix vandalism for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.remove_litter, kNAC, "remove-litter", "remove litter for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, kNAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, + { CMDLINE_TYPE_SWITCH, &_options.transparent, kNAC, "transparent", "make the background transparent" }, + { CMDLINE_TYPE_SWITCH, &_options.draw_bounding_boxes, kNAC, "draw-bounding-boxes", "draw bounding boxes" }, + { CMDLINE_TYPE_SWITCH, &_options.drawSegmentHeights, kNAC, "draw-segment-heights", "draw segment heights" }, kOptionTableEnd }; diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 49ec295325..b3dcc5d27b 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -68,29 +68,29 @@ namespace OpenRCT2::Config }); static const auto Enum_Currency = ConfigEnum({ - ConfigEnumEntry("GBP", CurrencyType::Pounds), - ConfigEnumEntry("USD", CurrencyType::Dollars), - ConfigEnumEntry("FRF", CurrencyType::Franc), - ConfigEnumEntry("DEM", CurrencyType::DeutscheMark), - ConfigEnumEntry("JPY", CurrencyType::Yen), - ConfigEnumEntry("ESP", CurrencyType::Peseta), - ConfigEnumEntry("ITL", CurrencyType::Lira), - ConfigEnumEntry("NLG", CurrencyType::Guilders), - ConfigEnumEntry("SEK", CurrencyType::Krona), - ConfigEnumEntry("EUR", CurrencyType::Euros), - ConfigEnumEntry("KRW", CurrencyType::Won), - ConfigEnumEntry("RUB", CurrencyType::Rouble), - ConfigEnumEntry("CZK", CurrencyType::CzechKoruna), - ConfigEnumEntry("HKD", CurrencyType::HKD), - ConfigEnumEntry("TWD", CurrencyType::TWD), - ConfigEnumEntry("CNY", CurrencyType::Yuan), - ConfigEnumEntry("HUF", CurrencyType::Forint), - ConfigEnumEntry("CUSTOM", CurrencyType::Custom), + ConfigEnumEntry("GBP", CurrencyType::pounds), + ConfigEnumEntry("USD", CurrencyType::dollars), + ConfigEnumEntry("FRF", CurrencyType::franc), + ConfigEnumEntry("DEM", CurrencyType::deutscheMark), + ConfigEnumEntry("JPY", CurrencyType::yen), + ConfigEnumEntry("ESP", CurrencyType::peseta), + ConfigEnumEntry("ITL", CurrencyType::lira), + ConfigEnumEntry("NLG", CurrencyType::guilders), + ConfigEnumEntry("SEK", CurrencyType::krona), + ConfigEnumEntry("EUR", CurrencyType::euros), + ConfigEnumEntry("KRW", CurrencyType::won), + ConfigEnumEntry("RUB", CurrencyType::rouble), + ConfigEnumEntry("CZK", CurrencyType::czechKoruna), + ConfigEnumEntry("HKD", CurrencyType::hongKongDollar), + ConfigEnumEntry("TWD", CurrencyType::newTaiwanDollar), + ConfigEnumEntry("CNY", CurrencyType::yuan), + ConfigEnumEntry("HUF", CurrencyType::forint), + ConfigEnumEntry("CUSTOM", CurrencyType::custom), }); static const auto Enum_CurrencySymbolAffix = ConfigEnum({ - ConfigEnumEntry("PREFIX", CurrencyAffix::Prefix), - ConfigEnumEntry("SUFFIX", CurrencyAffix::Suffix), + ConfigEnumEntry("PREFIX", CurrencyAffix::prefix), + ConfigEnumEntry("SUFFIX", CurrencyAffix::suffix), }); static const auto Enum_DateFormat = ConfigEnum({ @@ -164,110 +164,110 @@ namespace OpenRCT2::Config if (reader->ReadSection("general")) { auto model = &_config.general; - model->AlwaysShowGridlines = reader->GetBoolean("always_show_gridlines", false); - model->AutosaveFrequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES); - model->AutosaveAmount = reader->GetInt32("autosave_amount", kDefaultNumAutosavesToKeep); - model->ConfirmationPrompt = reader->GetBoolean("confirmation_prompt", false); - model->CurrencyFormat = reader->GetEnum( + model->alwaysShowGridlines = reader->GetBoolean("always_show_gridlines", false); + model->autosaveFrequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES); + model->autosaveAmount = reader->GetInt32("autosave_amount", kDefaultNumAutosavesToKeep); + model->confirmationPrompt = reader->GetBoolean("confirmation_prompt", false); + model->currencyFormat = reader->GetEnum( "currency_format", Platform::GetLocaleCurrency(), Enum_Currency); - model->CustomCurrencyRate = reader->GetInt32("custom_currency_rate", 10); - model->CustomCurrencyAffix = reader->GetEnum( - "custom_currency_affix", CurrencyAffix::Suffix, Enum_CurrencySymbolAffix); - model->CustomCurrencySymbol = reader->GetString("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( + model->customCurrencyRate = reader->GetInt32("custom_currency_rate", 10); + model->customCurrencyAffix = reader->GetEnum( + "custom_currency_affix", CurrencyAffix::suffix, Enum_CurrencySymbolAffix); + model->customCurrencySymbol = reader->GetString("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->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( + 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->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( + 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::SoftwareWithHardwareDisplay, Enum_DrawingEngine); - model->UncapFPS = reader->GetBoolean("uncap_fps", false); - model->UseVSync = reader->GetBoolean("use_vsync", true); - model->VirtualFloorStyle = 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->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( + 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", FileBrowserSort::NameAscending, Enum_FileBrowserSort); - model->MinimizeFullscreenFocusLoss = reader->GetBoolean("minimize_fullscreen_focus_loss", true); - model->DisableScreensaver = reader->GetBoolean("disable_screensaver", true); + 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->DayNightCycle = reader->GetBoolean("day_night_cycle", false); - const bool supportsLightFx = model->DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay; - model->EnableLightFx = supportsLightFx && reader->GetBoolean("enable_light_fx", false); - model->EnableLightFxForVehicles = supportsLightFx && 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->WindowScale = reader->GetFloat("window_scale", Platform::GetDefaultScale()); - model->InferDisplayDPI = reader->GetBoolean("infer_display_dpi", true); - model->ShowFPS = reader->GetBoolean("show_fps", false); + model->dayNightCycle = reader->GetBoolean("day_night_cycle", false); + const bool supportsLightFx = model->drawingEngine == DrawingEngine::SoftwareWithHardwareDisplay; + model->enableLightFx = supportsLightFx && reader->GetBoolean("enable_light_fx", false); + model->enableLightFxForVehicles = supportsLightFx && 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->windowScale = reader->GetFloat("window_scale", Platform::GetDefaultScale()); + model->inferDisplayDPI = reader->GetBoolean("infer_display_dpi", true); + model->showFPS = reader->GetBoolean("show_fps", false); #ifdef _DEBUG // Always have multi-threading disabled in debug builds, this makes things slower. - model->MultiThreading = false; + model->multiThreading = false; #else - model->MultiThreading = reader->GetBoolean("multithreading", true); + model->multiThreading = reader->GetBoolean("multithreading", true); #endif // _DEBUG - model->TrapCursor = reader->GetBoolean("trap_cursor", false); - model->AutoOpenShops = reader->GetBoolean("auto_open_shops", false); + model->trapCursor = reader->GetBoolean("trap_cursor", false); + model->autoOpenShops = reader->GetBoolean("auto_open_shops", false); // Gamepad settings model->gamepadDeadzone = reader->GetInt32("gamepad_deadzone", 3600); model->gamepadSensitivity = reader->GetFloat("gamepad_sensitivity", 1.5f); - 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", kWindowLimitMax); - 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->ShowRealNamesOfStaff = reader->GetBoolean("show_real_names_of_staff", false); - 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->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", kWindowLimitMax); + 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->showRealNamesOfStaff = reader->GetBoolean("show_real_names_of_staff", false); + 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->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->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->LastVersionCheckTime = reader->GetInt64("last_version_check_time", 0); + model->lastVersionCheckTime = reader->GetInt64("last_version_check_time", 0); - model->FileBrowserWidth = reader->GetInt32("file_browser_width", 0); - model->FileBrowserHeight = reader->GetInt32("file_browser_height", 0); - model->FileBrowserShowSizeColumn = reader->GetBoolean("file_browser_show_size_column", true); - model->FileBrowserShowDateColumn = reader->GetBoolean("file_browser_show_date_column", true); - model->FileBrowserPreviewType = reader->GetEnum( + model->fileBrowserWidth = reader->GetInt32("file_browser_width", 0); + model->fileBrowserHeight = reader->GetInt32("file_browser_height", 0); + model->fileBrowserShowSizeColumn = reader->GetBoolean("file_browser_show_size_column", true); + model->fileBrowserShowDateColumn = reader->GetBoolean("file_browser_show_date_column", true); + model->fileBrowserPreviewType = reader->GetEnum( "file_browser_preview_type", ParkPreviewPref::screenshot, Enum_ParkPreviewPref); } } @@ -276,92 +276,92 @@ namespace OpenRCT2::Config { auto model = &_config.general; writer->WriteSection("general"); - 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_FileBrowserSort); - 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->WriteFloat("window_scale", model->WindowScale); - writer->WriteBoolean("infer_display_dpi", model->InferDisplayDPI); - writer->WriteBoolean("show_fps", model->ShowFPS); - writer->WriteBoolean("multithreading", model->MultiThreading); - writer->WriteBoolean("trap_cursor", model->TrapCursor); - writer->WriteBoolean("auto_open_shops", model->AutoOpenShops); + 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_FileBrowserSort); + 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->WriteFloat("window_scale", model->windowScale); + writer->WriteBoolean("infer_display_dpi", model->inferDisplayDPI); + writer->WriteBoolean("show_fps", model->showFPS); + writer->WriteBoolean("multithreading", model->multiThreading); + writer->WriteBoolean("trap_cursor", model->trapCursor); + writer->WriteBoolean("auto_open_shops", model->autoOpenShops); // Gamepad settings writer->WriteInt32("gamepad_deadzone", model->gamepadDeadzone); writer->WriteFloat("gamepad_sensitivity", model->gamepadSensitivity); - 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("show_real_names_of_staff", model->ShowRealNamesOfStaff); - 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); - writer->WriteInt32("file_browser_width", model->FileBrowserWidth); - writer->WriteInt32("file_browser_height", model->FileBrowserHeight); - writer->WriteBoolean("file_browser_show_size_column", model->FileBrowserShowSizeColumn); - writer->WriteBoolean("file_browser_show_date_column", model->FileBrowserShowDateColumn); - writer->WriteEnum("file_browser_preview_type", model->FileBrowserPreviewType, Enum_ParkPreviewPref); + 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("show_real_names_of_staff", model->showRealNamesOfStaff); + 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); + writer->WriteInt32("file_browser_width", model->fileBrowserWidth); + writer->WriteInt32("file_browser_height", model->fileBrowserHeight); + writer->WriteBoolean("file_browser_show_size_column", model->fileBrowserShowSizeColumn); + writer->WriteBoolean("file_browser_show_date_column", model->fileBrowserShowDateColumn); + writer->WriteEnum("file_browser_preview_type", model->fileBrowserPreviewType, Enum_ParkPreviewPref); } static void ReadInterface(IIniReader* reader) @@ -369,26 +369,26 @@ namespace OpenRCT2::Config if (reader->ReadSection("interface")) { auto model = &_config.interface; - model->ToolbarButtonsCentred = reader->GetBoolean("toolbar_buttons_centred", 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->ToolbarShowRotateAnticlockwise = reader->GetBoolean("toolbar_show_rotate_anti_clockwise", false); - model->ConsoleSmallFont = reader->GetBoolean("console_small_font", false); - model->CurrentThemePreset = reader->GetString("current_theme", "*RCT2"); - model->CurrentTitleSequencePreset = reader->GetString("current_title_sequence", "*OPENRCT2"); - model->RandomTitleSequence = reader->GetBoolean("random_title_sequence", false); - model->ObjectSelectionFilterFlags = reader->GetInt32("object_selection_filter_flags", 0x3FFF); + model->toolbarButtonsCentred = reader->GetBoolean("toolbar_buttons_centred", 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->toolbarShowRotateAnticlockwise = reader->GetBoolean("toolbar_show_rotate_anti_clockwise", false); + model->consoleSmallFont = reader->GetBoolean("console_small_font", false); + model->currentThemePreset = reader->GetString("current_theme", "*RCT2"); + model->currentTitleSequencePreset = reader->GetString("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->scenarioPreviewScreenshots = reader->GetBoolean("scenario_preview_screenshots", true); - model->ListRideVehiclesSeparately = reader->GetBoolean("list_ride_vehicles_separately", false); - model->WindowButtonsOnTheLeft = reader->GetBoolean("window_buttons_on_the_left", kWindowButtonsOnTheLeftDefault); - model->EnlargedUi = reader->GetBoolean("enlarged_ui", kEnlargedUiDefault); - model->TouchEnhancements = reader->GetBoolean("touch_enhancements", kEnlargedUiDefault); + model->listRideVehiclesSeparately = reader->GetBoolean("list_ride_vehicles_separately", false); + model->windowButtonsOnTheLeft = reader->GetBoolean("window_buttons_on_the_left", kWindowButtonsOnTheLeftDefault); + model->enlargedUi = reader->GetBoolean("enlarged_ui", kEnlargedUiDefault); + model->touchEnhancements = reader->GetBoolean("touch_enhancements", kEnlargedUiDefault); } } @@ -396,26 +396,26 @@ namespace OpenRCT2::Config { auto model = &_config.interface; writer->WriteSection("interface"); - writer->WriteBoolean("toolbar_buttons_centred", model->ToolbarButtonsCentred); - 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("toolbar_show_rotate_anti_clockwise", model->ToolbarShowRotateAnticlockwise); - 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->WriteBoolean("toolbar_buttons_centred", model->toolbarButtonsCentred); + 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("toolbar_show_rotate_anti_clockwise", model->toolbarShowRotateAnticlockwise); + 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("scenario_preview_screenshots", model->scenarioPreviewScreenshots); - writer->WriteBoolean("list_ride_vehicles_separately", model->ListRideVehiclesSeparately); - writer->WriteBoolean("window_buttons_on_the_left", model->WindowButtonsOnTheLeft); - writer->WriteBoolean("enlarged_ui", model->EnlargedUi); - writer->WriteBoolean("touch_enhancements", model->TouchEnhancements); + writer->WriteBoolean("list_ride_vehicles_separately", model->listRideVehiclesSeparately); + writer->WriteBoolean("window_buttons_on_the_left", model->windowButtonsOnTheLeft); + writer->WriteBoolean("enlarged_ui", model->enlargedUi); + writer->WriteBoolean("touch_enhancements", model->touchEnhancements); } static void ReadSound(IIniReader* reader) @@ -423,16 +423,16 @@ namespace OpenRCT2::Config if (reader->ReadSection("sound")) { auto model = &_config.sound; - model->Device = reader->GetString("audio_device", ""); - model->MasterSoundEnabled = reader->GetBoolean("master_sound", true); - model->MasterVolume = reader->GetInt32("master_volume", 100); - model->TitleMusic = static_cast( + 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_theme", EnumValue(TitleMusicKind::OpenRCT2))); - 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); + model->soundEnabled = reader->GetBoolean("sound", true); + model->soundVolume = reader->GetInt32("sound_volume", 100); + model->rideMusicEnabled = reader->GetBoolean("ride_music", true); + model->rideMusicVolume = reader->GetInt32("ride_music_volume", 100); + model->audioFocus = reader->GetBoolean("audio_focus", false); } } @@ -440,15 +440,15 @@ namespace OpenRCT2::Config { auto model = &_config.sound; writer->WriteSection("sound"); - writer->WriteString("audio_device", model->Device); - writer->WriteBoolean("master_sound", model->MasterSoundEnabled); - writer->WriteInt32("master_volume", model->MasterVolume); - writer->WriteInt32("title_theme", 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); + writer->WriteString("audio_device", model->device); + writer->WriteBoolean("master_sound", model->masterSoundEnabled); + writer->WriteInt32("master_volume", model->masterVolume); + writer->WriteInt32("title_theme", 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->rideMusicVolume); + writer->WriteBoolean("audio_focus", model->audioFocus); } static void ReadNetwork(IIniReader* reader) @@ -472,26 +472,26 @@ namespace OpenRCT2::Config playerName = String::trim(playerName); auto model = &_config.network; - model->PlayerName = std::move(playerName); - model->DefaultPort = reader->GetInt32("default_port", ::Network::kDefaultPort); - 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); + model->playerName = std::move(playerName); + model->defaultPort = reader->GetInt32("default_port", ::Network::kDefaultPort); + 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); } } @@ -499,26 +499,26 @@ namespace OpenRCT2::Config { auto model = &_config.network; writer->WriteSection("network"); - 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); + 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) @@ -526,24 +526,24 @@ namespace OpenRCT2::Config if (reader->ReadSection("notifications")) { auto model = &_config.notifications; - 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); + 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); } } @@ -551,24 +551,24 @@ namespace OpenRCT2::Config { auto model = &_config.notifications; writer->WriteSection("notifications"); - 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); + 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) @@ -576,20 +576,20 @@ namespace OpenRCT2::Config if (reader->ReadSection("font")) { auto model = &_config.fonts; - model->FileName = reader->GetString("file_name", ""); - model->FontName = reader->GetString("font_name", ""); - 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); + model->fileName = reader->GetString("file_name", ""); + model->fontName = reader->GetString("font_name", ""); + 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); } } @@ -597,20 +597,20 @@ namespace OpenRCT2::Config { auto model = &_config.fonts; writer->WriteSection("font"); - 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); + 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) @@ -618,8 +618,8 @@ namespace OpenRCT2::Config if (reader->ReadSection("plugin")) { auto model = &_config.plugin; - model->EnableHotReloading = reader->GetBoolean("enable_hot_reloading", false); - model->AllowedHosts = reader->GetString("allowed_hosts", ""); + model->enableHotReloading = reader->GetBoolean("enable_hot_reloading", false); + model->allowedHosts = reader->GetString("allowed_hosts", ""); } } @@ -627,8 +627,8 @@ namespace OpenRCT2::Config { auto model = &_config.plugin; writer->WriteSection("plugin"); - writer->WriteBoolean("enable_hot_reloading", model->EnableHotReloading); - writer->WriteString("allowed_hosts", model->AllowedHosts); + writer->WriteBoolean("enable_hot_reloading", model->enableHotReloading); + writer->WriteString("allowed_hosts", model->allowedHosts); } bool SetDefaults() @@ -807,10 +807,9 @@ namespace OpenRCT2::Config LOG_ERROR("Please install innoextract to extract files from GOG."); return false; } - int32_t exit_status = Platform::Execute( - String::stdFormat( - "%s '%s' --exclude-temp --output-dir '%s'", path.c_str(), installerPath.c_str(), targetPath.c_str()), - &output); + const char* args[] = { path.c_str(), installerPath.c_str(), "--exclude-temp", "--silent", + "--output-dir", targetPath.c_str(), nullptr }; + int32_t exit_status = Platform::Execute(args, &output); LOG_INFO("Exit status %d", exit_status); return exit_status == 0; } @@ -852,7 +851,7 @@ namespace OpenRCT2::Config std::string path = FindRCT2Path(); if (!path.empty()) { - Get().general.RCT2Path = path; + Get().general.rct2Path = path; } else { @@ -950,7 +949,7 @@ namespace OpenRCT2::Config { if (Platform::OriginalGameDataExists(possiblePath)) { - Get().general.RCT2Path = possiblePath; + Get().general.rct2Path = possiblePath; return true; } } @@ -968,7 +967,7 @@ namespace OpenRCT2::Config std::string rct1Path = FindRCT1Path(); if (!rct1Path.empty()) { - Get().general.RCT1Path = std::move(rct1Path); + Get().general.rct2Path = std::move(rct1Path); } return true; diff --git a/src/openrct2/config/Config.h b/src/openrct2/config/Config.h index 2711c27c51..29cb6727e8 100644 --- a/src/openrct2/config/Config.h +++ b/src/openrct2/config/Config.h @@ -24,212 +24,212 @@ namespace OpenRCT2::Config struct General { // Paths - u8string RCT1Path; - u8string RCT2Path; + u8string rct1Path; + u8string rct2Path; // Display - int32_t DefaultDisplay; - int32_t WindowWidth; - int32_t WindowHeight; - int32_t FullscreenMode; - int32_t FullscreenWidth; - int32_t FullscreenHeight; - float WindowScale; - bool InferDisplayDPI; - ::DrawingEngine DrawingEngine; - bool UncapFPS; - bool UseVSync; - bool ShowFPS; - std::atomic_uint8_t MultiThreading; - bool MinimizeFullscreenFocusLoss; - bool DisableScreensaver; + int32_t defaultDisplay; + int32_t windowWidth; + int32_t windowHeight; + int32_t fullscreenMode; + int32_t fullscreenWidth; + int32_t fullscreenHeight; + float windowScale; + bool inferDisplayDPI; + ::DrawingEngine drawingEngine; + bool uncapFPS; + bool useVSync; + bool showFPS; + std::atomic_uint8_t multiThreading; + bool minimizeFullscreenFocusLoss; + bool disableScreensaver; // Map rendering - 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 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 InvisibleRides; - bool InvisibleVehicles; - bool InvisibleTrees; - bool InvisibleScenery; - bool InvisiblePaths; - bool InvisibleSupports; + bool invisibleRides; + bool invisibleVehicles; + bool invisibleTrees; + bool invisibleScenery; + bool invisiblePaths; + bool invisibleSupports; // Localisation - int32_t Language; - OpenRCT2::MeasurementFormat MeasurementFormat; - TemperatureUnit TemperatureFormat; - bool ShowHeightAsUnits; - int32_t DateFormat; - CurrencyType CurrencyFormat; - int32_t CustomCurrencyRate; - CurrencyAffix CustomCurrencyAffix; - u8string CustomCurrencySymbol; + int32_t language; + OpenRCT2::MeasurementFormat measurementFormat; + TemperatureUnit temperatureFormat; + bool showHeightAsUnits; + int32_t dateFormat; + CurrencyType currencyFormat; + int32_t customCurrencyRate; + CurrencyAffix customCurrencyAffix; + u8string customCurrencySymbol; // Controls - bool EdgeScrolling; - int32_t EdgeScrollingSpeed; - bool TrapCursor; - bool InvertViewportDrag; - bool ZoomToCursor; + bool edgeScrolling; + int32_t edgeScrollingSpeed; + bool trapCursor; + bool invertViewportDrag; + bool zoomToCursor; // Gamepad int32_t gamepadDeadzone; float gamepadSensitivity; // Miscellaneous - 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; - bool ScenarioUnlockingEnabled; - bool ScenarioHideMegaPark; - bool ShowRealNamesOfGuests; - bool ShowRealNamesOfStaff; - bool AllowEarlyCompletion; - u8string AssetPackOrder; - u8string EnabledAssetPacks; + 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; + bool scenarioUnlockingEnabled; + bool scenarioHideMegaPark; + bool showRealNamesOfGuests; + bool showRealNamesOfStaff; + bool allowEarlyCompletion; + u8string assetPackOrder; + u8string enabledAssetPacks; // Loading and saving - bool ConfirmationPrompt; - FileBrowserSort LoadSaveSort; - u8string LastSaveGameDirectory; - u8string LastSaveLandscapeDirectory; - u8string LastSaveScenarioDirectory; - u8string LastSaveTrackDirectory; - u8string LastRunVersion; - bool UseNativeBrowseDialog; - int64_t LastVersionCheckTime; - int16_t FileBrowserWidth; - int16_t FileBrowserHeight; - bool FileBrowserShowSizeColumn; - bool FileBrowserShowDateColumn; - ParkPreviewPref FileBrowserPreviewType; + bool confirmationPrompt; + FileBrowserSort loadSaveSort; + u8string lastSaveGameDirectory; + u8string lastSaveLandscapeDirectory; + u8string lastSaveScenarioDirectory; + u8string lastSaveTrackDirectory; + u8string lastRunVersion; + bool useNativeBrowseDialog; + int64_t lastVersionCheckTime; + int16_t fileBrowserWidth; + int16_t fileBrowserHeight; + bool fileBrowserShowSizeColumn; + bool fileBrowserShowDateColumn; + ParkPreviewPref fileBrowserPreviewType; }; struct Interface { - bool ToolbarButtonsCentred; - bool ToolbarShowFinances; - bool ToolbarShowResearch; - bool ToolbarShowCheats; - bool ToolbarShowNews; - bool ToolbarShowMute; - bool ToolbarShowChat; - bool ToolbarShowZoom; - bool ToolbarShowRotateAnticlockwise; - bool ConsoleSmallFont; - bool RandomTitleSequence; - u8string CurrentThemePreset; - u8string CurrentTitleSequencePreset; - int32_t ObjectSelectionFilterFlags; + bool toolbarButtonsCentred; + bool toolbarShowFinances; + bool toolbarShowResearch; + bool toolbarShowCheats; + bool toolbarShowNews; + bool toolbarShowMute; + bool toolbarShowChat; + bool toolbarShowZoom; + bool toolbarShowRotateAnticlockwise; + bool consoleSmallFont; + bool randomTitleSequence; + u8string currentThemePreset; + u8string currentTitleSequencePreset; + int32_t objectSelectionFilterFlags; int32_t scenarioSelectLastTab; bool scenarioPreviewScreenshots; - bool ListRideVehiclesSeparately; - bool WindowButtonsOnTheLeft; - bool EnlargedUi; - bool TouchEnhancements; + bool listRideVehiclesSeparately; + bool windowButtonsOnTheLeft; + bool enlargedUi; + bool touchEnhancements; }; struct Sound { - u8string Device; - bool MasterSoundEnabled; - uint8_t MasterVolume; - TitleMusicKind TitleMusic; - bool SoundEnabled; - uint8_t SoundVolume; - bool RideMusicEnabled; - uint8_t AudioFocus; - bool audio_focus; + u8string device; + bool masterSoundEnabled; + uint8_t masterVolume; + TitleMusicKind titleMusic; + bool soundEnabled; + uint8_t soundVolume; + bool rideMusicEnabled; + uint8_t rideMusicVolume; + bool audioFocus; }; struct Network { - u8string PlayerName; - int32_t DefaultPort; - u8string ListenAddress; - u8string DefaultPassword; - bool StayConnected; - bool Advertise; - u8string AdvertiseAddress; - int32_t Maxplayers; - u8string ServerName; - u8string ServerDescription; - u8string ServerGreeting; - u8string MasterServerUrl; - u8string ProviderName; - u8string ProviderEmail; - u8string ProviderWebsite; - bool KnownKeysOnly; - bool LogChat; - bool LogServerActions; - bool PauseServerIfNoClients; - bool DesyncDebugging; + u8string playerName; + int32_t defaultPort; + u8string listenAddress; + u8string defaultPassword; + bool stayConnected; + bool advertise; + u8string advertiseAddress; + int32_t maxplayers; + u8string serverName; + u8string serverDescription; + u8string serverGreeting; + u8string masterServerUrl; + u8string providerName; + u8string providerEmail; + u8string providerWebsite; + bool knownKeysOnly; + bool logChat; + bool logServerActions; + bool pauseServerIfNoClients; + bool desyncDebugging; }; struct Notification { - 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; + 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 Font { - u8string FileName; - u8string 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; + u8string fileName; + u8string 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 Plugin { - bool EnableHotReloading; - u8string AllowedHosts; + bool enableHotReloading; + u8string allowedHosts; }; struct Config diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index 1cebdbab01..01e9af91c6 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -17,6 +17,7 @@ #include "../ride/RideColour.h" #include "../ride/TrackDesign.h" #include "../world/Banner.h" +#include "../world/Footpath.h" #include "../world/Location.hpp" #include "../world/tile_element/TileElement.h" #include "DataSerialiserTag.h" @@ -422,10 +423,10 @@ struct DataSerializerTraitsT { static void encode(OpenRCT2::IStream* stream, const MapRange& v) { - stream->WriteValue(ByteSwapBE(v.GetLeft())); - stream->WriteValue(ByteSwapBE(v.GetTop())); - stream->WriteValue(ByteSwapBE(v.GetRight())); - stream->WriteValue(ByteSwapBE(v.GetBottom())); + stream->WriteValue(ByteSwapBE(v.GetX1())); + stream->WriteValue(ByteSwapBE(v.GetY1())); + stream->WriteValue(ByteSwapBE(v.GetX2())); + stream->WriteValue(ByteSwapBE(v.GetY2())); } static void decode(OpenRCT2::IStream* stream, MapRange& v) { @@ -439,8 +440,7 @@ struct DataSerializerTraitsT { char coords[128] = {}; snprintf( - coords, sizeof(coords), "MapRange(l = %d, t = %d, r = %d, b = %d)", v.GetLeft(), v.GetTop(), v.GetRight(), - v.GetBottom()); + coords, sizeof(coords), "MapRange(x1 = %d, y1 = %d, x2 = %d, y2 = %d)", v.GetX1(), v.GetY1(), v.GetX2(), v.GetY2()); stream->Write(coords, strlen(coords)); } @@ -990,3 +990,28 @@ struct DataSerializerTraitsT stream->Write(msg, strlen(msg)); } }; + +template<> +struct DataSerializerTraitsT +{ + static void encode(OpenRCT2::IStream* stream, const FootpathSlope& slope) + { + uint8_t combined = (EnumValue(slope.type) << 2) | (slope.direction % kNumOrthogonalDirections); + stream->WriteValue(combined); + } + + static void decode(OpenRCT2::IStream* stream, FootpathSlope& slope) + { + auto combined = stream->ReadValue(); + auto type = static_cast(combined >> 2); + Direction direction = combined & 0b00000011; + slope = FootpathSlope{ type, direction }; + } + + static void log(OpenRCT2::IStream* stream, const FootpathSlope& slope) + { + char msg[128] = {}; + snprintf(msg, sizeof(msg), "FootpathSlope(type = %d, direction = %d)", EnumValue(slope.type), slope.direction); + stream->Write(msg, strlen(msg)); + } +}; diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index 8baafc555b..5bd630f0fb 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -606,14 +606,14 @@ bool GfxLoadCsg() { LOG_VERBOSE("GfxLoadCsg()"); - if (Config::Get().general.RCT1Path.empty()) + if (Config::Get().general.rct1Path.empty()) { LOG_VERBOSE(" unable to load CSG, RCT1 path not set"); return false; } - auto pathHeaderPath = FindCsg1idatAtLocation(Config::Get().general.RCT1Path); - auto pathDataPath = FindCsg1datAtLocation(Config::Get().general.RCT1Path); + auto pathHeaderPath = FindCsg1idatAtLocation(Config::Get().general.rct1Path); + auto pathDataPath = FindCsg1datAtLocation(Config::Get().general.rct1Path); try { auto fileHeader = FileStream(pathHeaderPath, FileMode::open); diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index f876b99b12..4961dcf6a4 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -39,7 +39,7 @@ int32_t GfxGetStringWidthNewLined(std::string_view text, FontStyle fontStyle) FmtString fmt(text); for (const auto& token : fmt) { - if (token.kind == FormatToken::Newline || token.kind == FormatToken::NewlineSmall) + if (token.kind == FormatToken::newline || token.kind == FormatToken::newlineSmall) { auto width = GfxGetStringWidth(buffer, fontStyle); if (!maxWidth.has_value() || maxWidth.value() > width) @@ -221,7 +221,7 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 } } } - else if (token.kind == FormatToken::Newline) + else if (token.kind == FormatToken::newline) { buffer.push_back('\0'); @@ -360,7 +360,7 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle) { switch (token.kind) { - case FormatToken::Newline: + case FormatToken::newline: if (fontStyle == FontStyle::Small || fontStyle == FontStyle::Medium) { height += 10; @@ -374,7 +374,7 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle) } height += 18; break; - case FormatToken::NewlineSmall: + case FormatToken::newlineSmall: if (fontStyle == FontStyle::Small || fontStyle == FontStyle::Medium) { height += 5; @@ -388,13 +388,13 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle) } height += 9; break; - case FormatToken::FontTiny: + case FormatToken::fontTiny: fontStyle = FontStyle::Tiny; break; - case FormatToken::FontMedium: + case FormatToken::fontMedium: fontStyle = FontStyle::Medium; break; - case FormatToken::FontSmall: + case FormatToken::fontSmall: fontStyle = FontStyle::Small; break; default: @@ -533,7 +533,7 @@ static void TTFDrawStringRawTTF(RenderTarget& rt, std::string_view text, TextDra { int32_t drawX = info->x + fontDesc->offset_x; int32_t drawY = info->y + fontDesc->offset_y; - uint8_t hintThresh = Config::Get().fonts.EnableHinting ? fontDesc->hinting_threshold : 0; + uint8_t hintThresh = Config::Get().fonts.enableHinting ? fontDesc->hinting_threshold : 0; OpenRCT2::Drawing::IDrawingContext* dc = drawingEngine->GetDrawingContext(); dc->DrawTTFBitmap(rt, info, surface, drawX, drawY, hintThresh); } @@ -546,51 +546,51 @@ static void TTFProcessFormatCode(RenderTarget& rt, const FmtString::Token& token { switch (token.kind) { - case FormatToken::Move: + case FormatToken::move: info->x = info->startX + token.parameter; break; - case FormatToken::Newline: + case FormatToken::newline: info->x = info->startX; info->y += FontGetLineHeight(info->FontStyle); break; - case FormatToken::NewlineSmall: + case FormatToken::newlineSmall: info->x = info->startX; info->y += FontGetLineHeightSmall(info->FontStyle); break; - case FormatToken::FontTiny: + case FormatToken::fontTiny: info->FontStyle = FontStyle::Tiny; break; - case FormatToken::FontSmall: + case FormatToken::fontSmall: info->FontStyle = FontStyle::Small; break; - case FormatToken::FontMedium: + case FormatToken::fontMedium: info->FontStyle = FontStyle::Medium; break; - case FormatToken::OutlineEnable: + case FormatToken::outlineEnable: info->flags |= TEXT_DRAW_FLAG_OUTLINE; break; - case FormatToken::OutlineDisable: + case FormatToken::outlineDisable: info->flags &= ~TEXT_DRAW_FLAG_OUTLINE; break; - case FormatToken::ColourWindow1: + case FormatToken::colourWindow1: { uint16_t flags = info->flags; ColourCharacterWindow(gCurrentWindowColours[0], &flags, info->palette); break; } - case FormatToken::ColourWindow2: + case FormatToken::colourWindow2: { uint16_t flags = info->flags; ColourCharacterWindow(gCurrentWindowColours[1], &flags, info->palette); break; } - case FormatToken::ColourWindow3: + case FormatToken::colourWindow3: { uint16_t flags = info->flags; ColourCharacterWindow(gCurrentWindowColours[2], &flags, info->palette); break; } - case FormatToken::InlineSprite: + case FormatToken::inlineSprite: { auto imageId = ImageId(token.parameter); auto g1 = GfxGetG1Element(imageId); diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 13aa27a688..7e74dd397b 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -25,6 +25,7 @@ #include "../world/Climate.h" #include "../world/Location.hpp" #include "LightFX.h" +#include "Rectangle.h" #include #include @@ -682,7 +683,7 @@ void MaskFn( void GfxFilterPixel(RenderTarget& rt, const ScreenCoordsXY& coords, FilterPaletteID palette) { - GfxFilterRect(rt, { coords, coords }, palette); + Rectangle::filter(rt, { coords, coords }, palette); } /** @@ -703,9 +704,11 @@ void GfxTransposePalette(int32_t pal, uint8_t product) for (; width > 0; width--) { auto& dest_pointer = gGamePalette[x]; - dest_pointer.Blue = (source_pointer[0] * product) >> 8; - dest_pointer.Green = (source_pointer[1] * product) >> 8; - dest_pointer.Red = (source_pointer[2] * product) >> 8; + // Make sure the image never gets darker than the void colour (not-quite-block), to the background colour jumping + // between void and 100% black. + dest_pointer.Blue = std::max(35, ((source_pointer[0] * product) >> 8)); + dest_pointer.Green = std::max(35, ((source_pointer[1] * product) >> 8)); + dest_pointer.Red = std::max(23, ((source_pointer[2] * product) >> 8)); source_pointer += 3; x++; @@ -1011,7 +1014,7 @@ void UpdatePaletteEffects() // Animate the water/lava/chain movement palette uint32_t shade = 0; - if (Config::Get().general.RenderWeatherGloom) + if (Config::Get().general.renderWeatherGloom) { auto paletteId = ClimateGetWeatherGloomPaletteId(getGameState().weatherCurrent); if (paletteId != FilterPaletteID::paletteNull) @@ -1113,9 +1116,9 @@ void RefreshVideo() void ToggleWindowedMode() { - int32_t rt = Config::Get().general.FullscreenMode == 0 ? 2 : 0; + int32_t rt = Config::Get().general.fullscreenMode == 0 ? 2 : 0; ContextSetFullscreenMode(rt); - Config::Get().general.FullscreenMode = rt; + Config::Get().general.fullscreenMode = rt; Config::Save(); } diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index a39575f7b2..54f5a96810 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -183,20 +183,6 @@ constexpr DrawBlendOp kBlendSrc = 1 << 1; */ constexpr DrawBlendOp kBlendDst = 2 << 2; -enum -{ - INSET_RECT_FLAG_FILL_GREY = (1 << 2), // 0x04 - INSET_RECT_FLAG_BORDER_NONE = (1 << 3), // 0x08 - INSET_RECT_FLAG_FILL_NONE = (1 << 4), // 0x10 - INSET_RECT_FLAG_BORDER_INSET = (1 << 5), // 0x20 - INSET_RECT_FLAG_FILL_DONT_LIGHTEN = (1 << 6), // 0x40 - INSET_RECT_FLAG_FILL_MID_LIGHT = (1 << 7), // 0x80 - - INSET_RECT_F_30 = (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE), - INSET_RECT_F_60 = (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_DONT_LIGHTEN), - INSET_RECT_F_E0 = (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_DONT_LIGHTEN | INSET_RECT_FLAG_FILL_MID_LIGHT), -}; - enum class FilterPaletteID : int32_t { paletteNull = 0, @@ -527,11 +513,6 @@ void GfxDrawLineSoftware(RenderTarget& rt, const ScreenLine& line, int32_t colou void GfxDrawDashedLine( RenderTarget& rt, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color); -// rect -void GfxFillRect(RenderTarget& rt, const ScreenRect& rect, int32_t colour); -void GfxFillRectInset(RenderTarget& rt, const ScreenRect& rect, ColourWithFlags colour, uint8_t flags); -void GfxFilterRect(RenderTarget& rt, const ScreenRect& rect, FilterPaletteID palette); - // sprite bool GfxLoadG1(const OpenRCT2::IPlatformEnvironment& env); void GfxLoadG2FontsAndTracks(); diff --git a/src/openrct2/drawing/DrawingLock.hpp b/src/openrct2/drawing/DrawingLock.hpp index 00fa292cf9..dfee740028 100644 --- a/src/openrct2/drawing/DrawingLock.hpp +++ b/src/openrct2/drawing/DrawingLock.hpp @@ -22,7 +22,7 @@ class DrawingUniqueLock public: DrawingUniqueLock(T& mutex) : _mutex(mutex) - , _enabled(Config::Get().general.MultiThreading) + , _enabled(Config::Get().general.multiThreading) { if (_enabled) _mutex.lock(); @@ -43,7 +43,7 @@ class DrawingSharedLock public: DrawingSharedLock(T& mutex) : _mutex(mutex) - , _enabled(Config::Get().general.MultiThreading) + , _enabled(Config::Get().general.multiThreading) { if (_enabled) _mutex.lock_shared(); diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 0c26ae1421..2325588820 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -142,12 +142,12 @@ namespace OpenRCT2::Drawing::LightFx bool IsAvailable() { - return _lightfxAvailable && Config::Get().general.EnableLightFx; + return _lightfxAvailable && Config::Get().general.enableLightFx; } bool ForVehiclesIsAvailable() { - return IsAvailable() && Config::Get().general.EnableLightFxForVehicles; + return IsAvailable() && Config::Get().general.enableLightFxForVehicles; } void Init() diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index 6f22e3300e..c66ff5f78e 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -164,26 +164,6 @@ void GfxClear(RenderTarget& rt, uint8_t paletteIndex) } } -void GfxFillRect(RenderTarget& rt, const ScreenRect& rect, int32_t colour) -{ - auto drawingEngine = rt.DrawingEngine; - if (drawingEngine != nullptr) - { - IDrawingContext* dc = drawingEngine->GetDrawingContext(); - dc->FillRect(rt, colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); - } -} - -void GfxFilterRect(RenderTarget& rt, const ScreenRect& rect, FilterPaletteID palette) -{ - auto drawingEngine = rt.DrawingEngine; - if (drawingEngine != nullptr) - { - IDrawingContext* dc = drawingEngine->GetDrawingContext(); - dc->FilterRect(rt, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); - } -} - void GfxDrawLine(RenderTarget& rt, const ScreenLine& line, int32_t colour) { auto drawingEngine = rt.DrawingEngine; diff --git a/src/openrct2/drawing/Rect.cpp b/src/openrct2/drawing/Rect.cpp deleted file mode 100644 index bea8a9e9cf..0000000000 --- a/src/openrct2/drawing/Rect.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014-2025 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 "../interface/Colour.h" -#include "../world/Location.hpp" -#include "Drawing.h" - -/** - * Draw a rectangle, with optional border or fill - * - * rct2: 0x006E6F81 - * dpi (edi) - * left (ax) - * top (cx) - * right (bx) - * bottom (dx) - * colour (ebp) - * flags (si) - */ -void GfxFillRectInset(RenderTarget& rt, const ScreenRect& rect, ColourWithFlags colour, uint8_t flags) -{ - const auto leftTop = ScreenCoordsXY{ rect.GetLeft(), rect.GetTop() }; - const auto leftBottom = ScreenCoordsXY{ rect.GetLeft(), rect.GetBottom() }; - const auto rightTop = ScreenCoordsXY{ rect.GetRight(), rect.GetTop() }; - const auto rightBottom = ScreenCoordsXY{ rect.GetRight(), rect.GetBottom() }; - if (colour.hasFlag(ColourFlag::translucent)) - { - auto palette = kTranslucentWindowPalettes[colour.colour]; - - if (flags & INSET_RECT_FLAG_BORDER_NONE) - { - GfxFilterRect(rt, rect, palette.base); - } - else if (flags & INSET_RECT_FLAG_BORDER_INSET) - { - // Draw outline of box - GfxFilterRect(rt, { leftTop, leftBottom }, palette.highlight); - GfxFilterRect(rt, { leftTop, rightTop }, palette.highlight); - GfxFilterRect(rt, { rightTop, rightBottom }, palette.shadow); - GfxFilterRect(rt, { leftBottom, rightBottom }, palette.shadow); - - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) - { - GfxFilterRect(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, palette.base); - } - } - else - { - // Draw outline of box - GfxFilterRect(rt, { leftTop, leftBottom }, palette.shadow); - GfxFilterRect(rt, { leftTop, rightTop }, palette.shadow); - GfxFilterRect(rt, { rightTop, rightBottom }, palette.highlight); - GfxFilterRect(rt, { leftBottom, rightBottom }, palette.highlight); - - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) - { - GfxFilterRect(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, { rightBottom - ScreenCoordsXY{ 1, 1 } } }, palette.base); - } - } - } - else - { - uint8_t shadow, fill, hilight; - if (flags & INSET_RECT_FLAG_FILL_MID_LIGHT) - { - shadow = ColourMapA[colour.colour].dark; - fill = ColourMapA[colour.colour].mid_light; - hilight = ColourMapA[colour.colour].lighter; - } - else - { - shadow = ColourMapA[colour.colour].mid_dark; - fill = ColourMapA[colour.colour].light; - hilight = ColourMapA[colour.colour].lighter; - } - - if (flags & INSET_RECT_FLAG_BORDER_NONE) - { - GfxFillRect(rt, rect, fill); - } - else if (flags & INSET_RECT_FLAG_BORDER_INSET) - { - // Draw outline of box - GfxFillRect(rt, { leftTop, leftBottom }, shadow); - GfxFillRect(rt, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop }, shadow); - GfxFillRect(rt, { rightTop + ScreenCoordsXY{ 0, 1 }, rightBottom - ScreenCoordsXY{ 0, 1 } }, hilight); - GfxFillRect(rt, { leftBottom + ScreenCoordsXY{ 1, 0 }, rightBottom }, hilight); - - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) - { - if (!(flags & INSET_RECT_FLAG_FILL_DONT_LIGHTEN)) - { - if (flags & INSET_RECT_FLAG_FILL_GREY) - { - fill = ColourMapA[COLOUR_BLACK].light; - } - else - { - fill = ColourMapA[colour.colour].lighter; - } - } - GfxFillRect(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill); - } - } - else - { - // Draw outline of box - GfxFillRect(rt, { leftTop, leftBottom - ScreenCoordsXY{ 0, 1 } }, hilight); - GfxFillRect(rt, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop - ScreenCoordsXY{ 1, 0 } }, hilight); - GfxFillRect(rt, { rightTop, rightBottom - ScreenCoordsXY{ 0, 1 } }, shadow); - GfxFillRect(rt, { leftBottom, rightBottom }, shadow); - - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) - { - if (flags & INSET_RECT_FLAG_FILL_GREY) - { - fill = ColourMapA[COLOUR_BLACK].light; - } - GfxFillRect(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill); - } - } - } -} diff --git a/src/openrct2/drawing/Rectangle.cpp b/src/openrct2/drawing/Rectangle.cpp new file mode 100644 index 0000000000..db5992c93e --- /dev/null +++ b/src/openrct2/drawing/Rectangle.cpp @@ -0,0 +1,155 @@ +/***************************************************************************** + * Copyright (c) 2014-2025 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 "Rectangle.h" + +#include "../interface/Colour.h" +#include "../world/Location.hpp" +#include "Drawing.h" +#include "IDrawingContext.h" +#include "IDrawingEngine.h" + +using OpenRCT2::Drawing::IDrawingContext; + +namespace OpenRCT2::Drawing::Rectangle +{ + void fill(RenderTarget& rt, const ScreenRect& rect, int32_t colour) + { + auto drawingEngine = rt.DrawingEngine; + if (drawingEngine != nullptr) + { + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->FillRect(rt, colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); + } + } + + /** + * Draw a rectangle, with optional border or fill + * + * rct2: 0x006E6F81 + * dpi (edi) + * left (ax) + * top (cx) + * right (bx) + * bottom (dx) + * colour (ebp) + * flags (si) + */ + void fillInset( + RenderTarget& rt, const ScreenRect& rect, ColourWithFlags colour, BorderStyle borderStyle, FillBrightness brightness, + FillMode fillMode) + { + const auto leftTop = ScreenCoordsXY{ rect.GetLeft(), rect.GetTop() }; + const auto leftBottom = ScreenCoordsXY{ rect.GetLeft(), rect.GetBottom() }; + const auto rightTop = ScreenCoordsXY{ rect.GetRight(), rect.GetTop() }; + const auto rightBottom = ScreenCoordsXY{ rect.GetRight(), rect.GetBottom() }; + if (colour.hasFlag(ColourFlag::translucent)) + { + auto palette = kTranslucentWindowPalettes[colour.colour]; + + switch (borderStyle) + { + case BorderStyle::none: + Rectangle::filter(rt, rect, palette.base); + break; + + case BorderStyle::inset: + // Draw outline of box + Rectangle::filter(rt, { leftTop, leftBottom }, palette.highlight); + Rectangle::filter(rt, { leftTop, rightTop }, palette.highlight); + Rectangle::filter(rt, { rightTop, rightBottom }, palette.shadow); + Rectangle::filter(rt, { leftBottom, rightBottom }, palette.shadow); + + if (fillMode != FillMode::none) + { + Rectangle::filter( + rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, palette.base); + } + break; + + case BorderStyle::outset: + // Draw outline of box + Rectangle::filter(rt, { leftTop, leftBottom }, palette.shadow); + Rectangle::filter(rt, { leftTop, rightTop }, palette.shadow); + Rectangle::filter(rt, { rightTop, rightBottom }, palette.highlight); + Rectangle::filter(rt, { leftBottom, rightBottom }, palette.highlight); + + if (fillMode != FillMode::none) + { + Rectangle::filter( + rt, { leftTop + ScreenCoordsXY{ 1, 1 }, { rightBottom - ScreenCoordsXY{ 1, 1 } } }, palette.base); + } + break; + } + } + else + { + uint8_t shadow, fill, hilight; + if (brightness == FillBrightness::dark) + { + shadow = ColourMapA[colour.colour].dark; + fill = ColourMapA[colour.colour].mid_light; + hilight = ColourMapA[colour.colour].lighter; + } + else + { + shadow = ColourMapA[colour.colour].mid_dark; + fill = ColourMapA[colour.colour].light; + hilight = ColourMapA[colour.colour].lighter; + } + + switch (borderStyle) + { + case BorderStyle::none: + Rectangle::fill(rt, rect, fill); + break; + + case BorderStyle::inset: + // Draw outline of box + Rectangle::fill(rt, { leftTop, leftBottom }, shadow); + Rectangle::fill(rt, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop }, shadow); + Rectangle::fill(rt, { rightTop + ScreenCoordsXY{ 0, 1 }, rightBottom - ScreenCoordsXY{ 0, 1 } }, hilight); + Rectangle::fill(rt, { leftBottom + ScreenCoordsXY{ 1, 0 }, rightBottom }, hilight); + + if (fillMode != FillMode::none) + { + if (fillMode != FillMode::dontLightenWhenInset) + { + fill = ColourMapA[colour.colour].lighter; + } + Rectangle::fill(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill); + } + break; + + case BorderStyle::outset: + // Draw outline of box + Rectangle::fill(rt, { leftTop, leftBottom - ScreenCoordsXY{ 0, 1 } }, hilight); + Rectangle::fill(rt, { leftTop + ScreenCoordsXY{ 1, 0 }, rightTop - ScreenCoordsXY{ 1, 0 } }, hilight); + Rectangle::fill(rt, { rightTop, rightBottom - ScreenCoordsXY{ 0, 1 } }, shadow); + Rectangle::fill(rt, { leftBottom, rightBottom }, shadow); + + if (fillMode != FillMode::none) + { + Rectangle::fill(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill); + } + break; + } + } + } + + void filter(RenderTarget& rt, const ScreenRect& rect, FilterPaletteID palette) + { + auto drawingEngine = rt.DrawingEngine; + if (drawingEngine != nullptr) + { + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->FilterRect(rt, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); + } + } +} // namespace OpenRCT2::Drawing::Rectangle diff --git a/src/openrct2/drawing/Rectangle.h b/src/openrct2/drawing/Rectangle.h new file mode 100644 index 0000000000..f33629a41e --- /dev/null +++ b/src/openrct2/drawing/Rectangle.h @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2014-2025 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 + +struct ColourWithFlags; +enum class FilterPaletteID : int32_t; +struct RenderTarget; +struct ScreenRect; + +namespace OpenRCT2::Drawing::Rectangle +{ + enum class BorderStyle : uint8_t + { + outset, + inset, + none, + }; + enum class FillBrightness : uint8_t + { + light, + dark, + }; + enum class FillMode : uint8_t + { + standard, + none, + dontLightenWhenInset, + }; + + void fill(RenderTarget& rt, const ScreenRect& rect, int32_t colour); + void fillInset( + RenderTarget& rt, const ScreenRect& rect, ColourWithFlags colour, BorderStyle borderStyle = BorderStyle::outset, + FillBrightness brightness = FillBrightness::light, FillMode fillMode = FillMode::standard); + void filter(RenderTarget& rt, const ScreenRect& rect, FilterPaletteID palette); +} // namespace OpenRCT2::Drawing::Rectangle diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 81bd802ee5..3b571802ba 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -143,7 +143,7 @@ static int32_t ScrollingTextGetMatchingOrOldest( static void ScrollingTextFormat(utf8* dst, size_t size, DrawScrollText* scrollText) { - if (Config::Get().general.UpperCaseBanners) + if (Config::Get().general.upperCaseBanners) { FormatStringToUpper(dst, size, scrollText->string_id, scrollText->string_args); } @@ -1585,7 +1585,7 @@ static void ScrollingTextSetBitmapForTTF( int32_t min_vpos = -fontDesc->offset_y; int32_t max_vpos = std::min(surface->h - 2, min_vpos + 7); - bool use_hinting = Config::Get().fonts.EnableHinting && fontDesc->hinting_threshold > 0; + bool use_hinting = Config::Get().fonts.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 cef6458ace..358bd95f41 100644 --- a/src/openrct2/drawing/TTF.cpp +++ b/src/openrct2/drawing/TTF.cpp @@ -82,7 +82,7 @@ static void TTFToggleHinting(bool) for (int32_t i = 0; i < FontStyleCount; i++) { TTFFontDescriptor* fontDesc = &(gCurrentTTFFontSet->size[i]); - bool use_hinting = Config::Get().fonts.EnableHinting && fontDesc->hinting_threshold; + bool use_hinting = Config::Get().fonts.enableHinting && fontDesc->hinting_threshold; TTF_SetFontHinting(fontDesc->font, use_hinting ? 1 : 0); } diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index d8ba21ac52..03e3c04b10 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -10,11 +10,13 @@ #include "Text.h" #include "../core/UTF8.h" +#include "../drawing/Rectangle.h" #include "../localisation/Formatter.h" #include "../localisation/Formatting.h" #include "Drawing.h" using namespace OpenRCT2; +using namespace OpenRCT2::Drawing; class StaticLayout { @@ -98,12 +100,12 @@ void DrawText(RenderTarget& rt, const ScreenCoordsXY& coords, const TextPaint& p if (paint.UnderlineText == TextUnderline::On) { - GfxFillRect( + Rectangle::fill( rt, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } }, gTextPalette[1]); if (gTextPalette[2] != 0) { - GfxFillRect( + Rectangle::fill( rt, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } }, gTextPalette[2]); } diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index 7612b75373..b69cc47025 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -53,7 +53,7 @@ const DrawWeatherFunc DrawSnowFunctions[] = { */ void DrawWeather(RenderTarget& rt, IWeatherDrawer* weatherDrawer) { - if (!Config::Get().general.RenderWeatherEffects) + if (!Config::Get().general.renderWeatherEffects) return; uint32_t viewFlags = 0; diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 021118354d..fc8731e7bb 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -123,7 +123,7 @@ X8DrawingEngine::X8DrawingEngine([[maybe_unused]] Ui::IUiContext& uiContext) _drawingContext = new X8DrawingContext(this); _mainRT.DrawingEngine = this; LightFx::SetAvailable(true); - _lastLightFXenabled = Config::Get().general.EnableLightFx; + _lastLightFXenabled = Config::Get().general.enableLightFx; } X8DrawingEngine::~X8DrawingEngine() @@ -165,11 +165,11 @@ void X8DrawingEngine::BeginDraw() if (!IntroIsPlaying()) { // HACK we need to re-configure the bits if light fx has been enabled / disabled - if (_lastLightFXenabled != Config::Get().general.EnableLightFx) + if (_lastLightFXenabled != Config::Get().general.enableLightFx) { Resize(_width, _height); GfxInvalidateScreen(); - _lastLightFXenabled = Config::Get().general.EnableLightFx; + _lastLightFXenabled = Config::Get().general.enableLightFx; } _weatherDrawer.Restore(_mainRT); } diff --git a/src/openrct2/entity/Balloon.cpp b/src/openrct2/entity/Balloon.cpp index c01b78e503..cd6de6e31b 100644 --- a/src/openrct2/entity/Balloon.cpp +++ b/src/openrct2/entity/Balloon.cpp @@ -16,6 +16,7 @@ #include "../network/Network.h" #include "../paint/Paint.h" #include "../profiling/Profiling.h" +#include "../ride/RideData.h" #include "../scenario/Scenario.h" #include "../world/Map.h" #include "../world/tile_element/TrackElement.h" @@ -26,7 +27,7 @@ using namespace OpenRCT2; template<> bool EntityBase::Is() const { - return Type == EntityType::Balloon; + return Type == EntityType::balloon; } void Balloon::Update() @@ -157,13 +158,13 @@ bool Balloon::Collides() const if (tileElement->GetType() == TileElementType::Track) { const TrackElement* trackElement = tileElement->AsTrack(); - if (trackElement->GetRideType() == RIDE_TYPE_DODGEMS) + const auto* ride = GetRide(trackElement->GetRideIndex()); + if (ride != nullptr && ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasRoofOverWholeRide)) { check_ceiling = true; } else { - auto* ride = GetRide(trackElement->GetRideIndex()); check_ceiling = (ride != nullptr) ? RideHasStationShelter(*ride) : false; } } diff --git a/src/openrct2/entity/Balloon.h b/src/openrct2/entity/Balloon.h index dd349c3792..de805d1733 100644 --- a/src/openrct2/entity/Balloon.h +++ b/src/openrct2/entity/Balloon.h @@ -17,7 +17,7 @@ struct PaintSession; struct Balloon : EntityBase { - static constexpr auto cEntityType = EntityType::Balloon; + static constexpr auto cEntityType = EntityType::balloon; uint16_t frame; uint16_t popped; uint8_t time_to_move; diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index a1549af5fa..3f94824339 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -76,7 +76,7 @@ static constexpr const uint8_t* kDuckAnimations[] = { template<> bool EntityBase::Is() const { - return Type == EntityType::Duck; + return Type == EntityType::duck; } bool Duck::IsFlying() diff --git a/src/openrct2/entity/Duck.h b/src/openrct2/entity/Duck.h index 580f8cd876..a29c64e7be 100644 --- a/src/openrct2/entity/Duck.h +++ b/src/openrct2/entity/Duck.h @@ -17,7 +17,7 @@ struct PaintSession; struct Duck : EntityBase { - static constexpr auto cEntityType = EntityType::Duck; + static constexpr auto cEntityType = EntityType::duck; enum class DuckState : uint8_t { FlyToWater, diff --git a/src/openrct2/entity/EntityBase.cpp b/src/openrct2/entity/EntityBase.cpp index 230873f796..cf49d24a39 100644 --- a/src/openrct2/entity/EntityBase.cpp +++ b/src/openrct2/entity/EntityBase.cpp @@ -29,27 +29,27 @@ void EntityBase::Invalidate() ZoomLevel maxZoom{ 0 }; switch (Type) { - case EntityType::Vehicle: - case EntityType::Guest: - case EntityType::Staff: + case EntityType::vehicle: + case EntityType::guest: + case EntityType::staff: maxZoom = ZoomLevel{ 2 }; break; - case EntityType::CrashedVehicleParticle: - case EntityType::JumpingFountain: + case EntityType::crashedVehicleParticle: + case EntityType::jumpingFountain: maxZoom = ZoomLevel{ 0 }; break; - case EntityType::Duck: + case EntityType::duck: maxZoom = ZoomLevel{ 1 }; break; - case EntityType::SteamParticle: - case EntityType::MoneyEffect: - case EntityType::ExplosionCloud: - case EntityType::CrashSplash: - case EntityType::ExplosionFlare: - case EntityType::Balloon: + case EntityType::steamParticle: + case EntityType::moneyEffect: + case EntityType::explosionCloud: + case EntityType::crashSplash: + case EntityType::explosionFlare: + case EntityType::balloon: maxZoom = ZoomLevel{ 2 }; break; - case EntityType::Litter: + case EntityType::litter: maxZoom = ZoomLevel{ 0 }; break; default: diff --git a/src/openrct2/entity/EntityBase.h b/src/openrct2/entity/EntityBase.h index 7e38d30c87..d31c3455e7 100644 --- a/src/openrct2/entity/EntityBase.h +++ b/src/openrct2/entity/EntityBase.h @@ -5,21 +5,21 @@ enum class EntityType : uint8_t { - Vehicle, - Guest, - Staff, - Litter, - SteamParticle, - MoneyEffect, - CrashedVehicleParticle, - ExplosionCloud, - CrashSplash, - ExplosionFlare, - JumpingFountain, - Balloon, - Duck, - Count, - Null = 255 + vehicle, + guest, + staff, + litter, + steamParticle, + moneyEffect, + crashedVehicleParticle, + explosionCloud, + crashSplash, + explosionFlare, + jumpingFountain, + balloon, + duck, + count, + null = 255 }; struct EntitySpriteData diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index 46c78f03ab..d43a69b029 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -68,15 +68,15 @@ namespace OpenRCT2 { switch (type) { - case EntityType::SteamParticle: - case EntityType::MoneyEffect: - case EntityType::CrashedVehicleParticle: - case EntityType::ExplosionCloud: - case EntityType::CrashSplash: - case EntityType::ExplosionFlare: - case EntityType::JumpingFountain: - case EntityType::Balloon: - case EntityType::Duck: + case EntityType::steamParticle: + case EntityType::moneyEffect: + case EntityType::crashedVehicleParticle: + case EntityType::explosionCloud: + case EntityType::crashSplash: + case EntityType::explosionFlare: + case EntityType::jumpingFountain: + case EntityType::balloon: + case EntityType::duck: return true; default: return false; @@ -174,7 +174,7 @@ namespace OpenRCT2 { continue; } - spr->Type = EntityType::Null; + spr->Type = EntityType::null; spr->Id = EntityId::FromUnderlying(i); _entityFlashingList[i] = false; @@ -199,7 +199,7 @@ namespace OpenRCT2 for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { auto* entity = GetEntity(EntityId::FromUnderlying(i)); - if (entity != nullptr && entity->Type != EntityType::Null) + if (entity != nullptr && entity->Type != EntityType::null) { EntitySpatialInsert(*entity, { entity->x, entity->y }); } @@ -234,7 +234,7 @@ namespace OpenRCT2 *tempEntity = Entity_t(); entity.Id = entityIndex; - entity.Type = EntityType::Null; + entity.Type = EntityType::null; } void EntityRegistry::AddToEntityList(EntityBase& entity) @@ -264,9 +264,9 @@ namespace OpenRCT2 uint16_t EntityRegistry::GetMiscEntityCount() { uint16_t count = 0; - for (auto id : { EntityType::SteamParticle, EntityType::MoneyEffect, EntityType::CrashedVehicleParticle, - EntityType::ExplosionCloud, EntityType::CrashSplash, EntityType::ExplosionFlare, - EntityType::JumpingFountain, EntityType::Balloon, EntityType::Duck }) + for (auto id : { EntityType::steamParticle, EntityType::moneyEffect, EntityType::crashedVehicleParticle, + EntityType::explosionCloud, EntityType::crashSplash, EntityType::explosionFlare, + EntityType::jumpingFountain, EntityType::balloon, EntityType::duck }) { count += GetEntityListCount(id); } @@ -417,7 +417,7 @@ namespace OpenRCT2 for (auto& entityId : entityList) { auto* entity = TryGetEntity(entityId); - if (entity != nullptr && entity->Type != EntityType::Null) + if (entity != nullptr && entity->Type != EntityType::null) { UpdateEntitySpatialIndex(*entity); } diff --git a/src/openrct2/entity/EntityRegistry.h b/src/openrct2/entity/EntityRegistry.h index 136d271dd9..ae2f3a401b 100644 --- a/src/openrct2/entity/EntityRegistry.h +++ b/src/openrct2/entity/EntityRegistry.h @@ -55,7 +55,7 @@ namespace OpenRCT2 { private: Entity_t entities[kMaxEntities]{}; - std::array, EnumValue(EntityType::Count)> gEntityLists; + std::array, EnumValue(EntityType::count)> gEntityLists; std::vector _freeIdList; bool _entityFlashingList[kMaxEntities]; diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index 71337d4c7c..269082fedb 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -86,7 +86,7 @@ const FountainFlags _fountainPatternFlags[] = { template<> bool EntityBase::Is() const { - return Type == EntityType::JumpingFountain; + return Type == EntityType::jumpingFountain; } void JumpingFountain::StartAnimation(const JumpingFountainType newType, const CoordsXY& newLoc, const TileElement* tileElement) diff --git a/src/openrct2/entity/Fountain.h b/src/openrct2/entity/Fountain.h index 722f5289db..adeb42ad8b 100644 --- a/src/openrct2/entity/Fountain.h +++ b/src/openrct2/entity/Fountain.h @@ -40,7 +40,7 @@ enum class JumpingFountainType : uint8_t struct JumpingFountain : EntityBase { - static constexpr auto cEntityType = EntityType::JumpingFountain; + static constexpr auto cEntityType = EntityType::jumpingFountain; uint16_t frame; JumpingFountainType FountainType; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 15f25db082..94b56e9fdb 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -83,6 +83,8 @@ using namespace OpenRCT2; using namespace OpenRCT2::Numerics; +static const uint8_t kTicksToGoUpSpiralSlide = 30; + // Locations of the spiral slide platform that a peep walks from the entrance of the ride to the // entrance of the slide. Up to 4 waypoints for each 4 sides that an ride entrance can be located // and 4 different rotations of the ride. 4 * 4 * 4 = 64 locations. @@ -260,180 +262,180 @@ static struct PeepActionType action; PeepThoughtToActionFlag flags; } PeepThoughtToActionMap[] = { - { PeepActionType::ShakeHead, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::EmptyPockets, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Wow, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_SINGULAR }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_INDEFINITE }, - { PeepActionType::ShakeHead, PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_INDEFINITE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Wave, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Joy, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::CheckTime, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Wave, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Wave, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Disgust, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::BeingWatched, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::ShakeHead, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Joy, PEEP_THOUGHT_ACTION_NO_FLAGS }, - { PeepActionType::Walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::shakeHead, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::emptyPockets, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::wow, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_SINGULAR }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_INDEFINITE }, + { PeepActionType::shakeHead, PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_INDEFINITE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::wave, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::joy, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::checkTime, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::wave, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::wave, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::disgust, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::beingWatched, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::shakeHead, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::joy, PEEP_THOUGHT_ACTION_NO_FLAGS }, + { PeepActionType::walking, PEEP_THOUGHT_ACTION_FLAG_RIDE }, }; // These arrays contain the base minimum and maximum nausea ratings for peeps, based on their nausea tolerance level. @@ -473,7 +475,7 @@ static Ride* GuestFindBestRideToGoOn(Guest& guest); template<> bool EntityBase::Is() const { - return Type == EntityType::Guest; + return Type == EntityType::guest; } static bool IsValidLocation(const CoordsXYZ& coords) @@ -523,18 +525,18 @@ void Guest::GivePassingGuestPurpleClothes(Guest& passingPeep) void Guest::GivePassingGuestPizza(Guest& passingPeep) { - if (passingPeep.HasItem(ShopItem::Pizza)) + if (passingPeep.HasItem(ShopItem::pizza)) return; - passingPeep.GiveItem(ShopItem::Pizza); + passingPeep.GiveItem(ShopItem::pizza); int32_t peepDirection = (Orientation >> 3) ^ 2; int32_t otherPeepOppositeDirection = passingPeep.Orientation >> 3; if (peepDirection == otherPeepOppositeDirection) { - if (passingPeep.IsActionInterruptable()) + if (passingPeep.IsActionInterruptableSafely()) { - passingPeep.Action = PeepActionType::Wave2; + passingPeep.Action = PeepActionType::wave2; passingPeep.AnimationFrameNum = 0; passingPeep.AnimationImageIdOffset = 0; passingPeep.UpdateCurrentAnimationType(); @@ -544,12 +546,12 @@ void Guest::GivePassingGuestPizza(Guest& passingPeep) void Guest::MakePassingGuestSick(Guest& passingPeep) { - if (passingPeep.State != PeepState::Walking) + if (passingPeep.State != PeepState::walking) return; - if (passingPeep.IsActionInterruptable()) + if (passingPeep.IsActionInterruptableSafely()) { - passingPeep.Action = PeepActionType::ThrowUp; + passingPeep.Action = PeepActionType::throwUp; passingPeep.AnimationFrameNum = 0; passingPeep.AnimationImageIdOffset = 0; passingPeep.UpdateCurrentAnimationType(); @@ -558,10 +560,10 @@ void Guest::MakePassingGuestSick(Guest& passingPeep) void Guest::GivePassingPeepsIceCream(Guest& passingPeep) { - if (passingPeep.HasItem(ShopItem::IceCream)) + if (passingPeep.HasItem(ShopItem::iceCream)) return; - passingPeep.GiveItem(ShopItem::IceCream); + passingPeep.GiveItem(ShopItem::iceCream); passingPeep.UpdateAnimationGroup(); } @@ -595,9 +597,9 @@ void Guest::UpdateEasterEggInteractions() { if ((ScenarioRand() & 0xFFFF) <= 1456) { - if (IsActionInterruptable()) + if (IsActionInterruptableSafely()) { - Action = PeepActionType::Joy; + Action = PeepActionType::joy; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -796,13 +798,13 @@ void Guest::UpdateMotivesIdle() Toilet--; } - if (State == PeepState::Walking && NauseaTarget >= 128) + if (State == PeepState::walking && NauseaTarget >= 128) { if ((ScenarioRand() & 0xFF) <= static_cast((Nausea - 128) / 2)) { - if (IsActionInterruptable()) + if (IsActionInterruptableSafely()) { - Action = PeepActionType::ThrowUp; + Action = PeepActionType::throwUp; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -819,7 +821,7 @@ void Guest::UpdateConsumptionMotives() TimeToConsume += 3; } - if (TimeToConsume != 0 && State != PeepState::OnRide) + if (TimeToConsume != 0 && State != PeepState::onRide) { TimeToConsume = std::max(TimeToConsume - 3, 0); @@ -843,7 +845,7 @@ void Guest::UpdateConsumptionMotives() RemoveItem(food); auto discardContainer = GetShopItemDescriptor(food).DiscardContainer; - if (discardContainer != ShopItem::None) + if (discardContainer != ShopItem::none) { GiveItem(discardContainer); } @@ -946,7 +948,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) if (PeepFlags & PEEP_FLAGS_EXPLODE && x != kLocationNull) { - if (State == PeepState::Walking || State == PeepState::Sitting) + if (State == PeepState::walking || State == PeepState::sitting) { OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::crash, GetLocation()); @@ -987,7 +989,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) if (Angriness != 0) Angriness--; - if (State == PeepState::Walking || State == PeepState::Sitting) + if (State == PeepState::walking || State == PeepState::sitting) { SurroundingsThoughtTimeout++; if (SurroundingsThoughtTimeout >= 18) @@ -1011,7 +1013,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) UpdateAnimationGroup(); } - if (State == PeepState::OnRide || State == PeepState::EnteringRide) + if (State == PeepState::onRide || State == PeepState::enteringRide) { GuestTimeOnRide = std::min(255, GuestTimeOnRide + 1); @@ -1044,7 +1046,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) return; } - if (State == PeepState::Walking && !OutsideOfPark && !(PeepFlags & PEEP_FLAGS_LEAVING_PARK) && GuestNumRides == 0 + if (State == PeepState::walking && !OutsideOfPark && !(PeepFlags & PEEP_FLAGS_LEAVING_PARK) && GuestNumRides == 0 && GuestHeadingToRideId.IsNull()) { uint32_t time_duration = currentTicks - ParkEntryTime; @@ -1066,7 +1068,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) } } - if ((ScenarioRand() & 0xFFFF) <= ((HasItem(ShopItem::Map)) ? 8192u : 2184u)) + if ((ScenarioRand() & 0xFFFF) <= ((HasItem(ShopItem::map)) ? 8192u : 2184u)) { GuestPickRideToGoOn(*this); } @@ -1079,7 +1081,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) * is executed to once every second time the encompassing * conditional executes. */ - if (!OutsideOfPark && (State == PeepState::Walking || State == PeepState::Sitting)) + if (!OutsideOfPark && (State == PeepState::walking || State == PeepState::sitting)) { uint8_t num_thoughts = 0; PeepThoughtType possible_thoughts[5]; @@ -1170,14 +1172,14 @@ void Guest::Tick128UpdateGuest(uint32_t index) switch (State) { - case PeepState::Walking: - case PeepState::LeavingPark: - case PeepState::EnteringPark: + case PeepState::walking: + case PeepState::leavingPark: + case PeepState::enteringPark: GuestDecideWhetherToLeavePark(*this); GuestUpdateHunger(*this); break; - case PeepState::Sitting: + case PeepState::sitting: if (EnergyTarget <= 135) EnergyTarget += 5; @@ -1196,7 +1198,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) GuestUpdateHunger(*this); break; - case PeepState::Queuing: + case PeepState::queuing: if (TimeInQueue >= 2000) { /* Peep happiness is affected once the peep has been waiting @@ -1240,7 +1242,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) } GuestUpdateHunger(*this); break; - case PeepState::EnteringRide: + case PeepState::enteringRide: if (SubState == 17 || SubState == 15) { GuestDecideWhetherToLeavePark(*this); @@ -1269,7 +1271,7 @@ static void GuestTryGetUpFromSitting(Guest& guest) if (guest.TimeToSitdown) return; - guest.SetState(PeepState::Walking); + guest.SetState(PeepState::walking); // Set destination to the centre of the tile. const auto destination = guest.GetLocation().ToTileCentre(); @@ -1283,7 +1285,7 @@ static void GuestTryGetUpFromSitting(Guest& guest) */ void Guest::UpdateSitting() { - if (SittingSubState == PeepSittingSubState::TryingToSit) + if (SittingSubState == PeepSittingSubState::tryingToSit) { if (!CheckForPath()) return; @@ -1298,16 +1300,16 @@ void Guest::UpdateSitting() MoveTo(loc); Orientation = ((Var37 + 2) & 3) * 8; - Action = PeepActionType::Idle; - NextAnimationType = PeepAnimationType::SittingIdle; + Action = PeepActionType::idle; + NextAnimationType = PeepAnimationType::sittingIdle; SwitchNextAnimationType(); - SittingSubState = PeepSittingSubState::SatDown; + SittingSubState = PeepSittingSubState::satDown; // Sets time to sit on seat TimeToSitdown = (129 - Energy) * 16 + 50; } - else if (SittingSubState == PeepSittingSubState::SatDown) + else if (SittingSubState == PeepSittingSubState::satDown) { if (!IsActionInterruptable()) { @@ -1315,14 +1317,14 @@ void Guest::UpdateSitting() if (!IsActionWalking()) return; - Action = PeepActionType::Idle; + Action = PeepActionType::idle; GuestTryGetUpFromSitting(*this); return; } if ((PeepFlags & PEEP_FLAGS_LEAVING_PARK)) { - SetState(PeepState::Walking); + SetState(PeepState::walking); // Set destination to the centre of the tile auto destination = GetLocation().ToTileCentre(); @@ -1331,7 +1333,7 @@ void Guest::UpdateSitting() return; } - if (AnimationGroup == PeepAnimationGroup::Umbrella) + if (AnimationGroup == PeepAnimationGroup::umbrella) { GuestTryGetUpFromSitting(*this); return; @@ -1344,7 +1346,7 @@ void Guest::UpdateSitting() GuestTryGetUpFromSitting(*this); return; } - Action = PeepActionType::SittingEatFood; + Action = PeepActionType::sittingEatFood; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -1357,21 +1359,21 @@ void Guest::UpdateSitting() GuestTryGetUpFromSitting(*this); return; } - if (AnimationGroup == PeepAnimationGroup::Balloon || AnimationGroup == PeepAnimationGroup::Hat) + if (AnimationGroup == PeepAnimationGroup::balloon || AnimationGroup == PeepAnimationGroup::hat) { GuestTryGetUpFromSitting(*this); return; } - Action = PeepActionType::SittingLookAroundLeft; + Action = PeepActionType::sittingLookAroundLeft; if (rand & 0x80000000u) { - Action = PeepActionType::SittingLookAroundRight; + Action = PeepActionType::sittingLookAroundRight; } if (rand & 0x40000000u) { - Action = PeepActionType::SittingCheckWatch; + Action = PeepActionType::sittingCheckWatch; } AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -1528,10 +1530,10 @@ static money64 getItemValue(const ShopItemDescriptor& shopItemDescriptor) static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopItem, money64 price) { const bool isPrecipitating = ClimateIsPrecipitating(); - const bool isPrecipitatingAndUmbrella = isPrecipitating && (shopItem == ShopItem::Umbrella); + const bool isPrecipitatingAndUmbrella = isPrecipitating && (shopItem == ShopItem::umbrella); bool hasVoucher = false; - if ((guest.HasItem(ShopItem::Voucher)) && (guest.VoucherType == VOUCHER_TYPE_FOOD_OR_DRINK_FREE) + if ((guest.HasItem(ShopItem::voucher)) && (guest.VoucherType == VOUCHER_TYPE_FOOD_OR_DRINK_FREE) && (guest.VoucherShopItem == shopItem)) { hasVoucher = true; @@ -1557,15 +1559,15 @@ static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopI return false; } - if ((shopItem == ShopItem::Balloon || shopItem == ShopItem::IceCream || shopItem == ShopItem::Candyfloss - || shopItem == ShopItem::Sunglasses) + if ((shopItem == ShopItem::balloon || shopItem == ShopItem::iceCream || shopItem == ShopItem::candyfloss + || shopItem == ShopItem::sunglasses) && isPrecipitating) { return false; } auto& gameState = getGameState(); - if ((shopItem == ShopItem::Sunglasses || shopItem == ShopItem::IceCream) && gameState.weatherCurrent.temperature < 12) + if ((shopItem == ShopItem::sunglasses || shopItem == ShopItem::iceCream) && gameState.weatherCurrent.temperature < 12) { return false; } @@ -1582,7 +1584,7 @@ static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopI return false; } - if (!isPrecipitatingAndUmbrella && (shopItem != ShopItem::Map) && shopItemDescriptor.IsSouvenir() && !hasVoucher) + if (!isPrecipitatingAndUmbrella && (shopItem != ShopItem::map) && shopItemDescriptor.IsSouvenir() && !hasVoucher) { if (((ScenarioRand() & 0x7F) + 0x73) > guest.Happiness || guest.GuestNumRides < 3) return false; @@ -1667,31 +1669,31 @@ static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopI guest.GiveItem(shopItem); const auto hasRandomShopColour = ride.hasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); - if (shopItem == ShopItem::TShirt) + if (shopItem == ShopItem::tShirt) guest.TshirtColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; - if (shopItem == ShopItem::Hat) + if (shopItem == ShopItem::hat) guest.HatColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; - if (shopItem == ShopItem::Balloon) + if (shopItem == ShopItem::balloon) guest.BalloonColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; - if (shopItem == ShopItem::Umbrella) + if (shopItem == ShopItem::umbrella) guest.UmbrellaColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.trackColours[0].main; - if (shopItem == ShopItem::Map) + if (shopItem == ShopItem::map) guest.ResetPathfindGoal(); - if (shopItem == ShopItem::Photo) + if (shopItem == ShopItem::photo) guest.Photo1RideRef = ride.id; - if (shopItem == ShopItem::Photo2) + if (shopItem == ShopItem::photo2) guest.Photo2RideRef = ride.id; - if (shopItem == ShopItem::Photo3) + if (shopItem == ShopItem::photo3) guest.Photo3RideRef = ride.id; - if (shopItem == ShopItem::Photo4) + if (shopItem == ShopItem::photo4) guest.Photo4RideRef = ride.id; guest.WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; @@ -1701,7 +1703,7 @@ static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopI auto ft = Formatter(); guest.FormatNameTo(ft); ft.Add(shopItemDescriptor.Naming.Indefinite); - if (Config::Get().notifications.GuestBoughtItem) + if (Config::Get().notifications.guestBoughtItem) { News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_NOTIFICATION_BOUGHT_X, guest.Id, ft); } @@ -1738,7 +1740,7 @@ static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopI expenditure = static_cast(static_cast(expenditure) - 1); if (hasVoucher) { - guest.RemoveItem(ShopItem::Voucher); + guest.RemoveItem(ShopItem::voucher); guest.WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; } else if (!(gameState.park.flags & PARK_FLAGS_NO_MONEY)) @@ -1847,7 +1849,7 @@ void Guest::OnExitRide(Ride& ride) */ static void GuestPickRideToGoOn(Guest& guest) { - if (guest.State != PeepState::Walking) + if (guest.State != PeepState::walking) return; if (!guest.GuestHeadingToRideId.IsNull()) return; @@ -1868,7 +1870,7 @@ static void GuestPickRideToGoOn(Guest& guest) guest.WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_ACTION; // Make peep look at their map if they have one - if (guest.HasItem(ShopItem::Map)) + if (guest.HasItem(ShopItem::map)) { guest.ReadMap(); } @@ -1882,7 +1884,7 @@ static OpenRCT2::BitSet GuestFindRidesToGoOn( // FIX Originally checked for a toy, likely a mistake and should be a map, // but then again this seems to only allow the peep to go on // rides they haven't been on before. - if (guest.HasItem(ShopItem::Map)) + if (guest.HasItem(ShopItem::map)) { // Consider rides that peep hasn't been on yet auto& gameState = getGameState(); @@ -2401,7 +2403,7 @@ static bool GuestShouldRideWhileRaining(Guest& guest, const Ride& ride) } // Peeps with umbrellas will go on rides where they can use their umbrella on it (like the Maze) 50% of the time - if (guest.HasItem(ShopItem::Umbrella) && ride.getRideTypeDescriptor().HasFlag(RtdFlag::guestsCanUseUmbrella) + if (guest.HasItem(ShopItem::umbrella) && ride.getRideTypeDescriptor().HasFlag(RtdFlag::guestsCanUseUmbrella) && (ScenarioRand() & 2) == 0) { return true; @@ -2426,9 +2428,9 @@ void Guest::ChoseNotToGoOnRide(const Ride& ride, bool peepAtRide, bool updateLas void Guest::ReadMap() { - if (IsActionInterruptable() && !IsOnLevelCrossing()) + if (IsActionInterruptableSafely()) { - Action = PeepActionType::ReadMap; + Action = PeepActionType::readMap; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -2437,7 +2439,7 @@ void Guest::ReadMap() static bool GuestHasVoucherForFreeRide(Guest& guest, const Ride& ride) { - return guest.HasItem(ShopItem::Voucher) && guest.VoucherType == VOUCHER_TYPE_RIDE_FREE && guest.VoucherRideId == ride.id; + return guest.HasItem(ShopItem::voucher) && guest.VoucherType == VOUCHER_TYPE_RIDE_FREE && guest.VoucherRideId == ride.id; } /** @@ -2565,8 +2567,8 @@ void Guest::GoToRideEntrance(const Ride& ride) location.y += y_shift; SetDestination(location, 2); - SetState(PeepState::EnteringRide); - RideSubState = PeepRideSubState::InEntrance; + SetState(PeepState::enteringRide); + RideSubState = PeepRideSubState::inEntrance; RejoinQueueTimeout = 0; GuestTimeOnRide = 0; @@ -2649,13 +2651,13 @@ static void PeepUpdateRideAtEntranceTryLeave(Guest& guest) if (guest.DestinationTolerance == 0) { guest.RemoveFromQueue(); - guest.SetState(PeepState::Falling); + guest.SetState(PeepState::falling); } } static bool PeepCheckRidePriceAtEntrance(Guest& guest, const Ride& ride, money64 ridePrice) { - if ((guest.HasItem(ShopItem::Voucher)) && guest.VoucherType == VOUCHER_TYPE_RIDE_FREE + if ((guest.HasItem(ShopItem::voucher)) && guest.VoucherType == VOUCHER_TYPE_RIDE_FREE && guest.VoucherRideId == guest.CurrentRide) return true; @@ -3171,7 +3173,7 @@ static void GuestLeavePark(Guest& guest) template static void PeepHeadForNearestRide(Guest& guest, bool considerOnlyCloseRides, T predicate) { - if (guest.State != PeepState::Sitting && guest.State != PeepState::Watching && guest.State != PeepState::Walking) + if (guest.State != PeepState::sitting && guest.State != PeepState::watching && guest.State != PeepState::walking) { return; } @@ -3189,7 +3191,7 @@ static void PeepHeadForNearestRide(Guest& guest, bool considerOnlyCloseRides, T } OpenRCT2::BitSet rideConsideration; - if (!considerOnlyCloseRides && (guest.HasItem(ShopItem::Map))) + if (!considerOnlyCloseRides && (guest.HasItem(ShopItem::map))) { // Consider all rides in the park auto& gameState = getGameState(); @@ -3387,7 +3389,7 @@ void Guest::UpdateBuying() auto ride = GetRide(CurrentRide); if (ride == nullptr || ride->status != RideStatus::open) { - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } @@ -3416,7 +3418,7 @@ void Guest::UpdateBuying() SetDestination(destination); PeepDirection = DirectionReverse(PeepDirection); - SetState(PeepState::Walking); + SetState(PeepState::walking); return; } @@ -3435,7 +3437,7 @@ void Guest::UpdateBuying() } else { - Action = PeepActionType::WithdrawMoney; + Action = PeepActionType::withdrawMoney; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -3451,7 +3453,7 @@ void Guest::UpdateBuying() { return; } - if (ride_type->shop_item[1] != ShopItem::None) + if (ride_type->shop_item[1] != ShopItem::none) { auto price = ride->price[1]; @@ -3462,7 +3464,7 @@ void Guest::UpdateBuying() } } - if (!item_bought && ride_type->shop_item[0] != ShopItem::None) + if (!item_bought && ride_type->shop_item[0] != ShopItem::none) { auto price = ride->price[0]; @@ -3597,7 +3599,7 @@ void PeepUpdateRideLeaveEntranceMaze(Guest& guest, Ride& ride, CoordsXYZD& entra ride.curNumCustomers++; guest.OnEnterRide(ride); - guest.RideSubState = PeepRideSubState::MazePathfinding; + guest.RideSubState = PeepRideSubState::mazePathfinding; } void PeepUpdateRideLeaveEntranceSpiralSlide(Guest& guest, Ride& ride, CoordsXYZD& entrance_loc) @@ -3617,7 +3619,7 @@ void PeepUpdateRideLeaveEntranceSpiralSlide(Guest& guest, Ride& ride, CoordsXYZD ride.curNumCustomers++; guest.OnEnterRide(ride); - guest.RideSubState = PeepRideSubState::ApproachSpiralSlide; + guest.RideSubState = PeepRideSubState::approachSpiralSlide; } void PeepUpdateRideLeaveEntranceDefault(Guest& guest, Ride& ride, CoordsXYZD& entrance_loc) @@ -3633,7 +3635,7 @@ void PeepUpdateRideLeaveEntranceDefault(Guest& guest, Ride& ride, CoordsXYZD& en auto ft = Formatter(); ride.formatNameTo(ft); - if (Config::Get().notifications.RideWarnings) + if (Config::Get().notifications.rideWarnings) { News::AddItemToQueue(News::ItemType::ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, guest.CurrentRide.ToUnderlying(), ft); } @@ -3649,7 +3651,7 @@ uint8_t Guest::GetWaypointedSeatLocation(const Ride& ride, const CarEntry* vehic uint8_t seatLocationFixed = CurrentSeat & 0xF8; // Enterprise has more segments (8) compared to the normal (4) - if (ride.type != RIDE_TYPE_ENTERPRISE) + if (ride.getRideTypeDescriptor().specialType != RtdSpecialType::enterprise) track_direction *= 2; // Type 1 loading doesn't do segments and all peeps go to the same @@ -3701,7 +3703,7 @@ void Guest::UpdateRideLeaveEntranceWaypoints(const Ride& ride) } SetDestination(waypoint); - RideSubState = PeepRideSubState::ApproachVehicleWaypoints; + RideSubState = PeepRideSubState::approachVehicleWaypoints; } /** @@ -3731,9 +3733,9 @@ void Guest::UpdateRideAdvanceThroughEntrance() } } - if (RideSubState == PeepRideSubState::InEntrance && xy_distance < distanceThreshold) + if (RideSubState == PeepRideSubState::inEntrance && xy_distance < distanceThreshold) { - RideSubState = PeepRideSubState::FreeVehicleCheck; + RideSubState = PeepRideSubState::freeVehicleCheck; } actionZ = ride->getStation(CurrentRideStation).GetBaseZ(); @@ -3748,9 +3750,9 @@ void Guest::UpdateRideAdvanceThroughEntrance() return; } - if (RideSubState == PeepRideSubState::InEntrance) + if (RideSubState == PeepRideSubState::inEntrance) { - RideSubState = PeepRideSubState::FreeVehicleCheck; + RideSubState = PeepRideSubState::freeVehicleCheck; return; } @@ -3797,7 +3799,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() if (vehicle_type->flags & CAR_ENTRY_FLAG_DODGEM_CAR_PLACEMENT) { SetDestination(vehicle->GetLocation(), 15); - RideSubState = PeepRideSubState::ApproachVehicle; + RideSubState = PeepRideSubState::approachVehicle; return; } @@ -3833,7 +3835,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() } SetDestination(destination); - RideSubState = PeepRideSubState::ApproachVehicle; + RideSubState = PeepRideSubState::approachVehicle; } /** @@ -3887,7 +3889,7 @@ static void PeepGoToRideExit(Guest& guest, const Ride& ride, int16_t x, int16_t guest.SetDestination({ x, y }, 2); guest.Orientation = exit_direction * 8; - guest.RideSubState = PeepRideSubState::ApproachExit; + guest.RideSubState = PeepRideSubState::approachExit; } /** @@ -3899,9 +3901,9 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) auto ridePrice = RideGetPrice(ride); if (ridePrice != 0) { - if ((HasItem(ShopItem::Voucher)) && (VoucherType == VOUCHER_TYPE_RIDE_FREE) && (VoucherRideId == CurrentRide)) + if ((HasItem(ShopItem::voucher)) && (VoucherType == VOUCHER_TYPE_RIDE_FREE) && (VoucherRideId == CurrentRide)) { - RemoveItem(ShopItem::Voucher); + RemoveItem(ShopItem::voucher); WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; } else @@ -3912,7 +3914,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) } } - RideSubState = PeepRideSubState::LeaveEntrance; + RideSubState = PeepRideSubState::leaveEntrance; uint8_t queueTime = DaysInQueue; if (queueTime < 253) queueTime += 3; @@ -3938,7 +3940,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride& ride) else msg_string = STR_PEEP_TRACKING_PEEP_IS_ON_X; - if (Config::Get().notifications.GuestOnRide) + if (Config::Get().notifications.guestOnRide) { News::AddItemToQueue(News::ItemType::peepOnRide, msg_string, Id, ft); } @@ -3970,8 +3972,8 @@ static void PeepUpdateRideNoFreeVehicleRejoinQueue(Guest& guest, Ride& ride) } guest.SetDestination({ x, y }, 2); - guest.SetState(PeepState::QueuingFront); - guest.RideSubState = PeepRideSubState::AtEntrance; + guest.SetState(PeepState::queuingFront); + guest.RideSubState = PeepRideSubState::atEntrance; ride.queueInsertGuestAtFront(guest.CurrentRideStation, &guest); } @@ -4097,7 +4099,7 @@ void Guest::UpdateRideApproachVehicle() MoveTo({ loc.value(), z }); return; } - RideSubState = PeepRideSubState::EnterVehicle; + RideSubState = PeepRideSubState::enterVehicle; } void Guest::UpdateRideEnterVehicle() @@ -4126,7 +4128,7 @@ void Guest::UpdateRideEnterVehicle() auto* seatedGuest = gameState.entities.GetEntity(vehicle->peep[CurrentSeat ^ 1]); if (seatedGuest != nullptr) { - if (seatedGuest->RideSubState != PeepRideSubState::EnterVehicle) + if (seatedGuest->RideSubState != PeepRideSubState::enterVehicle) return; vehicle->num_peeps++; @@ -4134,9 +4136,9 @@ void Guest::UpdateRideEnterVehicle() vehicle->ApplyMass(seatedGuest->Mass); seatedGuest->MoveTo({ kLocationNull, 0, 0 }); - seatedGuest->SetState(PeepState::OnRide); + seatedGuest->SetState(PeepState::onRide); seatedGuest->GuestTimeOnRide = 0; - seatedGuest->RideSubState = PeepRideSubState::OnRide; + seatedGuest->RideSubState = PeepRideSubState::onRide; seatedGuest->OnEnterRide(*ride); } } @@ -4149,10 +4151,10 @@ void Guest::UpdateRideEnterVehicle() MoveTo({ kLocationNull, 0, 0 }); - SetState(PeepState::OnRide); + SetState(PeepState::onRide); GuestTimeOnRide = 0; - RideSubState = PeepRideSubState::OnRide; + RideSubState = PeepRideSubState::onRide; OnEnterRide(*ride); } } @@ -4374,7 +4376,7 @@ void Guest::UpdateRideLeaveVehicle() exitWaypointLoc.y += carEntry->peep_loading_waypoints[waypointIndex][2].y; } - if (ride->type == RIDE_TYPE_MOTION_SIMULATOR) + if (ride->getRideTypeDescriptor().specialType == RtdSpecialType::motionSimulator) exitWaypointLoc.z += 15; MoveTo(exitWaypointLoc); @@ -4386,7 +4388,7 @@ void Guest::UpdateRideLeaveVehicle() } SetDestination(waypointLoc, 2); - RideSubState = PeepRideSubState::ApproachExitWaypoints; + RideSubState = PeepRideSubState::approachExitWaypoints; } /** @@ -4432,7 +4434,7 @@ void Guest::UpdateRidePrepareForExit() newDestination.y -= yShift; SetDestination(newDestination, 2); - RideSubState = PeepRideSubState::InExit; + RideSubState = PeepRideSubState::inExit; } /** @@ -4485,7 +4487,7 @@ void Guest::UpdateRideInExit() ride->numSecondaryItemsSold = AddClamp(ride->numSecondaryItemsSold, 1u); } } - RideSubState = PeepRideSubState::LeaveExit; + RideSubState = PeepRideSubState::leaveExit; } #pragma warning(default : 6011) @@ -4521,7 +4523,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() if (waypoint == 2) { - RideSubState = PeepRideSubState::EnterVehicle; + RideSubState = PeepRideSubState::enterVehicle; return; } @@ -4598,7 +4600,7 @@ void Guest::UpdateRideApproachExitWaypoints() { int16_t actionZ; - if (ride->type == RIDE_TYPE_MOTION_SIMULATOR) + if (ride->getRideTypeDescriptor().specialType == RtdSpecialType::motionSimulator) { actionZ = ride->getStation(CurrentRideStation).GetBaseZ() + 2; @@ -4707,7 +4709,8 @@ void Guest::UpdateRideApproachSpiralSlide() if (waypoint == 3) { SubState = 15; - SetDestination({ 0, 0 }); + spiralSlideSubstate = PeepSpiralSlideSubState::goingUp; + spiralSlideGoingUpTimer = 0; Var37 = (Var37 / 4) & 0xC; MoveTo({ kLocationNull, y, z }); return; @@ -4743,7 +4746,7 @@ void Guest::UpdateRideApproachSpiralSlide() targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); - RideSubState = PeepRideSubState::LeaveSpiralSlide; + RideSubState = PeepRideSubState::leaveSpiralSlide; return; } } @@ -4790,19 +4793,17 @@ void Guest::UpdateRideOnSpiralSlide() if (rtd.specialType != RtdSpecialType::spiralSlide) return; - auto destination = GetDestination(); if ((Var37 & 3) == 0) { - switch (destination.x) + switch (spiralSlideSubstate) { - case 0: - destination.y++; - if (destination.y >= 30) - destination.x++; + case PeepSpiralSlideSubState::goingUp: + spiralSlideGoingUpTimer++; + if (spiralSlideGoingUpTimer >= kTicksToGoUpSpiralSlide) + spiralSlideSubstate = PeepSpiralSlideSubState::prepareToSlide; - SetDestination(destination); return; - case 1: + case PeepSpiralSlideSubState::prepareToSlide: if (ride->slideInUse) return; @@ -4810,22 +4811,19 @@ void Guest::UpdateRideOnSpiralSlide() ride->slidePeep = Id; ride->slidePeepTShirtColour = TshirtColour; ride->spiralSlideProgress = 0; - destination.x++; + spiralSlideSubstate = PeepSpiralSlideSubState::slidingDown; - SetDestination(destination); return; - case 2: - return; - case 3: + case PeepSpiralSlideSubState::finishedSliding: { auto newLocation = ride->getStation(CurrentRideStation).Start; uint8_t dir = (Var37 / 4) & 3; - // Set the location that the peep walks to go on slide again - destination = newLocation + kSpiralSlideEndWaypoint[dir]; + // Set the location that the guest walks to go on slide again + auto destination = newLocation + kSpiralSlideEndWaypoint[dir]; SetDestination(destination); - // Move the peep sprite to just at the end of the slide + // Move the guest sprite to just at the end of the slide newLocation.x += kSpiralSlideEnd[dir].x; newLocation.y += kSpiralSlideEnd[dir].y; @@ -4836,6 +4834,7 @@ void Guest::UpdateRideOnSpiralSlide() Var37++; return; } + case PeepSpiralSlideSubState::slidingDown: // Handled by updateSpiralSlide in Ride.cpp default: return; } @@ -4855,7 +4854,7 @@ void Guest::UpdateRideOnSpiralSlide() targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); - RideSubState = PeepRideSubState::ApproachSpiralSlide; + RideSubState = PeepRideSubState::approachSpiralSlide; } /** @@ -4961,7 +4960,7 @@ void Guest::UpdateRideMazePathfinding() if (Energy > 80 && !(PeepFlags & PEEP_FLAGS_SLOW_WALK) && !ClimateIsPrecipitating() && (ScenarioRand() & 0xFFFF) <= 2427) { - Action = PeepActionType::Jump; + Action = PeepActionType::jump; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -5097,7 +5096,7 @@ void Guest::UpdateRideLeaveExit() FormatNameTo(ft); ride->formatNameTo(ft); - if (Config::Get().notifications.GuestLeftRide) + if (Config::Get().notifications.guestLeftRide) { News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_LEFT_RIDE_X, Id, ft); } @@ -5105,7 +5104,7 @@ void Guest::UpdateRideLeaveExit() } InteractionRideIndex = RideId::GetNull(); - SetState(PeepState::Falling); + SetState(PeepState::falling); CoordsXY targetLoc = { x, y }; @@ -5136,7 +5135,7 @@ void Guest::UpdateRideShopApproach() return; } - RideSubState = PeepRideSubState::InteractShop; + RideSubState = PeepRideSubState::interactShop; } /** @@ -5157,7 +5156,7 @@ void Guest::UpdateRideShopInteract() { if (Nausea <= 35) { - RideSubState = PeepRideSubState::LeaveShop; + RideSubState = PeepRideSubState::leaveShop; SetDestination({ tileCentreX, tileCentreY }, 3); HappinessTarget = std::min(HappinessTarget + 30, kPeepMaxHappiness); @@ -5183,7 +5182,7 @@ void Guest::UpdateRideShopInteract() OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::toiletFlush, GetLocation()); } - RideSubState = PeepRideSubState::LeaveShop; + RideSubState = PeepRideSubState::leaveShop; SetDestination({ tileCentreX, tileCentreY }, 3); @@ -5210,8 +5209,8 @@ void Guest::UpdateRideShopLeave() return; } - // #11758 Previously SetState(PeepState::Walking) caused Peeps to double-back to exit point of shop - SetState(PeepState::Falling); + // #11758 Previously SetState(PeepState::walking) caused Peeps to double-back to exit point of shop + SetState(PeepState::falling); auto ride = GetRide(CurrentRide); if (ride != nullptr) @@ -5332,49 +5331,49 @@ void Guest::Update() // Loc68FD2F switch (State) { - case PeepState::Falling: + case PeepState::falling: UpdateFalling(); break; - case PeepState::One: + case PeepState::one: Update1(); break; - case PeepState::OnRide: + case PeepState::onRide: // No action break; - case PeepState::Picked: + case PeepState::picked: UpdatePicked(); break; - case PeepState::QueuingFront: + case PeepState::queuingFront: UpdateRide(); break; - case PeepState::LeavingRide: + case PeepState::leavingRide: UpdateRide(); break; - case PeepState::Walking: + case PeepState::walking: UpdateWalking(); break; - case PeepState::Queuing: + case PeepState::queuing: UpdateQueuing(); break; - case PeepState::EnteringRide: + case PeepState::enteringRide: UpdateRide(); break; - case PeepState::Sitting: + case PeepState::sitting: UpdateSitting(); break; - case PeepState::EnteringPark: + case PeepState::enteringPark: UpdateEnteringPark(); break; - case PeepState::LeavingPark: + case PeepState::leavingPark: UpdateLeavingPark(); break; - case PeepState::Buying: + case PeepState::buying: UpdateBuying(); break; - case PeepState::Watching: + case PeepState::watching: UpdateWatching(); break; - case PeepState::UsingBin: + case PeepState::usingBin: UpdateUsingBin(); break; default: @@ -5395,64 +5394,64 @@ void Guest::UpdateRide() switch (RideSubState) { - case PeepRideSubState::AtEntrance: + case PeepRideSubState::atEntrance: UpdateRideAtEntrance(); break; - case PeepRideSubState::InEntrance: + case PeepRideSubState::inEntrance: UpdateRideAdvanceThroughEntrance(); break; - case PeepRideSubState::FreeVehicleCheck: + case PeepRideSubState::freeVehicleCheck: UpdateRideFreeVehicleCheck(); break; - case PeepRideSubState::LeaveEntrance: + case PeepRideSubState::leaveEntrance: UpdateRideAdvanceThroughEntrance(); break; - case PeepRideSubState::ApproachVehicle: + case PeepRideSubState::approachVehicle: UpdateRideApproachVehicle(); break; - case PeepRideSubState::EnterVehicle: + case PeepRideSubState::enterVehicle: UpdateRideEnterVehicle(); break; - case PeepRideSubState::OnRide: + case PeepRideSubState::onRide: // No action, on ride. break; - case PeepRideSubState::LeaveVehicle: + case PeepRideSubState::leaveVehicle: UpdateRideLeaveVehicle(); break; - case PeepRideSubState::ApproachExit: + case PeepRideSubState::approachExit: UpdateRideApproachExit(); break; - case PeepRideSubState::InExit: + case PeepRideSubState::inExit: UpdateRideInExit(); break; - case PeepRideSubState::ApproachVehicleWaypoints: + case PeepRideSubState::approachVehicleWaypoints: UpdateRideApproachVehicleWaypoints(); break; - case PeepRideSubState::ApproachExitWaypoints: + case PeepRideSubState::approachExitWaypoints: UpdateRideApproachExitWaypoints(); break; - case PeepRideSubState::ApproachSpiralSlide: + case PeepRideSubState::approachSpiralSlide: UpdateRideApproachSpiralSlide(); break; - case PeepRideSubState::OnSpiralSlide: + case PeepRideSubState::onSpiralSlide: UpdateRideOnSpiralSlide(); break; - case PeepRideSubState::LeaveSpiralSlide: + case PeepRideSubState::leaveSpiralSlide: UpdateRideLeaveSpiralSlide(); break; - case PeepRideSubState::MazePathfinding: + case PeepRideSubState::mazePathfinding: UpdateRideMazePathfinding(); break; - case PeepRideSubState::LeaveExit: + case PeepRideSubState::leaveExit: UpdateRideLeaveExit(); break; - case PeepRideSubState::ApproachShop: + case PeepRideSubState::approachShop: UpdateRideShopApproach(); break; - case PeepRideSubState::InteractShop: + case PeepRideSubState::interactShop: UpdateRideShopInteract(); break; - case PeepRideSubState::LeaveShop: + case PeepRideSubState::leaveShop: UpdateRideShopLeave(); break; default: @@ -5473,32 +5472,22 @@ void Guest::UpdateWalking() const auto currentTicks = getGameState().currentTicks; - if (!IsOnLevelCrossing()) + if (IsActionInterruptableSafely()) { - if (PeepFlags & PEEP_FLAGS_WAVING && IsActionInterruptable() && (0xFFFF & ScenarioRand()) < 936) + PeepActionType NewAction = Action; + + if (PeepFlags & PEEP_FLAGS_WAVING && (0xFFFF & ScenarioRand()) < 936) + NewAction = PeepActionType::wave2; + else if (PeepFlags & PEEP_FLAGS_PHOTO && (0xFFFF & ScenarioRand()) < 936) + NewAction = PeepActionType::takePhoto; + else if (PeepFlags & PEEP_FLAGS_PAINTING && (0xFFFF & ScenarioRand()) < 936) + NewAction = PeepActionType::drawPicture; + + if (NewAction != Action) { - Action = PeepActionType::Wave2; + Action = NewAction; AnimationFrameNum = 0; AnimationImageIdOffset = 0; - - UpdateCurrentAnimationType(); - } - - if (PeepFlags & PEEP_FLAGS_PHOTO && IsActionInterruptable() && (0xFFFF & ScenarioRand()) < 936) - { - Action = PeepActionType::TakePhoto; - AnimationFrameNum = 0; - AnimationImageIdOffset = 0; - - UpdateCurrentAnimationType(); - } - - if (PeepFlags & PEEP_FLAGS_PAINTING && IsActionInterruptable() && (0xFFFF & ScenarioRand()) < 936) - { - Action = PeepActionType::DrawPicture; - AnimationFrameNum = 0; - AnimationImageIdOffset = 0; - UpdateCurrentAnimationType(); } } @@ -5510,10 +5499,10 @@ void Guest::UpdateWalking() if ((0xFFFF & ScenarioRand()) <= 4096) { static constexpr Litter::Type litter_types[] = { - Litter::Type::EmptyCan, - Litter::Type::Rubbish, - Litter::Type::BurgerBox, - Litter::Type::EmptyCup, + Litter::Type::emptyCan, + Litter::Type::rubbish, + Litter::Type::burgerBox, + Litter::Type::emptyCup, }; auto litterType = litter_types[ScenarioRand() & 0x3]; const auto loc = GetLocation(); @@ -5531,7 +5520,7 @@ void Guest::UpdateWalking() && ((0xFFFF & ScenarioRand()) <= 4096)) { int32_t container = Numerics::bitScanForward(GetEmptyContainerFlags()); - auto litterType = Litter::Type::Vomit; + auto litterType = Litter::Type::vomit; if (container != -1) { @@ -5574,7 +5563,7 @@ void Guest::UpdateWalking() if (water_height > 0) { MoveTo({ x, y, water_height }); - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } } @@ -5592,7 +5581,7 @@ void Guest::UpdateWalking() GuestUpdateWalkingBreakScenery(*this); - if (State != PeepState::Walking) + if (State != PeepState::walking) return; if (PeepFlags & PEEP_FLAGS_LEAVING_PARK) @@ -5666,7 +5655,7 @@ void Guest::UpdateWalking() // Check if there is a peep watching (and if there is place for us) for (auto peep : EntityTileList({ x, y })) { - if (peep->State != PeepState::Watching) + if (peep->State != PeepState::watching) continue; if (z != peep->z) @@ -5690,7 +5679,7 @@ void Guest::UpdateWalking() CurrentSeat = ride_seat_to_view; Var37 = chosen_edge | (chosen_position << 2); - SetState(PeepState::Watching); + SetState(PeepState::watching); SubState = 0; int32_t destX = (x & 0xFFE0) + kWatchingPositionOffsets[Var37 & 0x1F].x; @@ -5718,15 +5707,15 @@ void Guest::UpdateWaitingAtCrossing() return; } - Action = PeepActionType::Idle; - NextAnimationType = PeepAnimationType::WatchRide; + Action = PeepActionType::idle; + NextAnimationType = PeepAnimationType::watchRide; SwitchNextAnimationType(); if (HasFoodOrDrink()) { if ((ScenarioRand() & 0xFFFF) <= 1310) { - Action = PeepActionType::EatFood; + Action = PeepActionType::eatFood; AnimationFrameNum = 0; AnimationImageIdOffset = 0; } @@ -5738,7 +5727,7 @@ void Guest::UpdateWaitingAtCrossing() if ((ScenarioRand() & 0xFFFF) <= 64) { - Action = PeepActionType::Wave2; + Action = PeepActionType::wave2; AnimationFrameNum = 0; AnimationImageIdOffset = 0; } @@ -5761,12 +5750,12 @@ void Guest::UpdateQueuing() if (ride == nullptr || ride->status != RideStatus::open) { RemoveFromQueue(); - SetState(PeepState::One); + SetState(PeepState::one); return; } // If not in the queue then at front of queue - if (RideSubState != PeepRideSubState::InQueue) + if (RideSubState != PeepRideSubState::inQueue) { bool is_front = true; // Fix #4819: Occasionally the peep->GuestNextInQueue is incorrectly set @@ -5787,8 +5776,8 @@ void Guest::UpdateQueuing() { // Happens every time peep goes onto ride. DestinationTolerance = 0; - SetState(PeepState::QueuingFront); - RideSubState = PeepRideSubState::AtEntrance; + SetState(PeepState::queuingFront); + RideSubState = PeepRideSubState::atEntrance; } return; @@ -5797,12 +5786,12 @@ void Guest::UpdateQueuing() PerformNextAction(); if (!IsActionInterruptable()) return; - if (AnimationGroup == PeepAnimationGroup::Normal) + if (AnimationGroup == PeepAnimationGroup::normal) { if (TimeInQueue >= 2000 && (0xFFFF & ScenarioRand()) <= 119) { // Eat Food/Look at watch - Action = PeepActionType::EatFood; + Action = PeepActionType::eatFood; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -5815,34 +5804,34 @@ void Guest::UpdateQueuing() } else { - if (!(TimeInQueue & 0x3F) && IsActionIdle() && NextAnimationType == PeepAnimationType::WatchRide) + if (!(TimeInQueue & 0x3F) && IsActionIdle() && NextAnimationType == PeepAnimationType::watchRide) { switch (AnimationGroup) { - case PeepAnimationGroup::IceCream: - case PeepAnimationGroup::Chips: - case PeepAnimationGroup::Burger: - case PeepAnimationGroup::Drink: - case PeepAnimationGroup::Candyfloss: - case PeepAnimationGroup::Pizza: - case PeepAnimationGroup::Popcorn: - case PeepAnimationGroup::HotDog: - case PeepAnimationGroup::Tentacle: - case PeepAnimationGroup::ToffeeApple: - case PeepAnimationGroup::Doughnut: - case PeepAnimationGroup::Coffee: - case PeepAnimationGroup::Chicken: - case PeepAnimationGroup::Lemonade: - case PeepAnimationGroup::Pretzel: - case PeepAnimationGroup::Sujeonggwa: - case PeepAnimationGroup::Juice: - case PeepAnimationGroup::FunnelCake: - case PeepAnimationGroup::Noodles: - case PeepAnimationGroup::Sausage: - case PeepAnimationGroup::Soup: - case PeepAnimationGroup::Sandwich: + case PeepAnimationGroup::iceCream: + case PeepAnimationGroup::chips: + case PeepAnimationGroup::burger: + case PeepAnimationGroup::drink: + case PeepAnimationGroup::candyfloss: + case PeepAnimationGroup::pizza: + case PeepAnimationGroup::popcorn: + case PeepAnimationGroup::hotDog: + case PeepAnimationGroup::tentacle: + case PeepAnimationGroup::toffeeApple: + case PeepAnimationGroup::doughnut: + case PeepAnimationGroup::coffee: + case PeepAnimationGroup::chicken: + case PeepAnimationGroup::lemonade: + case PeepAnimationGroup::pretzel: + case PeepAnimationGroup::sujeonggwa: + case PeepAnimationGroup::juice: + case PeepAnimationGroup::funnelCake: + case PeepAnimationGroup::noodles: + case PeepAnimationGroup::sausage: + case PeepAnimationGroup::soup: + case PeepAnimationGroup::sandwich: // Eat food - Action = PeepActionType::EatFood; + Action = PeepActionType::eatFood; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -5861,7 +5850,7 @@ void Guest::UpdateQueuing() Orientation ^= (1 << 4); Invalidate(); RemoveFromQueue(); - SetState(PeepState::One); + SetState(PeepState::one); } } @@ -5885,7 +5874,7 @@ void Guest::UpdateEnteringPark() MoveTo({ loc.value(), z }); return; } - SetState(PeepState::Falling); + SetState(PeepState::falling); OutsideOfPark = false; ParkEntryTime = getGameState().currentTicks; @@ -5951,8 +5940,8 @@ void Guest::UpdateWatching() Orientation = (Var37 & 3) * 8; - Action = PeepActionType::Idle; - NextAnimationType = PeepAnimationType::WatchRide; + Action = PeepActionType::idle; + NextAnimationType = PeepAnimationType::watchRide; SwitchNextAnimationType(); @@ -5970,7 +5959,7 @@ void Guest::UpdateWatching() Invalidate(); if (!IsActionWalking()) return; - Action = PeepActionType::Idle; + Action = PeepActionType::idle; } else { @@ -5978,7 +5967,7 @@ void Guest::UpdateWatching() { if ((ScenarioRand() & 0xFFFF) <= 1310) { - Action = PeepActionType::EatFood; + Action = PeepActionType::eatFood; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -5988,7 +5977,7 @@ void Guest::UpdateWatching() if ((ScenarioRand() & 0xFFFF) <= 655) { - Action = PeepActionType::TakePhoto; + Action = PeepActionType::takePhoto; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -5999,7 +5988,7 @@ void Guest::UpdateWatching() { if ((ScenarioRand() & 0xFFFF) <= 655) { - Action = PeepActionType::Wave; + Action = PeepActionType::wave; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -6016,7 +6005,7 @@ void Guest::UpdateWatching() if (TimeToStand != 0) return; - SetState(PeepState::Walking); + SetState(PeepState::walking); UpdateAnimationGroup(); // Send peep to the centre of current tile. @@ -6034,7 +6023,7 @@ void Guest::UpdateUsingBin() { switch (UsingBinSubState) { - case PeepUsingBinSubState::WalkingToBin: + case PeepUsingBinSubState::walkingToBin: { if (!CheckForPath()) return; @@ -6042,11 +6031,11 @@ void Guest::UpdateUsingBin() const auto [pathingResult, _] = PerformNextAction(); if (pathingResult & PATHING_DESTINATION_REACHED) { - UsingBinSubState = PeepUsingBinSubState::GoingBack; + UsingBinSubState = PeepUsingBinSubState::goingBack; } break; } - case PeepUsingBinSubState::GoingBack: + case PeepUsingBinSubState::goingBack: { if (!IsActionWalking()) { @@ -6219,7 +6208,7 @@ bool Guest::UpdateWalkingFindBench() // Check if there is no peep sitting in chosen_edge for (auto peep : EntityTileList({ x, y })) { - if (peep->State != PeepState::Sitting) + if (peep->State != PeepState::sitting) continue; if (z != peep->z) @@ -6243,9 +6232,9 @@ bool Guest::UpdateWalkingFindBench() Var37 = ((free_edge & 1) << 2) | chosen_edge; - SetState(PeepState::Sitting); + SetState(PeepState::sitting); - SittingSubState = PeepSittingSubState::TryingToSit; + SittingSubState = PeepSittingSubState::tryingToSit; int32_t benchX = (x & 0xFFE0) + BenchUseOffsets[Var37 & 0x7].x; int32_t benchY = (y & 0xFFE0) + BenchUseOffsets[Var37 & 0x7].y; @@ -6322,8 +6311,8 @@ bool Guest::UpdateWalkingFindBin() peep->Var37 = chosen_edge; - peep->SetState(PeepState::UsingBin); - peep->UsingBinSubState = PeepUsingBinSubState::WalkingToBin; + peep->SetState(PeepState::usingBin); + peep->UsingBinSubState = PeepUsingBinSubState::walkingToBin; int32_t binX = (peep->x & 0xFFE0) + BinUseOffsets[peep->Var37 & 0x3].x; int32_t binY = (peep->y & 0xFFE0) + BinUseOffsets[peep->Var37 & 0x3].y; @@ -6374,7 +6363,7 @@ static void GuestUpdateWalkingBreakScenery(Guest& guest) return; if (guest.Energy < 85) return; - if (guest.State != PeepState::Walking) + if (guest.State != PeepState::walking) return; if ((guest.LitterCount & 0xC0) != 0xC0 && (guest.DisgustingCount & 0xC0) != 0xC0) @@ -6398,7 +6387,7 @@ static void GuestUpdateWalkingBreakScenery(Guest& guest) // Check if a peep is already sitting on the bench. If so, do not vandalise it. for (auto* otherGuest : EntityTileList({ guest.x, guest.y })) { - if ((otherGuest->State != PeepState::Sitting) || (guest.z != otherGuest->z)) + if ((otherGuest->State != PeepState::sitting) || (guest.z != otherGuest->z)) { continue; } @@ -6408,7 +6397,7 @@ static void GuestUpdateWalkingBreakScenery(Guest& guest) for (auto innerPeep : EntityList()) { - if (innerPeep->AssignedStaffType != StaffType::Security || innerPeep->x == kLocationNull) + if (innerPeep->AssignedStaffType != StaffType::security || innerPeep->x == kLocationNull) continue; int32_t xDist = abs(innerPeep->x - guest.x); @@ -6903,7 +6892,7 @@ void Guest::SetAnimationGroup(PeepAnimationGroup new_sprite_type) WalkingAnimationFrameNum = 0; if (IsActionInterruptable()) - Action = PeepActionType::Walking; + Action = PeepActionType::walking; auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(AnimationObjectIndex); @@ -6914,19 +6903,19 @@ void Guest::SetAnimationGroup(PeepAnimationGroup new_sprite_type) PeepFlags |= PEEP_FLAGS_SLOW_WALK; } - AnimationType = PeepAnimationType::Invalid; + AnimationType = PeepAnimationType::invalid; UpdateCurrentAnimationType(); - if (State == PeepState::Sitting) + if (State == PeepState::sitting) { - Action = PeepActionType::Idle; - NextAnimationType = PeepAnimationType::SittingIdle; + Action = PeepActionType::idle; + NextAnimationType = PeepAnimationType::sittingIdle; SwitchNextAnimationType(); } - if (State == PeepState::Watching) + if (State == PeepState::watching) { - Action = PeepActionType::Idle; - NextAnimationType = PeepAnimationType::WatchRide; + Action = PeepActionType::idle; + NextAnimationType = PeepAnimationType::watchRide; SwitchNextAnimationType(); } } @@ -6939,37 +6928,37 @@ struct ItemPref // clang-format off static ItemPref item_order_preference[] = { - { ShopItem::IceCream, PeepAnimationGroup::IceCream }, - { ShopItem::Chips, PeepAnimationGroup::Chips }, - { ShopItem::Pizza, PeepAnimationGroup::Pizza }, - { ShopItem::Burger, PeepAnimationGroup::Burger }, - { ShopItem::Drink, PeepAnimationGroup::Drink }, - { ShopItem::Coffee, PeepAnimationGroup::Coffee }, - { ShopItem::Chicken, PeepAnimationGroup::Chicken }, - { ShopItem::Lemonade, PeepAnimationGroup::Lemonade }, - { ShopItem::Candyfloss, PeepAnimationGroup::Candyfloss }, - { ShopItem::Popcorn, PeepAnimationGroup::Popcorn }, - { ShopItem::HotDog, PeepAnimationGroup::HotDog }, - { ShopItem::Tentacle, PeepAnimationGroup::Tentacle }, - { ShopItem::ToffeeApple, PeepAnimationGroup::ToffeeApple }, - { ShopItem::Doughnut, PeepAnimationGroup::Doughnut }, - { ShopItem::Pretzel, PeepAnimationGroup::Pretzel }, - { ShopItem::Cookie, PeepAnimationGroup::Pretzel }, - { ShopItem::Chocolate, PeepAnimationGroup::Coffee }, - { ShopItem::IcedTea, PeepAnimationGroup::Coffee }, - { ShopItem::FunnelCake, PeepAnimationGroup::FunnelCake }, - { ShopItem::BeefNoodles, PeepAnimationGroup::Noodles }, - { ShopItem::FriedRiceNoodles, PeepAnimationGroup::Noodles }, - { ShopItem::WontonSoup, PeepAnimationGroup::Soup }, - { ShopItem::MeatballSoup, PeepAnimationGroup::Soup }, - { ShopItem::FruitJuice, PeepAnimationGroup::Juice }, - { ShopItem::SoybeanMilk, PeepAnimationGroup::Sujeonggwa }, - { ShopItem::Sujeonggwa, PeepAnimationGroup::Sujeonggwa }, - { ShopItem::SubSandwich, PeepAnimationGroup::Sandwich }, - { ShopItem::RoastSausage, PeepAnimationGroup::Sausage }, - { ShopItem::Balloon, PeepAnimationGroup::Balloon }, - { ShopItem::Hat, PeepAnimationGroup::Hat }, - { ShopItem::Sunglasses, PeepAnimationGroup::Sunglasses }, + { ShopItem::iceCream, PeepAnimationGroup::iceCream }, + { ShopItem::chips, PeepAnimationGroup::chips }, + { ShopItem::pizza, PeepAnimationGroup::pizza }, + { ShopItem::burger, PeepAnimationGroup::burger }, + { ShopItem::drink, PeepAnimationGroup::drink }, + { ShopItem::coffee, PeepAnimationGroup::coffee }, + { ShopItem::chicken, PeepAnimationGroup::chicken }, + { ShopItem::lemonade, PeepAnimationGroup::lemonade }, + { ShopItem::candyfloss, PeepAnimationGroup::candyfloss }, + { ShopItem::popcorn, PeepAnimationGroup::popcorn }, + { ShopItem::hotDog, PeepAnimationGroup::hotDog }, + { ShopItem::tentacle, PeepAnimationGroup::tentacle }, + { ShopItem::toffeeApple, PeepAnimationGroup::toffeeApple }, + { ShopItem::doughnut, PeepAnimationGroup::doughnut }, + { ShopItem::pretzel, PeepAnimationGroup::pretzel }, + { ShopItem::cookie, PeepAnimationGroup::pretzel }, + { ShopItem::chocolate, PeepAnimationGroup::coffee }, + { ShopItem::icedTea, PeepAnimationGroup::coffee }, + { ShopItem::funnelCake, PeepAnimationGroup::funnelCake }, + { ShopItem::beefNoodles, PeepAnimationGroup::noodles }, + { ShopItem::friedRiceNoodles, PeepAnimationGroup::noodles }, + { ShopItem::wontonSoup, PeepAnimationGroup::soup }, + { ShopItem::meatballSoup, PeepAnimationGroup::soup }, + { ShopItem::fruitJuice, PeepAnimationGroup::juice }, + { ShopItem::soybeanMilk, PeepAnimationGroup::sujeonggwa }, + { ShopItem::sujeonggwa, PeepAnimationGroup::sujeonggwa }, + { ShopItem::subSandwich, PeepAnimationGroup::sandwich }, + { ShopItem::roastSausage, PeepAnimationGroup::sausage }, + { ShopItem::balloon, PeepAnimationGroup::balloon }, + { ShopItem::hat, PeepAnimationGroup::hat }, + { ShopItem::sunglasses, PeepAnimationGroup::sunglasses }, }; // clang-format on @@ -6979,7 +6968,7 @@ static ItemPref item_order_preference[] = { */ void Guest::UpdateAnimationGroup() { - if (AnimationGroup == PeepAnimationGroup::Balloon && (ScenarioRand() & 0xFFFF) <= 327) + if (AnimationGroup == PeepAnimationGroup::balloon && (ScenarioRand() & 0xFFFF) <= 327) { bool isBalloonPopped = false; if (x != kLocationNull) @@ -6991,11 +6980,11 @@ void Guest::UpdateAnimationGroup() } Balloon::Create({ x, y, z + 9 }, BalloonColour, isBalloonPopped); } - RemoveItem(ShopItem::Balloon); + RemoveItem(ShopItem::balloon); WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; } - if (ClimateIsPrecipitating() && (HasItem(ShopItem::Umbrella)) && x != kLocationNull) + if (ClimateIsPrecipitating() && (HasItem(ShopItem::umbrella)) && x != kLocationNull) { CoordsXY loc = { x, y }; if (MapIsLocationValid(loc.ToTileStart())) @@ -7010,7 +6999,7 @@ void Guest::UpdateAnimationGroup() if (tileElement->IsLastForTile()) { - SetAnimationGroup(PeepAnimationGroup::Umbrella); + SetAnimationGroup(PeepAnimationGroup::umbrella); return; } tileElement++; @@ -7027,43 +7016,43 @@ void Guest::UpdateAnimationGroup() } } - if (State == PeepState::Watching && StandingFlags & (1 << 1)) + if (State == PeepState::watching && StandingFlags & (1 << 1)) { - SetAnimationGroup(PeepAnimationGroup::Watching); + SetAnimationGroup(PeepAnimationGroup::watching); return; } if (Nausea > 170) { - SetAnimationGroup(PeepAnimationGroup::VeryNauseous); + SetAnimationGroup(PeepAnimationGroup::veryNauseous); return; } if (Nausea > 140) { - SetAnimationGroup(PeepAnimationGroup::Nauseous); + SetAnimationGroup(PeepAnimationGroup::nauseous); return; } if (Energy <= 64 && Happiness < 128) { - SetAnimationGroup(PeepAnimationGroup::HeadDown); + SetAnimationGroup(PeepAnimationGroup::headDown); return; } if (Energy <= 80 && Happiness < 128) { - SetAnimationGroup(PeepAnimationGroup::ArmsCrossed); + SetAnimationGroup(PeepAnimationGroup::armsCrossed); return; } if (Toilet > 220) { - SetAnimationGroup(PeepAnimationGroup::RequireToilet); + SetAnimationGroup(PeepAnimationGroup::requireToilet); return; } - SetAnimationGroup(PeepAnimationGroup::Normal); + SetAnimationGroup(PeepAnimationGroup::normal); } bool Guest::HeadingForRideOrParkExit() const @@ -7129,7 +7118,7 @@ void Guest::InsertNewThought(PeepThoughtType thought_type, RideId rideId) void Guest::InsertNewThought(PeepThoughtType thoughtType, uint16_t thoughtArguments) { PeepActionType newAction = PeepThoughtToActionMap[EnumValue(thoughtType)].action; - if (newAction != PeepActionType::Walking && IsActionInterruptable()) + if (newAction != PeepActionType::walking && IsActionInterruptableSafely()) { Action = newAction; AnimationFrameNum = 0; @@ -7282,15 +7271,15 @@ Guest* Guest::Generate(const CoordsXYZ& coords) Guest* peep = gameState.entities.CreateEntity(); - peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Guest); - peep->AnimationGroup = PeepAnimationGroup::Normal; + peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::guest); + peep->AnimationGroup = PeepAnimationGroup::normal; peep->OutsideOfPark = true; - peep->State = PeepState::Falling; - peep->Action = PeepActionType::Walking; + peep->State = PeepState::falling; + peep->Action = PeepActionType::walking; peep->SpecialSprite = 0; peep->AnimationImageIdOffset = 0; peep->WalkingAnimationFrameNum = 0; - peep->AnimationType = PeepAnimationType::Walking; + peep->AnimationType = PeepAnimationType::walking; peep->PeepFlags = 0; peep->FavouriteRide = RideId::GetNull(); peep->FavouriteRideRating = 0; @@ -7299,9 +7288,9 @@ Guest* Guest::Generate(const CoordsXYZ& coords) auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& spriteBounds = animObj->GetSpriteBounds(peep->AnimationGroup, peep->AnimationType); - peep->SpriteData.Width = spriteBounds.sprite_width; - peep->SpriteData.HeightMin = spriteBounds.sprite_height_negative; - peep->SpriteData.HeightMax = spriteBounds.sprite_height_positive; + peep->SpriteData.Width = spriteBounds.spriteWidth; + peep->SpriteData.HeightMin = spriteBounds.spriteHeightNegative; + peep->SpriteData.HeightMax = spriteBounds.spriteHeightPositive; peep->Orientation = 0; peep->MoveTo(coords); @@ -7634,9 +7623,9 @@ bool Guest::UpdateQueuePosition(PeepActionType previous_action) if (!IsActionWalking()) return true; - Action = PeepActionType::Idle; - NextAnimationType = PeepAnimationType::WatchRide; - if (previous_action != PeepActionType::Idle) + Action = PeepActionType::idle; + NextAnimationType = PeepAnimationType::watchRide; + if (previous_action != PeepActionType::idle) Invalidate(); return true; } @@ -7734,7 +7723,7 @@ static bool IsThoughtShopItemRelated(const PeepThoughtType type) void Guest::RemoveRideFromMemory(RideId rideId) { - if (State == PeepState::Watching) + if (State == PeepState::watching) { if (CurrentRide == rideId) { @@ -7748,41 +7737,41 @@ void Guest::RemoveRideFromMemory(RideId rideId) } // remove any free voucher for this ride from peep - if (HasItem(ShopItem::Voucher)) + if (HasItem(ShopItem::voucher)) { if (VoucherType == VOUCHER_TYPE_RIDE_FREE && VoucherRideId == rideId) { - RemoveItem(ShopItem::Voucher); + RemoveItem(ShopItem::voucher); } } // remove any photos of this ride from peep - if (HasItem(ShopItem::Photo)) + if (HasItem(ShopItem::photo)) { if (Photo1RideRef == rideId) { - RemoveItem(ShopItem::Photo); + RemoveItem(ShopItem::photo); } } - if (HasItem(ShopItem::Photo2)) + if (HasItem(ShopItem::photo2)) { if (Photo2RideRef == rideId) { - RemoveItem(ShopItem::Photo2); + RemoveItem(ShopItem::photo2); } } - if (HasItem(ShopItem::Photo3)) + if (HasItem(ShopItem::photo3)) { if (Photo3RideRef == rideId) { - RemoveItem(ShopItem::Photo3); + RemoveItem(ShopItem::photo3); } } - if (HasItem(ShopItem::Photo4)) + if (HasItem(ShopItem::photo4)) { if (Photo4RideRef == rideId) { - RemoveItem(ShopItem::Photo4); + RemoveItem(ShopItem::photo4); } } @@ -7835,7 +7824,7 @@ void Guest::ThrowUp() WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_2; const auto curLoc = GetLocation(); - Litter::Create({ curLoc, Orientation }, (Id.ToUnderlying() & 1) ? Litter::Type::VomitAlt : Litter::Type::Vomit); + Litter::Create({ curLoc, Orientation }, (Id.ToUnderlying() & 1) ? Litter::Type::vomitAlt : Litter::Type::vomit); static constexpr OpenRCT2::Audio::SoundId coughs[4] = { OpenRCT2::Audio::SoundId::cough1, diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index a2ff56f302..0257f0c93c 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -258,7 +258,7 @@ public: struct Guest : Peep { - static constexpr auto cEntityType = EntityType::Guest; + static constexpr auto cEntityType = EntityType::guest; public: uint8_t GuestNumRides; diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 7e6f50f51b..9eae8b4a07 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -20,7 +20,7 @@ using namespace OpenRCT2; template<> bool EntityBase::Is() const { - return Type == EntityType::Litter; + return Type == EntityType::litter; } static bool IsLocationLitterable(const CoordsXYZ& mapPos) @@ -64,7 +64,7 @@ void Litter::Create(const CoordsXYZD& litterPos, Type type) if (!IsLocationLitterable(offsetLitterPos)) return; - if (gameState.entities.GetEntityListCount(EntityType::Litter) >= 500) + if (gameState.entities.GetEntityListCount(EntityType::litter) >= 500) { Litter* newestLitter = nullptr; uint32_t newestLitterCreationTick = 0; diff --git a/src/openrct2/entity/Litter.h b/src/openrct2/entity/Litter.h index 62e888f058..41ed66823c 100644 --- a/src/openrct2/entity/Litter.h +++ b/src/openrct2/entity/Litter.h @@ -21,21 +21,21 @@ struct Litter : EntityBase { enum class Type : uint8_t { - Vomit, - VomitAlt, - EmptyCan, - Rubbish, - BurgerBox, - EmptyCup, - EmptyBox, - EmptyBottle, - EmptyBowlRed, - EmptyDrinkCarton, - EmptyJuiceCup, - EmptyBowlBlue, + vomit, + vomitAlt, + emptyCan, + rubbish, + burgerBox, + emptyCup, + emptyBox, + emptyBottle, + emptyBowlRed, + emptyDrinkCarton, + emptyJuiceCup, + emptyBowlBlue, }; - static constexpr auto cEntityType = EntityType::Litter; + static constexpr auto cEntityType = EntityType::litter; Type SubType; uint32_t creationTick; static void Create(const CoordsXYZD& litterPos, Type type); diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index 5cc63b25e5..d96e87ea49 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -36,7 +36,7 @@ static constexpr CoordsXY kMoneyEffectMoveOffset[] = { template<> bool EntityBase::Is() const { - return Type == EntityType::MoneyEffect; + return Type == EntityType::moneyEffect; } /** @@ -192,7 +192,7 @@ void MoneyEffect::Paint(PaintSession& session, int32_t imageDirection) const return; } - if (GuestPurchase && !Config::Get().general.ShowGuestPurchases) + if (GuestPurchase && !Config::Get().general.showGuestPurchases) { // Don't show the money effect for guest purchases when the option is disabled. return; diff --git a/src/openrct2/entity/MoneyEffect.h b/src/openrct2/entity/MoneyEffect.h index 7549f3e1fe..f98b7449f8 100644 --- a/src/openrct2/entity/MoneyEffect.h +++ b/src/openrct2/entity/MoneyEffect.h @@ -21,7 +21,7 @@ struct PaintSession; struct MoneyEffect : EntityBase { - static constexpr auto cEntityType = EntityType::MoneyEffect; + static constexpr auto cEntityType = EntityType::moneyEffect; uint16_t frame; uint16_t MoveDelay; diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index 0d6e43a53b..3ade9dd0c5 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -32,31 +32,31 @@ static constexpr uint32_t kVehicleCrashParticleSprites[kCrashedVehicleParticleNu template<> bool EntityBase::Is() const { - return Type == EntityType::SteamParticle; + return Type == EntityType::steamParticle; } template<> bool EntityBase::Is() const { - return Type == EntityType::ExplosionFlare; + return Type == EntityType::explosionFlare; } template<> bool EntityBase::Is() const { - return Type == EntityType::ExplosionCloud; + return Type == EntityType::explosionCloud; } template<> bool EntityBase::Is() const { - return Type == EntityType::CrashedVehicleParticle; + return Type == EntityType::crashedVehicleParticle; } template<> bool EntityBase::Is() const { - return Type == EntityType::CrashSplash; + return Type == EntityType::crashSplash; } void VehicleCrashParticle::SetSpriteData() diff --git a/src/openrct2/entity/Particle.h b/src/openrct2/entity/Particle.h index b4c2141c4f..1a80c84f9c 100644 --- a/src/openrct2/entity/Particle.h +++ b/src/openrct2/entity/Particle.h @@ -23,7 +23,7 @@ constexpr int32_t kCrashedVehicleParticleFrameIncrement = 85; // 1/3 of 256, rou struct VehicleCrashParticle : EntityBase { - static constexpr auto cEntityType = EntityType::CrashedVehicleParticle; + static constexpr auto cEntityType = EntityType::crashedVehicleParticle; uint16_t frame; uint16_t time_to_live; uint8_t colour[2]; @@ -44,7 +44,7 @@ struct VehicleCrashParticle : EntityBase struct CrashSplashParticle : EntityBase { - static constexpr auto cEntityType = EntityType::CrashSplash; + static constexpr auto cEntityType = EntityType::crashSplash; uint16_t frame; static void Create(const CoordsXYZ& splashPos); void Update(); @@ -54,7 +54,7 @@ struct CrashSplashParticle : EntityBase struct ExplosionFlare : EntityBase { - static constexpr auto cEntityType = EntityType::ExplosionFlare; + static constexpr auto cEntityType = EntityType::explosionFlare; uint16_t frame; static void Create(const CoordsXYZ& flarePos); void Update(); @@ -64,7 +64,7 @@ struct ExplosionFlare : EntityBase struct ExplosionCloud : EntityBase { - static constexpr auto cEntityType = EntityType::ExplosionCloud; + static constexpr auto cEntityType = EntityType::explosionCloud; uint16_t frame; static void Create(const CoordsXYZ& cloudPos); void Update(); @@ -74,7 +74,7 @@ struct ExplosionCloud : EntityBase struct SteamParticle : EntityBase { - static constexpr auto cEntityType = EntityType::SteamParticle; + static constexpr auto cEntityType = EntityType::steamParticle; uint16_t frame; uint16_t time_to_move; diff --git a/src/openrct2/entity/PatrolArea.cpp b/src/openrct2/entity/PatrolArea.cpp index 80eda98dac..0d4efcdaf9 100644 --- a/src/openrct2/entity/PatrolArea.cpp +++ b/src/openrct2/entity/PatrolArea.cpp @@ -18,7 +18,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Core; -static PatrolArea _consolidatedPatrolArea[EnumValue(StaffType::Count)]; +static PatrolArea _consolidatedPatrolArea[EnumValue(StaffType::count)]; static std::variant _patrolAreaToRender; static bool CompareTileCoordsXY(const TileCoordsXY& lhs, const TileCoordsXY& rhs) @@ -138,7 +138,7 @@ const PatrolArea& GetMergedPatrolArea(const StaffType type) void UpdateConsolidatedPatrolAreas() { - for (int32_t staffType = 0; staffType < EnumValue(StaffType::Count); ++staffType) + for (int32_t staffType = 0; staffType < EnumValue(StaffType::count); ++staffType) { // Reset all of the merged data for the type. auto& mergedArea = _consolidatedPatrolArea[staffType]; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 7fe3308b7c..4b34e64383 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -88,49 +88,49 @@ static std::shared_ptr _crowdSoundChannel = nullptr; static void GuestReleaseBalloon(Guest* peep, int16_t spawn_height); static PeepAnimationType PeepSpecialSpriteToAnimationGroupMap[] = { - PeepAnimationType::Walking, - PeepAnimationType::HoldMat, - PeepAnimationType::StaffMower, + PeepAnimationType::walking, + PeepAnimationType::holdMat, + PeepAnimationType::staffMower, }; static PeepAnimationType PeepActionToAnimationGroupMap[] = { - PeepAnimationType::CheckTime, - PeepAnimationType::EatFood, - PeepAnimationType::ShakeHead, - PeepAnimationType::EmptyPockets, - PeepAnimationType::SittingEatFood, - PeepAnimationType::SittingLookAroundLeft, - PeepAnimationType::SittingLookAroundRight, - PeepAnimationType::Wow, - PeepAnimationType::ThrowUp, - PeepAnimationType::Jump, - PeepAnimationType::StaffSweep, - PeepAnimationType::Drowning, - PeepAnimationType::StaffAnswerCall, - PeepAnimationType::StaffAnswerCall2, - PeepAnimationType::StaffCheckBoard, - PeepAnimationType::StaffFix, - PeepAnimationType::StaffFix2, - PeepAnimationType::StaffFixGround, - PeepAnimationType::StaffFix3, - PeepAnimationType::StaffWatering, - PeepAnimationType::Joy, - PeepAnimationType::ReadMap, - PeepAnimationType::Wave, - PeepAnimationType::StaffEmptyBin, - PeepAnimationType::Wave2, - PeepAnimationType::TakePhoto, - PeepAnimationType::Clap, - PeepAnimationType::Disgust, - PeepAnimationType::DrawPicture, - PeepAnimationType::BeingWatched, - PeepAnimationType::WithdrawMoney, + PeepAnimationType::checkTime, + PeepAnimationType::eatFood, + PeepAnimationType::shakeHead, + PeepAnimationType::emptyPockets, + PeepAnimationType::sittingEatFood, + PeepAnimationType::sittingLookAroundLeft, + PeepAnimationType::sittingLookAroundRight, + PeepAnimationType::wow, + PeepAnimationType::throwUp, + PeepAnimationType::jump, + PeepAnimationType::staffSweep, + PeepAnimationType::drowning, + PeepAnimationType::staffAnswerCall, + PeepAnimationType::staffAnswerCall2, + PeepAnimationType::staffCheckBoard, + PeepAnimationType::staffFix, + PeepAnimationType::staffFix2, + PeepAnimationType::staffFixGround, + PeepAnimationType::staffFix3, + PeepAnimationType::staffWatering, + PeepAnimationType::joy, + PeepAnimationType::readMap, + PeepAnimationType::wave, + PeepAnimationType::staffEmptyBin, + PeepAnimationType::wave2, + PeepAnimationType::takePhoto, + PeepAnimationType::clap, + PeepAnimationType::disgust, + PeepAnimationType::drawPicture, + PeepAnimationType::beingWatched, + PeepAnimationType::withdrawMoney, }; template<> bool EntityBase::Is() const { - return Type == EntityType::Guest || Type == EntityType::Staff; + return Type == EntityType::guest || Type == EntityType::staff; } uint8_t Peep::GetNextDirection() const @@ -159,31 +159,31 @@ bool Peep::CanBePickedUp() const { switch (State) { - case PeepState::One: - case PeepState::QueuingFront: - case PeepState::OnRide: - case PeepState::EnteringRide: - case PeepState::LeavingRide: - case PeepState::EnteringPark: - case PeepState::LeavingPark: - case PeepState::Fixing: - case PeepState::Buying: - case PeepState::Inspecting: + case PeepState::one: + case PeepState::queuingFront: + case PeepState::onRide: + case PeepState::enteringRide: + case PeepState::leavingRide: + case PeepState::enteringPark: + case PeepState::leavingPark: + case PeepState::fixing: + case PeepState::buying: + case PeepState::inspecting: return false; - case PeepState::Falling: - case PeepState::Walking: - case PeepState::Queuing: - case PeepState::Sitting: - case PeepState::Picked: - case PeepState::Patrolling: - case PeepState::Mowing: - case PeepState::Sweeping: - case PeepState::Answering: - case PeepState::Watching: - case PeepState::EmptyingBin: - case PeepState::UsingBin: - case PeepState::Watering: - case PeepState::HeadingToInspection: + case PeepState::falling: + case PeepState::walking: + case PeepState::queuing: + case PeepState::sitting: + case PeepState::picked: + case PeepState::patrolling: + case PeepState::mowing: + case PeepState::sweeping: + case PeepState::answering: + case PeepState::watching: + case PeepState::emptyingBin: + case PeepState::usingBin: + case PeepState::watering: + case PeepState::headingToInspection: return true; } return false; @@ -191,7 +191,7 @@ bool Peep::CanBePickedUp() const int32_t PeepGetStaffCount() { - return getGameState().entities.GetEntityListCount(EntityType::Staff); + return getGameState().entities.GetEntityListCount(EntityType::staff); } /** @@ -220,7 +220,7 @@ void PeepUpdateAll() } // 128 tick can delete so double check its not deleted - if (peep->Type == EntityType::Guest) + if (peep->Type == EntityType::guest) { peep->Update(); } @@ -236,7 +236,7 @@ void PeepUpdateAll() } // 128 tick can delete so double check its not deleted - if (staff->Type == EntityType::Staff) + if (staff->Type == EntityType::staff) { staff->Update(); } @@ -298,7 +298,7 @@ bool Peep::CheckForPath() } while (!(tile_element++)->IsLastForTile()); // Found no suitable path - SetState(PeepState::Falling); + SetState(PeepState::falling); return false; } @@ -340,7 +340,7 @@ bool Peep::IsOnPathBlockedByVehicle() const PeepAnimationType Peep::GetAnimationType() { if (IsActionInterruptable()) - { // PeepActionType::None1 or PeepActionType::None2 + { // PeepActionType::none1 or PeepActionType::none2 return PeepSpecialSpriteToAnimationGroupMap[SpecialSprite]; } @@ -350,9 +350,9 @@ PeepAnimationType Peep::GetAnimationType() } Guard::Assert( - EnumValue(Action) >= std::size(PeepActionToAnimationGroupMap) && Action < PeepActionType::Idle, + EnumValue(Action) >= std::size(PeepActionToAnimationGroupMap) && Action < PeepActionType::idle, "Invalid peep action %u", EnumValue(Action)); - return PeepAnimationType::Walking; + return PeepAnimationType::walking; } /* @@ -379,9 +379,9 @@ void Peep::UpdateSpriteBoundingBox() auto* animObj = objManager.GetLoadedObject(AnimationObjectIndex); const auto& spriteBounds = animObj->GetSpriteBounds(AnimationGroup, AnimationType); - SpriteData.Width = spriteBounds.sprite_width; - SpriteData.HeightMin = spriteBounds.sprite_height_negative; - SpriteData.HeightMax = spriteBounds.sprite_height_positive; + SpriteData.Width = spriteBounds.spriteWidth; + SpriteData.HeightMin = spriteBounds.spriteHeightNegative; + SpriteData.HeightMax = spriteBounds.spriteHeightPositive; } /* rct2: 0x00693BE5 */ @@ -401,7 +401,7 @@ void Peep::SwitchToSpecialSprite(uint8_t special_sprite_id) void Peep::StateReset() { - SetState(PeepState::One); + SetState(PeepState::one); SwitchToSpecialSprite(0); } @@ -432,9 +432,9 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) PROFILED_FUNCTION(); _backupAnimationImageIdOffset = AnimationImageIdOffset; - if (Action == PeepActionType::Idle) + if (Action == PeepActionType::idle) { - Action = PeepActionType::Walking; + Action = PeepActionType::walking; } CoordsXY differenceLoc = GetLocation(); @@ -454,7 +454,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) if (!UpdateActionAnimation()) { AnimationImageIdOffset = 0; - Action = PeepActionType::Walking; + Action = PeepActionType::walking; UpdateCurrentAnimationType(); return { { x, y } }; } @@ -462,7 +462,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) // Should we throw up, and are we at the frame where sick appears? if (auto* guest = As(); guest != nullptr) { - if (Action == PeepActionType::ThrowUp && AnimationFrameNum == 15) + if (Action == PeepActionType::throwUp && AnimationFrameNum == 15) { guest->ThrowUp(); } @@ -480,12 +480,12 @@ bool Peep::UpdateActionAnimation() AnimationFrameNum++; // If last frame of action - if (AnimationFrameNum >= peepAnimation.frame_offsets.size()) + if (AnimationFrameNum >= peepAnimation.frameOffsets.size()) { return false; } - AnimationImageIdOffset = peepAnimation.frame_offsets[AnimationFrameNum]; + AnimationImageIdOffset = peepAnimation.frameOffsets[AnimationFrameNum]; return true; } @@ -539,11 +539,11 @@ void Peep::UpdateWalkingAnimation() WalkingAnimationFrameNum++; const PeepAnimation& peepAnimation = animObj->GetPeepAnimation(AnimationGroup, AnimationType); - if (WalkingAnimationFrameNum >= peepAnimation.frame_offsets.size()) + if (WalkingAnimationFrameNum >= peepAnimation.frameOffsets.size()) { WalkingAnimationFrameNum = 0; } - AnimationImageIdOffset = peepAnimation.frame_offsets[WalkingAnimationFrameNum]; + AnimationImageIdOffset = peepAnimation.frameOffsets[WalkingAnimationFrameNum]; } /** @@ -552,7 +552,7 @@ void Peep::UpdateWalkingAnimation() */ void PeepDecrementNumRiders(Peep* peep) { - if (peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide) + if (peep->State == PeepState::onRide || peep->State == PeepState::enteringRide) { auto ride = GetRide(peep->CurrentRide); if (ride != nullptr) @@ -577,7 +577,7 @@ void PeepWindowStateUpdate(Peep* peep) if (peep->Is()) { - if (peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide) + if (peep->State == PeepState::onRide || peep->State == PeepState::enteringRide) { auto ride = GetRide(peep->CurrentRide); if (ride != nullptr) @@ -604,24 +604,24 @@ void Peep::Pickup() guest->RemoveFromRide(); } MoveTo({ kLocationNull, y, z }); - SetState(PeepState::Picked); + SetState(PeepState::picked); SubState = 0; } void Peep::PickupAbort(int32_t old_x) { - if (State != PeepState::Picked) + if (State != PeepState::picked) return; MoveTo({ old_x, y, z + 8 }); if (x != kLocationNull) { - SetState(PeepState::Falling); - Action = PeepActionType::Walking; + SetState(PeepState::falling); + Action = PeepActionType::walking; SpecialSprite = 0; AnimationImageIdOffset = 0; - AnimationType = PeepAnimationType::Walking; + AnimationType = PeepAnimationType::walking; PathCheckOptimisation = 0; } @@ -666,16 +666,16 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) if (apply) { MoveTo(destination); - SetState(PeepState::Falling); - Action = PeepActionType::Walking; + SetState(PeepState::falling); + Action = PeepActionType::walking; SpecialSprite = 0; AnimationImageIdOffset = 0; - AnimationType = PeepAnimationType::Walking; + AnimationType = PeepAnimationType::walking; PathCheckOptimisation = 0; EntityTweener::Get().Reset(); if (auto* guest = As(); guest != nullptr) { - AnimationType = PeepAnimationType::Invalid; + AnimationType = PeepAnimationType::invalid; guest->HappinessTarget = std::max(guest->HappinessTarget - 10, 0); UpdateCurrentAnimationType(); } @@ -735,7 +735,7 @@ void Peep::Remove() auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); ContextBroadcastIntent(&intent); } - if (State == PeepState::EnteringPark) + if (State == PeepState::enteringPark) { DecrementGuestsHeadingForPark(); } @@ -749,15 +749,15 @@ void Peep::Remove() */ void Peep::UpdateFalling() { - if (Action == PeepActionType::Drowning) + if (Action == PeepActionType::drowning) { // Check to see if we are ready to drown. UpdateAction(); Invalidate(); - if (Action == PeepActionType::Drowning) + if (Action == PeepActionType::drowning) return; - if (Config::Get().notifications.GuestDied) + if (Config::Get().notifications.guestDied) { auto ft = Formatter(); FormatNameTo(ft); @@ -812,7 +812,7 @@ void Peep::UpdateFalling() guest->InsertNewThought(PeepThoughtType::Drowning); } - Action = PeepActionType::Drowning; + Action = PeepActionType::drowning; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -857,7 +857,7 @@ void Peep::UpdateFalling() { SetNextFlags(saved_map->AsPath()->GetSlopeDirection(), saved_map->AsPath()->IsSloped(), false); } - SetState(PeepState::One); + SetState(PeepState::one); } /** @@ -871,11 +871,11 @@ void Peep::Update1() if (Is()) { - SetState(PeepState::Walking); + SetState(PeepState::walking); } else { - SetState(PeepState::Patrolling); + SetState(PeepState::patrolling); } SetDestination(GetLocation(), 10); @@ -908,14 +908,14 @@ void Peep::UpdatePicked() uint32_t Peep::GetStepsToTake() const { uint32_t stepsToTake = Energy; - if (stepsToTake < 95 && State == PeepState::Queuing) + if (stepsToTake < 95 && State == PeepState::queuing) stepsToTake = 95; - if ((PeepFlags & PEEP_FLAGS_SLOW_WALK) && State != PeepState::Queuing) + if ((PeepFlags & PEEP_FLAGS_SLOW_WALK) && State != PeepState::queuing) stepsToTake /= 2; if (IsActionWalking() && GetNextIsSloped()) { stepsToTake /= 2; - if (State == PeepState::Queuing) + if (State == PeepState::queuing) stepsToTake += stepsToTake / 2; } // Ensure guests make it across a level crossing in time @@ -948,7 +948,7 @@ void PeepProblemWarningsUpdate() if (peep->OutsideOfPark) continue; - if (peep->State == PeepState::Queuing || peep->State == PeepState::QueuingFront) + if (peep->State == PeepState::queuing || peep->State == PeepState::queuingFront) inQueueCounter++; if (peep->Thoughts[0].freshness > 5) @@ -1020,7 +1020,7 @@ void PeepProblemWarningsUpdate() else if (hungerCounter >= kPeepHungerWarningThreshold && hungerCounter >= gameState.park.numGuestsInPark / 16) { warningThrottle[0] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Hungry); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_ARE_HUNGRY, thoughtId, {}); @@ -1032,7 +1032,7 @@ void PeepProblemWarningsUpdate() else if (thirstCounter >= kPeepThirstWarningThreshold && thirstCounter >= gameState.park.numGuestsInPark / 16) { warningThrottle[1] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Thirsty); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_ARE_THIRSTY, thoughtId, {}); @@ -1044,7 +1044,7 @@ void PeepProblemWarningsUpdate() else if (toiletCounter >= kPeepToiletWarningThreshold && toiletCounter >= gameState.park.numGuestsInPark / 16) { warningThrottle[2] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Toilet); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_CANT_FIND_TOILET, thoughtId, {}); @@ -1056,7 +1056,7 @@ void PeepProblemWarningsUpdate() else if (litterCounter >= kPeepLitterWarningThreshold && litterCounter >= gameState.park.numGuestsInPark / 32) { warningThrottle[3] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::BadLitter); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_DISLIKE_LITTER, thoughtId, {}); @@ -1068,7 +1068,7 @@ void PeepProblemWarningsUpdate() else if (disgustCounter >= kPeepDisgustWarningThreshold && disgustCounter >= gameState.park.numGuestsInPark / 32) { warningThrottle[4] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::PathDisgusting); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_DISGUSTED_BY_PATHS, thoughtId, {}); @@ -1080,7 +1080,7 @@ void PeepProblemWarningsUpdate() else if (vandalismCounter >= kPeepVandalismWarningThreshold && vandalismCounter >= gameState.park.numGuestsInPark / 32) { warningThrottle[5] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Vandalism); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_DISLIKE_VANDALISM, thoughtId, {}); @@ -1092,7 +1092,7 @@ void PeepProblemWarningsUpdate() else if (noexitCounter >= kPeepNoExitWarningThreshold) { warningThrottle[6] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::CantFindExit); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_GETTING_LOST_OR_STUCK, thoughtId, {}); @@ -1101,7 +1101,7 @@ void PeepProblemWarningsUpdate() else if (lostCounter >= kPeepLostWarningThreshold) { warningThrottle[6] = 4; - if (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Lost); News::AddItemToQueue(News::ItemType::peeps, STR_PEEPS_GETTING_LOST_OR_STUCK, thoughtId, {}); @@ -1114,7 +1114,7 @@ void PeepProblemWarningsUpdate() { // 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 (Config::Get().notifications.GuestWarnings) + if (Config::Get().notifications.guestWarnings) { auto rideWithMostQueueComplaints = std::max_element( queueComplainingGuestsMap.begin(), queueComplainingGuestsMap.end(), @@ -1145,7 +1145,7 @@ void PeepUpdateCrowdNoise() if (OpenRCT2::Audio::gGameSoundsOff) return; - if (!Config::Get().sound.SoundEnabled) + if (!Config::Get().sound.soundEnabled) return; if (gLegacyScene == LegacyScene::scenarioEditor) @@ -1171,7 +1171,7 @@ void PeepUpdateCrowdNoise() if (viewport->viewPos.y + viewport->ViewHeight() < peep->SpriteData.SpriteRect.GetTop()) continue; - visiblePeeps += peep->State == PeepState::Queuing ? 1 : 2; + visiblePeeps += peep->State == PeepState::queuing ? 1 : 2; } // This function doesn't account for the fact that the screen might be so big that 100 peeps could potentially be very @@ -1229,9 +1229,9 @@ void PeepApplause() GuestReleaseBalloon(peep, peep->z + 9); // Clap - if ((peep->State == PeepState::Walking || peep->State == PeepState::Queuing) && peep->IsActionInterruptable()) + if ((peep->State == PeepState::walking || peep->State == PeepState::queuing) && peep->IsActionInterruptableSafely()) { - peep->Action = PeepActionType::Clap; + peep->Action = PeepActionType::clap; peep->AnimationFrameNum = 0; peep->AnimationImageIdOffset = 0; peep->UpdateCurrentAnimationType(); @@ -1250,7 +1250,7 @@ void PeepUpdateDaysInQueue() { for (auto peep : EntityList()) { - if (!peep->OutsideOfPark && peep->State == PeepState::Queuing) + if (!peep->OutsideOfPark && peep->State == PeepState::queuing) { if (peep->DaysInQueue < 255) { @@ -1264,15 +1264,15 @@ void Peep::FormatActionTo(Formatter& ft) const { switch (State) { - case PeepState::Falling: - ft.Add(Action == PeepActionType::Drowning ? STR_DROWNING : STR_WALKING); + case PeepState::falling: + ft.Add(Action == PeepActionType::drowning ? STR_DROWNING : STR_WALKING); break; - case PeepState::One: + case PeepState::one: ft.Add(STR_WALKING); break; - case PeepState::OnRide: - case PeepState::LeavingRide: - case PeepState::EnteringRide: + case PeepState::onRide: + case PeepState::leavingRide: + case PeepState::enteringRide: { auto ride = GetRide(CurrentRide); if (ride != nullptr) @@ -1286,7 +1286,7 @@ void Peep::FormatActionTo(Formatter& ft) const } break; } - case PeepState::Buying: + case PeepState::buying: { ft.Add(STR_AT_RIDE); auto ride = GetRide(CurrentRide); @@ -1300,8 +1300,8 @@ void Peep::FormatActionTo(Formatter& ft) const } break; } - case PeepState::Walking: - case PeepState::UsingBin: + case PeepState::walking: + case PeepState::usingBin: { if (auto* guest = As(); guest != nullptr) { @@ -1321,8 +1321,8 @@ void Peep::FormatActionTo(Formatter& ft) const } break; } - case PeepState::QueuingFront: - case PeepState::Queuing: + case PeepState::queuingFront: + case PeepState::queuing: { auto ride = GetRide(CurrentRide); if (ride != nullptr) @@ -1332,10 +1332,10 @@ void Peep::FormatActionTo(Formatter& ft) const } break; } - case PeepState::Sitting: + case PeepState::sitting: ft.Add(STR_SITTING); break; - case PeepState::Watching: + case PeepState::watching: if (!CurrentRide.IsNull()) { auto ride = GetRide(CurrentRide); @@ -1350,27 +1350,27 @@ void Peep::FormatActionTo(Formatter& ft) const ft.Add((StandingFlags & 0x1) ? STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED : STR_LOOKING_AT_SCENERY); } break; - case PeepState::Picked: + case PeepState::picked: ft.Add(STR_SELECT_LOCATION); break; - case PeepState::Patrolling: - case PeepState::EnteringPark: - case PeepState::LeavingPark: + case PeepState::patrolling: + case PeepState::enteringPark: + case PeepState::leavingPark: ft.Add(STR_WALKING); break; - case PeepState::Mowing: + case PeepState::mowing: ft.Add(STR_MOWING_GRASS); break; - case PeepState::Sweeping: + case PeepState::sweeping: ft.Add(STR_SWEEPING_FOOTPATH); break; - case PeepState::Watering: + case PeepState::watering: ft.Add(STR_WATERING_GARDENS); break; - case PeepState::EmptyingBin: + case PeepState::emptyingBin: ft.Add(STR_EMPTYING_LITTER_BIN); break; - case PeepState::Answering: + case PeepState::answering: if (SubState == 0) { ft.Add(STR_WALKING); @@ -1393,7 +1393,7 @@ void Peep::FormatActionTo(Formatter& ft) const } } break; - case PeepState::Fixing: + case PeepState::fixing: { ft.Add(STR_FIXING_RIDE); auto ride = GetRide(CurrentRide); @@ -1407,7 +1407,7 @@ void Peep::FormatActionTo(Formatter& ft) const } break; } - case PeepState::HeadingToInspection: + case PeepState::headingToInspection: { ft.Add(STR_HEADING_TO_RIDE_FOR_INSPECTION); auto ride = GetRide(CurrentRide); @@ -1421,7 +1421,7 @@ void Peep::FormatActionTo(Formatter& ft) const } break; } - case PeepState::Inspecting: + case PeepState::inspecting: { ft.Add(STR_INSPECTING_RIDE); auto ride = GetRide(CurrentRide); @@ -1520,12 +1520,12 @@ bool Peep::SetName(std::string_view value) bool Peep::IsActionWalking() const { - return Action == PeepActionType::Walking; + return Action == PeepActionType::walking; } bool Peep::IsActionIdle() const { - return Action == PeepActionType::Idle; + return Action == PeepActionType::idle; } bool Peep::IsActionInterruptable() const @@ -1533,6 +1533,15 @@ bool Peep::IsActionInterruptable() const return IsActionIdle() || IsActionWalking(); } +/** + * Used to avoid peep action and animation triggers that cause them to stop moving and might put them at risk + * of getting run over at level crossings, such as guests reading the map and entertainers performing. + */ +bool Peep::IsActionInterruptableSafely() const +{ + return IsActionInterruptable() && !IsOnLevelCrossing(); +} + void PeepSetMapTooltip(Peep* peep) { auto ft = Formatter(); @@ -1570,9 +1579,9 @@ void Peep::SwitchNextAnimationType() auto* animObj = objManager.GetLoadedObject(AnimationObjectIndex); const auto& spriteBounds = animObj->GetSpriteBounds(AnimationGroup, NextAnimationType); - SpriteData.Width = spriteBounds.sprite_width; - SpriteData.HeightMin = spriteBounds.sprite_height_negative; - SpriteData.HeightMax = spriteBounds.sprite_height_positive; + SpriteData.Width = spriteBounds.spriteWidth; + SpriteData.HeightMin = spriteBounds.spriteHeightNegative; + SpriteData.HeightMax = spriteBounds.spriteHeightPositive; Invalidate(); } } @@ -1602,7 +1611,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ { // If an entrance or exit that doesn't belong to the ride we are queuing for ignore the entrance/exit // This can happen when paths clip through entrance/exits - if (peep->State == PeepState::Queuing && peep->CurrentRide != rideIndex) + if (peep->State == PeepState::queuing && peep->CurrentRide != rideIndex) { return false; } @@ -1646,10 +1655,10 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ return true; } - if (guest->State == PeepState::Queuing) + if (guest->State == PeepState::queuing) { // Guest is in the ride queue. - guest->RideSubState = PeepRideSubState::AtQueueFront; + guest->RideSubState = PeepRideSubState::atQueueFront; guest->AnimationImageIdOffset = _backupAnimationImageIdOffset; return true; } @@ -1692,15 +1701,15 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ guest->CurrentRide = rideIndex; guest->CurrentRideStation = stationNum; guest->DaysInQueue = 0; - guest->SetState(PeepState::Queuing); - guest->RideSubState = PeepRideSubState::AtQueueFront; + guest->SetState(PeepState::queuing); + guest->RideSubState = PeepRideSubState::atQueueFront; guest->TimeInQueue = 0; if (guest->PeepFlags & PEEP_FLAGS_TRACKING) { auto ft = Formatter(); guest->FormatNameTo(ft); ride->formatNameTo(ft); - if (Config::Get().notifications.GuestQueuingForRide) + if (Config::Get().notifications.guestQueuingForRide) { News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_PEEP_JOINED_QUEUE_FOR_X, guest->Id, ft); } @@ -1735,7 +1744,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ } // Peep is leaving the park. - if (guest->State != PeepState::Walking) + if (guest->State != PeepState::walking) { PeepReturnToCentreOfTile(guest); return true; @@ -1754,14 +1763,14 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ auto destination = guest->GetDestination() + CoordsDirectionDelta[guest->PeepDirection]; guest->SetDestination(destination, 9); guest->MoveTo({ coords, guest->z }); - guest->SetState(PeepState::LeavingPark); + guest->SetState(PeepState::leavingPark); guest->Var37 = 0; if (guest->PeepFlags & PEEP_FLAGS_TRACKING) { auto ft = Formatter(); guest->FormatNameTo(ft); - if (Config::Get().notifications.GuestLeftPark) + if (Config::Get().notifications.guestLeftPark) { News::AddItemToQueue(News::ItemType::peepOnRide, STR_PEEP_TRACKING_LEFT_PARK, guest->Id, ft); } @@ -1771,7 +1780,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ // Peep is entering the park. - if (guest->State != PeepState::EnteringPark) + if (guest->State != PeepState::enteringPark) { PeepReturnToCentreOfTile(guest); return true; @@ -1779,7 +1788,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ if (!(gameState.park.flags & PARK_FLAGS_PARK_OPEN)) { - guest->State = PeepState::LeavingPark; + guest->State = PeepState::leavingPark; guest->Var37 = 1; DecrementGuestsHeadingForPark(); PeepWindowStateUpdate(guest); @@ -1842,7 +1851,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ if (!found) { - guest->State = PeepState::LeavingPark; + guest->State = PeepState::leavingPark; guest->Var37 = 1; DecrementGuestsHeadingForPark(); PeepWindowStateUpdate(guest); @@ -1853,24 +1862,24 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ auto entranceFee = Park::GetEntranceFee(); if (entranceFee != 0) { - if (guest->HasItem(ShopItem::Voucher)) + if (guest->HasItem(ShopItem::voucher)) { if (guest->VoucherType == VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE) { entranceFee /= 2; - guest->RemoveItem(ShopItem::Voucher); + guest->RemoveItem(ShopItem::voucher); guest->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; } else if (guest->VoucherType == VOUCHER_TYPE_PARK_ENTRY_FREE) { entranceFee = 0; - guest->RemoveItem(ShopItem::Voucher); + guest->RemoveItem(ShopItem::voucher); guest->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; } } if (entranceFee > guest->CashInPocket) { - guest->State = PeepState::LeavingPark; + guest->State = PeepState::leavingPark; guest->Var37 = 1; DecrementGuestsHeadingForPark(); PeepWindowStateUpdate(guest); @@ -1971,7 +1980,7 @@ static void PeepFootpathMoveForward(Peep* peep, const CoordsXYE& coords, bool va if (const auto* otherPeep = otherEnt->As(); otherPeep != nullptr) { - if (otherPeep->State != PeepState::Walking) + if (otherPeep->State != PeepState::walking) continue; crowdCount++; @@ -1980,7 +1989,7 @@ static void PeepFootpathMoveForward(Peep* peep, const CoordsXYE& coords, bool va if (const auto* litter = otherEnt->As(); litter != nullptr) { - if (litter->SubType != Litter::Type::Vomit && litter->SubType != Litter::Type::VomitAlt) + if (litter->SubType != Litter::Type::vomit && litter->SubType != Litter::Type::vomitAlt) { litterCount++; } @@ -1991,7 +2000,7 @@ static void PeepFootpathMoveForward(Peep* peep, const CoordsXYE& coords, bool va } } - if (crowdCount >= kThresholdCrowdCount && guest->State == PeepState::Walking && (ScenarioRand() & 0xFFFF) <= 21845) + if (crowdCount >= kThresholdCrowdCount && guest->State == PeepState::walking && (ScenarioRand() & 0xFFFF) <= 21845) { guest->InsertNewThought(PeepThoughtType::Crowded); guest->HappinessTarget = std::max(0, guest->HappinessTarget - 14); @@ -2093,7 +2102,7 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords) if (guest != nullptr && pathElement->IsQueue()) { auto rideIndex = pathElement->GetRideIndex(); - if (guest->State == PeepState::Queuing) + if (guest->State == PeepState::queuing) { // Check if this queue is connected to the ride the // peep is queuing for, i.e. the player hasn't edited @@ -2107,7 +2116,7 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords) // Queue got disconnected from the original ride. guest->InteractionRideIndex = RideId::GetNull(); guest->RemoveFromQueue(); - guest->SetState(PeepState::One); + guest->SetState(PeepState::one); PeepFootpathMoveForward(guest, coords, vandalismPresent); } } @@ -2140,11 +2149,11 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords) PeepDecrementNumRiders(guest); guest->CurrentRide = rideIndex; guest->CurrentRideStation = stationNum; - guest->State = PeepState::Queuing; + guest->State = PeepState::queuing; guest->DaysInQueue = 0; PeepWindowStateUpdate(guest); - guest->RideSubState = PeepRideSubState::InQueue; + guest->RideSubState = PeepRideSubState::inQueue; guest->DestinationTolerance = 2; guest->TimeInQueue = 0; if (guest->PeepFlags & PEEP_FLAGS_TRACKING) @@ -2152,7 +2161,7 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords) auto ft = Formatter(); guest->FormatNameTo(ft); ride->formatNameTo(ft); - if (Config::Get().notifications.GuestQueuingForRide) + if (Config::Get().notifications.guestQueuingForRide) { News::AddItemToQueue( News::ItemType::peepOnRide, STR_PEEP_TRACKING_PEEP_JOINED_QUEUE_FOR_X, guest->Id, ft); @@ -2183,10 +2192,10 @@ static void PeepInteractWithPath(Peep* peep, const CoordsXYE& coords) else { peep->InteractionRideIndex = RideId::GetNull(); - if (guest != nullptr && peep->State == PeepState::Queuing) + if (guest != nullptr && peep->State == PeepState::queuing) { guest->RemoveFromQueue(); - guest->SetState(PeepState::One); + guest->SetState(PeepState::one); } PeepFootpathMoveForward(peep, coords, vandalismPresent); } @@ -2212,7 +2221,7 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) // If we are queuing ignore the 'shop' // This can happen when paths clip through track - if (guest->State == PeepState::Queuing) + if (guest->State == PeepState::queuing) { return false; } @@ -2257,8 +2266,8 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) auto coordsCentre = coords.ToTileCentre(); guest->SetDestination(coordsCentre, 3); guest->CurrentRide = rideIndex; - guest->SetState(PeepState::EnteringRide); - guest->RideSubState = PeepRideSubState::ApproachShop; + guest->SetState(PeepState::enteringRide); + guest->RideSubState = PeepRideSubState::approachShop; guest->GuestTimeOnRide = 0; ride->curNumCustomers++; @@ -2270,7 +2279,7 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) StringId string_id = ride->getRideTypeDescriptor().HasFlag(RtdFlag::describeAsInside) ? STR_PEEP_TRACKING_PEEP_IS_IN_X : STR_PEEP_TRACKING_PEEP_IS_ON_X; - if (Config::Get().notifications.GuestUsedFacility) + if (Config::Get().notifications.guestUsedFacility) { News::AddItemToQueue(News::ItemType::peepOnRide, string_id, guest->Id, ft); } @@ -2281,7 +2290,7 @@ static bool PeepInteractWithShop(Peep* peep, const CoordsXYE& coords) if (guest->GuestHeadingToRideId == rideIndex) guest->GuestHeadingToRideId = RideId::GetNull(); guest->AnimationImageIdOffset = _backupAnimationImageIdOffset; - guest->SetState(PeepState::Buying); + guest->SetState(PeepState::buying); guest->CurrentRide = rideIndex; guest->SubState = 0; } @@ -2300,11 +2309,11 @@ std::pair Peep::PerformNextAction() PeepActionType previousAction = Action; - if (Action == PeepActionType::Idle) - Action = PeepActionType::Walking; + if (Action == PeepActionType::idle) + Action = PeepActionType::walking; auto* guest = As(); - if (State == PeepState::Queuing && guest != nullptr) + if (State == PeepState::queuing && guest != nullptr) { if (guest->UpdateQueuePosition(previousAction)) { @@ -2402,10 +2411,10 @@ std::pair Peep::PerformNextAction() if (height <= 3 || (Is() && height <= 32)) { InteractionRideIndex = RideId::GetNull(); - if (guest != nullptr && State == PeepState::Queuing) + if (guest != nullptr && State == PeepState::queuing) { guest->RemoveFromQueue(); - SetState(PeepState::One); + SetState(PeepState::one); } if (!MapIsLocationInPark(newLoc)) @@ -2547,12 +2556,12 @@ void PeepUpdateNames() auto& gameState = getGameState(); auto& config = Config::Get().general; - if (config.ShowRealNamesOfGuests) + if (config.showRealNamesOfGuests) gameState.park.flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; else gameState.park.flags &= ~PARK_FLAGS_SHOW_REAL_GUEST_NAMES; - if (config.ShowRealNamesOfStaff) + if (config.showRealNamesOfStaff) gameState.park.flags |= PARK_FLAGS_SHOW_REAL_STAFF_NAMES; else gameState.park.flags &= ~PARK_FLAGS_SHOW_REAL_STAFF_NAMES; @@ -2617,11 +2626,11 @@ void DecrementGuestsHeadingForPark() static void GuestReleaseBalloon(Guest* peep, int16_t spawn_height) { - if (peep->HasItem(ShopItem::Balloon)) + if (peep->HasItem(ShopItem::balloon)) { - peep->RemoveItem(ShopItem::Balloon); + peep->RemoveItem(ShopItem::balloon); - if (peep->AnimationGroup == PeepAnimationGroup::Balloon && peep->x != kLocationNull) + if (peep->AnimationGroup == PeepAnimationGroup::balloon && peep->x != kLocationNull) { Balloon::Create({ peep->x, peep->y, spawn_height }, peep->BalloonColour, false); peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; @@ -2637,7 +2646,7 @@ static void GuestReleaseBalloon(Guest* peep, int16_t spawn_height) void Peep::RemoveFromRide() { auto* guest = As(); - if (guest != nullptr && State == PeepState::Queuing) + if (guest != nullptr && State == PeepState::queuing) { guest->RemoveFromQueue(); } @@ -2744,7 +2753,7 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const PeepAnimationType actionAnimationGroup = AnimationType; uint8_t imageOffset = AnimationImageIdOffset; - if (Action == PeepActionType::Idle) + if (Action == PeepActionType::idle) { actionAnimationGroup = NextAnimationType; imageOffset = 0; @@ -2753,10 +2762,10 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(AnimationObjectIndex); - uint32_t baseImageId = animObj->GetPeepAnimation(AnimationGroup, actionAnimationGroup).base_image; + uint32_t baseImageId = animObj->GetPeepAnimation(AnimationGroup, actionAnimationGroup).baseImage; // Offset frame onto the base image, using rotation except for the 'picked up' state - if (actionAnimationGroup != PeepAnimationType::Hanging) + if (actionAnimationGroup != PeepAnimationType::hanging) baseImageId += (imageDirection >> 3) + imageOffset * 4; else baseImageId += imageOffset; @@ -2774,18 +2783,18 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const return; // Can't display any accessories whilst drowning or clapping - if (Action == PeepActionType::Drowning || Action == PeepActionType::Clap) + if (Action == PeepActionType::drowning || Action == PeepActionType::clap) return; // There are only 6 walking frames available for each item, // as well as 1 sprite for sitting and 1 for standing still. auto itemFrame = imageOffset % 6; - if (actionAnimationGroup == PeepAnimationType::WatchRide) + if (actionAnimationGroup == PeepAnimationType::watchRide) itemFrame = 6; - else if (actionAnimationGroup == PeepAnimationType::SittingIdle) + else if (actionAnimationGroup == PeepAnimationType::sittingIdle) itemFrame = 7; - if (AnimationGroup == PeepAnimationGroup::Hat) + if (AnimationGroup == PeepAnimationGroup::hat) { auto itemOffset = kPeepSpriteHatItemStart; imageId = ImageId(itemOffset + (imageDirection >> 3) + itemFrame * 4, guest->HatColour); @@ -2793,7 +2802,7 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const return; } - if (AnimationGroup == PeepAnimationGroup::Balloon) + if (AnimationGroup == PeepAnimationGroup::balloon) { auto itemOffset = kPeepSpriteBalloonItemStart; imageId = ImageId(itemOffset + (imageDirection >> 3) + itemFrame * 4, guest->BalloonColour); @@ -2801,7 +2810,7 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const return; } - if (AnimationGroup == PeepAnimationGroup::Umbrella) + if (AnimationGroup == PeepAnimationGroup::umbrella) { auto itemOffset = kPeepSpriteUmbrellaItemStart; imageId = ImageId(itemOffset + (imageDirection >> 3) + itemFrame * 4, guest->UmbrellaColour); diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index f4689518a9..fefadec182 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -43,151 +43,160 @@ namespace OpenRCT2::GameActions enum class PeepState : uint8_t { - Falling = 0, // Drowning is part of falling - One = 1, // was PEEP_STATE_1 - QueuingFront = 2, - OnRide = 3, - LeavingRide = 4, - Walking = 5, - Queuing = 6, - EnteringRide = 7, - Sitting = 8, - Picked = 9, - Patrolling = 10, // Not sure - Mowing = 11, - Sweeping = 12, - EnteringPark = 13, - LeavingPark = 14, - Answering = 15, - Fixing = 16, - Buying = 17, - Watching = 18, - EmptyingBin = 19, - UsingBin = 20, - Watering = 21, - HeadingToInspection = 22, - Inspecting = 23 + falling = 0, // Drowning is part of falling + one = 1, // was PEEP_STATE_1 + queuingFront = 2, + onRide = 3, + leavingRide = 4, + walking = 5, + queuing = 6, + enteringRide = 7, + sitting = 8, + picked = 9, + patrolling = 10, // Not sure + mowing = 11, + sweeping = 12, + enteringPark = 13, + leavingPark = 14, + answering = 15, + fixing = 16, + buying = 17, + watching = 18, + emptyingBin = 19, + usingBin = 20, + watering = 21, + headingToInspection = 22, + inspecting = 23, }; enum class PeepSittingSubState : uint8_t { - TryingToSit, // was = 0 - SatDown // was unassigned + tryingToSit, // was = 0 + satDown // was unassigned }; enum class PeepRideSubState : uint8_t { - AtEntrance = 0, - InEntrance = 1, - FreeVehicleCheck = 2, // Spend money on ride - LeaveEntrance = 3, // Calculate what direction and where to go after committing to entering vehicle - ApproachVehicle = 4, - EnterVehicle = 5, - OnRide = 6, - LeaveVehicle = 7, - ApproachExit = 8, - InExit = 9, - InQueue = 10, - AtQueueFront = 11, - ApproachVehicleWaypoints = 12, - ApproachExitWaypoints = 13, - ApproachSpiralSlide = 14, - OnSpiralSlide = 15, - LeaveSpiralSlide = 16, - MazePathfinding = 17, - LeaveExit = 18, - ApproachShop = 19, - InteractShop = 20, - LeaveShop = 21 + atEntrance = 0, + inEntrance = 1, + freeVehicleCheck = 2, // Spend money on ride + leaveEntrance = 3, // Calculate what direction and where to go after committing to entering vehicle + approachVehicle = 4, + enterVehicle = 5, + onRide = 6, + leaveVehicle = 7, + approachExit = 8, + inExit = 9, + inQueue = 10, + atQueueFront = 11, + approachVehicleWaypoints = 12, + approachExitWaypoints = 13, + approachSpiralSlide = 14, + onSpiralSlide = 15, + leaveSpiralSlide = 16, + mazePathfinding = 17, + leaveExit = 18, + approachShop = 19, + interactShop = 20, + leaveShop = 21, +}; + +// Substates for guests that are inside the Spiral Slide. Declared as uint16_t to match DestinationX. +enum class PeepSpiralSlideSubState : uint16_t +{ + goingUp = 0, + prepareToSlide = 1, + slidingDown = 2, + finishedSliding = 3 }; enum class PeepUsingBinSubState : uint8_t { - WalkingToBin = 0, - GoingBack, + walkingToBin = 0, + goingBack, }; enum class PeepActionType : uint8_t { - CheckTime = 0, + checkTime = 0, // If no food then check watch - EatFood = 1, - ShakeHead = 2, - EmptyPockets = 3, - SittingEatFood = 4, - SittingCheckWatch = 4, - SittingLookAroundLeft = 5, - SittingLookAroundRight = 6, - Wow = 7, - ThrowUp = 8, - Jump = 9, - StaffSweep = 10, - Drowning = 11, - StaffAnswerCall = 12, - StaffAnswerCall2 = 13, - StaffCheckBoard = 14, - StaffFix = 15, - StaffFix2 = 16, - StaffFixGround = 17, - StaffFix3 = 18, - StaffWatering = 19, - Joy = 20, - ReadMap = 21, - Wave = 22, - StaffEmptyBin = 23, - Wave2 = 24, - TakePhoto = 25, - Clap = 26, - Disgust = 27, - DrawPicture = 28, - BeingWatched = 29, - WithdrawMoney = 30, + eatFood = 1, + shakeHead = 2, + emptyPockets = 3, + sittingEatFood = 4, + sittingCheckWatch = 4, + sittingLookAroundLeft = 5, + sittingLookAroundRight = 6, + wow = 7, + throwUp = 8, + jump = 9, + staffSweep = 10, + drowning = 11, + staffAnswerCall = 12, + staffAnswerCall2 = 13, + staffCheckBoard = 14, + staffFix = 15, + staffFix2 = 16, + staffFixGround = 17, + staffFix3 = 18, + staffWatering = 19, + joy = 20, + readMap = 21, + wave = 22, + staffEmptyBin = 23, + wave2 = 24, + takePhoto = 25, + clap = 26, + disgust = 27, + drawPicture = 28, + beingWatched = 29, + withdrawMoney = 30, - Idle = 254, - Walking = 255, + idle = 254, + walking = 255, }; enum class PeepAnimationType : uint8_t { - Walking = 0, - CheckTime = 1, - WatchRide = 2, - EatFood = 3, - ShakeHead = 4, - EmptyPockets = 5, - HoldMat = 6, - SittingIdle = 7, - SittingEatFood = 8, - SittingLookAroundLeft = 9, - SittingLookAroundRight = 10, - Hanging = 11, - StaffMower = 12, - Wow = 13, - ThrowUp = 14, - Jump = 15, - StaffSweep = 16, - Drowning = 17, - StaffAnswerCall = 18, - StaffAnswerCall2 = 19, - StaffCheckBoard = 20, - StaffFix = 21, - StaffFix2 = 22, - StaffFixGround = 23, - StaffFix3 = 24, - StaffWatering = 25, - Joy = 26, - ReadMap = 27, - Wave = 28, - StaffEmptyBin = 29, - Wave2 = 30, - TakePhoto = 31, - Clap = 32, - Disgust = 33, - DrawPicture = 34, - BeingWatched = 35, - WithdrawMoney = 36, + walking = 0, + checkTime = 1, + watchRide = 2, + eatFood = 3, + shakeHead = 4, + emptyPockets = 5, + holdMat = 6, + sittingIdle = 7, + sittingEatFood = 8, + sittingLookAroundLeft = 9, + sittingLookAroundRight = 10, + hanging = 11, + staffMower = 12, + wow = 13, + throwUp = 14, + jump = 15, + staffSweep = 16, + drowning = 17, + staffAnswerCall = 18, + staffAnswerCall2 = 19, + staffCheckBoard = 20, + staffFix = 21, + staffFix2 = 22, + staffFixGround = 23, + staffFix3 = 24, + staffWatering = 25, + joy = 26, + readMap = 27, + wave = 28, + staffEmptyBin = 29, + wave2 = 30, + takePhoto = 31, + clap = 32, + disgust = 33, + drawPicture = 34, + beingWatched = 35, + withdrawMoney = 36, - Invalid = 255 + invalid = 255 }; enum PeepFlags : uint32_t @@ -238,46 +247,46 @@ enum PeepNextFlags enum class PeepAnimationGroup : uint8_t { - Normal = 0, + normal = 0, // Security staff - Alternate = 1, + alternate = 1, // Guest variations - IceCream = 1, - Chips = 2, - Burger = 3, - Drink = 4, - Balloon = 5, - Candyfloss = 6, - Umbrella = 7, - Pizza = 8, - Popcorn = 9, - ArmsCrossed = 10, - HeadDown = 11, - Nauseous = 12, - VeryNauseous = 13, - RequireToilet = 14, - Hat = 15, - HotDog = 16, - Tentacle = 17, - ToffeeApple = 18, - Doughnut = 19, - Coffee = 20, - Chicken = 21, - Lemonade = 22, - Watching = 23, - Pretzel = 24, - Sunglasses = 25, - Sujeonggwa = 26, - Juice = 27, - FunnelCake = 28, - Noodles = 29, - Sausage = 30, - Soup = 31, - Sandwich = 32, + iceCream = 1, + chips = 2, + burger = 3, + drink = 4, + balloon = 5, + candyfloss = 6, + umbrella = 7, + pizza = 8, + popcorn = 9, + armsCrossed = 10, + headDown = 11, + nauseous = 12, + veryNauseous = 13, + requireToilet = 14, + hat = 15, + hotDog = 16, + tentacle = 17, + toffeeApple = 18, + doughnut = 19, + coffee = 20, + chicken = 21, + lemonade = 22, + watching = 23, + pretzel = 24, + sunglasses = 25, + sujeonggwa = 26, + juice = 27, + funnelCake = 28, + noodles = 29, + sausage = 30, + soup = 31, + sandwich = 32, - Invalid = 255 + invalid = 255 }; // Flags used by peep->WindowInvalidateFlags @@ -311,8 +320,16 @@ struct Peep : EntityBase PeepAnimationGroup AnimationGroup; uint8_t TshirtColour; uint8_t TrousersColour; - uint16_t DestinationX; // Location that the peep is trying to get to - uint16_t DestinationY; + union + { + uint16_t DestinationX; + PeepSpiralSlideSubState spiralSlideSubstate; + }; + union + { + uint16_t DestinationY; + uint16_t spiralSlideGoingUpTimer; + }; uint8_t DestinationTolerance; // How close to destination before next action/state 0 = exact uint8_t Var37; uint8_t Energy; @@ -388,6 +405,7 @@ public: // Peep bool IsActionWalking() const; bool IsActionIdle() const; bool IsActionInterruptable() const; + bool IsActionInterruptableSafely() const; // Reset the peep's stored goal, which means they will forget any stored pathfinding history // on the next GuestPathfinding::ChooseDirection call. diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 54b7f16e17..21cf85b90e 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -64,7 +64,7 @@ using namespace OpenRCT2; template<> bool EntityBase::Is() const { - return Type == EntityType::Staff; + return Type == EntityType::staff; } /** @@ -295,9 +295,9 @@ void Staff::SetPatrolArea(const CoordsXY& coords, bool value) void Staff::SetPatrolArea(const MapRange& range, bool value) { - for (int32_t yy = range.GetTop(); yy <= range.GetBottom(); yy += kCoordsXYStep) + for (int32_t yy = range.GetY1(); yy <= range.GetY2(); yy += kCoordsXYStep) { - for (int32_t xx = range.GetLeft(); xx <= range.GetRight(); xx += kCoordsXYStep) + for (int32_t xx = range.GetX1(); xx <= range.GetX2(); xx += kCoordsXYStep) { SetPatrolArea({ xx, yy }, value); } @@ -568,7 +568,7 @@ bool Staff::DoHandymanPathFinding() PeepDirection = newDirection; SetDestination(chosenTile + CoordsXY{ 16, 16 }, 3); - if (State == PeepState::Queuing) + if (State == PeepState::queuing) { DestinationTolerance = (ScenarioRand() & 7) + 2; } @@ -622,7 +622,7 @@ Direction Staff::MechanicDirectionSurface() const Direction direction = ScenarioRand() & 3; auto ride = GetRide(CurrentRide); - if (ride != nullptr && (State == PeepState::Answering || State == PeepState::HeadingToInspection) && (ScenarioRand() & 1)) + if (ride != nullptr && (State == PeepState::answering || State == PeepState::headingToInspection) && (ScenarioRand() & 1)) { auto location = ride->getStation(CurrentRideStation).Exit; if (location.IsNull()) @@ -685,7 +685,7 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat pathDirections &= ~(1 << direction); if (pathDirections == 0) { - if (State != PeepState::Answering && State != PeepState::HeadingToInspection) + if (State != PeepState::answering && State != PeepState::headingToInspection) { return direction; } @@ -701,7 +701,7 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat // Mechanic is heading to ride (either broken down or for inspection). auto ride = GetRide(CurrentRide); - if (ride != nullptr && (State == PeepState::Answering || State == PeepState::HeadingToInspection)) + if (ride != nullptr && (State == PeepState::answering || State == PeepState::headingToInspection)) { /* Find location of the exit for the target ride station * or if the ride has no exit, the entrance. */ @@ -783,7 +783,7 @@ bool Staff::DoMechanicPathFinding() Direction Staff::DirectionPath(uint8_t validDirections, PathElement* pathElement) const { uint32_t pathDirections = pathElement->GetEdges(); - if (State != PeepState::Answering && State != PeepState::HeadingToInspection) + if (State != PeepState::answering && State != PeepState::headingToInspection) { pathDirections &= validDirections; } @@ -904,11 +904,11 @@ void Staff::EntertainerUpdateNearbyPeeps() const if (y_dist > kLookupRadius) continue; - if (guest->State == PeepState::Walking) + if (guest->State == PeepState::walking) { guest->HappinessTarget = std::min(guest->HappinessTarget + 4, kPeepMaxHappiness); } - else if (guest->State == PeepState::Queuing) + else if (guest->State == PeepState::queuing) { guest->TimeInQueue = std::max(0, guest->TimeInQueue - 200); guest->HappinessTarget = std::min(guest->HappinessTarget + 3, kPeepMaxHappiness); @@ -924,9 +924,9 @@ void Staff::EntertainerUpdateNearbyPeeps() const */ bool Staff::DoEntertainerPathFinding() { - if (((ScenarioRand() & 0xFFFF) <= 0x4000) && IsActionInterruptable()) + if (((ScenarioRand() & 0xFFFF) <= 0x4000) && IsActionInterruptableSafely()) { - Action = (ScenarioRand() & 1) ? PeepActionType::Wave2 : PeepActionType::Joy; + Action = (ScenarioRand() & 1) ? PeepActionType::wave2 : PeepActionType::joy; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -945,13 +945,13 @@ bool Staff::DoPathFinding() { switch (AssignedStaffType) { - case StaffType::Handyman: + case StaffType::handyman: return DoHandymanPathFinding(); - case StaffType::Mechanic: + case StaffType::mechanic: return DoMechanicPathFinding(); - case StaffType::Security: + case StaffType::security: return DoMiscPathFinding(); - case StaffType::Entertainer: + case StaffType::entertainer: return DoEntertainerPathFinding(); default: @@ -975,13 +975,13 @@ colour_t StaffGetColour(StaffType staffType) const auto& park = getGameState().park; switch (staffType) { - case StaffType::Handyman: + case StaffType::handyman: return park.staffHandymanColour; - case StaffType::Mechanic: + case StaffType::mechanic: return park.staffMechanicColour; - case StaffType::Security: + case StaffType::security: return park.staffSecurityColour; - case StaffType::Entertainer: + case StaffType::entertainer: return 0; default: assert(false); @@ -994,13 +994,13 @@ GameActions::Result StaffSetColour(StaffType staffType, colour_t value) auto& park = getGameState().park; switch (staffType) { - case StaffType::Handyman: + case StaffType::handyman: park.staffHandymanColour = value; break; - case StaffType::Mechanic: + case StaffType::mechanic: park.staffMechanicColour = value; break; - case StaffType::Security: + case StaffType::security: park.staffSecurityColour = value; break; default: @@ -1080,7 +1080,7 @@ void Staff::UpdateWatering() return; Orientation = (Var37 & 3) << 3; - Action = PeepActionType::StaffWatering; + Action = PeepActionType::staffWatering; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -1143,7 +1143,7 @@ void Staff::UpdateEmptyingBin() return; Orientation = (Var37 & 3) << 3; - Action = PeepActionType::StaffEmptyBin; + Action = PeepActionType::staffEmptyBin; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -1215,7 +1215,7 @@ void Staff::UpdateSweeping() if (!CheckForPath()) return; - if (Action == PeepActionType::StaffSweep && AnimationFrameNum == 8) + if (Action == PeepActionType::staffSweep && AnimationFrameNum == 8) { // Remove sick at this location Litter::RemoveAt(GetLocation()); @@ -1232,7 +1232,7 @@ void Staff::UpdateSweeping() Var37++; if (Var37 != 2) { - Action = PeepActionType::StaffSweep; + Action = PeepActionType::staffSweep; AnimationFrameNum = 0; AnimationImageIdOffset = 0; UpdateCurrentAnimationType(); @@ -1250,20 +1250,20 @@ void Staff::UpdateHeadingToInspect() auto ride = GetRide(CurrentRide); if (ride == nullptr) { - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } if (ride->getStation(CurrentRideStation).Exit.IsNull()) { ride->lifecycleFlags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } if (ride->mechanicStatus != RIDE_MECHANIC_STATUS_HEADING || !(ride->lifecycleFlags & RIDE_LIFECYCLE_DUE_INSPECTION)) { - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } @@ -1283,7 +1283,7 @@ void Staff::UpdateHeadingToInspect() { ride->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; } - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } @@ -1338,7 +1338,7 @@ void Staff::UpdateHeadingToInspect() return; } - SetState(PeepState::Inspecting); + SetState(PeepState::inspecting); SubState = 0; } @@ -1351,13 +1351,13 @@ void Staff::UpdateAnswering() auto ride = GetRide(CurrentRide); if (ride == nullptr || ride->mechanicStatus != RIDE_MECHANIC_STATUS_HEADING) { - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } if (SubState == 0) { - Action = PeepActionType::StaffAnswerCall; + Action = PeepActionType::staffAnswerCall; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -1388,7 +1388,7 @@ void Staff::UpdateAnswering() { ride->mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } @@ -1445,7 +1445,7 @@ void Staff::UpdateAnswering() return; } - SetState(PeepState::Fixing); + SetState(PeepState::fixing); SubState = 0; } @@ -1512,7 +1512,7 @@ bool Staff::UpdatePatrollingFindWatering() } } - SetState(PeepState::Watering); + SetState(PeepState::watering); Var37 = chosen_position; SubState = 0; @@ -1581,7 +1581,7 @@ bool Staff::UpdatePatrollingFindBin() return false; Var37 = chosen_position; - SetState(PeepState::EmptyingBin); + SetState(PeepState::emptyingBin); SubState = 0; auto destination = BinUseOffsets[chosen_position] + GetLocation().ToTileStart(); @@ -1609,7 +1609,7 @@ bool Staff::UpdatePatrollingFindGrass() { if ((surfaceElement->GetGrassLength() & 0x7) >= GRASS_LENGTH_CLEAR_1) { - SetState(PeepState::Mowing); + SetState(PeepState::mowing); Var37 = 0; // Original code used .y for both x and y. Changed to .x to make more sense (both x and y are 28) @@ -1637,7 +1637,7 @@ bool Staff::UpdatePatrollingFindSweeping() if (z_diff >= 16) continue; - SetState(PeepState::Sweeping); + SetState(PeepState::sweeping); Var37 = 0; SetDestination(litter->GetLocation(), 5); @@ -1692,13 +1692,13 @@ bool Staff::SecurityGuardPathIsCrowded() const void Staff::Tick128UpdateStaff() { - if (AssignedStaffType != StaffType::Security) + if (AssignedStaffType != StaffType::security) return; // Alternate between walking animations based on crowd size - auto newAnimationGroup = PeepAnimationGroup::Normal; - if (State == PeepState::Patrolling && SecurityGuardPathIsCrowded()) - newAnimationGroup = PeepAnimationGroup::Alternate; + auto newAnimationGroup = PeepAnimationGroup::normal; + if (State == PeepState::patrolling && SecurityGuardPathIsCrowded()) + newAnimationGroup = PeepAnimationGroup::alternate; if (AnimationGroup == newAnimationGroup) return; @@ -1706,8 +1706,8 @@ void Staff::Tick128UpdateStaff() AnimationGroup = newAnimationGroup; AnimationImageIdOffset = 0; WalkingAnimationFrameNum = 0; - if (Action < PeepActionType::Idle) - Action = PeepActionType::Walking; + if (Action < PeepActionType::idle) + Action = PeepActionType::walking; auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(AnimationObjectIndex); @@ -1719,18 +1719,18 @@ void Staff::Tick128UpdateStaff() PeepFlags |= PEEP_FLAGS_SLOW_WALK; } - AnimationType = PeepAnimationType::Invalid; + AnimationType = PeepAnimationType::invalid; UpdateCurrentAnimationType(); } bool Staff::IsMechanic() const { - return AssignedStaffType == StaffType::Mechanic; + return AssignedStaffType == StaffType::mechanic; } bool Staff::isEntertainer() const { - return AssignedStaffType == StaffType::Entertainer; + return AssignedStaffType == StaffType::entertainer; } void Staff::Update() @@ -1773,43 +1773,43 @@ void Staff::Update() // Loc68FD2F switch (State) { - case PeepState::Falling: + case PeepState::falling: UpdateFalling(); break; - case PeepState::One: + case PeepState::one: Update1(); break; - case PeepState::OnRide: + case PeepState::onRide: // No action break; - case PeepState::Picked: + case PeepState::picked: UpdatePicked(); break; - case PeepState::Patrolling: + case PeepState::patrolling: UpdatePatrolling(); break; - case PeepState::Mowing: + case PeepState::mowing: UpdateMowing(); break; - case PeepState::Sweeping: + case PeepState::sweeping: UpdateSweeping(); break; - case PeepState::Answering: + case PeepState::answering: UpdateAnswering(); break; - case PeepState::Fixing: + case PeepState::fixing: UpdateFixing(stepsToTake); break; - case PeepState::Inspecting: + case PeepState::inspecting: UpdateFixing(stepsToTake); break; - case PeepState::EmptyingBin: + case PeepState::emptyingBin: UpdateEmptyingBin(); break; - case PeepState::Watering: + case PeepState::watering: UpdateWatering(); break; - case PeepState::HeadingToInspection: + case PeepState::headingToInspection: UpdateHeadingToInspect(); break; default: @@ -1846,13 +1846,13 @@ void Staff::UpdatePatrolling() if (water_height > 0) { MoveTo({ x, y, water_height }); - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } } } - if (AssignedStaffType != StaffType::Handyman) + if (AssignedStaffType != StaffType::handyman) return; if (UpdatePatrollingFindSweeping()) @@ -1977,19 +1977,19 @@ void Staff::UpdateFixing(int32_t steps) auto ride = GetRide(CurrentRide); if (ride == nullptr) { - SetState(PeepState::Falling); + SetState(PeepState::falling); return; } bool progressToNextSubstate = true; bool firstRun = true; - if ((State == PeepState::Inspecting) + if ((State == PeepState::inspecting) && (ride->lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN))) { // Ride has broken down since Mechanic was called to inspect it. // Mechanic identifies the breakdown and switches to fixing it. - State = PeepState::Fixing; + State = PeepState::fixing; } while (progressToNextSubstate) @@ -2063,7 +2063,7 @@ void Staff::UpdateFixing(int32_t steps) int32_t subState = SubState; uint32_t sub_state_sequence_mask = FixingSubstatesForBreakdown[8]; - if (State != PeepState::Inspecting) + if (State != PeepState::inspecting) { sub_state_sequence_mask = FixingSubstatesForBreakdown[ride->breakdownReasonPending]; } @@ -2153,7 +2153,7 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, const Ride& ride) { Orientation = PeepDirection << 3; - Action = (ScenarioRand() & 1) ? PeepActionType::StaffFix2 : PeepActionType::StaffFix; + Action = (ScenarioRand() & 1) ? PeepActionType::staffFix2 : PeepActionType::staffFix; AnimationImageIdOffset = 0; AnimationFrameNum = 0; UpdateCurrentAnimationType(); @@ -2167,7 +2167,7 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, const Ride& ride) UpdateAction(); Invalidate(); - uint8_t actionFrame = (Action == PeepActionType::StaffFix) ? 0x25 : 0x50; + uint8_t actionFrame = (Action == PeepActionType::staffFix) ? 0x25 : 0x50; if (AnimationFrameNum != actionFrame) { return false; @@ -2194,7 +2194,7 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, const Ride& ride) if (!firstRun) { Orientation = PeepDirection << 3; - Action = PeepActionType::StaffFix3; + Action = PeepActionType::staffFix3; AnimationImageIdOffset = 0; AnimationFrameNum = 0; @@ -2300,7 +2300,7 @@ bool Staff::UpdateFixingFixStationEnd(bool firstRun) if (!firstRun) { Orientation = PeepDirection << 3; - Action = PeepActionType::StaffCheckBoard; + Action = PeepActionType::staffCheckBoard; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -2415,7 +2415,7 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, const Ride& ride) Orientation = PeepDirection << 3; - Action = PeepActionType::StaffFix; + Action = PeepActionType::staffFix; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -2443,7 +2443,7 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride& ride) { Orientation = PeepDirection << 3; - Action = PeepActionType::StaffFixGround; + Action = PeepActionType::staffFixGround; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -2520,7 +2520,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride& r { if (!firstRun) { - if (State == PeepState::Inspecting) + if (State == PeepState::inspecting) { UpdateRideInspected(CurrentRide); @@ -2534,7 +2534,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride& r WindowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME | RIDE_INVALIDATE_RIDE_LIST; Orientation = PeepDirection << 3; - Action = PeepActionType::StaffAnswerCall2; + Action = PeepActionType::staffAnswerCall2; AnimationFrameNum = 0; AnimationImageIdOffset = 0; @@ -2569,7 +2569,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride& ride) if (exitPosition.IsNull()) { - SetState(PeepState::Falling); + SetState(PeepState::falling); return false; } } @@ -2595,7 +2595,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride& ride) MoveTo({ loc.value(), stationHeight }); return false; } - SetState(PeepState::Falling); + SetState(PeepState::falling); return false; } @@ -2619,13 +2619,13 @@ money64 GetStaffWage(StaffType type) switch (type) { default: - case StaffType::Handyman: + case StaffType::handyman: return 50.00_GBP; - case StaffType::Mechanic: + case StaffType::mechanic: return 80.00_GBP; - case StaffType::Security: + case StaffType::security: return 60.00_GBP; - case StaffType::Entertainer: + case StaffType::entertainer: return 55.00_GBP; } } diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index 547e1e84d8..905f5d4025 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -30,17 +30,17 @@ using colour_t = uint8_t; enum class StaffType : uint8_t { - Handyman, - Mechanic, - Security, - Entertainer, + handyman, + mechanic, + security, + entertainer, - Count + count }; struct Staff : Peep { - static constexpr auto cEntityType = EntityType::Staff; + static constexpr auto cEntityType = EntityType::staff; public: PatrolArea* PatrolInfo; diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index c753c0567a..743729cf25 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -15,6 +15,7 @@ #include "../audio/AudioMixer.h" #include "../core/UTF8.h" #include "../drawing/Drawing.h" +#include "../drawing/Rectangle.h" #include "../drawing/Text.h" #include "../localisation/Formatter.h" #include "../localisation/Formatting.h" @@ -24,6 +25,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Audio; +using namespace OpenRCT2::Drawing; bool gChatOpen = false; static u8string _chatCurrentLine; @@ -138,19 +140,19 @@ void ChatDraw(RenderTarget& rt, ColourWithFlags chatBackgroundColor) ScreenCoordsXY bottomLeft{ _chatLeft, _chatBottom }; GfxSetDirtyBlocks( { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }); // Background area + Textbox - GfxFilterRect( + Rectangle::filter( rt, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }, FilterPaletteID::palette51); // Opaque grey background - GfxFillRectInset( + Rectangle::fillInset( rt, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }, chatBackgroundColor, - INSET_RECT_FLAG_FILL_NONE); - GfxFillRectInset( + Rectangle::BorderStyle::outset, Rectangle::FillBrightness::light, Rectangle::FillMode::none); + Rectangle::fillInset( rt, { topLeft + ScreenCoordsXY{ 1, -4 }, bottomRight - ScreenCoordsXY{ 1, inputLineHeight + 6 } }, - chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET); - GfxFillRectInset( + chatBackgroundColor, Rectangle::BorderStyle::inset); + Rectangle::fillInset( rt, { bottomLeft + ScreenCoordsXY{ 1, -inputLineHeight - 5 }, bottomRight + ScreenCoordsXY{ -1, 4 } }, chatBackgroundColor, - INSET_RECT_FLAG_BORDER_INSET); // Textbox + Rectangle::BorderStyle::inset); // Textbox } auto screenCoords = ScreenCoordsXY{ _chatLeft + 5, _chatBottom - inputLineHeight - 20 }; @@ -202,7 +204,7 @@ void ChatDraw(RenderTarget& rt, ColourWithFlags chatBackgroundColor) int32_t caretX = screenCoords.x + GfxGetStringWidth(lineBuffer, FontStyle::Medium); int32_t caretY = screenCoords.y + 14; - GfxFillRect(rt, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PaletteIndex::pi56); + Rectangle::fill(rt, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PaletteIndex::pi56); } } } diff --git a/src/openrct2/interface/Fonts.cpp b/src/openrct2/interface/Fonts.cpp index 1677d476f8..54185412f8 100644 --- a/src/openrct2/interface/Fonts.cpp +++ b/src/openrct2/interface/Fonts.cpp @@ -149,15 +149,15 @@ static bool LoadFont(LocalisationService& localisationService, TTFFontSetDescrip static bool LoadCustomConfigFont(LocalisationService& localisationService) { static TTFFontSetDescriptor TTFFontCustom = { { - { Config::Get().fonts.FileName.c_str(), Config::Get().fonts.FontName.c_str(), Config::Get().fonts.SizeTiny, - Config::Get().fonts.OffsetX, Config::Get().fonts.OffsetY, Config::Get().fonts.HeightTiny, - Config::Get().fonts.HintingThreshold, nullptr }, - { Config::Get().fonts.FileName.c_str(), Config::Get().fonts.FontName.c_str(), Config::Get().fonts.SizeSmall, - Config::Get().fonts.OffsetX, Config::Get().fonts.OffsetY, Config::Get().fonts.HeightSmall, - Config::Get().fonts.HintingThreshold, nullptr }, - { Config::Get().fonts.FileName.c_str(), Config::Get().fonts.FontName.c_str(), Config::Get().fonts.SizeMedium, - Config::Get().fonts.OffsetX, Config::Get().fonts.OffsetY, Config::Get().fonts.HeightMedium, - Config::Get().fonts.HintingThreshold, nullptr }, + { Config::Get().fonts.fileName.c_str(), Config::Get().fonts.fontName.c_str(), Config::Get().fonts.sizeTiny, + Config::Get().fonts.offsetX, Config::Get().fonts.offsetY, Config::Get().fonts.heightTiny, + Config::Get().fonts.hintingThreshold, nullptr }, + { Config::Get().fonts.fileName.c_str(), Config::Get().fonts.fontName.c_str(), Config::Get().fonts.sizeSmall, + Config::Get().fonts.offsetX, Config::Get().fonts.offsetY, Config::Get().fonts.heightSmall, + Config::Get().fonts.hintingThreshold, nullptr }, + { Config::Get().fonts.fileName.c_str(), Config::Get().fonts.fontName.c_str(), Config::Get().fonts.sizeMedium, + Config::Get().fonts.offsetX, Config::Get().fonts.offsetY, Config::Get().fonts.heightMedium, + Config::Get().fonts.hintingThreshold, nullptr }, } }; TTFDispose(); @@ -177,7 +177,7 @@ void TryLoadFonts(LocalisationService& localisationService) if (fontFamily != kFamilyOpenRCT2Sprite) { - if (!Config::Get().fonts.FileName.empty()) + if (!Config::Get().fonts.fileName.empty()) { if (LoadCustomConfigFont(localisationService)) { diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index a995d71550..1b8a96615d 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -480,8 +480,8 @@ static void ConsoleCommandStaff(InteractiveConsole& console, const arguments_t& console.WriteFormatLine("staff set energy "); console.WriteFormatLine("staff set costume "); - auto _availableCostumeIndexes = findAllPeepAnimationsIndexesForType(AnimationPeepType::Entertainer); - auto _availableCostumeObjects = findAllPeepAnimationsObjectForType(AnimationPeepType::Entertainer); + auto _availableCostumeIndexes = findAllPeepAnimationsIndexesForType(AnimationPeepType::entertainer); + auto _availableCostumeObjects = findAllPeepAnimationsObjectForType(AnimationPeepType::entertainer); for (auto i = 0u; i < _availableCostumeIndexes.size(); i++) { @@ -682,7 +682,7 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar } else if (argv[0] == "console_small_font") { - console.WriteFormatLine("console_small_font %d", Config::Get().interface.ConsoleSmallFont); + console.WriteFormatLine("console_small_font %d", Config::Get().interface.consoleSmallFont); } else if (argv[0] == "location") { @@ -699,19 +699,19 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar } else if (argv[0] == "window_scale") { - console.WriteFormatLine("window_scale %.3f", Config::Get().general.WindowScale); + console.WriteFormatLine("window_scale %.3f", Config::Get().general.windowScale); } else if (argv[0] == "window_limit") { - console.WriteFormatLine("window_limit %d", Config::Get().general.WindowLimit); + console.WriteFormatLine("window_limit %d", Config::Get().general.windowLimit); } else if (argv[0] == "render_weather_effects") { - console.WriteFormatLine("render_weather_effects %d", Config::Get().general.RenderWeatherEffects); + console.WriteFormatLine("render_weather_effects %d", Config::Get().general.renderWeatherEffects); } else if (argv[0] == "render_weather_gloom") { - console.WriteFormatLine("render_weather_gloom %d", Config::Get().general.RenderWeatherGloom); + console.WriteFormatLine("render_weather_gloom %d", Config::Get().general.renderWeatherGloom); } else if (argv[0] == "cheat_sandbox_mode") { @@ -736,7 +736,7 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar #ifndef DISABLE_TTF else if (argv[0] == "enable_hinting") { - console.WriteFormatLine("enable_hinting %d", Config::Get().fonts.EnableHinting); + console.WriteFormatLine("enable_hinting %d", Config::Get().fonts.enableHinting); } #endif else @@ -923,7 +923,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar } else if (varName == "console_small_font" && InvalidArguments(&invalidArgs, int_valid[0])) { - Config::Get().interface.ConsoleSmallFont = (int_val[0] != 0); + Config::Get().interface.consoleSmallFont = (int_val[0] != 0); Config::Save(); console.Execute("get console_small_font"); } @@ -941,7 +941,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar else if (varName == "window_scale" && InvalidArguments(&invalidArgs, double_valid[0])) { float newScale = static_cast(0.001 * std::trunc(1000 * double_val[0])); - Config::Get().general.WindowScale = std::clamp(newScale, 0.5f, 5.0f); + Config::Get().general.windowScale = std::clamp(newScale, 0.5f, 5.0f); Config::Save(); GfxInvalidateScreen(); ContextTriggerResize(); @@ -955,13 +955,13 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar } else if (varName == "render_weather_effects" && InvalidArguments(&invalidArgs, int_valid[0])) { - Config::Get().general.RenderWeatherEffects = (int_val[0] != 0); + Config::Get().general.renderWeatherEffects = (int_val[0] != 0); Config::Save(); console.Execute("get render_weather_effects"); } else if (varName == "render_weather_gloom" && InvalidArguments(&invalidArgs, int_valid[0])) { - Config::Get().general.RenderWeatherGloom = (int_val[0] != 0); + Config::Get().general.renderWeatherGloom = (int_val[0] != 0); Config::Save(); console.Execute("get render_weather_gloom"); } @@ -1026,7 +1026,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar #ifndef DISABLE_TTF else if (varName == "enable_hinting" && InvalidArguments(&invalidArgs, int_valid[0])) { - Config::Get().fonts.EnableHinting = (int_val[0] != 0); + Config::Get().fonts.enableHinting = (int_val[0] != 0); Config::Save(); console.Execute("get enable_hinting"); TTFToggleHinting(); @@ -1051,78 +1051,92 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar static void ConsoleCommandLoadObject(InteractiveConsole& console, const arguments_t& argv) { - if (!argv.empty()) + if (argv.empty()) + { + console.WriteLineError("Please specify an object name."); + return; + } + + auto& objectRepository = GetContext()->GetObjectRepository(); + auto objectName = argv[0]; + + // First, try and find a JSON object by this name + const ObjectRepositoryItem* ori = objectRepository.FindObject(objectName); + + // If this fails, try loading by DAT name + if (ori == nullptr) { char name[9] = { 0 }; std::fill_n(name, 8, ' '); std::size_t i = 0; - for (const char* ch = argv[0].c_str(); *ch != '\0' && i < std::size(name) - 1; ch++) + for (const char* ch = objectName.c_str(); *ch != '\0' && i < std::size(name) - 1; ch++) { name[i++] = *ch; } - const ObjectRepositoryItem* ori = ObjectRepositoryFindObjectByName(name); - if (ori == nullptr) - { - console.WriteLineError("Could not find the object."); - return; - } - - const auto* entry = &ori->ObjectEntry; - const auto* loadedObject = ObjectManagerGetLoadedObject(ObjectEntryDescriptor(*ori)); - if (loadedObject != nullptr) - { - console.WriteLineError("Object is already in scenario."); - return; - } - - loadedObject = ObjectManagerLoadObject(entry); - if (loadedObject == nullptr) - { - console.WriteLineError("Unable to load object."); - return; - } - auto groupIndex = ObjectManagerGetLoadedObjectEntryIndex(loadedObject); - - ObjectType objectType = entry->GetType(); - if (objectType == ObjectType::ride) - { - // Automatically research the ride so it's supported by the game. - const auto* rideEntry = GetRideEntryByIndex(groupIndex); - - for (int32_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) - { - auto rideType = rideEntry->ride_type[j]; - if (rideType != kRideTypeNull) - { - ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory(); - ResearchInsertRideEntry(rideType, groupIndex, category, true); - } - } - - gSilentResearch = true; - ResearchResetCurrentItem(); - gSilentResearch = false; - } - else if (objectType == ObjectType::sceneryGroup) - { - ResearchInsertSceneryGroupEntry(groupIndex, true); - - gSilentResearch = true; - ResearchResetCurrentItem(); - gSilentResearch = false; - } - - auto sceneryIntent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); - ContextBroadcastIntent(&sceneryIntent); - - auto ridesIntent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - ContextBroadcastIntent(&ridesIntent); - - gWindowUpdateTicks = 0; - GfxInvalidateScreen(); - console.WriteLine("Object file loaded."); + ori = objectRepository.FindObjectLegacy(name); } + + if (ori == nullptr) + { + console.WriteLineError("Could not find the object."); + return; + } + + const auto* loadedObject = ObjectManagerGetLoadedObject(ObjectEntryDescriptor(*ori)); + if (loadedObject != nullptr) + { + console.WriteLineError("Object is already in scenario."); + return; + } + + auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); + loadedObject = objectManager.LoadRepositoryItem(*ori); + if (loadedObject == nullptr) + { + console.WriteLineError("Unable to load object."); + return; + } + auto groupIndex = ObjectManagerGetLoadedObjectEntryIndex(loadedObject); + + ObjectType objectType = loadedObject->GetObjectType(); + if (objectType == ObjectType::ride) + { + // Automatically research the ride so it's supported by the game. + const auto* rideEntry = GetRideEntryByIndex(groupIndex); + + for (int32_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) + { + auto rideType = rideEntry->ride_type[j]; + if (rideType != kRideTypeNull) + { + ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory(); + ResearchInsertRideEntry(rideType, groupIndex, category, true); + } + } + + gSilentResearch = true; + ResearchResetCurrentItem(); + gSilentResearch = false; + } + else if (objectType == ObjectType::sceneryGroup) + { + ResearchInsertSceneryGroupEntry(groupIndex, true); + + gSilentResearch = true; + ResearchResetCurrentItem(); + gSilentResearch = false; + } + + auto sceneryIntent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); + ContextBroadcastIntent(&sceneryIntent); + + auto ridesIntent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); + ContextBroadcastIntent(&ridesIntent); + + gWindowUpdateTicks = 0; + GfxInvalidateScreen(); + console.WriteLine("Object file loaded."); } constexpr auto _objectTypeNames = std::to_array({ @@ -1243,7 +1257,7 @@ static void ConsoleCommandShowLimits(InteractiveConsole& console, [[maybe_unused int32_t rideCount = RideGetCount(); int32_t spriteCount = 0; - for (int32_t i = 0; i < static_cast(EntityType::Count); ++i) + for (int32_t i = 0; i < static_cast(EntityType::count); ++i) { auto& gameState = getGameState(); spriteCount += gameState.entities.GetEntityListCount(EntityType(i)); @@ -1955,17 +1969,17 @@ void InteractiveConsole::Execute(const std::string& s) void InteractiveConsole::WriteLine(const std::string& s) { - WriteLine(s, FormatToken::ColourWindow2); + WriteLine(s, FormatToken::colourWindow2); } void InteractiveConsole::WriteLineError(const std::string& s) { - WriteLine(s, FormatToken::ColourRed); + WriteLine(s, FormatToken::colourRed); } void InteractiveConsole::WriteLineWarning(const std::string& s) { - WriteLine(s, FormatToken::ColourYellow); + WriteLine(s, FormatToken::colourYellow); } void InteractiveConsole::WriteFormatLine(const char* format, ...) diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 9b2dc527fd..4ed67f1808 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -28,6 +28,7 @@ #include "../drawing/X8DrawingEngine.h" #include "../localisation/Formatter.h" #include "../paint/Painter.h" +#include "../paint/tile_element/Paint.TileElement.h" #include "../platform/Platform.h" #include "../world/Climate.h" #include "../world/Map.h" @@ -350,7 +351,7 @@ void ScreenshotGiant() { viewport.flags = vp->flags; } - if (Config::Get().general.TransparentScreenshot) + if (Config::Get().general.transparentScreenshot) { viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND; } @@ -418,7 +419,7 @@ static void ApplyOptions(const ScreenshotOptions* options, Viewport& viewport) CheatsSet(CheatType::removeLitter); } - if (options->transparent || Config::Get().general.TransparentScreenshot) + if (options->transparent || Config::Get().general.transparentScreenshot) { viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND; } @@ -427,6 +428,11 @@ static void ApplyOptions(const ScreenshotOptions* options, Viewport& viewport) { gPaintBoundingBoxes = true; } + + if (options->drawSegmentHeights) + { + gShowSupportSegmentHeights = true; + } } int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOptions* options) diff --git a/src/openrct2/interface/Screenshot.h b/src/openrct2/interface/Screenshot.h index 1528be254b..d4214dcef7 100644 --- a/src/openrct2/interface/Screenshot.h +++ b/src/openrct2/interface/Screenshot.h @@ -34,6 +34,7 @@ struct ScreenshotOptions bool tidy_up_park = false; bool transparent = false; bool draw_bounding_boxes = false; + bool drawSegmentHeights = false; }; struct CaptureView diff --git a/src/openrct2/interface/StdInOutConsole.cpp b/src/openrct2/interface/StdInOutConsole.cpp index 2a0b5ca3ff..5eb143b58a 100644 --- a/src/openrct2/interface/StdInOutConsole.cpp +++ b/src/openrct2/interface/StdInOutConsole.cpp @@ -123,10 +123,10 @@ void StdInOutConsole::WriteLine(const std::string& s, FormatToken colourFormat) std::string formatBegin; switch (colourFormat) { - case FormatToken::ColourRed: + case FormatToken::colourRed: formatBegin = "\033[31m"; break; - case FormatToken::ColourYellow: + case FormatToken::colourYellow: formatBegin = "\033[33m"; break; default: diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 7627514495..e2511c36bd 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -21,6 +21,7 @@ #include "../core/Numerics.hpp" #include "../drawing/Drawing.h" #include "../drawing/IDrawingEngine.h" +#include "../drawing/Rectangle.h" #include "../entity/EntityList.h" #include "../entity/Guest.h" #include "../entity/PatrolArea.h" @@ -53,6 +54,7 @@ namespace OpenRCT2 { + using namespace OpenRCT2::Drawing; using namespace OpenRCT2::Numerics; enum : uint8_t @@ -201,7 +203,7 @@ namespace OpenRCT2 viewport->flags = 0; viewport->rotation = GetCurrentRotation(); - if (Config::Get().general.AlwaysShowGridlines) + if (Config::Get().general.alwaysShowGridlines) viewport->flags |= VIEWPORT_FLAG_GRIDLINES; w.viewport = viewport; viewport->isVisible = w.isVisible; @@ -664,7 +666,7 @@ namespace OpenRCT2 void ViewportUpdateSmartFollowEntity(WindowBase* window) { auto entity = getGameState().entities.TryGetEntity(window->viewportSmartFollowSprite); - if (entity == nullptr || entity->Type == EntityType::Null) + if (entity == nullptr || entity->Type == EntityType::null) { window->viewportSmartFollowSprite = EntityId::GetNull(); window->viewportTargetSprite = EntityId::GetNull(); @@ -673,11 +675,11 @@ namespace OpenRCT2 switch (entity->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: ViewportUpdateSmartFollowVehicle(window); break; - case EntityType::Guest: + case EntityType::guest: { auto* guest = entity->As(); if (guest == nullptr) @@ -687,7 +689,7 @@ namespace OpenRCT2 ViewportUpdateSmartFollowGuest(window, *guest); break; } - case EntityType::Staff: + case EntityType::staff: { auto* staff = entity->As(); if (staff == nullptr) @@ -709,7 +711,7 @@ namespace OpenRCT2 Focus focus = Focus(peep.Id); window->viewportTargetSprite = peep.Id; - if (peep.State == PeepState::Picked) + if (peep.State == PeepState::picked) { window->viewportSmartFollowSprite = EntityId::GetNull(); window->viewportTargetSprite = EntityId::GetNull(); @@ -718,8 +720,8 @@ namespace OpenRCT2 } bool overallFocus = true; - if (peep.State == PeepState::OnRide || peep.State == PeepState::EnteringRide - || (peep.State == PeepState::LeavingRide && peep.x == kLocationNull)) + if (peep.State == PeepState::onRide || peep.State == PeepState::enteringRide + || (peep.State == PeepState::leavingRide && peep.x == kLocationNull)) { auto ride = GetRide(peep.CurrentRide); if (ride != nullptr && (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) @@ -758,7 +760,7 @@ namespace OpenRCT2 void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff& peep) { - if (peep.State == PeepState::Picked) + if (peep.State == PeepState::picked) { window->viewportSmartFollowSprite = EntityId::GetNull(); window->viewportTargetSprite = EntityId::GetNull(); @@ -889,7 +891,7 @@ namespace OpenRCT2 PaintDrawStructs(session); - if (Config::Get().general.RenderWeatherGloom && !gTrackDesignSaveMode + if (Config::Get().general.renderWeatherGloom && !gTrackDesignSaveMode && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_ENTITIES) && !(session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { ViewportPaintWeatherGloom(session.DPI); @@ -934,7 +936,7 @@ namespace OpenRCT2 _paintColumns.clear(); - bool useMultithreading = Config::Get().general.MultiThreading; + bool useMultithreading = Config::Get().general.multiThreading; if (useMultithreading && _paintJobs == nullptr) { _paintJobs = std::make_unique(); @@ -1036,7 +1038,7 @@ namespace OpenRCT2 auto y = rt.y; auto w = rt.width; auto h = rt.height; - GfxFilterRect(rt, ScreenRect(x, y, x + w, y + h), paletteId); + Rectangle::filter(rt, ScreenRect(x, y, x + w, y + h), paletteId); } } @@ -1172,7 +1174,7 @@ namespace OpenRCT2 WindowBase* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - if (!Config::Get().general.AlwaysShowGridlines) + if (!Config::Get().general.alwaysShowGridlines) { mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; mainWindow->invalidate(); @@ -1393,7 +1395,7 @@ namespace OpenRCT2 { switch (ps->Entity->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: { if (viewFlags & VIEWPORT_FLAG_HIDE_VEHICLES || clipped) { @@ -1417,7 +1419,7 @@ namespace OpenRCT2 } break; } - case EntityType::Guest: + case EntityType::guest: if (viewFlags & VIEWPORT_FLAG_HIDE_GUESTS) { return VisibilityKind::hidden; @@ -1427,7 +1429,7 @@ namespace OpenRCT2 return VisibilityKind::partial; } break; - case EntityType::Staff: + case EntityType::staff: if (viewFlags & VIEWPORT_FLAG_HIDE_STAFF) { return VisibilityKind::hidden; @@ -1989,11 +1991,11 @@ namespace OpenRCT2 int32_t GetHeightMarkerOffset() { // Height labels in units - if (Config::Get().general.ShowHeightAsUnits) + if (Config::Get().general.showHeightAsUnits) return 0; // Height labels in feet - if (Config::Get().general.MeasurementFormat == MeasurementFormat::Imperial) + if (Config::Get().general.measurementFormat == MeasurementFormat::Imperial) return 1 * 256; // Height labels in metres diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index 698b257d64..a95da188fe 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -32,6 +32,11 @@ namespace OpenRCT2 trnBtn = 7, tab = 8, flatBtn = 9, + /** + * For stuff that mostly acts as a label, while providing a way for power users to quickly + * open the associated window. For example: the money display in the lower left of the screen. + */ + hiddenButton = 11, button = 10, labelCentred = 12, // Centred text tableHeader = 13, // Left-aligned textual button diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 0d42f7ea76..f69a50ab42 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -83,8 +83,9 @@ static constexpr float kWindowScrollLocations[][2] = { void WindowVisitEach(std::function func) { - for (auto& w : gWindowList) + for (size_t i = 0; i < gWindowList.size(); i++) { + auto& w = gWindowList[i]; if (w->flags.has(WindowFlag::dead)) continue; func(w.get()); @@ -209,9 +210,9 @@ static constexpr float kWindowScrollLocations[][2] = { */ void WindowSetWindowLimit(int32_t value) { - int32_t prev = Config::Get().general.WindowLimit; + int32_t prev = Config::Get().general.windowLimit; int32_t val = std::clamp(value, kWindowLimitMin, kWindowLimitMax); - Config::Get().general.WindowLimit = val; + Config::Get().general.windowLimit = val; Config::Save(); // Checks if value decreases and then closes surplus // windows if one sets a limit lower than the number of windows open @@ -455,7 +456,7 @@ static constexpr float kWindowScrollLocations[][2] = { w.savedViewPos.y -= v->ViewHeight() / 4; } - if (Config::Get().general.ZoomToCursor && atCursor) + if (Config::Get().general.zoomToCursor && atCursor) { const auto mouseCoords = ContextGetCursorPositionScaled() - v->pos; const int32_t diffX = (mouseCoords.x - (zoomLevel.ApplyInversedTo(v->ViewWidth()) / 2)); diff --git a/src/openrct2/interface/WindowBase.cpp b/src/openrct2/interface/WindowBase.cpp index 7c3e08c20f..c2642acede 100644 --- a/src/openrct2/interface/WindowBase.cpp +++ b/src/openrct2/interface/WindowBase.cpp @@ -51,8 +51,8 @@ namespace OpenRCT2 static inline void repositionCloseButton(Widget& closeButton, int32_t windowWidth, bool translucent) { - auto closeButtonSize = Config::Get().interface.EnlargedUi ? kCloseButtonSizeTouch : kCloseButtonSize; - if (Config::Get().interface.WindowButtonsOnTheLeft) + auto closeButtonSize = Config::Get().interface.enlargedUi ? kCloseButtonSizeTouch : kCloseButtonSize; + if (Config::Get().interface.windowButtonsOnTheLeft) { closeButton.left = 2; closeButton.right = 2 + closeButtonSize; @@ -146,7 +146,7 @@ namespace OpenRCT2 int16_t WindowBase::getTitleBarTargetHeight() const { - return Config::Get().interface.EnlargedUi ? kTitleHeightLarge : kTitleHeightNormal; + return Config::Get().interface.enlargedUi ? kTitleHeightLarge : kTitleHeightNormal; } int16_t WindowBase::getTitleBarCurrentHeight() const diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 868b309ddf..d7a817f213 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -253,6 +253,7 @@ + @@ -543,6 +544,7 @@ + @@ -831,7 +833,7 @@ - + @@ -1092,6 +1094,7 @@ + diff --git a/src/openrct2/localisation/Currency.cpp b/src/openrct2/localisation/Currency.cpp index 5cd858c14f..f569a7cc9e 100644 --- a/src/openrct2/localisation/Currency.cpp +++ b/src/openrct2/localisation/Currency.cpp @@ -21,44 +21,44 @@ namespace OpenRCT2 { // clang-format off - CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)] = { - { "GBP", 10, CurrencyAffix::Prefix, u8"£", CurrencyAffix::Suffix, "GBP", STR_POUNDS }, // British Pound - { "USD", 10, CurrencyAffix::Prefix, u8"$", CurrencyAffix::Prefix, "$", STR_DOLLARS }, // US Dollar - { "FRF", 10, CurrencyAffix::Suffix, u8"F", CurrencyAffix::Suffix, "F", STR_FRANC }, // French Franc - { "DEM", 10, CurrencyAffix::Prefix, u8"DM", CurrencyAffix::Prefix, "DM", STR_DEUTSCHE_MARK }, // Deutsche Mark - { "JPY", 1000, CurrencyAffix::Prefix, u8"¥", CurrencyAffix::Suffix, "YEN", STR_YEN }, // Japanese Yen - { "ESP", 10, CurrencyAffix::Suffix, u8"Pts", CurrencyAffix::Suffix, "Pts", STR_PESETA }, // Spanish Peseta - { "ITL", 1000, CurrencyAffix::Prefix, u8"L", CurrencyAffix::Prefix, "L", STR_LIRA }, // Italian Lira - { "NLG", 10, CurrencyAffix::Prefix, u8"ƒ ", CurrencyAffix::Prefix, "fl.", STR_GUILDERS }, // Dutch Guilder - { "SEK", 100, CurrencyAffix::Suffix, u8" kr", CurrencyAffix::Suffix, " kr", STR_KRONA }, // Swedish Krona - { "EUR", 10, CurrencyAffix::Prefix, u8"€", CurrencyAffix::Suffix, "EUR", STR_EUROS }, // Euro - { "KRW", 10000, CurrencyAffix::Prefix, u8"₩", CurrencyAffix::Prefix, "W", STR_WON }, // South Korean Won - { "RUB", 1000, CurrencyAffix::Suffix, u8"₽", CurrencyAffix::Prefix, "R ", STR_ROUBLE }, // Russian Rouble - { "CZK", 100, CurrencyAffix::Suffix, u8" Kč", CurrencyAffix::Suffix, " Kc", STR_CZECH_KORUNA }, // Czech koruna - { "HKD", 100, CurrencyAffix::Prefix, u8"$", CurrencyAffix::Prefix, "HKD", STR_HONG_KONG_DOLLAR}, // Hong Kong Dollar - { "TWD", 1000, CurrencyAffix::Prefix, u8"NT$", CurrencyAffix::Prefix, "NT$", STR_NEW_TAIWAN_DOLLAR}, // New Taiwan Dollar - { "CNY", 100, CurrencyAffix::Prefix, u8"CN¥", CurrencyAffix::Prefix, "CNY", STR_CHINESE_YUAN }, // Chinese Yuan - { "HUF", 1000, CurrencyAffix::Suffix, u8" Ft", CurrencyAffix::Suffix, " Ft", STR_HUNGARIAN_FORINT}, // Hungarian Forint - { "CTM", 10, CurrencyAffix::Prefix, u8"Ctm", CurrencyAffix::Prefix, "Ctm", STR_CUSTOM_CURRENCY }, // Customizable currency + CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::count)] = { + { "GBP", 10, CurrencyAffix::prefix, u8"£", CurrencyAffix::suffix, "GBP", STR_POUNDS }, // British Pound + { "USD", 10, CurrencyAffix::prefix, u8"$", CurrencyAffix::prefix, "$", STR_DOLLARS }, // US Dollar + { "FRF", 10, CurrencyAffix::suffix, u8"F", CurrencyAffix::suffix, "F", STR_FRANC }, // French Franc + { "DEM", 10, CurrencyAffix::prefix, u8"DM", CurrencyAffix::prefix, "DM", STR_DEUTSCHE_MARK }, // Deutsche Mark + { "JPY", 1000, CurrencyAffix::prefix, u8"¥", CurrencyAffix::suffix, "YEN", STR_YEN }, // Japanese Yen + { "ESP", 10, CurrencyAffix::suffix, u8"Pts", CurrencyAffix::suffix, "Pts", STR_PESETA }, // Spanish Peseta + { "ITL", 1000, CurrencyAffix::prefix, u8"L", CurrencyAffix::prefix, "L", STR_LIRA }, // Italian Lira + { "NLG", 10, CurrencyAffix::prefix, u8"ƒ ", CurrencyAffix::prefix, "fl.", STR_GUILDERS }, // Dutch Guilder + { "SEK", 100, CurrencyAffix::suffix, u8" kr", CurrencyAffix::suffix, " kr", STR_KRONA }, // Swedish Krona + { "EUR", 10, CurrencyAffix::prefix, u8"€", CurrencyAffix::suffix, "EUR", STR_EUROS }, // Euro + { "KRW", 10000, CurrencyAffix::prefix, u8"₩", CurrencyAffix::prefix, "W", STR_WON }, // South Korean Won + { "RUB", 1000, CurrencyAffix::suffix, u8"₽", CurrencyAffix::prefix, "R ", STR_ROUBLE }, // Russian Rouble + { "CZK", 100, CurrencyAffix::suffix, u8" Kč", CurrencyAffix::suffix, " Kc", STR_CZECH_KORUNA }, // Czech koruna + { "HKD", 100, CurrencyAffix::prefix, u8"$", CurrencyAffix::prefix, "HKD", STR_HONG_KONG_DOLLAR}, // Hong Kong Dollar + { "TWD", 1000, CurrencyAffix::prefix, u8"NT$", CurrencyAffix::prefix, "NT$", STR_NEW_TAIWAN_DOLLAR}, // New Taiwan Dollar + { "CNY", 100, CurrencyAffix::prefix, u8"CN¥", CurrencyAffix::prefix, "CNY", STR_CHINESE_YUAN }, // Chinese Yuan + { "HUF", 1000, CurrencyAffix::suffix, u8" Ft", CurrencyAffix::suffix, " Ft", STR_HUNGARIAN_FORINT}, // Hungarian Forint + { "CTM", 10, CurrencyAffix::prefix, u8"Ctm", CurrencyAffix::prefix, "Ctm", STR_CUSTOM_CURRENCY }, // Customizable currency }; // clang-format on void CurrencyLoadCustomCurrencyConfig() { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = Config::Get().general.CustomCurrencyRate; - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = Config::Get().general.CustomCurrencyAffix; - if (!Config::Get().general.CustomCurrencySymbol.empty()) + CurrencyDescriptors[EnumValue(CurrencyType::custom)].rate = Config::Get().general.customCurrencyRate; + CurrencyDescriptors[EnumValue(CurrencyType::custom)].affix_unicode = Config::Get().general.customCurrencyAffix; + if (!Config::Get().general.customCurrencySymbol.empty()) { String::safeUtf8Copy( - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, - Config::Get().general.CustomCurrencySymbol.c_str(), kCurrencySymbolMaxSize); + CurrencyDescriptors[EnumValue(CurrencyType::custom)].symbol_unicode, + Config::Get().general.customCurrencySymbol.c_str(), kCurrencySymbolMaxSize); } } money64 StringToMoney(const char* string_to_monetise) { const char* decimal_char = LanguageGetString(STR_LOCALE_DECIMAL_POINT); - const CurrencyDescriptor* currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)]; + const CurrencyDescriptor* currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)]; char processedString[128] = {}; Guard::Assert(strlen(string_to_monetise) < sizeof(processedString)); @@ -148,7 +148,7 @@ namespace OpenRCT2 return; } - const CurrencyDescriptor& currencyDesc = CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)]; + const CurrencyDescriptor& currencyDesc = CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)]; const char* sign = amount >= 0 ? "" : "-"; const uint64_t a = std::abs(amount) * currencyDesc.rate; diff --git a/src/openrct2/localisation/Currency.h b/src/openrct2/localisation/Currency.h index e0a651f1d5..a3b16cbd5a 100644 --- a/src/openrct2/localisation/Currency.h +++ b/src/openrct2/localisation/Currency.h @@ -35,7 +35,7 @@ namespace OpenRCT2 // List of currency formats // TODO: refactor into getter - extern CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)]; + extern CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::count)]; /** * Loads custom currency saved parameters into {@link CurrencyDescriptors}' diff --git a/src/openrct2/localisation/CurrencyTypes.h b/src/openrct2/localisation/CurrencyTypes.h index 26c5ecfaa7..fdf5d9dcca 100644 --- a/src/openrct2/localisation/CurrencyTypes.h +++ b/src/openrct2/localisation/CurrencyTypes.h @@ -16,32 +16,32 @@ namespace OpenRCT2 // List of currencies enum class CurrencyType : uint8_t { - Pounds, // British Pound - Dollars, // US Dollar - Franc, // French Franc - DeutscheMark, // Deutsche Mark - Yen, // Japanese Yen - Peseta, // Spanish Peseta - Lira, // Italian Lira - Guilders, // Dutch Gilder - Krona, // Swedish Krona - Euros, // Euro - Won, // South Korean Won - Rouble, // Russian Rouble - CzechKoruna, // Czech koruna - HKD, // Hong Kong Dollar - TWD, // New Taiwan Dollar - Yuan, // Chinese Yuan - Forint, // Hungarian Forint + pounds, // British Pound + dollars, // US Dollar + franc, // French Franc + deutscheMark, // Deutsche Mark + yen, // Japanese Yen + peseta, // Spanish Peseta + lira, // Italian Lira + guilders, // Dutch Gilder + krona, // Swedish Krona + euros, // Euro + won, // South Korean Won + rouble, // Russian Rouble + czechKoruna, // Czech koruna + hongKongDollar, // Hong Kong Dollar + newTaiwanDollar, // New Taiwan Dollar + yuan, // Chinese Yuan + forint, // Hungarian Forint - Custom, // Custom currency + custom, // Custom currency - Count // Last item + count, // Last item }; enum class CurrencyAffix : uint8_t { - Prefix, - Suffix + prefix, + suffix }; } // namespace OpenRCT2 diff --git a/src/openrct2/localisation/FormatCodes.cpp b/src/openrct2/localisation/FormatCodes.cpp index 36a2b74b97..4c6efe1b7a 100644 --- a/src/openrct2/localisation/FormatCodes.cpp +++ b/src/openrct2/localisation/FormatCodes.cpp @@ -17,60 +17,60 @@ namespace OpenRCT2 { // clang-format off static const EnumMap FormatTokenMap = { - { "MOVE_X", FormatToken::Move, }, - { "NEWLINE", FormatToken::Newline, }, - { "NEWLINE_SMALLER", FormatToken::NewlineSmall, }, - { "TINYFONT", FormatToken::FontTiny, }, - { "MEDIUMFONT", FormatToken::FontMedium, }, - { "SMALLFONT", FormatToken::FontSmall, }, - { "OUTLINE", FormatToken::OutlineEnable, }, - { "OUTLINE_OFF", FormatToken::OutlineDisable, }, - { "WINDOW_COLOUR_1", FormatToken::ColourWindow1, }, - { "WINDOW_COLOUR_2", FormatToken::ColourWindow2, }, - { "WINDOW_COLOUR_3", FormatToken::ColourWindow3, }, - { "INLINE_SPRITE", FormatToken::InlineSprite, }, - { "COMMA32", FormatToken::Comma32, }, - { "INT32", FormatToken::Int32, }, - { "COMMA1DP16", FormatToken::Comma1dp16, }, - { "COMMA2DP32", FormatToken::Comma2dp32, }, - { "COMMA16", FormatToken::Comma16, }, - { "UINT16", FormatToken::UInt16, }, - { "CURRENCY2DP", FormatToken::Currency2dp, }, - { "CURRENCY", FormatToken::Currency, }, - { "STRINGID", FormatToken::StringById, }, - { "STRING", FormatToken::String, }, - { "MONTHYEAR", FormatToken::MonthYear, }, - { "MONTHYEAR_SENTENCE", FormatToken::MonthYearSentence, }, - { "MONTH", FormatToken::Month, }, - { "VELOCITY", FormatToken::Velocity, }, - { "POP16", FormatToken::Pop16, }, - { "PUSH16", FormatToken::Push16, }, - { "DURATION", FormatToken::DurationShort, }, - { "REALTIME", FormatToken::DurationLong, }, - { "LENGTH", FormatToken::Length, }, - { "HEIGHT", FormatToken::Height, }, - { "SPRITE", FormatToken::Sprite, }, - { "BLACK", FormatToken::ColourBlack, }, - { "GREY", FormatToken::ColourGrey, }, - { "WHITE", FormatToken::ColourWhite, }, - { "RED", FormatToken::ColourRed, }, - { "GREEN", FormatToken::ColourGreen, }, - { "YELLOW", FormatToken::ColourYellow, }, - { "TOPAZ", FormatToken::ColourTopaz, }, - { "CELADON", FormatToken::ColourCeladon, }, - { "BABYBLUE", FormatToken::ColourBabyBlue, }, - { "PALELAVENDER", FormatToken::ColourPaleLavender, }, - { "PALEGOLD", FormatToken::ColourPaleGold, }, - { "LIGHTPINK", FormatToken::ColourLightPink, }, - { "PEARLAQUA", FormatToken::ColourPearlAqua, }, - { "PALESILVER", FormatToken::ColourPaleSilver, }, + { "MOVE_X", FormatToken::move, }, + { "NEWLINE", FormatToken::newline, }, + { "NEWLINE_SMALLER", FormatToken::newlineSmall, }, + { "TINYFONT", FormatToken::fontTiny, }, + { "MEDIUMFONT", FormatToken::fontMedium, }, + { "SMALLFONT", FormatToken::fontSmall, }, + { "OUTLINE", FormatToken::outlineEnable, }, + { "OUTLINE_OFF", FormatToken::outlineDisable, }, + { "WINDOW_COLOUR_1", FormatToken::colourWindow1, }, + { "WINDOW_COLOUR_2", FormatToken::colourWindow2, }, + { "WINDOW_COLOUR_3", FormatToken::colourWindow3, }, + { "INLINE_SPRITE", FormatToken::inlineSprite, }, + { "COMMA32", FormatToken::comma32, }, + { "INT32", FormatToken::int32, }, + { "COMMA1DP16", FormatToken::comma1dp16, }, + { "COMMA2DP32", FormatToken::comma2dp32, }, + { "COMMA16", FormatToken::comma16, }, + { "UINT16", FormatToken::uint16, }, + { "CURRENCY2DP", FormatToken::currency2dp, }, + { "CURRENCY", FormatToken::currency, }, + { "STRINGID", FormatToken::stringById, }, + { "STRING", FormatToken::string, }, + { "MONTHYEAR", FormatToken::monthYear, }, + { "MONTHYEAR_SENTENCE", FormatToken::monthYearSentence, }, + { "MONTH", FormatToken::month, }, + { "VELOCITY", FormatToken::velocity, }, + { "POP16", FormatToken::pop16, }, + { "PUSH16", FormatToken::push16, }, + { "DURATION", FormatToken::durationShort, }, + { "REALTIME", FormatToken::durationLong, }, + { "LENGTH", FormatToken::length, }, + { "HEIGHT", FormatToken::height, }, + { "SPRITE", FormatToken::sprite, }, + { "BLACK", FormatToken::colourBlack, }, + { "GREY", FormatToken::colourGrey, }, + { "WHITE", FormatToken::colourWhite, }, + { "RED", FormatToken::colourRed, }, + { "GREEN", FormatToken::colourGreen, }, + { "YELLOW", FormatToken::colourYellow, }, + { "TOPAZ", FormatToken::colourTopaz, }, + { "CELADON", FormatToken::colourCeladon, }, + { "BABYBLUE", FormatToken::colourBabyBlue, }, + { "PALELAVENDER", FormatToken::colourPaleLavender, }, + { "PALEGOLD", FormatToken::colourPaleGold, }, + { "LIGHTPINK", FormatToken::colourLightPink, }, + { "PEARLAQUA", FormatToken::colourPearlAqua, }, + { "PALESILVER", FormatToken::colourPaleSilver, }, }; // clang-format on FormatToken FormatTokenFromString(std::string_view token) { auto result = FormatTokenMap.find(token); - return result != std::end(FormatTokenMap) ? result->second : FormatToken::Unknown; + return result != std::end(FormatTokenMap) ? result->second : FormatToken::unknown; } std::string FormatTokenToString(FormatToken token) @@ -91,25 +91,25 @@ namespace OpenRCT2 { switch (token) { - case FormatToken::Comma32: - case FormatToken::Int32: - case FormatToken::Comma1dp16: - case FormatToken::Comma2dp32: - case FormatToken::Comma16: - case FormatToken::UInt16: - case FormatToken::Currency2dp: - case FormatToken::Currency: - case FormatToken::StringById: - case FormatToken::String: - case FormatToken::MonthYear: - case FormatToken::MonthYearSentence: - case FormatToken::Month: - case FormatToken::Velocity: - case FormatToken::DurationShort: - case FormatToken::DurationLong: - case FormatToken::Length: - case FormatToken::Height: - case FormatToken::Sprite: + case FormatToken::comma32: + case FormatToken::int32: + case FormatToken::comma1dp16: + case FormatToken::comma2dp32: + case FormatToken::comma16: + case FormatToken::uint16: + case FormatToken::currency2dp: + case FormatToken::currency: + case FormatToken::stringById: + case FormatToken::string: + case FormatToken::monthYear: + case FormatToken::monthYearSentence: + case FormatToken::month: + case FormatToken::velocity: + case FormatToken::durationShort: + case FormatToken::durationLong: + case FormatToken::length: + case FormatToken::height: + case FormatToken::sprite: return true; default: return false; @@ -120,20 +120,20 @@ namespace OpenRCT2 { switch (token) { - case FormatToken::ColourBlack: - case FormatToken::ColourGrey: - case FormatToken::ColourWhite: - case FormatToken::ColourRed: - case FormatToken::ColourGreen: - case FormatToken::ColourYellow: - case FormatToken::ColourTopaz: - case FormatToken::ColourCeladon: - case FormatToken::ColourBabyBlue: - case FormatToken::ColourPaleLavender: - case FormatToken::ColourPaleGold: - case FormatToken::ColourLightPink: - case FormatToken::ColourPearlAqua: - case FormatToken::ColourPaleSilver: + case FormatToken::colourBlack: + case FormatToken::colourGrey: + case FormatToken::colourWhite: + case FormatToken::colourRed: + case FormatToken::colourGreen: + case FormatToken::colourYellow: + case FormatToken::colourTopaz: + case FormatToken::colourCeladon: + case FormatToken::colourBabyBlue: + case FormatToken::colourPaleLavender: + case FormatToken::colourPaleGold: + case FormatToken::colourLightPink: + case FormatToken::colourPearlAqua: + case FormatToken::colourPaleSilver: return true; default: return false; @@ -142,7 +142,7 @@ namespace OpenRCT2 TextColour FormatTokenToTextColour(FormatToken token) { - uint8_t value = EnumValue(token) - EnumValue(FormatToken::ColourBlack); + uint8_t value = EnumValue(token) - EnumValue(FormatToken::colourBlack); if (value >= kNumTextColours) return TextColour::black; @@ -152,20 +152,20 @@ namespace OpenRCT2 FormatToken FormatTokenFromTextColour(TextColour textColour) { static constexpr FormatToken tokens[] = { - FormatToken::ColourBlack, // TextColour::black - FormatToken::ColourGrey, // TextColour::grey - FormatToken::ColourWhite, // TextColour::white - FormatToken::ColourRed, // TextColour::red - FormatToken::ColourGreen, // TextColour::green - FormatToken::ColourYellow, // TextColour::yellow - FormatToken::ColourTopaz, // TextColour::topaz - FormatToken::ColourCeladon, // TextColour::celadon - FormatToken::ColourBabyBlue, // TextColour::babyBlue - FormatToken::ColourPaleLavender, // TextColour::paleLavender - FormatToken::ColourPaleGold, // TextColour::paleGold - FormatToken::ColourLightPink, // TextColour::lightPink - FormatToken::ColourPearlAqua, // TextColour::pearlAqua - FormatToken::ColourPaleSilver, // TextColour::paleSilver + FormatToken::colourBlack, // TextColour::black + FormatToken::colourGrey, // TextColour::grey + FormatToken::colourWhite, // TextColour::white + FormatToken::colourRed, // TextColour::red + FormatToken::colourGreen, // TextColour::green + FormatToken::colourYellow, // TextColour::yellow + FormatToken::colourTopaz, // TextColour::topaz + FormatToken::colourCeladon, // TextColour::celadon + FormatToken::colourBabyBlue, // TextColour::babyBlue + FormatToken::colourPaleLavender, // TextColour::paleLavender + FormatToken::colourPaleGold, // TextColour::paleGold + FormatToken::colourLightPink, // TextColour::lightPink + FormatToken::colourPearlAqua, // TextColour::pearlAqua + FormatToken::colourPaleSilver, // TextColour::paleSilver }; return tokens[EnumValue(textColour)]; diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index bb0ccb70dd..1c6f8a5e53 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -19,66 +19,66 @@ namespace OpenRCT2 { enum class FormatToken : uint8_t { - Unknown, - Literal, - Escaped, + unknown, + literal, + escaped, - Newline, - NewlineSmall, + newline, + newlineSmall, // With parameters - Move, - InlineSprite, + move, + inlineSprite, // With arguments - Comma32, - Int32, - Comma1dp16, - Comma2dp32, - Comma16, - UInt16, - Currency2dp, - Currency, - StringById, - String, - MonthYear, - MonthYearSentence, - Month, - Velocity, - DurationShort, - DurationLong, - Length, - Height, - Sprite, - Pop16, - Push16, + comma32, + int32, + comma1dp16, + comma2dp32, + comma16, + uint16, + currency2dp, + currency, + stringById, + string, + monthYear, + monthYearSentence, + month, + velocity, + durationShort, + durationLong, + length, + height, + sprite, + pop16, + push16, // Colours - ColourWindow1, - ColourWindow2, - ColourWindow3, - ColourBlack, - ColourGrey, - ColourWhite, - ColourRed, - ColourGreen, - ColourYellow, - ColourTopaz, - ColourCeladon, - ColourBabyBlue, - ColourPaleLavender, - ColourPaleGold, - ColourLightPink, - ColourPearlAqua, - ColourPaleSilver, + colourWindow1, + colourWindow2, + colourWindow3, + colourBlack, + colourGrey, + colourWhite, + colourRed, + colourGreen, + colourYellow, + colourTopaz, + colourCeladon, + colourBabyBlue, + colourPaleLavender, + colourPaleGold, + colourLightPink, + colourPearlAqua, + colourPaleSilver, // Fonts - FontTiny, - FontSmall, - FontMedium, + fontTiny, + fontSmall, + fontMedium, - OutlineEnable, - OutlineDisable, + outlineEnable, + outlineDisable, }; FormatToken FormatTokenFromString(std::string_view token); diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index b90afb8c09..db1948189a 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -70,17 +70,17 @@ namespace OpenRCT2 bool FmtString::Token::IsLiteral() const { - return kind == FormatToken::Literal; + return kind == FormatToken::literal; } bool FmtString::Token::IsCodepoint() const { - return kind == FormatToken::Escaped; + return kind == FormatToken::escaped; } codepoint_t FmtString::Token::GetCodepoint() const { - if (kind == FormatToken::Escaped) + if (kind == FormatToken::escaped) { // Assume text is only "{{" or "}}" for now return text[0]; @@ -137,7 +137,7 @@ namespace OpenRCT2 { p = *p0; } - current = Token(FormatToken::Move, str.substr(startIndex, i - startIndex), p); + current = Token(FormatToken::move, str.substr(startIndex, i - startIndex), p); return; } @@ -155,7 +155,7 @@ namespace OpenRCT2 p |= (*p2) << 16; p |= (*p3) << 24; } - current = Token(FormatToken::InlineSprite, str.substr(startIndex, i - startIndex), p); + current = Token(FormatToken::inlineSprite, str.substr(startIndex, i - startIndex), p); return; } } @@ -186,7 +186,7 @@ namespace OpenRCT2 if (sztoken.size() >= 2 && ((sztoken[0] == '{' && sztoken[1] == '{') || (sztoken[0] == '}' && sztoken[1] == '}'))) { - return Token(FormatToken::Escaped, sztoken); + return Token(FormatToken::escaped, sztoken); } if (sztoken.size() >= 2 && sztoken[0] == '{' && sztoken[1] != '{') { @@ -195,9 +195,9 @@ namespace OpenRCT2 } if (sztoken == "\n" || sztoken == "\r") { - return Token(FormatToken::Newline, sztoken); + return Token(FormatToken::newline, sztoken); } - return Token(FormatToken::Literal, sztoken); + return Token(FormatToken::literal, sztoken); } const FmtString::Token* FmtString::iterator::operator->() const @@ -400,7 +400,7 @@ namespace OpenRCT2 template void FormatCurrency(FormatBuffer& ss, T rawValue) { - auto currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)]; + auto currencyDesc = &CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)]; auto value = static_cast(rawValue) * currencyDesc->rate; // Negative sign @@ -426,7 +426,7 @@ namespace OpenRCT2 } // Currency symbol prefix - if (affix == CurrencyAffix::Prefix) + if (affix == CurrencyAffix::prefix) { ss << symbol; } @@ -447,7 +447,7 @@ namespace OpenRCT2 } // Currency symbol suffix - if (affix == CurrencyAffix::Suffix) + if (affix == CurrencyAffix::suffix) { ss << symbol; } @@ -504,21 +504,21 @@ namespace OpenRCT2 { switch (token) { - case FormatToken::UInt16: - case FormatToken::Int32: + case FormatToken::uint16: + case FormatToken::int32: if constexpr (std::is_integral()) { FormatNumber<0, false>(ss, arg); } break; - case FormatToken::Comma16: - case FormatToken::Comma32: + case FormatToken::comma16: + case FormatToken::comma32: if constexpr (std::is_integral()) { FormatNumber<0, true>(ss, arg); } break; - case FormatToken::Comma1dp16: + case FormatToken::comma1dp16: if constexpr (std::is_integral()) { FormatNumber<1, true>(ss, arg); @@ -528,7 +528,7 @@ namespace OpenRCT2 FormatNumber<1, true>(ss, std::round(arg * 10)); } break; - case FormatToken::Comma2dp32: + case FormatToken::comma2dp32: if constexpr (std::is_integral()) { FormatNumber<2, true>(ss, arg); @@ -538,22 +538,22 @@ namespace OpenRCT2 FormatNumber<2, true>(ss, std::round(arg * 100)); } break; - case FormatToken::Currency2dp: + case FormatToken::currency2dp: if constexpr (std::is_integral()) { FormatCurrency<2, true>(ss, arg); } break; - case FormatToken::Currency: + case FormatToken::currency: if constexpr (std::is_integral()) { FormatCurrency<0, true>(ss, arg); } break; - case FormatToken::Velocity: + case FormatToken::velocity: if constexpr (std::is_integral()) { - switch (Config::Get().general.MeasurementFormat) + switch (Config::Get().general.measurementFormat) { default: case MeasurementFormat::Imperial: @@ -568,22 +568,22 @@ namespace OpenRCT2 } } break; - case FormatToken::DurationShort: + case FormatToken::durationShort: if constexpr (std::is_integral()) { FormatMinutesSeconds(ss, arg); } break; - case FormatToken::DurationLong: + case FormatToken::durationLong: if constexpr (std::is_integral()) { FormatHoursMinutes(ss, arg); } break; - case FormatToken::Length: + case FormatToken::length: if constexpr (std::is_integral()) { - switch (Config::Get().general.MeasurementFormat) + switch (Config::Get().general.measurementFormat) { default: case MeasurementFormat::Imperial: @@ -596,11 +596,11 @@ namespace OpenRCT2 } } break; - case FormatToken::Height: + case FormatToken::height: if constexpr (std::is_integral()) { auto metres = HeightUnitsToMetres(arg); - switch (Config::Get().general.MeasurementFormat) + switch (Config::Get().general.measurementFormat) { default: case MeasurementFormat::Imperial: @@ -613,16 +613,16 @@ namespace OpenRCT2 } } break; - case FormatToken::MonthYear: - case FormatToken::MonthYearSentence: + case FormatToken::monthYear: + case FormatToken::monthYearSentence: if constexpr (std::is_integral()) { auto month = DateGetMonth(arg); auto year = DateGetYear(arg) + 1; - FormatMonthYear(ss, month, year, token == FormatToken::MonthYearSentence); + FormatMonthYear(ss, month, year, token == FormatToken::monthYearSentence); } break; - case FormatToken::Month: + case FormatToken::month: if constexpr (std::is_integral()) { auto szMonth = LanguageGetString(DateGameMonthNames[DateGetMonth(arg)]); @@ -632,10 +632,10 @@ namespace OpenRCT2 } } break; - case FormatToken::String: + case FormatToken::string: ss << arg; break; - case FormatToken::Sprite: + case FormatToken::sprite: if constexpr (std::is_integral()) { auto idx = static_cast(arg); @@ -720,7 +720,7 @@ namespace OpenRCT2 { for (const auto& token : fmt) { - if (token.kind == FormatToken::StringById) + if (token.kind == FormatToken::stringById) { if (argIndex < args.size()) { @@ -760,7 +760,7 @@ namespace OpenRCT2 } argIndex++; } - else if (token.kind != FormatToken::Push16 && token.kind != FormatToken::Pop16) + else if (token.kind != FormatToken::push16 && token.kind != FormatToken::pop16) { ss << token.text; } @@ -798,48 +798,48 @@ namespace OpenRCT2 { switch (t.kind) { - case FormatToken::Comma32: - case FormatToken::Int32: - case FormatToken::Comma2dp32: - case FormatToken::Sprite: + case FormatToken::comma32: + case FormatToken::int32: + case FormatToken::comma2dp32: + case FormatToken::sprite: anyArgs.emplace_back(ReadFromArgs(args)); break; - case FormatToken::Currency2dp: - case FormatToken::Currency: + case FormatToken::currency2dp: + case FormatToken::currency: anyArgs.emplace_back(ReadFromArgs(args)); break; - case FormatToken::UInt16: - case FormatToken::MonthYear: - case FormatToken::MonthYearSentence: - case FormatToken::Month: - case FormatToken::Velocity: - case FormatToken::DurationShort: - case FormatToken::DurationLong: + case FormatToken::uint16: + case FormatToken::monthYear: + case FormatToken::monthYearSentence: + case FormatToken::month: + case FormatToken::velocity: + case FormatToken::durationShort: + case FormatToken::durationLong: anyArgs.emplace_back(ReadFromArgs(args)); break; - case FormatToken::Comma16: - case FormatToken::Length: - case FormatToken::Height: - case FormatToken::Comma1dp16: + case FormatToken::comma16: + case FormatToken::length: + case FormatToken::height: + case FormatToken::comma1dp16: anyArgs.emplace_back(ReadFromArgs(args)); break; - case FormatToken::StringById: + case FormatToken::stringById: { auto stringId = ReadFromArgs(args); anyArgs.emplace_back(stringId); BuildAnyArgListFromLegacyArgBuffer(GetFmtStringById(stringId), anyArgs, args); break; } - case FormatToken::String: + case FormatToken::string: { auto sz = ReadFromArgs(args); anyArgs.emplace_back(sz); break; } - case FormatToken::Pop16: + case FormatToken::pop16: args = reinterpret_cast(reinterpret_cast(args) + 2); break; - case FormatToken::Push16: + case FormatToken::push16: args = reinterpret_cast(reinterpret_cast(args) - 2); break; default: diff --git a/src/openrct2/localisation/Formatting.h b/src/openrct2/localisation/Formatting.h index 9d40941948..eaa7dcb775 100644 --- a/src/openrct2/localisation/Formatting.h +++ b/src/openrct2/localisation/Formatting.h @@ -238,7 +238,7 @@ namespace OpenRCT2 while (!it.eol()) { auto token = *it++; - if (token.kind == FormatToken::StringById) + if (token.kind == FormatToken::stringById) { if constexpr (std::is_integral()) { diff --git a/src/openrct2/localisation/Language.h b/src/openrct2/localisation/Language.h index 187dc1decf..6501c9c236 100644 --- a/src/openrct2/localisation/Language.h +++ b/src/openrct2/localisation/Language.h @@ -53,22 +53,22 @@ namespace OpenRCT2 enum class RCT2LanguageId : uint8_t { - EnglishUK, - EnglishUS, - French, - German, - Spanish, - Italian, - Dutch, - Swedish, - Japanese, - Korean, - ChineseSimplified, - ChineseTraditional, - Undefined, - Portuguese, - Blank = 254, - End = 255 + englishUK, + englishUS, + french, + german, + spanish, + italian, + dutch, + swedish, + japanese, + korean, + chineseSimplified, + chineseTraditional, + undefined, + portuguese, + blank = 254, + end = 255 }; struct LanguageDescriptor diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 8d80493ed7..24f9f8804b 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -85,11 +85,11 @@ StringId AwardGetNews(AwardType type) /** More than 1/16 of the total guests must be thinking untidy thoughts. */ static bool AwardIsDeservedMostUntidy(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::MostBeautiful)) + if (activeAwardTypes & EnumToFlag(AwardType::mostBeautiful)) return false; - if (activeAwardTypes & EnumToFlag(AwardType::BestStaff)) + if (activeAwardTypes & EnumToFlag(AwardType::bestStaff)) return false; - if (activeAwardTypes & EnumToFlag(AwardType::MostTidy)) + if (activeAwardTypes & EnumToFlag(AwardType::mostTidy)) return false; uint32_t negativeCount = 0; @@ -115,9 +115,9 @@ static bool AwardIsDeservedMostUntidy(GameState_t& gameState, int32_t activeAwar /** More than 1/64 of the total guests must be thinking tidy thoughts and less than 6 guests thinking untidy thoughts. */ static bool AwardIsDeservedMostTidy(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::MostUntidy)) + if (activeAwardTypes & EnumToFlag(AwardType::mostUntidy)) return false; - if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing)) + if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing)) return false; uint32_t positiveCount = 0; @@ -176,10 +176,10 @@ static bool AwardIsDeservedBestValue(GameState_t& gameState, int32_t activeAward { auto& park = gameState.park; - if (activeAwardTypes & EnumToFlag(AwardType::WorstValue)) + if (activeAwardTypes & EnumToFlag(AwardType::worstValue)) return false; - if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing)) + if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing)) return false; if ((park.flags & PARK_FLAGS_NO_MONEY) || !Park::EntranceFeeUnlocked()) @@ -197,9 +197,9 @@ static bool AwardIsDeservedBestValue(GameState_t& gameState, int32_t activeAward /** More than 1/128 of the total guests must be thinking scenic thoughts and fewer than 16 untidy thoughts. */ static bool AwardIsDeservedMostBeautiful(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::MostUntidy)) + if (activeAwardTypes & EnumToFlag(AwardType::mostUntidy)) return false; - if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing)) + if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing)) return false; uint32_t positiveCount = 0; @@ -232,7 +232,7 @@ static bool AwardIsDeservedWorstValue(GameState_t& gameState, int32_t activeAwar { auto& park = gameState.park; - if (activeAwardTypes & EnumToFlag(AwardType::BestValue)) + if (activeAwardTypes & EnumToFlag(AwardType::bestValue)) return false; if (park.flags & PARK_FLAGS_NO_MONEY) return false; @@ -277,11 +277,11 @@ static bool AwardIsDeservedSafest(GameState_t& gameState, [[maybe_unused]] int32 /** All staff types, at least 20 staff, one staff per 32 peeps. */ static bool AwardIsDeservedBestStaff(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::MostUntidy)) + if (activeAwardTypes & EnumToFlag(AwardType::mostUntidy)) return false; - auto staffCount = gameState.entities.GetEntityListCount(EntityType::Staff); - auto peepCount = gameState.entities.GetEntityListCount(EntityType::Guest); + auto staffCount = gameState.entities.GetEntityListCount(EntityType::staff); + auto peepCount = gameState.entities.GetEntityListCount(EntityType::guest); return ((staffCount != 0) && staffCount >= 20 && staffCount >= peepCount / 32); } @@ -289,7 +289,7 @@ static bool AwardIsDeservedBestStaff(GameState_t& gameState, int32_t activeAward /** At least 7 shops, 4 unique, one shop per 128 guests and no more than 12 hungry guests. */ static bool AwardIsDeservedBestFood(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::WorstFood)) + if (activeAwardTypes & EnumToFlag(AwardType::worstFood)) return false; uint32_t shops = 0; @@ -334,7 +334,7 @@ static bool AwardIsDeservedBestFood(GameState_t& gameState, int32_t activeAwardT /** No more than 2 unique shops, less than one shop per 256 guests and more than 15 hungry guests. */ static bool AwardIsDeservedWorstFood(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::BestFood)) + if (activeAwardTypes & EnumToFlag(AwardType::bestFood)) return false; uint32_t shops = 0; @@ -411,7 +411,7 @@ static bool AwardIsDeservedBestToilets(GameState_t& gameState, [[maybe_unused]] /** More than half of the rides have satisfaction <= 6 and park rating <= 650. */ static bool AwardIsDeservedMostDisappointing(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::BestValue)) + if (activeAwardTypes & EnumToFlag(AwardType::bestValue)) return false; if (gameState.park.rating > 650) return false; @@ -466,7 +466,7 @@ static bool AwardIsDeservedBestWaterRides(GameState_t& gameState, [[maybe_unused /** At least 6 custom designed rides. */ static bool AwardIsDeservedBestCustomDesignedRides(GameState_t& gameState, int32_t activeAwardTypes) { - if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing)) + if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing)) return false; auto customDesignedRides = 0; @@ -497,7 +497,7 @@ static bool AwardIsDeservedMostDazzlingRideColours(GameState_t& gameState, int32 COLOUR_BRIGHT_PINK, }; - if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing)) + if (activeAwardTypes & EnumToFlag(AwardType::mostDisappointing)) return false; auto countedRides = 0; @@ -607,7 +607,7 @@ void AwardReset() static void AwardAdd(AwardType type) { getGameState().park.currentAwards.push_back(Award{ 5u, type }); - if (Config::Get().notifications.ParkAward) + if (Config::Get().notifications.parkAward) { News::AddItemToQueue(News::ItemType::award, AwardGetNews(type), 0, {}); } @@ -658,7 +658,7 @@ void AwardUpdateAll() AwardType awardType; do { - awardType = static_cast((((ScenarioRand() & 0xFF) * EnumValue(AwardType::Count)) >> 8) & 0xFF); + awardType = static_cast((((ScenarioRand() & 0xFF) * EnumValue(AwardType::count)) >> 8) & 0xFF); } while (activeAwardTypes & (1 << EnumValue(awardType))); // Check if award is deserved diff --git a/src/openrct2/management/Award.h b/src/openrct2/management/Award.h index 60790f0954..02950ff455 100644 --- a/src/openrct2/management/Award.h +++ b/src/openrct2/management/Award.h @@ -17,26 +17,26 @@ enum class AwardType : uint16_t { - MostUntidy, - MostTidy, - BestRollerCoasters, - BestValue, - MostBeautiful, - WorstValue, - Safest, - BestStaff, - BestFood, - WorstFood, - BestToilets, - MostDisappointing, - BestWaterRides, - BestCustomDesignedRides, - MostDazzlingRideColours, - MostConfusingLayout, - BestGentleRides, - Count + mostUntidy, + mostTidy, + bestRollerCoasters, + bestValue, + mostBeautiful, + worstValue, + safest, + bestStaff, + bestFood, + worstFood, + bestToilets, + mostDisappointing, + bestWaterRides, + bestCustomDesignedRides, + mostDazzlingRideColours, + mostConfusingLayout, + bestGentleRides, + count, }; -static_assert(static_cast(AwardType::Count) < 32); // Awards are used in a 32bit bitset +static_assert(static_cast(AwardType::count) < 32); // Awards are used in a 32bit bitset struct Award { diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index 52ccdac77e..7e2576ac1e 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -83,7 +83,7 @@ uint16_t MarketingGetCampaignGuestGenerationProbability(int32_t campaignType) static void MarketingRaiseFinishedNotification(const MarketingCampaign& campaign) { - if (Config::Get().notifications.ParkMarketingCampaignFinished) + if (Config::Get().notifications.parkMarketingCampaignFinished) { Formatter ft; // This sets the string parameters for the marketing types that have an argument. @@ -155,22 +155,22 @@ void MarketingSetGuestCampaign(Guest* peep, int32_t campaignType) switch (campaign->Type) { case ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE: - peep->GiveItem(ShopItem::Voucher); + peep->GiveItem(ShopItem::voucher); peep->VoucherType = VOUCHER_TYPE_PARK_ENTRY_FREE; break; case ADVERTISING_CAMPAIGN_RIDE_FREE: - peep->GiveItem(ShopItem::Voucher); + peep->GiveItem(ShopItem::voucher); peep->VoucherType = VOUCHER_TYPE_RIDE_FREE; peep->VoucherRideId = campaign->RideId; peep->GuestHeadingToRideId = campaign->RideId; peep->GuestIsLostCountdown = 240; break; case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE: - peep->GiveItem(ShopItem::Voucher); + peep->GiveItem(ShopItem::voucher); peep->VoucherType = VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE; break; case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE: - peep->GiveItem(ShopItem::Voucher); + peep->GiveItem(ShopItem::voucher); peep->VoucherType = VOUCHER_TYPE_FOOD_OR_DRINK_FREE; peep->VoucherShopItem = campaign->ShopItemType; break; diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 05d7e9931f..58743f503c 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -238,7 +238,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s if (subjectLoc->x != kLocationNull) break; - if (peep->State != PeepState::OnRide && peep->State != PeepState::EnteringRide) + if (peep->State != PeepState::onRide && peep->State != PeepState::enteringRide) { subjectLoc = std::nullopt; break; @@ -397,8 +397,8 @@ void News::OpenSubject(News::ItemType type, int32_t subject) break; case News::ItemType::research: { - auto item = ResearchItem(subject, ResearchCategory::Transport, 0); - if (item.type == Research::EntryType::Ride) + auto item = ResearchItem(subject, ResearchCategory::transport, 0); + if (item.type == Research::EntryType::ride) { auto intent = Intent(INTENT_ACTION_NEW_RIDE_OF_TYPE); intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, item.baseRideType); diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index e09a1fd68c..45c194ff1d 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -198,7 +198,7 @@ void ResearchFinishItem(const ResearchItem& researchItem) gameState.researchLastItem = researchItem; ResearchInvalidateRelatedWindows(); - if (researchItem.type == Research::EntryType::Ride) + if (researchItem.type == Research::EntryType::ride) { // Ride auto base_ride_type = researchItem.baseRideType; @@ -253,7 +253,7 @@ void ResearchFinishItem(const ResearchItem& researchItem) if (GetRideTypeDescriptor(base_ride_type).HasFlag(RtdFlag::listVehiclesSeparately) || researchItem.flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) { - RideNaming naming = GetRideNaming(base_ride_type, *rideEntry); + RideNaming naming = GetRideNaming(base_ride_type, rideEntry); availabilityString = STR_NEWS_ITEM_RESEARCH_NEW_RIDE_AVAILABLE; ft.Add(naming.Name); } @@ -262,7 +262,7 @@ void ResearchFinishItem(const ResearchItem& researchItem) else { availabilityString = STR_NEWS_ITEM_RESEARCH_NEW_VEHICLE_AVAILABLE; - RideNaming baseRideNaming = GetRideNaming(base_ride_type, *rideEntry); + RideNaming baseRideNaming = GetRideNaming(base_ride_type, rideEntry); ft.Add(baseRideNaming.Name); ft.Add(rideEntry->naming.Name); @@ -270,7 +270,7 @@ void ResearchFinishItem(const ResearchItem& researchItem) if (!gSilentResearch) { - if (Config::Get().notifications.RideResearched) + if (Config::Get().notifications.rideResearched) { News::AddItemToQueue(News::ItemType::research, availabilityString, researchItem.rawValue, ft); } @@ -292,7 +292,7 @@ void ResearchFinishItem(const ResearchItem& researchItem) if (!gSilentResearch) { - if (Config::Get().notifications.RideResearched) + if (Config::Get().notifications.rideResearched) { News::AddItemToQueue( News::ItemType::research, STR_NEWS_ITEM_RESEARCH_NEW_SCENERY_SET_AVAILABLE, researchItem.rawValue, ft); @@ -503,7 +503,7 @@ bool ResearchInsertRideEntry(ride_type_t rideType, ObjectEntryIndex entryIndex, { if (rideType != kRideTypeNull && entryIndex != kObjectEntryIndexNull) { - auto tmpItem = ResearchItem(Research::EntryType::Ride, entryIndex, rideType, category, 0); + auto tmpItem = ResearchItem(Research::EntryType::ride, entryIndex, rideType, category, 0); ResearchInsert(std::move(tmpItem), researched); return true; } @@ -531,7 +531,7 @@ bool ResearchInsertSceneryGroupEntry(ObjectEntryIndex entryIndex, bool researche { if (entryIndex != kObjectEntryIndexNull) { - auto tmpItem = ResearchItem(Research::EntryType::Scenery, entryIndex, 0, ResearchCategory::SceneryGroup, 0); + auto tmpItem = ResearchItem(Research::EntryType::scenery, entryIndex, 0, ResearchCategory::sceneryGroup, 0); ResearchInsert(std::move(tmpItem), researched); return true; } @@ -648,7 +648,7 @@ bool SceneryGroupIsInvented(int32_t sgIndex) return std::none_of( std::begin(gameState.researchItemsUninvented), std::end(gameState.researchItemsUninvented), [sgIndex](const ResearchItem& item) { - return item.type == Research::EntryType::Scenery && item.entryIndex == sgIndex; + return item.type == Research::EntryType::scenery && item.entryIndex == sgIndex; }); } @@ -723,7 +723,7 @@ void SetEveryRideEntryNotInvented() */ StringId ResearchItem::GetName() const { - if (type == Research::EntryType::Ride) + if (type == Research::EntryType::ride) { const auto* rideEntry = GetRideEntryByIndex(entryIndex); if (rideEntry == nullptr) @@ -765,7 +765,7 @@ void ResearchRemoveFlags() static void ResearchRemoveNullItems(std::vector& items) { const auto it = std::remove_if(std::begin(items), std::end(items), [](const ResearchItem& researchItem) { - if (researchItem.type == Research::EntryType::Ride) + if (researchItem.type == Research::EntryType::ride) { return GetRideEntryByIndex(researchItem.entryIndex) == nullptr; } @@ -779,7 +779,7 @@ static void ResearchRemoveNullItems(std::vector& items) static void ResearchMarkItemAsResearched(const ResearchItem& item) { - if (item.type == Research::EntryType::Ride) + if (item.type == Research::EntryType::ride) { const auto* rideEntry = GetRideEntryByIndex(item.entryIndex); if (rideEntry != nullptr) @@ -794,7 +794,7 @@ static void ResearchMarkItemAsResearched(const ResearchItem& item) } } } - else if (item.type == Research::EntryType::Scenery) + else if (item.type == Research::EntryType::scenery) { const auto sgEntry = OpenRCT2::ObjectManager::GetObjectEntry(item.entryIndex); if (sgEntry != nullptr) @@ -1031,7 +1031,7 @@ static void ResearchUpdateFirstOfType(ResearchItem* researchItem) if (researchItem->IsNull()) return; - if (researchItem->type != Research::EntryType::Ride) + if (researchItem->type != Research::EntryType::ride) return; auto rideType = researchItem->baseRideType; @@ -1069,7 +1069,7 @@ void ResearchDetermineFirstOfType() for (const auto& researchItem : gameState.researchItemsInvented) { - if (researchItem.type != Research::EntryType::Ride) + if (researchItem.type != Research::EntryType::ride) continue; auto rideType = researchItem.baseRideType; diff --git a/src/openrct2/management/Research.h b/src/openrct2/management/Research.h index 5684950146..d6403ee42e 100644 --- a/src/openrct2/management/Research.h +++ b/src/openrct2/management/Research.h @@ -27,8 +27,8 @@ namespace OpenRCT2::Research { enum class EntryType : uint8_t { - Scenery = 0, - Ride = 1, + scenery = 0, + ride = 1, }; } @@ -41,13 +41,13 @@ enum enum class ResearchCategory : uint8_t { - Transport = 0, - Gentle = 1, - Rollercoaster = 2, - Thrill = 3, - Water = 4, - Shop = 5, - SceneryGroup = 6, + transport = 0, + gentle = 1, + rollercoaster = 2, + thrill = 3, + water = 4, + shop = 5, + sceneryGroup = 6, }; struct ResearchItem diff --git a/src/openrct2/network/NetworkAction.cpp b/src/openrct2/network/NetworkAction.cpp index c281f8f364..a9bb710edc 100644 --- a/src/openrct2/network/NetworkAction.cpp +++ b/src/openrct2/network/NetworkAction.cpp @@ -34,7 +34,7 @@ namespace OpenRCT2::Network { return static_cast(it - Actions.begin()); } - return Permission::Count; + return Permission::count; } Permission NetworkActions::FindCommandByPermissionName(const std::string& permission_name) @@ -46,10 +46,10 @@ namespace OpenRCT2::Network { return static_cast(it - Actions.begin()); } - return Permission::Count; + return Permission::count; } - const std::array(Permission::Count)> NetworkActions::Actions = { + const std::array(Permission::count)> NetworkActions::Actions = { NetworkAction{ STR_ACTION_CHAT, "PERMISSION_CHAT", diff --git a/src/openrct2/network/NetworkAction.h b/src/openrct2/network/NetworkAction.h index 5d754ae382..d82feac9be 100644 --- a/src/openrct2/network/NetworkAction.h +++ b/src/openrct2/network/NetworkAction.h @@ -20,31 +20,31 @@ namespace OpenRCT2::Network { enum class Permission : uint32_t { - Chat, - Terraform, - SetWaterLevel, - TogglePause, - CreateRide, - RemoveRide, - BuildRide, - RideProperties, - Scenery, - Path, - ClearLandscape, - Guest, - Staff, - ParkProperties, - ParkFunding, - KickPlayer, - ModifyGroups, - SetPlayerGroup, - Cheat, - ToggleSceneryCluster, - PasswordlessLogin, - ModifyTile, - EditScenarioOptions, + chat, + terraform, + setWaterLevel, + togglePause, + createRide, + removeRide, + buildRide, + rideProperties, + scenery, + path, + clearLandscape, + guest, + staff, + parkProperties, + parkFunding, + kickPlayer, + modifyGroups, + setPlayerGroup, + cheat, + toggleSceneryCluster, + passwordlessLogin, + modifyTile, + editScenarioOptions, - Count + count, }; class NetworkAction final @@ -58,7 +58,7 @@ namespace OpenRCT2::Network class NetworkActions final { public: - static const std::array(Permission::Count)> Actions; + static const std::array(Permission::count)> Actions; static Permission FindCommand(GameCommand command); static Permission FindCommandByPermissionName(const std::string& permission_name); diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index afe97f0e2f..084b362125 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -47,7 +47,7 @@ // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -constexpr uint8_t kStreamVersion = 0; +constexpr uint8_t kStreamVersion = 6; const std::string kStreamID = std::string(kOpenRCT2Version) + "-" + std::to_string(kStreamVersion); @@ -283,7 +283,7 @@ namespace OpenRCT2::Network // risk of tick collision with the server map and title screen map. GameActions::SuspendQueue(); - auto keyPath = GetPrivateKeyPath(Config::Get().network.PlayerName); + auto keyPath = GetPrivateKeyPath(Config::Get().network.playerName); if (!File::Exists(keyPath)) { Console::WriteLine("Generating key... This may take a while"); @@ -311,7 +311,7 @@ namespace OpenRCT2::Network const std::string hash = _key.PublicKeyHash(); const utf8* publicKeyHash = hash.c_str(); - keyPath = GetPublicKeyPath(Config::Get().network.PlayerName, publicKeyHash); + keyPath = GetPublicKeyPath(Config::Get().network.playerName, publicKeyHash); Console::WriteLine("Key generated, saving public bits as %s", keyPath.c_str()); try @@ -373,12 +373,12 @@ namespace OpenRCT2::Network return false; } - ServerName = Config::Get().network.ServerName; - ServerDescription = Config::Get().network.ServerDescription; - ServerGreeting = Config::Get().network.ServerGreeting; - ServerProviderName = Config::Get().network.ProviderName; - ServerProviderEmail = Config::Get().network.ProviderEmail; - ServerProviderWebsite = Config::Get().network.ProviderWebsite; + ServerName = Config::Get().network.serverName; + ServerDescription = Config::Get().network.serverDescription; + ServerGreeting = Config::Get().network.serverGreeting; + ServerProviderName = Config::Get().network.providerName; + ServerProviderEmail = Config::Get().network.providerEmail; + ServerProviderWebsite = Config::Get().network.providerWebsite; IsServerPlayerInvisible = gOpenRCT2Headless; @@ -386,7 +386,7 @@ namespace OpenRCT2::Network BeginChatLog(); BeginServerLog(); - Player* player = AddPlayer(Config::Get().network.PlayerName, ""); + Player* player = AddPlayer(Config::Get().network.playerName, ""); player->Flags |= PlayerFlags::kIsServer; player->Group = 0; player_id = player->Id; @@ -407,7 +407,7 @@ namespace OpenRCT2::Network status = Status::connected; listening_port = port; - _serverState.gamestateSnapshotsEnabled = Config::Get().network.DesyncDebugging; + _serverState.gamestateSnapshotsEnabled = Config::Get().network.desyncDebugging; _advertiser = CreateServerAdvertiser(listening_port); GameLoadScripts(); @@ -863,7 +863,7 @@ namespace OpenRCT2::Network intent.PutExtra(INTENT_EXTRA_MESSAGE, std::string{ str_desync }); ContextOpenIntent(&intent); - if (!Config::Get().network.StayConnected) + if (!Config::Get().network.stayConnected) { Close(); } @@ -935,12 +935,12 @@ namespace OpenRCT2::Network std::string NetworkBase::GetMasterServerUrl() { - if (Config::Get().network.MasterServerUrl.empty()) + if (Config::Get().network.masterServerUrl.empty()) { return kMasterServerURL; } - return Config::Get().network.MasterServerUrl; + return Config::Get().network.masterServerUrl; } NetworkGroup* NetworkBase::AddGroup() @@ -1059,7 +1059,7 @@ namespace OpenRCT2::Network // Spectator group auto spectator = std::make_unique(); spectator->SetName("Spectator"); - spectator->ToggleActionPermission(Permission::Chat); + spectator->ToggleActionPermission(Permission::chat); spectator->Id = 1; group_list.push_back(std::move(spectator)); @@ -1067,13 +1067,13 @@ namespace OpenRCT2::Network auto user = std::make_unique(); user->SetName("User"); user->ActionsAllowed.fill(0xFF); - user->ToggleActionPermission(Permission::KickPlayer); - user->ToggleActionPermission(Permission::ModifyGroups); - user->ToggleActionPermission(Permission::SetPlayerGroup); - user->ToggleActionPermission(Permission::Cheat); - user->ToggleActionPermission(Permission::PasswordlessLogin); - user->ToggleActionPermission(Permission::ModifyTile); - user->ToggleActionPermission(Permission::EditScenarioOptions); + user->ToggleActionPermission(Permission::kickPlayer); + user->ToggleActionPermission(Permission::modifyGroups); + user->ToggleActionPermission(Permission::setPlayerGroup); + user->ToggleActionPermission(Permission::cheat); + user->ToggleActionPermission(Permission::passwordlessLogin); + user->ToggleActionPermission(Permission::modifyTile); + user->ToggleActionPermission(Permission::editScenarioOptions); user->Id = 2; group_list.push_back(std::move(user)); @@ -1180,7 +1180,7 @@ namespace OpenRCT2::Network void NetworkBase::AppendChatLog(std::string_view s) { - if (Config::Get().network.LogChat && _chat_log_fs.is_open()) + if (Config::Get().network.logChat && _chat_log_fs.is_open()) { AppendLog(_chat_log_fs, s); } @@ -1218,7 +1218,7 @@ namespace OpenRCT2::Network void NetworkBase::AppendServerLog(const std::string& s) { - if (Config::Get().network.LogServerActions && _server_log_fs.is_open()) + if (Config::Get().network.logServerActions && _server_log_fs.is_open()) { AppendLog(_server_log_fs, s); } @@ -1670,13 +1670,13 @@ namespace OpenRCT2::Network json_t NetworkBase::GetServerInfoAsJson() const { json_t jsonObj = { - { "name", Config::Get().network.ServerName }, + { "name", Config::Get().network.serverName }, { "requiresPassword", _password.size() > 0 }, { "version", GetVersion() }, { "players", GetNumVisiblePlayers() }, - { "maxPlayers", Config::Get().network.Maxplayers }, - { "description", Config::Get().network.ServerDescription }, - { "greeting", Config::Get().network.ServerGreeting }, + { "maxPlayers", Config::Get().network.maxplayers }, + { "description", Config::Get().network.serverDescription }, + { "greeting", Config::Get().network.serverGreeting }, { "dedicated", gOpenRCT2Headless }, }; return jsonObj; @@ -1690,9 +1690,9 @@ namespace OpenRCT2::Network // Provider details json_t jsonProvider = { - { "name", Config::Get().network.ProviderName }, - { "email", Config::Get().network.ProviderEmail }, - { "website", Config::Get().network.ProviderWebsite }, + { "name", Config::Get().network.providerName }, + { "email", Config::Get().network.providerEmail }, + { "website", Config::Get().network.providerWebsite }, }; jsonObj["provider"] = jsonProvider; @@ -2212,7 +2212,7 @@ namespace OpenRCT2::Network void NetworkBase::Client_Handle_TOKEN(Connection& connection, Packet& packet) { - auto keyPath = GetPrivateKeyPath(Config::Get().network.PlayerName); + auto keyPath = GetPrivateKeyPath(Config::Get().network.playerName); if (!File::Exists(keyPath)) { LOG_ERROR("Key file (%s) was not found. Restart client to re-generate it.", keyPath.c_str()); @@ -2255,7 +2255,7 @@ namespace OpenRCT2::Network // when process dump gets collected at some point in future. _key.Unload(); - Client_Send_AUTH(Config::Get().network.PlayerName, gCustomPassword, pubkey, signature); + Client_Send_AUTH(Config::Get().network.playerName, gCustomPassword, pubkey, signature); } void NetworkBase::ServerHandleRequestGamestate(Connection& connection, Packet& packet) @@ -2688,7 +2688,7 @@ namespace OpenRCT2::Network if (verified) { LOG_VERBOSE("Connection %s: Signature verification ok. Hash %s", hostName, hash.c_str()); - if (Config::Get().network.KnownKeysOnly && _userManager.GetUserByHash(hash) == nullptr) + if (Config::Get().network.knownKeysOnly && _userManager.GetUserByHash(hash) == nullptr) { LOG_VERBOSE("Connection %s: Hash %s, not known", hostName, hash.c_str()); connection.AuthStatus = Auth::unknownKeyDisallowed; @@ -2717,7 +2717,7 @@ namespace OpenRCT2::Network const NetworkGroup* group = GetGroupByID(GetGroupIDByHash(connection.key.PublicKeyHash())); if (group != nullptr) { - passwordless = group->CanPerformAction(Permission::PasswordlessLogin); + passwordless = group->CanPerformAction(Permission::passwordlessLogin); } } if (gameversion != GetVersion()) @@ -2744,7 +2744,7 @@ namespace OpenRCT2::Network } } - if (GetNumVisiblePlayers() >= Config::Get().network.Maxplayers) + if (GetNumVisiblePlayers() >= Config::Get().network.maxplayers) { connection.AuthStatus = Auth::full; LOG_INFO("Connection %s: Server is full.", hostName); @@ -2952,7 +2952,7 @@ namespace OpenRCT2::Network if (connection.player != nullptr) { NetworkGroup* group = GetGroupByID(connection.player->Group); - if (group == nullptr || !group->CanPerformAction(Permission::Chat)) + if (group == nullptr || !group->CanPerformAction(Permission::chat)) { return; } @@ -3981,7 +3981,7 @@ namespace OpenRCT2::Network void SendPassword(const std::string& password) { auto& network = GetContext()->GetNetwork(); - const auto keyPath = GetPrivateKeyPath(Config::Get().network.PlayerName); + const auto keyPath = GetPrivateKeyPath(Config::Get().network.playerName); if (!File::Exists(keyPath)) { LOG_ERROR("Private key %s missing! Restart the game to generate it.", keyPath.c_str()); @@ -4004,7 +4004,7 @@ namespace OpenRCT2::Network // 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(Config::Get().network.PlayerName, password, pubkey, signature); + network.Client_Send_AUTH(Config::Get().network.playerName, password, pubkey, signature); } void SetPassword(const char* password) diff --git a/src/openrct2/network/NetworkGroup.cpp b/src/openrct2/network/NetworkGroup.cpp index b6f5fb7dc4..0a96fe3ad4 100644 --- a/src/openrct2/network/NetworkGroup.cpp +++ b/src/openrct2/network/NetworkGroup.cpp @@ -40,7 +40,7 @@ namespace OpenRCT2::Network const std::string permission = Json::GetString(jsonValue); Permission action_id = NetworkActions::FindCommandByPermissionName(permission); - if (action_id != Permission::Count) + if (action_id != Permission::count) { group.ToggleActionPermission(action_id); } @@ -123,7 +123,7 @@ namespace OpenRCT2::Network bool NetworkGroup::CanPerformCommand(GameCommand command) const { Permission action = NetworkActions::FindCommand(command); - if (action != Permission::Count) + if (action != Permission::count) { return CanPerformAction(action); } diff --git a/src/openrct2/network/NetworkServerAdvertiser.cpp b/src/openrct2/network/NetworkServerAdvertiser.cpp index d8a3c04841..51c5828de1 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.cpp +++ b/src/openrct2/network/NetworkServerAdvertiser.cpp @@ -93,7 +93,7 @@ namespace OpenRCT2::Network { UpdateLAN(); #ifndef DISABLE_HTTP - if (Config::Get().network.Advertise) + if (Config::Get().network.advertise) { UpdateWAN(); } @@ -183,9 +183,9 @@ namespace OpenRCT2::Network { "port", _port }, }; - if (!Config::Get().network.AdvertiseAddress.empty()) + if (!Config::Get().network.advertiseAddress.empty()) { - body["address"] = Config::Get().network.AdvertiseAddress; + body["address"] = Config::Get().network.advertiseAddress; } request.body = body.dump(); @@ -346,9 +346,9 @@ namespace OpenRCT2::Network static std::string GetMasterServerUrl() { std::string result = kMasterServerURL; - if (!Config::Get().network.MasterServerUrl.empty()) + if (!Config::Get().network.masterServerUrl.empty()) { - result = Config::Get().network.MasterServerUrl; + result = Config::Get().network.masterServerUrl; } return result; } diff --git a/src/openrct2/network/ServerList.cpp b/src/openrct2/network/ServerList.cpp index e857f3c60b..11ab4dfb73 100644 --- a/src/openrct2/network/ServerList.cpp +++ b/src/openrct2/network/ServerList.cpp @@ -364,9 +364,9 @@ namespace OpenRCT2::Network auto f = p->get_future(); std::string masterServerUrl = kMasterServerURL; - if (!Config::Get().network.MasterServerUrl.empty()) + if (!Config::Get().network.masterServerUrl.empty()) { - masterServerUrl = Config::Get().network.MasterServerUrl; + masterServerUrl = Config::Get().network.masterServerUrl; } Http::Request request; diff --git a/src/openrct2/object/BannerObject.cpp b/src/openrct2/object/BannerObject.cpp index 5118dfa346..2b373461eb 100644 --- a/src/openrct2/object/BannerObject.cpp +++ b/src/openrct2/object/BannerObject.cpp @@ -29,7 +29,7 @@ namespace OpenRCT2 _legacyType.scenery_tab_id = kObjectEntryIndexNull; stream->Seek(2, OpenRCT2::STREAM_SEEK_CURRENT); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); RCTObjectEntry sgEntry = stream->ReadValue(); SetPrimarySceneryGroup(ObjectEntryDescriptor(sgEntry)); @@ -39,13 +39,13 @@ namespace OpenRCT2 // Validate properties if (_legacyType.price <= 0.00_GBP) { - context->LogError(ObjectError::InvalidProperty, "Price can not be free or negative."); + context->LogError(ObjectError::invalidProperty, "Price can not be free or negative."); } // Add banners to 'Signs and items for footpaths' group, rather than lumping them in the Miscellaneous tab. // Since this is already done the other way round for original items, avoid adding those to prevent duplicates. auto firstSourceGame = GetFirstSourceGame(); - if (firstSourceGame == ObjectSourceGame::Custom) + if (firstSourceGame == ObjectSourceGame::custom) { auto scgPathX = Object::GetScgPathXHeader(); SetPrimarySceneryGroup(scgPathX); diff --git a/src/openrct2/object/EntranceObject.cpp b/src/openrct2/object/EntranceObject.cpp index 1e911c6b85..cb7ad7c51b 100644 --- a/src/openrct2/object/EntranceObject.cpp +++ b/src/openrct2/object/EntranceObject.cpp @@ -25,7 +25,7 @@ namespace OpenRCT2 _legacyType.scrolling_mode = stream->ReadValue(); _legacyType.text_height = stream->ReadValue(); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); GetImageTable().Read(context, stream); } diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index c83b6a4956..4c52b16207 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -25,13 +25,13 @@ namespace OpenRCT2 _legacyType.scrolling_mode = stream->ReadValue(); stream->Seek(1, STREAM_SEEK_CURRENT); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); GetImageTable().Read(context, stream); // Validate properties if (_legacyType.support_type >= RailingEntrySupportType::Count) { - context->LogError(ObjectError::InvalidProperty, "RailingEntrySupportType not supported."); + context->LogError(ObjectError::invalidProperty, "RailingEntrySupportType not supported."); } } diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index a05fa25e77..f7f829fd51 100644 --- a/src/openrct2/object/ImageTable.cpp +++ b/src/openrct2/object/ImageTable.cpp @@ -181,7 +181,7 @@ namespace OpenRCT2 catch (const std::exception& e) { auto msg = String::stdFormat("Unable to load image '%s': %s", s.c_str(), e.what()); - context->LogWarning(ObjectError::BadImageTable, msg.c_str()); + context->LogWarning(ObjectError::badImageTable, msg.c_str()); result.push_back(std::make_unique()); } } @@ -216,7 +216,7 @@ namespace OpenRCT2 catch (const std::exception& e) { auto msg = String::stdFormat("Unable to load image '%s': %s", path.c_str(), e.what()); - context->LogWarning(ObjectError::BadImageTable, msg.c_str()); + context->LogWarning(ObjectError::badImageTable, msg.c_str()); result.push_back(std::make_unique()); } return result; @@ -263,7 +263,7 @@ namespace OpenRCT2 if (placeHoldersAdded > 0) { std::string msg = "Adding " + std::to_string(placeHoldersAdded) + " placeholders"; - context->LogWarning(ObjectError::InvalidProperty, msg.c_str()); + context->LogWarning(ObjectError::invalidProperty, msg.c_str()); } } else @@ -275,7 +275,7 @@ namespace OpenRCT2 else { auto msg = String::stdFormat("Unable to load Gx '%s'", path.c_str()); - context->LogWarning(ObjectError::BadImageTable, msg.c_str()); + context->LogWarning(ObjectError::badImageTable, msg.c_str()); for (size_t i = 0; i < range.size(); i++) { result.push_back(std::make_unique()); @@ -328,13 +328,13 @@ namespace OpenRCT2 if (placeHoldersAdded > 0) { std::string msg = "Adding " + std::to_string(placeHoldersAdded) + " placeholders"; - context->LogWarning(ObjectError::InvalidProperty, msg.c_str()); + context->LogWarning(ObjectError::invalidProperty, msg.c_str()); } } else { std::string msg = "Unable to open '" + name + "'"; - context->LogWarning(ObjectError::InvalidProperty, msg.c_str()); + context->LogWarning(ObjectError::invalidProperty, msg.c_str()); for (size_t i = 0; i < range.size(); i++) { result.push_back(std::make_unique()); @@ -445,7 +445,7 @@ namespace OpenRCT2 uint64_t remainingBytes = stream->GetLength() - stream->GetPosition() - headerTableSize; if (remainingBytes > imageDataSize) { - context->LogVerbose(ObjectError::BadImageTable, "Image table size longer than expected."); + context->LogVerbose(ObjectError::badImageTable, "Image table size longer than expected."); imageDataSize = static_cast(remainingBytes); } @@ -453,7 +453,7 @@ namespace OpenRCT2 auto data = std::make_unique(dataSize); if (data == nullptr) { - context->LogError(ObjectError::BadImageTable, "Image table too large."); + context->LogError(ObjectError::badImageTable, "Image table too large."); throw std::runtime_error("Image table too large."); } @@ -485,7 +485,7 @@ namespace OpenRCT2 if (unreadBytes > 0) { std::fill_n(data.get() + readBytes, unreadBytes, 0); - context->LogWarning(ObjectError::BadImageTable, "Image table size shorter than expected."); + context->LogWarning(ObjectError::badImageTable, "Image table size shorter than expected."); } _data = std::move(data); @@ -493,7 +493,7 @@ namespace OpenRCT2 } catch (const std::exception&) { - context->LogError(ObjectError::BadImageTable, "Bad image table."); + context->LogError(ObjectError::badImageTable, "Bad image table."); throw; } } diff --git a/src/openrct2/object/LargeSceneryObject.cpp b/src/openrct2/object/LargeSceneryObject.cpp index 210df13341..8d6ad1fb06 100644 --- a/src/openrct2/object/LargeSceneryObject.cpp +++ b/src/openrct2/object/LargeSceneryObject.cpp @@ -64,7 +64,7 @@ namespace OpenRCT2 _legacyType.scrolling_mode = stream->ReadValue(); stream->Seek(4, OpenRCT2::STREAM_SEEK_CURRENT); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); RCTObjectEntry sgEntry = stream->ReadValue(); SetPrimarySceneryGroup(ObjectEntryDescriptor(sgEntry)); @@ -83,7 +83,7 @@ namespace OpenRCT2 // Validate properties if (_legacyType.price <= 0.00_GBP) { - context->LogError(ObjectError::InvalidProperty, "Price can not be free or negative."); + context->LogError(ObjectError::invalidProperty, "Price can not be free or negative."); } if (_legacyType.removal_price <= 0.00_GBP) { @@ -91,7 +91,7 @@ namespace OpenRCT2 const auto reimbursement = _legacyType.removal_price; if (reimbursement > _legacyType.price) { - context->LogError(ObjectError::InvalidProperty, "Sell price can not be more than buy price."); + context->LogError(ObjectError::invalidProperty, "Sell price can not be more than buy price."); } } diff --git a/src/openrct2/object/MusicObject.cpp b/src/openrct2/object/MusicObject.cpp index ae7f1945c5..263cdcb3e7 100644 --- a/src/openrct2/object/MusicObject.cpp +++ b/src/openrct2/object/MusicObject.cpp @@ -169,7 +169,7 @@ namespace OpenRCT2 auto source = Json::GetString(jTrack["source"]); if (source.empty()) { - context.LogError(ObjectError::InvalidProperty, "Invalid audio track definition."); + context.LogError(ObjectError::invalidProperty, "Invalid audio track definition."); } else { diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index e007f81044..f70921c41d 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -195,7 +195,7 @@ namespace OpenRCT2 ObjectSourceGame Object::GetFirstSourceGame() const { if (_sourceGames.size() == 0) - return ObjectSourceGame::Custom; + return ObjectSourceGame::custom; return _sourceGames[0]; } @@ -207,12 +207,12 @@ namespace OpenRCT2 std::string Object::GetName() const { - return GetString(ObjectStringID::NAME); + return GetString(ObjectStringID::name); } std::string Object::GetName(int32_t language) const { - return GetString(language, ObjectStringID::NAME); + return GetString(language, ObjectStringID::name); } ImageIndex Object::LoadImages() diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 568c550cea..9f4ca2da55 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -45,14 +45,14 @@ namespace OpenRCT2 enum class ObjectSourceGame : uint8_t { - Custom, - WackyWorlds, - TimeTwister, - OpenRCT2Official, - RCT1, - AddedAttractions, - LoopyLandscapes, - RCT2 = 8 + custom, + wackyWorlds, + timeTwister, + openRCT2Official, + rct1, + addedAttractions, + loopyLandscapes, + rct2 = 8, }; #pragma pack(push, 1) @@ -154,13 +154,13 @@ namespace OpenRCT2 enum class ObjectError : uint32_t { - Ok, - Unknown, - BadEncoding, - InvalidProperty, - BadStringTable, - BadImageTable, - UnexpectedEOF, + ok, + unknown, + badEncoding, + invalidProperty, + badStringTable, + badImageTable, + unexpectedEOF, }; struct IReadObjectContext diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index c1cc83dba9..d40c335886 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -224,17 +224,17 @@ namespace OpenRCT2::ObjectFactory static ObjectSourceGame ParseSourceGame(const std::string_view s) { static const std::unordered_map LookupTable{ - { "rct1", ObjectSourceGame::RCT1 }, - { "rct1aa", ObjectSourceGame::AddedAttractions }, - { "rct1ll", ObjectSourceGame::LoopyLandscapes }, - { "rct2", ObjectSourceGame::RCT2 }, - { "rct2ww", ObjectSourceGame::WackyWorlds }, - { "rct2tt", ObjectSourceGame::TimeTwister }, - { "official", ObjectSourceGame::OpenRCT2Official }, - { "custom", ObjectSourceGame::Custom }, + { "rct1", ObjectSourceGame::rct1 }, + { "rct1aa", ObjectSourceGame::addedAttractions }, + { "rct1ll", ObjectSourceGame::loopyLandscapes }, + { "rct2", ObjectSourceGame::rct2 }, + { "rct2ww", ObjectSourceGame::wackyWorlds }, + { "rct2tt", ObjectSourceGame::timeTwister }, + { "official", ObjectSourceGame::openRCT2Official }, + { "custom", ObjectSourceGame::custom }, }; auto result = LookupTable.find(s); - return (result != LookupTable.end()) ? result->second : ObjectSourceGame::Custom; + return (result != LookupTable.end()) ? result->second : ObjectSourceGame::custom; } static void ReadObjectLegacy(Object& object, IReadObjectContext* context, OpenRCT2::IStream* stream) @@ -246,11 +246,11 @@ namespace OpenRCT2::ObjectFactory catch (const IOException&) { // TODO check that ex is really EOF and not some other error - context->LogError(ObjectError::UnexpectedEOF, "Unexpectedly reached end of file."); + context->LogError(ObjectError::unexpectedEOF, "Unexpectedly reached end of file."); } catch (const std::exception&) { - context->LogError(ObjectError::Unknown, nullptr); + context->LogError(ObjectError::unknown, nullptr); } } @@ -506,18 +506,18 @@ namespace OpenRCT2::ObjectFactory else { LOG_ERROR("Object %s has an incorrect sourceGame parameter.", id.c_str()); - result.SetSourceGames({ ObjectSourceGame::Custom }); + result.SetSourceGames({ ObjectSourceGame::custom }); } } // >90% of objects are custom, so allow omitting the parameter without displaying an error. else if (sourceGames.is_null()) { - result.SetSourceGames({ ObjectSourceGame::Custom }); + result.SetSourceGames({ ObjectSourceGame::custom }); } else { LOG_ERROR("Object %s has an incorrect sourceGame parameter.", id.c_str()); - result.SetSourceGames({ ObjectSourceGame::Custom }); + result.SetSourceGames({ ObjectSourceGame::custom }); } } diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index 56f3fe57b6..0c71b854e7 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -195,7 +195,7 @@ namespace OpenRCT2 for (size_t i = 0; i < subList.size(); i++) { if (subList[i].Generation == ObjectGeneration::DAT && subList[i].Entry.GetName() == identifier - && subList[i].Entry.GetSourceGame() != ObjectSourceGame::Custom) + && subList[i].Entry.GetSourceGame() != ObjectSourceGame::custom) { return static_cast(i); } diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 1fae3b57d2..714d1290cc 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -202,6 +202,11 @@ namespace OpenRCT2 return RepositoryItemToObject(ori, slot); } + Object* LoadRepositoryItem(const ObjectRepositoryItem& ori) override + { + return RepositoryItemToObject(&ori); + } + void LoadObjects(const ObjectList& objectList, const bool reportProgress) override { // Find all the required objects @@ -294,19 +299,19 @@ namespace OpenRCT2 { switch (sourceGame) { - case ObjectSourceGame::RCT1: + case ObjectSourceGame::rct1: return STR_SCENARIO_CATEGORY_RCT1; - case ObjectSourceGame::AddedAttractions: + case ObjectSourceGame::addedAttractions: return STR_SCENARIO_CATEGORY_RCT1_AA; - case ObjectSourceGame::LoopyLandscapes: + case ObjectSourceGame::loopyLandscapes: return STR_SCENARIO_CATEGORY_RCT1_LL; - case ObjectSourceGame::RCT2: + case ObjectSourceGame::rct2: return STR_ROLLERCOASTER_TYCOON_2_DROPDOWN; - case ObjectSourceGame::WackyWorlds: + case ObjectSourceGame::wackyWorlds: return STR_OBJECT_FILTER_WW; - case ObjectSourceGame::TimeTwister: + case ObjectSourceGame::timeTwister: return STR_OBJECT_FILTER_TT; - case ObjectSourceGame::OpenRCT2Official: + case ObjectSourceGame::openRCT2Official: return STR_OBJECT_FILTER_OPENRCT2_OFFICIAL; default: return STR_OBJECT_FILTER_CUSTOM; diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index 3e1420e0c2..ebd128a314 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -44,6 +44,7 @@ namespace OpenRCT2 virtual Object* LoadObject(const RCTObjectEntry* entry) = 0; virtual Object* LoadObject(const ObjectEntryDescriptor& descriptor) = 0; virtual Object* LoadObject(const ObjectEntryDescriptor& descriptor, ObjectEntryIndex slot) = 0; + virtual Object* LoadRepositoryItem(const ObjectRepositoryItem& ori) = 0; virtual void LoadObjects(const ObjectList& entries, const bool reportProgress = false) = 0; virtual void UnloadObjects(const std::vector& entries) = 0; virtual void UnloadAllTransient() = 0; diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index 940a5013d5..8bcf1e6ac4 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -101,7 +101,7 @@ namespace OpenRCT2 // which can happen if the user copies the official DAT objects to their custom content folder. if (object == nullptr || (object->GetGeneration() == ObjectGeneration::DAT - && object->GetObjectEntry().GetSourceGame() != ObjectSourceGame::Custom)) + && object->GetObjectEntry().GetSourceGame() != ObjectSourceGame::custom)) { return std::nullopt; } @@ -649,13 +649,13 @@ namespace OpenRCT2 Guard::ArgumentNotNull(object); switch (object->GetFirstSourceGame()) { - case ObjectSourceGame::RCT1: - case ObjectSourceGame::AddedAttractions: - case ObjectSourceGame::LoopyLandscapes: - case ObjectSourceGame::RCT2: - case ObjectSourceGame::WackyWorlds: - case ObjectSourceGame::TimeTwister: - case ObjectSourceGame::OpenRCT2Official: + case ObjectSourceGame::rct1: + case ObjectSourceGame::addedAttractions: + case ObjectSourceGame::loopyLandscapes: + case ObjectSourceGame::rct2: + case ObjectSourceGame::wackyWorlds: + case ObjectSourceGame::timeTwister: + case ObjectSourceGame::openRCT2Official: return false; default: return true; diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index 1f18dec50c..39e4dd9421 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -69,7 +69,7 @@ namespace OpenRCT2 [[nodiscard]] ObjectSourceGame GetFirstSourceGame() const { if (Sources.empty()) - return ObjectSourceGame::Custom; + return ObjectSourceGame::custom; return static_cast(Sources[0]); } diff --git a/src/openrct2/object/PathAdditionEntry.h b/src/openrct2/object/PathAdditionEntry.h index 60fbb78850..f3a59d26a5 100644 --- a/src/openrct2/object/PathAdditionEntry.h +++ b/src/openrct2/object/PathAdditionEntry.h @@ -19,10 +19,10 @@ namespace OpenRCT2 { enum class PathAdditionDrawType : uint8_t { - Light, - Bin, - Bench, - JumpingFountain, + light, + bin, + bench, + jumpingFountain, }; enum diff --git a/src/openrct2/object/PathAdditionObject.cpp b/src/openrct2/object/PathAdditionObject.cpp index 144d00c1d2..1403113e7f 100644 --- a/src/openrct2/object/PathAdditionObject.cpp +++ b/src/openrct2/object/PathAdditionObject.cpp @@ -32,7 +32,7 @@ namespace OpenRCT2 _legacyType.scenery_tab_id = kObjectEntryIndexNull; stream->Seek(2, STREAM_SEEK_CURRENT); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); RCTObjectEntry sgEntry = stream->ReadValue(); SetPrimarySceneryGroup(ObjectEntryDescriptor(sgEntry)); @@ -42,13 +42,13 @@ namespace OpenRCT2 // Validate properties if (_legacyType.price <= 0.00_GBP) { - context->LogError(ObjectError::InvalidProperty, "Price can not be free or negative."); + context->LogError(ObjectError::invalidProperty, "Price can not be free or negative."); } // Add path additions to 'Signs and items for footpaths' group, rather than lumping them in the Miscellaneous tab. // Since this is already done the other way round for original items, avoid adding those to prevent duplicates. auto firstSourceGame = GetFirstSourceGame(); - if (firstSourceGame == ObjectSourceGame::Custom) + if (firstSourceGame == ObjectSourceGame::custom) { auto scgPathX = Object::GetScgPathXHeader(); SetPrimarySceneryGroup(scgPathX); @@ -82,14 +82,14 @@ namespace OpenRCT2 static PathAdditionDrawType ParseDrawType(const std::string& s) { if (s == "lamp") - return PathAdditionDrawType::Light; + return PathAdditionDrawType::light; if (s == "bin") - return PathAdditionDrawType::Bin; + return PathAdditionDrawType::bin; if (s == "bench") - return PathAdditionDrawType::Bench; + return PathAdditionDrawType::bench; if (s == "fountain") - return PathAdditionDrawType::JumpingFountain; - return PathAdditionDrawType::Light; + return PathAdditionDrawType::jumpingFountain; + return PathAdditionDrawType::light; } void PathAdditionObject::ReadJson(IReadObjectContext* context, json_t& root) diff --git a/src/openrct2/object/PeepAnimationsObject.cpp b/src/openrct2/object/PeepAnimationsObject.cpp index 21d961aa70..4e25f3ea32 100644 --- a/src/openrct2/object/PeepAnimationsObject.cpp +++ b/src/openrct2/object/PeepAnimationsObject.cpp @@ -22,11 +22,11 @@ namespace OpenRCT2 { static const EnumMap animationPeepTypeMap( { - { "guest", AnimationPeepType::Guest }, - { "handyman", AnimationPeepType::Handyman }, - { "mechanic", AnimationPeepType::Mechanic }, - { "security", AnimationPeepType::Security }, - { "entertainer", AnimationPeepType::Entertainer }, + { "guest", AnimationPeepType::guest }, + { "handyman", AnimationPeepType::handyman }, + { "mechanic", AnimationPeepType::mechanic }, + { "security", AnimationPeepType::security }, + { "entertainer", AnimationPeepType::entertainer }, }); void PeepAnimationsObject::Load() @@ -44,16 +44,16 @@ namespace OpenRCT2 auto& requiredAnimationMap = getAnimationsByPeepType(_peepType); for (auto& [typeStr, typeEnum] : requiredAnimationMap) { - group[typeEnum].base_image = _imageOffsetId + group[typeEnum].imageTableOffset; + group[typeEnum].baseImage = _imageOffsetId + group[typeEnum].imageTableOffset; group[typeEnum].bounds = inferMaxAnimationDimensions(group[typeEnum]); // Balloons, hats and umbrellas are painted separately, so the inference // algorithm doesn't account for those. We manually compensate for these here. // Between 8-12 pixels are needed, depending on rotation, so we're generalising. auto pag = PeepAnimationGroup(groupKey); - if (pag == PeepAnimationGroup::Balloon || pag == PeepAnimationGroup::Hat || pag == PeepAnimationGroup::Umbrella) + if (pag == PeepAnimationGroup::balloon || pag == PeepAnimationGroup::hat || pag == PeepAnimationGroup::umbrella) { - group[typeEnum].bounds.sprite_height_negative += 12; + group[typeEnum].bounds.spriteHeightNegative += 12; } } } @@ -87,14 +87,14 @@ namespace OpenRCT2 if (groupJson.contains("legacyPosition")) { auto position = Json::GetNumber(groupJson["legacyPosition"]); - if (position <= EnumValue(RCT12PeepAnimationGroup::Count)) + if (position <= EnumValue(RCT12PeepAnimationGroup::count)) { group.legacyPosition = static_cast(position); } } else { - group.legacyPosition = RCT12PeepAnimationGroup::Invalid; + group.legacyPosition = RCT12PeepAnimationGroup::invalid; } group.isSlowWalking = Json::GetBoolean(groupJson["isSlowWalking"], false); @@ -119,10 +119,10 @@ namespace OpenRCT2 if (referenceAnim.imageTableOffset != 0) { LOG_VERBOSE("Copying animation '%s' from primary group", std::string(typeStr).c_str()); - std::vector sequence = referenceAnim.frame_offsets; + std::vector sequence = referenceAnim.frameOffsets; group[typeEnum] = { .imageTableOffset = referenceAnim.imageTableOffset, - .frame_offsets = sequence, + .frameOffsets = sequence, }; continue; } @@ -142,7 +142,7 @@ namespace OpenRCT2 group[typeEnum] = { .imageTableOffset = Json::GetNumber(animJson["offset"]), - .frame_offsets = sequence, + .frameOffsets = sequence, }; } @@ -162,7 +162,7 @@ namespace OpenRCT2 std::string PeepAnimationsObject::GetCostumeName() const { - return GetStringTable().GetString(ObjectStringID::NAME); + return GetStringTable().GetString(ObjectStringID::name); } ImageIndex PeepAnimationsObject::GetInlineImageId() const diff --git a/src/openrct2/object/PeepAnimationsObject.h b/src/openrct2/object/PeepAnimationsObject.h index 62124b2704..0840e973f7 100644 --- a/src/openrct2/object/PeepAnimationsObject.h +++ b/src/openrct2/object/PeepAnimationsObject.h @@ -41,9 +41,9 @@ namespace OpenRCT2 ImageIndex GetInlineImageId() const; const PeepAnimation& GetPeepAnimation( - PeepAnimationGroup animGroup, PeepAnimationType animType = PeepAnimationType::Walking) const; + PeepAnimationGroup animGroup, PeepAnimationType animType = PeepAnimationType::walking) const; const SpriteBounds& GetSpriteBounds( - PeepAnimationGroup spriteType, PeepAnimationType actionAnimationGroup = PeepAnimationType::Walking) const; + PeepAnimationGroup spriteType, PeepAnimationType actionAnimationGroup = PeepAnimationType::walking) const; AnimationPeepType GetPeepType() const; size_t GetNumAnimationGroups() const; diff --git a/src/openrct2/object/ResourceTable.cpp b/src/openrct2/object/ResourceTable.cpp index 7ca4ba2ebd..910ab0547d 100644 --- a/src/openrct2/object/ResourceTable.cpp +++ b/src/openrct2/object/ResourceTable.cpp @@ -74,34 +74,34 @@ namespace OpenRCT2 auto& env = GetContext()->GetPlatformEnvironment(); if (String::startsWith(base, "$LGX:")) { - info.Kind = SourceKind::Gx; + info.Kind = SourceKind::gx; info.Path = fileName; } else if (String::startsWith(base, "$G1")) { auto dataPath = env.GetDirectoryPath(DirBase::rct2, DirId::data); - info.Kind = SourceKind::G1; + info.Kind = SourceKind::g1; // info.Path = env->FindFile(DirBase::rct2, DirId::data, "g1.dat"); } else if (String::startsWith(base, "$CSG")) { auto dataPath = env.GetDirectoryPath(DirBase::rct2, DirId::data); - info.Kind = SourceKind::Csg; + info.Kind = SourceKind::csg; // info.Path = env->FindFile(DirBase::rct2, DirId::data, "g1.dat"); } else if (String::startsWith(base, "$RCT1:DATA/")) { - info.Kind = SourceKind::Data; + info.Kind = SourceKind::data; info.Path = env.FindFile(DirBase::rct1, DirId::data, fileName); } else if (String::startsWith(base, "$RCT2:DATA/")) { - info.Kind = SourceKind::Data; + info.Kind = SourceKind::data; info.Path = env.FindFile(DirBase::rct2, DirId::data, fileName); } else if (String::startsWith(base, "$RCT2:OBJDATA/")) { - info.Kind = SourceKind::ObjData; + info.Kind = SourceKind::objData; info.Path = env.FindFile(DirBase::rct2, DirId::objects, fileName); } else if (!String::startsWith(base, "$")) diff --git a/src/openrct2/object/ResourceTable.h b/src/openrct2/object/ResourceTable.h index c8c5b97421..d8fb67d1a0 100644 --- a/src/openrct2/object/ResourceTable.h +++ b/src/openrct2/object/ResourceTable.h @@ -23,13 +23,13 @@ namespace OpenRCT2 protected: enum class SourceKind { - None, - Data, - ObjData, - Gx, - G1, - Csg, - Png, + none, + data, + objData, + gx, + g1, + csg, + png, }; struct SourceInfo diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 299973daf6..3c71d206ba 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -194,9 +194,9 @@ namespace OpenRCT2 _legacyType.shop_item[0] = static_cast(stream->ReadValue()); _legacyType.shop_item[1] = static_cast(stream->ReadValue()); - GetStringTable().Read(context, stream, ObjectStringID::NAME); - GetStringTable().Read(context, stream, ObjectStringID::DESCRIPTION); - GetStringTable().Read(context, stream, ObjectStringID::CAPACITY); + GetStringTable().Read(context, stream, ObjectStringID::name); + GetStringTable().Read(context, stream, ObjectStringID::description); + GetStringTable().Read(context, stream, ObjectStringID::capacity); // Read preset colours, by default there are 32 _presetColours.count = stream->ReadValue(); @@ -277,15 +277,15 @@ namespace OpenRCT2 // Validate properties if (_legacyType.excitement_multiplier > 75) { - context->LogError(ObjectError::InvalidProperty, "Excitement multiplier too high."); + context->LogError(ObjectError::invalidProperty, "Excitement multiplier too high."); } if (_legacyType.intensity_multiplier > 75) { - context->LogError(ObjectError::InvalidProperty, "Intensity multiplier too high."); + context->LogError(ObjectError::invalidProperty, "Intensity multiplier too high."); } if (_legacyType.nausea_multiplier > 75) { - context->LogError(ObjectError::InvalidProperty, "Nausea multiplier too high."); + context->LogError(ObjectError::invalidProperty, "Nausea multiplier too high."); } RideObjectUpdateRideType(_legacyType); _legacyType.Clearance = GetDefaultClearance(); @@ -391,12 +391,12 @@ namespace OpenRCT2 std::string RideObject::GetDescription() const { - return GetString(ObjectStringID::DESCRIPTION); + return GetString(ObjectStringID::description); } std::string RideObject::GetCapacity() const { - return GetString(ObjectStringID::CAPACITY); + return GetString(ObjectStringID::capacity); } ImageIndex RideObject::GetPreviewImage(ride_type_t type) @@ -430,9 +430,9 @@ namespace OpenRCT2 car.num_seats = stream->ReadValue(); CarSpriteFlags carSpriteFlags; carSpriteFlags.holder = stream->ReadValue(); - car.sprite_width = stream->ReadValue(); - car.sprite_height_negative = stream->ReadValue(); - car.sprite_height_positive = stream->ReadValue(); + car.spriteWidth = stream->ReadValue(); + car.spriteHeightNegative = stream->ReadValue(); + car.spriteHeightPositive = stream->ReadValue(); auto legacyAnimation = stream->ReadValue(); car.flags = stream->ReadValue(); // Implied in vanilla, but can be turned off in OpenRCT2. @@ -565,7 +565,7 @@ namespace OpenRCT2 if (rideType == kRideTypeNull) { - context->LogError(ObjectError::InvalidProperty, "Unknown ride type"); + context->LogError(ObjectError::invalidProperty, "Unknown ride type"); } } @@ -578,7 +578,7 @@ namespace OpenRCT2 // This needs to be set for both shops/facilities _and_ regular rides. for (auto& item : _legacyType.shop_item) { - item = ShopItem::None; + item = ShopItem::none; } auto carColours = Json::AsArray(properties["carColours"]); @@ -590,9 +590,9 @@ namespace OpenRCT2 auto& car = _legacyType.Cars[0]; car.spacing = 544; car.SpriteGroups[EnumValue(SpriteGroupType::SlopeFlat)].spritePrecision = SpritePrecision::Sprites4; - car.sprite_width = 1; - car.sprite_height_negative = 1; - car.sprite_height_positive = 1; + car.spriteWidth = 1; + car.spriteHeightNegative = 1; + car.spriteHeightPositive = 1; car.flags = CAR_ENTRY_FLAG_SPINNING; car.PaintStyle = VEHICLE_VISUAL_FLAT_RIDE_OR_CAR_RIDE; car.friction_sound_id = OpenRCT2::Audio::SoundId::null; @@ -606,9 +606,9 @@ namespace OpenRCT2 for (size_t i = 0; i < numShopItems; i++) { auto shopItem = ParseShopItem(Json::GetString(rideSells[i])); - if (shopItem == ShopItem::None) + if (shopItem == ShopItem::none) { - context->LogWarning(ObjectError::InvalidProperty, "Unknown shop item"); + context->LogWarning(ObjectError::invalidProperty, "Unknown shop item"); } _legacyType.shop_item[i] = shopItem; @@ -621,22 +621,22 @@ namespace OpenRCT2 auto swingMode = Json::GetNumber(properties["swingMode"]); if (swingMode == 1) { - _legacyType.flags |= RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_1; + _legacyType.flags |= RIDE_ENTRY_FLAG_INVERTER_SHIP_SWING_MODE; } else if (swingMode == 2) { - _legacyType.flags |= RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_1; - _legacyType.flags |= RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_2; + _legacyType.flags |= RIDE_ENTRY_FLAG_INVERTER_SHIP_SWING_MODE; + _legacyType.flags |= RIDE_ENTRY_FLAG_MAGIC_CARPET_SWING_MODE; } auto rotationMode = Json::GetNumber(properties["rotationMode"]); if (rotationMode == 1) { - _legacyType.flags |= RIDE_ENTRY_FLAG_ALTERNATIVE_ROTATION_MODE_1; + _legacyType.flags |= RIDE_ENTRY_FLAG_TWIST_ROTATION_TYPE; } else if (rotationMode == 2) { - _legacyType.flags |= RIDE_ENTRY_FLAG_ALTERNATIVE_ROTATION_MODE_2; + _legacyType.flags |= RIDE_ENTRY_FLAG_ENTERPRISE_ROTATION_TYPE; } auto ratingMultiplier = properties["ratingMultipler"]; @@ -745,9 +745,9 @@ namespace OpenRCT2 car.num_seats |= kVehicleSeatPairFlag; } - car.sprite_width = Json::GetNumber(jCar["spriteWidth"]); - car.sprite_height_negative = Json::GetNumber(jCar["spriteHeightNegative"]); - car.sprite_height_positive = Json::GetNumber(jCar["spriteHeightPositive"]); + car.spriteWidth = Json::GetNumber(jCar["spriteWidth"]); + car.spriteHeightNegative = Json::GetNumber(jCar["spriteHeightNegative"]); + car.spriteHeightPositive = Json::GetNumber(jCar["spriteHeightPositive"]); car.base_num_frames = Json::GetNumber(jCar["baseNumFrames"]); car.NumCarImages = Json::GetNumber(jCar["numImages"]); car.no_seating_rows = Json::GetNumber(jCar["numSeatRows"]); @@ -924,7 +924,7 @@ namespace OpenRCT2 { if (!std::has_single_bit(numRotationFrames)) { - context->LogError(ObjectError::InvalidProperty, "spriteGroups values must be powers of 2"); + context->LogError(ObjectError::invalidProperty, "spriteGroups values must be powers of 2"); continue; } car.SpriteGroups[i].spritePrecision = PrecisionFromNumFrames(numRotationFrames); @@ -1036,49 +1036,49 @@ namespace OpenRCT2 } static const EnumMap ShopItemLookupTable{ - { "burger", ShopItem::Burger }, - { "chips", ShopItem::Chips }, - { "ice_cream", ShopItem::IceCream }, - { "candyfloss", ShopItem::Candyfloss }, - { "pizza", ShopItem::Pizza }, - { "popcorn", ShopItem::Popcorn }, - { "hot_dog", ShopItem::HotDog }, - { "tentacle", ShopItem::Tentacle }, - { "toffee_apple", ShopItem::ToffeeApple }, - { "doughnut", ShopItem::Doughnut }, - { "chicken", ShopItem::Chicken }, - { "pretzel", ShopItem::Pretzel }, - { "funnel_cake", ShopItem::FunnelCake }, - { "beef_noodles", ShopItem::BeefNoodles }, - { "fried_rice_noodles", ShopItem::FriedRiceNoodles }, - { "wonton_soup", ShopItem::WontonSoup }, - { "meatball_soup", ShopItem::MeatballSoup }, - { "sub_sandwich", ShopItem::SubSandwich }, - { "cookie", ShopItem::Cookie }, - { "roast_sausage", ShopItem::RoastSausage }, - { "drink", ShopItem::Drink }, - { "coffee", ShopItem::Coffee }, - { "lemonade", ShopItem::Lemonade }, - { "chocolate", ShopItem::Chocolate }, - { "iced_tea", ShopItem::IcedTea }, - { "fruit_juice", ShopItem::FruitJuice }, - { "soybean_milk", ShopItem::SoybeanMilk }, - { "sujeonggwa", ShopItem::Sujeonggwa }, - { "balloon", ShopItem::Balloon }, - { "toy", ShopItem::Toy }, - { "map", ShopItem::Map }, - { "photo", ShopItem::Photo }, - { "umbrella", ShopItem::Umbrella }, - { "voucher", ShopItem::Voucher }, - { "hat", ShopItem::Hat }, - { "tshirt", ShopItem::TShirt }, - { "sunglasses", ShopItem::Sunglasses }, + { "burger", ShopItem::burger }, + { "chips", ShopItem::chips }, + { "ice_cream", ShopItem::iceCream }, + { "candyfloss", ShopItem::candyfloss }, + { "pizza", ShopItem::pizza }, + { "popcorn", ShopItem::popcorn }, + { "hot_dog", ShopItem::hotDog }, + { "tentacle", ShopItem::tentacle }, + { "toffee_apple", ShopItem::toffeeApple }, + { "doughnut", ShopItem::doughnut }, + { "chicken", ShopItem::chicken }, + { "pretzel", ShopItem::pretzel }, + { "funnel_cake", ShopItem::funnelCake }, + { "beef_noodles", ShopItem::beefNoodles }, + { "fried_rice_noodles", ShopItem::friedRiceNoodles }, + { "wonton_soup", ShopItem::wontonSoup }, + { "meatball_soup", ShopItem::meatballSoup }, + { "sub_sandwich", ShopItem::subSandwich }, + { "cookie", ShopItem::cookie }, + { "roast_sausage", ShopItem::roastSausage }, + { "drink", ShopItem::drink }, + { "coffee", ShopItem::coffee }, + { "lemonade", ShopItem::lemonade }, + { "chocolate", ShopItem::chocolate }, + { "iced_tea", ShopItem::icedTea }, + { "fruit_juice", ShopItem::fruitJuice }, + { "soybean_milk", ShopItem::soybeanMilk }, + { "sujeonggwa", ShopItem::sujeonggwa }, + { "balloon", ShopItem::balloon }, + { "toy", ShopItem::toy }, + { "map", ShopItem::map }, + { "photo", ShopItem::photo }, + { "umbrella", ShopItem::umbrella }, + { "voucher", ShopItem::voucher }, + { "hat", ShopItem::hat }, + { "tshirt", ShopItem::tShirt }, + { "sunglasses", ShopItem::sunglasses }, }; ShopItem RideObject::ParseShopItem(const std::string& s) { auto result = ShopItemLookupTable.find(s); - return (result != ShopItemLookupTable.end()) ? result->second : ShopItem::None; + return (result != ShopItemLookupTable.end()) ? result->second : ShopItem::none; } // Converts legacy sprite groups into OpenRCT2 sprite groups diff --git a/src/openrct2/object/ScenarioMetaObject.cpp b/src/openrct2/object/ScenarioMetaObject.cpp index fd483c313d..b4573a20a3 100644 --- a/src/openrct2/object/ScenarioMetaObject.cpp +++ b/src/openrct2/object/ScenarioMetaObject.cpp @@ -38,17 +38,17 @@ namespace OpenRCT2 std::string ScenarioMetaObject::GetScenarioName() { - return GetStringTable().GetString(ObjectStringID::NAME); // SCENARIO_NAME + return GetStringTable().GetString(ObjectStringID::name); // scenarioName } std::string ScenarioMetaObject::GetParkName() { - return GetStringTable().GetString(ObjectStringID::PARK_NAME); + return GetStringTable().GetString(ObjectStringID::parkName); } std::string ScenarioMetaObject::GetScenarioDetails() { - return GetStringTable().GetString(ObjectStringID::SCENARIO_DETAILS); + return GetStringTable().GetString(ObjectStringID::scenarioDetails); } PreviewImage ScenarioMetaObject::GetMiniMapImage() const diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index 1ccfeb56da..399c451896 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -48,7 +48,7 @@ namespace OpenRCT2 stream->Seek(1, STREAM_SEEK_CURRENT); // Pad109; _legacyType.entertainer_costumes = stream->ReadValue(); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); _items = ReadItems(stream); GetImageTable().Read(context, stream); } @@ -174,7 +174,7 @@ namespace OpenRCT2 if (entryName.length() != kDatEntryLength) { std::string errorMessage = "Malformed DAT entry in scenery group: " + entryName; - context->LogError(ObjectError::InvalidProperty, errorMessage.c_str()); + context->LogError(ObjectError::invalidProperty, errorMessage.c_str()); continue; } @@ -189,7 +189,7 @@ namespace OpenRCT2 catch (std::invalid_argument&) { std::string errorMessage = "Malformed flags in DAT entry in scenery group: " + entryName; - context->LogError(ObjectError::InvalidProperty, errorMessage.c_str()); + context->LogError(ObjectError::invalidProperty, errorMessage.c_str()); } } else diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index 8293481ea4..d305547404 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -38,7 +38,7 @@ namespace OpenRCT2 // Skip past the reserved space for the scenery_tab_id and an unused byte - the string table starts at offset 0x1C. stream->Seek(2, STREAM_SEEK_CURRENT); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); RCTObjectEntry sgEntry = stream->ReadValue(); SetPrimarySceneryGroup(ObjectEntryDescriptor(sgEntry)); @@ -58,7 +58,7 @@ namespace OpenRCT2 // Validate properties if (_legacyType.price <= 0.00_GBP) { - context->LogError(ObjectError::InvalidProperty, "Price can not be free or negative."); + context->LogError(ObjectError::invalidProperty, "Price can not be free or negative."); } if (_legacyType.removal_price <= 0.00_GBP) { @@ -66,7 +66,7 @@ namespace OpenRCT2 const auto reimbursement = _legacyType.removal_price; if (reimbursement > _legacyType.price) { - context->LogError(ObjectError::InvalidProperty, "Sell price can not be more than buy price."); + context->LogError(ObjectError::invalidProperty, "Sell price can not be more than buy price."); } } } diff --git a/src/openrct2/object/StringTable.cpp b/src/openrct2/object/StringTable.cpp index 8b1c198ca7..9c6fe8c044 100644 --- a/src/openrct2/object/StringTable.cpp +++ b/src/openrct2/object/StringTable.cpp @@ -55,9 +55,9 @@ namespace OpenRCT2 try { RCT2LanguageId rct2LanguageId; - while ((rct2LanguageId = static_cast(stream->ReadValue())) != RCT2LanguageId::End) + while ((rct2LanguageId = static_cast(stream->ReadValue())) != RCT2LanguageId::end) { - uint8_t languageId = (EnumValue(rct2LanguageId) <= EnumValue(RCT2LanguageId::Portuguese)) + uint8_t languageId = (EnumValue(rct2LanguageId) <= EnumValue(RCT2LanguageId::portuguese)) ? RCT2ToOpenRCT2LanguageId[EnumValue(rct2LanguageId)] : static_cast(LANGUAGE_UNDEFINED); std::string stringAsWin1252 = stream->ReadString(); @@ -76,7 +76,7 @@ namespace OpenRCT2 } catch (const std::exception&) { - context->LogError(ObjectError::BadStringTable, "Bad string table."); + context->LogError(ObjectError::badStringTable, "Bad string table."); throw; } Sort(); @@ -85,18 +85,18 @@ namespace OpenRCT2 ObjectStringID StringTable::ParseStringId(const std::string& s) { if (s == "name") - return ObjectStringID::NAME; + return ObjectStringID::name; if (s == "description") - return ObjectStringID::DESCRIPTION; + return ObjectStringID::description; if (s == "park_name") - return ObjectStringID::PARK_NAME; + return ObjectStringID::parkName; if (s == "details") - return ObjectStringID::SCENARIO_DETAILS; + return ObjectStringID::scenarioDetails; if (s == "capacity") - return ObjectStringID::CAPACITY; + return ObjectStringID::capacity; if (s == "vehicleName") - return ObjectStringID::VEHICLE_NAME; - return ObjectStringID::UNKNOWN; + return ObjectStringID::vehicleName; + return ObjectStringID::unknown; } void StringTable::ReadJson(json_t& root) @@ -109,7 +109,7 @@ namespace OpenRCT2 for (auto& [key, jsonLanguages] : jsonStrings.items()) { auto stringId = ParseStringId(key); - if (stringId != ObjectStringID::UNKNOWN) + if (stringId != ObjectStringID::unknown) { for (auto& [locale, jsonString] : jsonLanguages.items()) { diff --git a/src/openrct2/object/StringTable.h b/src/openrct2/object/StringTable.h index 10577ab998..f5f27b245f 100644 --- a/src/openrct2/object/StringTable.h +++ b/src/openrct2/object/StringTable.h @@ -22,19 +22,19 @@ namespace OpenRCT2 enum class ObjectStringID : uint8_t { - UNKNOWN = 255, - NAME = 0, - DESCRIPTION, - SCENARIO_NAME = 0, - PARK_NAME = 1, - SCENARIO_DETAILS = 2, - CAPACITY = 2, - VEHICLE_NAME = 3, + unknown = 255, + name = 0, + description, + scenarioName = 0, + parkName = 1, + scenarioDetails = 2, + capacity = 2, + vehicleName = 3, }; struct StringTableEntry { - ObjectStringID Id = ObjectStringID::UNKNOWN; + ObjectStringID Id = ObjectStringID::unknown; uint8_t LanguageId = LANGUAGE_UNDEFINED; std::string Text; }; diff --git a/src/openrct2/object/WallObject.cpp b/src/openrct2/object/WallObject.cpp index 63f717d2d3..2482b41a32 100644 --- a/src/openrct2/object/WallObject.cpp +++ b/src/openrct2/object/WallObject.cpp @@ -32,7 +32,7 @@ namespace OpenRCT2 stream->Seek(1, STREAM_SEEK_CURRENT); _legacyType.scrolling_mode = stream->ReadValue(); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); RCTObjectEntry sgEntry = stream->ReadValue(); SetPrimarySceneryGroup(ObjectEntryDescriptor(sgEntry)); @@ -42,7 +42,7 @@ namespace OpenRCT2 // Validate properties if (_legacyType.price <= 0.00_GBP) { - context->LogError(ObjectError::InvalidProperty, "Price can not be free or negative."); + context->LogError(ObjectError::invalidProperty, "Price can not be free or negative."); } // Autofix this object (will be turned into an official object later). diff --git a/src/openrct2/object/WaterObject.cpp b/src/openrct2/object/WaterObject.cpp index 0719225a7d..dfe0998ac3 100644 --- a/src/openrct2/object/WaterObject.cpp +++ b/src/openrct2/object/WaterObject.cpp @@ -30,7 +30,7 @@ namespace OpenRCT2 stream->Seek(14, STREAM_SEEK_CURRENT); _legacyType.flags = stream->ReadValue(); - GetStringTable().Read(context, stream, ObjectStringID::NAME); + GetStringTable().Read(context, stream, ObjectStringID::name); GetImageTable().Read(context, stream); } diff --git a/src/openrct2/paint/Paint.Entity.cpp b/src/openrct2/paint/Paint.Entity.cpp index 6126085b63..0cec9296d5 100644 --- a/src/openrct2/paint/Paint.Entity.cpp +++ b/src/openrct2/paint/Paint.Entity.cpp @@ -66,12 +66,12 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos) const auto staff = entity->As(); if (staff != nullptr) { - if (staff->AssignedStaffType != StaffType::Handyman) + if (staff->AssignedStaffType != StaffType::handyman) { continue; } } - else if (entity->Type != EntityType::Litter) + else if (entity->Type != EntityType::litter) { continue; } @@ -130,45 +130,45 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos) switch (entity->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: entity->cast()->Paint(session, image_direction); if (LightFx::ForVehiclesIsAvailable()) { LightFx::AddLightsMagicVehicle(entity->cast()); } break; - case EntityType::Guest: - case EntityType::Staff: + case EntityType::guest: + case EntityType::staff: entity->cast()->Paint(session, image_direction); break; - case EntityType::SteamParticle: + case EntityType::steamParticle: entity->cast()->Paint(session, image_direction); break; - case EntityType::MoneyEffect: + case EntityType::moneyEffect: entity->cast()->Paint(session, image_direction); break; - case EntityType::CrashedVehicleParticle: + case EntityType::crashedVehicleParticle: entity->cast()->Paint(session, image_direction); break; - case EntityType::ExplosionCloud: + case EntityType::explosionCloud: entity->cast()->Paint(session, image_direction); break; - case EntityType::CrashSplash: + case EntityType::crashSplash: entity->cast()->Paint(session, image_direction); break; - case EntityType::ExplosionFlare: + case EntityType::explosionFlare: entity->cast()->Paint(session, image_direction); break; - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: entity->cast()->Paint(session, image_direction); break; - case EntityType::Balloon: + case EntityType::balloon: entity->cast()->Paint(session, image_direction); break; - case EntityType::Duck: + case EntityType::duck: entity->cast()->Paint(session, image_direction); break; - case EntityType::Litter: + case EntityType::litter: entity->cast()->Paint(session, image_direction); break; default: diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index b15910bc84..8c5fb8b63c 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -1090,7 +1090,7 @@ void PaintDrawMoneyStructs(RenderTarget& rt, PaintStringStruct* ps) // Use sprite font unless the currency contains characters unsupported by the sprite font auto forceSpriteFont = false; - const auto& currencyDesc = CurrencyDescriptors[EnumValue(Config::Get().general.CurrencyFormat)]; + const auto& currencyDesc = CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)]; if (LocalisationService_UseTrueTypeFont() && FontSupportsStringSprite(currencyDesc.symbol_unicode)) { forceSpriteFont = true; diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 2fd0c56646..6ab1efbc38 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -74,7 +74,7 @@ void Painter::Paint(IDrawingEngine& de) if (text != nullptr) PaintReplayNotice(*rt, text); - if (Config::Get().general.ShowFPS) + if (Config::Get().general.showFPS) { PaintFPS(*rt); } @@ -124,7 +124,7 @@ void Painter::PaintFPS(RenderTarget& rt) // Move counter below toolbar if buttons are centred const bool isTitle = gLegacyScene == LegacyScene::titleSequence; - if (!isTitle && Config::Get().interface.ToolbarButtonsCentred) + if (!isTitle && Config::Get().interface.toolbarButtonsCentred) { screenCoords.y = kTopToolbarHeight + 3; } diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index 21ea96bc55..3df3fa28ed 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -385,7 +385,7 @@ void VirtualFloorPaint(PaintSession& session) { { 5, 5, _virtualFloorHeight + ((dullEdges & EDGE_NW) ? -2 : 0) }, { 0, 0, 1 } }); } - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Glassy) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Glassy) return; if (!weAreOccupied && !weAreLit && weAreAboveGround && weAreOwned) diff --git a/src/openrct2/paint/support/WoodenSupports.cpp b/src/openrct2/paint/support/WoodenSupports.cpp index ee9efd3f81..41e99b9506 100644 --- a/src/openrct2/paint/support/WoodenSupports.cpp +++ b/src/openrct2/paint/support/WoodenSupports.cpp @@ -60,70 +60,89 @@ constexpr SupportsIdDescriptor GetWoodenSupportIds(WoodenSupportType supportType return WoodenSupportImageIds[EnumValue(supportType)][EnumValue(subType)]; } -using ImagesByTransitionTypeArray = std::array, 21>; +using ImagesByTransitionTypeArray = std::array< + std::array, kWoodenSupportTransitionTypeCount>; static constexpr ImagesByTransitionTypeArray WoodenCurveSupportImageIds0 = { { - { 3465, 3466, 3467, 3468 }, // Flat to gentle - { 3469, 3470, 3471, 3472 }, // Gentle to flat - { 3473, 3474, 3475, 3476 }, // Gentle slope - { 3477, 3478, 3479, 3480 }, // Gentle to steep - { 3481, 3482, 3483, 3484 }, // Steep to gentle - { 3485, 3486, 3487, 3488 }, // Steep slope - { 3489, 3490, 3491, 3492 }, // Slope - { 3493, 3494, 3495, 3496 }, // Flat to steep small - { 3497, 3498, 3499, 3500 }, // Steep to flat small - { 3501, 3502, 3503, 3504 }, // ? - { 3505, 3506, 3507, 3508 }, // ? - { 3509, 3510, 3511, 3512 }, // ? - { 3513, 3513, 3513, 3513 }, // Large scenery - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 1, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 2, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 3 }, // Flat to steep large 1 - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 4, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 5, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 6, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 7 }, // Flat to steep large 2 - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 8, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 9, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 10, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 11 }, // Flat to steep large 3 - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 12, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 13, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 14, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 15 }, // Flat to steep large 4 - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 16, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 17, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 18, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 19 }, // Steep to flat large 1 - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 20, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 21, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 22, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 23 }, // Steep to flat large 2 - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 24, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 25, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 26, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 27 }, // Steep to flat large 3 - { SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 28, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 29, SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 30, - SPR_TRACKS_SUPPORT_WOODEN_TRUSS + 31 }, // Steep to flat large 4 + { 3465, 3466, 3467, 3468 }, // flatToUp25Deg + { 3469, 3470, 3471, 3472 }, // up25DegToFlat + { 3473, 3474, 3475, 3476 }, // up25Deg + { 3477, 3478, 3479, 3480 }, // up25DegToUp60Deg + { 3481, 3482, 3483, 3484 }, // up60DegToUp25Deg + { 3485, 3486, 3487, 3488 }, // up60Deg + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_UP_25_EVEN, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_UP_25_EVEN + 1, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_UP_25_EVEN + 2, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_UP_25_EVEN + 3 }, // up25even + { 3493, 3494, 3495, 3496 }, // flatToUp60Deg + { 3497, 3498, 3499, 3500 }, // up60DegToFlat + { 3501, 3502, 3503, 3504 }, // flatToUp25DegRailway + { 3505, 3506, 3507, 3508 }, // up25DegToFlatRailway + { 3509, 3510, 3511, 3512 }, // up25DegRailway + { 3513, 3513, 3513, 3513 }, // scenery + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 1, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 2, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 3 }, // flatToUp60DegLongBaseSeq0 + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 4, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 5, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 6, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 7 }, // flatToUp60DegLongBaseSeq1 + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 8, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 9, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 10, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 11 }, // flatToUp60DegLongBaseSeq2 + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 12, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 13, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 14, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_FLAT_TO_STEEP + 15 }, // flatToUp60DegLongBaseSeq3 + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 1, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 2, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 3 }, // up60DegToFlatLongBaseSeq0 + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 4, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 5, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 6, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 7 }, // up60DegToFlatLongBaseSeq1 + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 8, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 9, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 10, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 11 }, // up60DegToFlatLongBaseSeq2 + { SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 12, SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 13, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 14, + SPR_TRACKS_SUPPORT_WOODEN_TRUSS_LONG_STEEP_TO_FLAT + 15 }, // up60DegToFlatLongBaseSeq3 } }; static constexpr ImagesByTransitionTypeArray WoodenCurveSupportImageIds1 = { { - { 3681, 3682, 3683, 3684 }, // Flat to gentle - { 3685, 3686, 3687, 3688 }, // Gentle to flat - { 3689, 3690, 3691, 3692 }, // Gentle slope - { 3693, 3694, 3695, 3696 }, // Gentle to steep - { 3697, 3698, 3699, 3700 }, // Steep to gentle - { 3701, 3702, 3703, 3704 }, // Steep slope - { 3705, 3706, 3707, 3708 }, // Slope - { 3709, 3710, 3711, 3712 }, // Flat to steep small - { 3713, 3714, 3715, 3716 }, // Steep to flat small - { 3717, 3718, 3719, 3720 }, // ? - { 3721, 3722, 3723, 3724 }, // ? - { 3725, 3726, 3727, 3728 }, // ? - { 3729, 3729, 3729, 3729 }, // Large scenery - { SPR_TRACKS_SUPPORT_WOODEN_MINE, SPR_TRACKS_SUPPORT_WOODEN_MINE + 1, SPR_TRACKS_SUPPORT_WOODEN_MINE + 2, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 3 }, // Flat to steep large 1 - { SPR_TRACKS_SUPPORT_WOODEN_MINE + 4, SPR_TRACKS_SUPPORT_WOODEN_MINE + 5, SPR_TRACKS_SUPPORT_WOODEN_MINE + 6, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 7 }, // Flat to steep large 2 - { SPR_TRACKS_SUPPORT_WOODEN_MINE + 8, SPR_TRACKS_SUPPORT_WOODEN_MINE + 9, SPR_TRACKS_SUPPORT_WOODEN_MINE + 10, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 11 }, // Flat to steep large 3 - { SPR_TRACKS_SUPPORT_WOODEN_MINE + 12, SPR_TRACKS_SUPPORT_WOODEN_MINE + 13, SPR_TRACKS_SUPPORT_WOODEN_MINE + 14, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 15 }, // Flat to steep large 4 - { SPR_TRACKS_SUPPORT_WOODEN_MINE + 16, SPR_TRACKS_SUPPORT_WOODEN_MINE + 17, SPR_TRACKS_SUPPORT_WOODEN_MINE + 18, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 19 }, // Steep to flat large 1 - { SPR_TRACKS_SUPPORT_WOODEN_MINE + 20, SPR_TRACKS_SUPPORT_WOODEN_MINE + 21, SPR_TRACKS_SUPPORT_WOODEN_MINE + 22, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 23 }, // Steep to flat large 2 - { SPR_TRACKS_SUPPORT_WOODEN_MINE + 24, SPR_TRACKS_SUPPORT_WOODEN_MINE + 25, SPR_TRACKS_SUPPORT_WOODEN_MINE + 26, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 27 }, // Steep to flat large 3 - { SPR_TRACKS_SUPPORT_WOODEN_MINE + 28, SPR_TRACKS_SUPPORT_WOODEN_MINE + 29, SPR_TRACKS_SUPPORT_WOODEN_MINE + 30, - SPR_TRACKS_SUPPORT_WOODEN_MINE + 31 }, // Steep to flat large 4 + { 3681, 3682, 3683, 3684 }, // flatToUp25Deg + { 3685, 3686, 3687, 3688 }, // up25DegToFlat + { 3689, 3690, 3691, 3692 }, // up25Deg + { 3693, 3694, 3695, 3696 }, // up25DegToUp60Deg + { 3697, 3698, 3699, 3700 }, // up60DegToUp25Deg + { 3701, 3702, 3703, 3704 }, // up60Deg + { SPR_TRACKS_SUPPORT_WOODEN_MINE_UP_25_EVEN, SPR_TRACKS_SUPPORT_WOODEN_MINE_UP_25_EVEN + 1, + SPR_TRACKS_SUPPORT_WOODEN_MINE_UP_25_EVEN + 2, SPR_TRACKS_SUPPORT_WOODEN_MINE_UP_25_EVEN + 3 }, // up25even + { 3709, 3710, 3711, 3712 }, // flatToUp60Deg + { 3713, 3714, 3715, 3716 }, // up60DegToFlat + { 3717, 3718, 3719, 3720 }, // flatToUp25DegRailway + { 3721, 3722, 3723, 3724 }, // up25DegToFlatRailway + { 3725, 3726, 3727, 3728 }, // up25DegRailway + { 3729, 3729, 3729, 3729 }, // scenery + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 1, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 2, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 3 }, // flatToUp60DegLongBaseSeq0 + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 4, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 5, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 6, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 7 }, // flatToUp60DegLongBaseSeq1 + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 8, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 9, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 10, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 11 }, // flatToUp60DegLongBaseSeq2 + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 12, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 13, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 14, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_FLAT_TO_STEEP + 15 }, // flatToUp60DegLongBaseSeq3 + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 1, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 2, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 3 }, // up60DegToFlatLongBaseSeq0 + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 4, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 5, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 6, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 7 }, // up60DegToFlatLongBaseSeq1 + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 8, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 9, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 10, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 11 }, // up60DegToFlatLongBaseSeq2 + { SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 12, SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 13, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 14, + SPR_TRACKS_SUPPORT_WOODEN_MINE_LONG_STEEP_TO_FLAT + 15 }, // up60DegToFlatLongBaseSeq3 } }; // clang-format off @@ -155,7 +174,7 @@ struct SlopedSupportsDescriptor { }; /* 0x0097B23C */ -static constexpr SlopedSupportsDescriptor SupportsDescriptors[] = { +static constexpr auto kSupportsDescriptors = std::to_array({ {{{0, 0, 0}, {1, 1, 8}}, false}, // Flat to gentle {{{0, 0, 0}, {1, 1, 8}}, false}, {{{0, 0, 0}, {1, 1, 8}}, false}, @@ -240,7 +259,8 @@ static constexpr SlopedSupportsDescriptor SupportsDescriptors[] = { {{{0, 0, 0}, {1, 1, 8}}, false}, {{{0, 0, 0}, {1, 1, 8}}, false}, {{{0, 0, 0}, {1, 1, 8}}, false}, -}; +}); +static_assert(std::size(kSupportsDescriptors) == kWoodenSupportTransitionTypeCount * kNumOrthogonalDirections); /* 0x0098D8D4 */ static constexpr SlopedSupportsDescriptor kSlopedPathSupportsDescriptor = {{{0, 0, 0}, {1, 1, 4}}, false}; @@ -384,14 +404,8 @@ static bool WoodenABPaintSlopeTransitions( PaintSession& session, WoodenSupportType supportType, WoodenSupportSubType subType, WoodenSupportTransitionType transitionType, Direction direction, const ImageId& imageTemplate, uint16_t baseHeight) { - if (EnumValue(transitionType) >= 21) - { - transitionType = static_cast(EnumValue(transitionType) - 21); - direction = DirectionReverse(direction); - } - const uint16_t supportsDescriptorIndex = (EnumValue(transitionType) * kNumOrthogonalDirections) + direction; - const SlopedSupportsDescriptor& supportsDesc = SupportsDescriptors[supportsDescriptorIndex]; + const SlopedSupportsDescriptor& supportsDesc = kSupportsDescriptors[supportsDescriptorIndex]; const auto* imageIds = WoodenCurveSupportImageIds[EnumValue(supportType)][EnumValue(subType)]; if (imageIds == nullptr || imageIds[EnumValue(transitionType)][direction] == 0) @@ -640,29 +654,35 @@ bool PathBoxSupportsPaintSetup( } bool DrawSupportForSequenceA( - PaintSession& session, WoodenSupportType supportType, OpenRCT2::TrackElemType trackType, uint8_t sequence, - Direction direction, int32_t height, ImageId imageTemplate) + PaintSession& session, const WoodenSupportType supportType, const OpenRCT2::TrackElemType trackType, const uint8_t sequence, + const Direction direction, const int32_t height, const ImageId imageTemplate) { const auto& ted = OpenRCT2::TrackMetaData::GetTrackElementDescriptor(trackType); - const auto& desc = ted.sequences[sequence].woodenSupports; + const auto& sequenceDesc = ted.sequences[sequence]; + const auto& desc = sequenceDesc.woodenSupports; if (desc.subType == WoodenSupportSubType::null) return false; + const Direction supportRotation = (direction + sequenceDesc.extraSupportRotation) & 3; + return WoodenASupportsPaintSetupRotated( - session, supportType, desc.subType, direction, height, imageTemplate, desc.transitionType); + session, supportType, desc.subType, supportRotation, height, imageTemplate, desc.transitionType); } bool DrawSupportForSequenceB( - PaintSession& session, WoodenSupportType supportType, OpenRCT2::TrackElemType trackType, uint8_t sequence, - Direction direction, int32_t height, ImageId imageTemplate) + PaintSession& session, const WoodenSupportType supportType, const OpenRCT2::TrackElemType trackType, const uint8_t sequence, + const Direction direction, const int32_t height, const ImageId imageTemplate) { const auto& ted = OpenRCT2::TrackMetaData::GetTrackElementDescriptor(trackType); - const auto& desc = ted.sequences[sequence].woodenSupports; + const auto& sequenceDesc = ted.sequences[sequence]; + const auto& desc = sequenceDesc.woodenSupports; if (desc.subType == WoodenSupportSubType::null) return false; + const Direction supportRotation = (direction + sequenceDesc.extraSupportRotation) & 3; + return WoodenBSupportsPaintSetupRotated( - session, supportType, desc.subType, direction, height, imageTemplate, desc.transitionType); + session, supportType, desc.subType, supportRotation, height, imageTemplate, desc.transitionType); } diff --git a/src/openrct2/paint/support/WoodenSupports.h b/src/openrct2/paint/support/WoodenSupports.h index 39ee1c6308..e3688d73f2 100644 --- a/src/openrct2/paint/support/WoodenSupports.h +++ b/src/openrct2/paint/support/WoodenSupports.h @@ -46,6 +46,7 @@ enum class WoodenSupportTransitionType : uint8_t up25DegToUp60Deg = 3, up60DegToUp25Deg = 4, up60Deg = 5, + up25even = 6, flatToUp60Deg = 7, up60DegToFlat = 8, flatToUp25DegRailway = 9, @@ -60,29 +61,8 @@ enum class WoodenSupportTransitionType : uint8_t up60DegToFlatLongBaseSeq1 = 18, up60DegToFlatLongBaseSeq2 = 19, up60DegToFlatLongBaseSeq3 = 20, - - // Inverted versions - down25DegToFlat = 21, - flatToDown25Deg = 22, - down25Deg = 23, - down60DegToDown25Deg = 24, - down25DegToDown60Deg = 25, - down60Deg = 26, - down60DegToFlat = 28, - flatToDown60Deg = 29, - down25DegToFlatRailway = 30, - flatToDown25DegRailway = 31, - down25DegRailway = 32, - - down60DegToFlatLongBaseSeq3 = 34, - down60DegToFlatLongBaseSeq2 = 35, - down60DegToFlatLongBaseSeq1 = 36, - down60DegToFlatLongBaseSeq0 = 37, - flatToDown60DegLongBaseSeq3 = 38, - flatToDown60DegLongBaseSeq2 = 39, - flatToDown60DegLongBaseSeq1 = 40, - flatToDown60DegLongBaseSeq0 = 41, }; +constexpr int32_t kWoodenSupportTransitionTypeCount = 21; struct FootpathPaintInfo; struct PaintSession; diff --git a/src/openrct2/paint/support/WoodenSupports.hpp b/src/openrct2/paint/support/WoodenSupports.hpp index d4e8322f6f..e26198ced2 100644 --- a/src/openrct2/paint/support/WoodenSupports.hpp +++ b/src/openrct2/paint/support/WoodenSupports.hpp @@ -13,30 +13,36 @@ template bool DrawSupportForSequenceA( - PaintSession& session, WoodenSupportType supportType, uint8_t sequence, Direction direction, int32_t height, - ImageId imageTemplate) + PaintSession& session, const WoodenSupportType supportType, const uint8_t sequence, const Direction direction, + const int32_t height, const ImageId imageTemplate) { const auto& ted = OpenRCT2::TrackMetaData::GetTrackElementDescriptor(trackType); - const auto& desc = ted.sequences[sequence].woodenSupports; + const auto& sequenceDesc = ted.sequences[sequence]; + const auto& desc = sequenceDesc.woodenSupports; if (desc.subType == WoodenSupportSubType::null) return false; + const Direction supportRotation = (direction + sequenceDesc.extraSupportRotation) & 3; + return WoodenASupportsPaintSetupRotated( - session, supportType, desc.subType, direction, height, imageTemplate, desc.transitionType); + session, supportType, desc.subType, supportRotation, height, imageTemplate, desc.transitionType); } template bool DrawSupportForSequenceB( - PaintSession& session, WoodenSupportType supportType, uint8_t sequence, Direction direction, int32_t height, - ImageId imageTemplate) + PaintSession& session, const WoodenSupportType supportType, const uint8_t sequence, const Direction direction, + const int32_t height, const ImageId imageTemplate) { const auto& ted = OpenRCT2::TrackMetaData::GetTrackElementDescriptor(trackType); - const auto& desc = ted.sequences[sequence].woodenSupports; + const auto& sequenceDesc = ted.sequences[sequence]; + const auto& desc = sequenceDesc.woodenSupports; if (desc.subType == WoodenSupportSubType::null) return false; + const Direction supportRotation = (direction + sequenceDesc.extraSupportRotation) & 3; + return WoodenBSupportsPaintSetupRotated( - session, supportType, desc.subType, direction, height, imageTemplate, desc.transitionType); + session, supportType, desc.subType, supportRotation, height, imageTemplate, desc.transitionType); } diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index ba0dbded72..5a54a0a035 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -58,7 +58,7 @@ static void PaintBannerScrollingText( banner.formatTextWithColourTo(ft); char text[256]; - if (Config::Get().general.UpperCaseBanners) + if (Config::Get().general.upperCaseBanners) { FormatStringToUpper(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 8a6e991499..2ffd312361 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -67,7 +67,7 @@ static void PaintRideEntranceExitScrollingText( } char text[256]; - if (Config::Get().general.UpperCaseBanners) + if (Config::Get().general.upperCaseBanners) { FormatStringToUpper(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } @@ -248,7 +248,7 @@ static void PaintParkEntranceScrollingText( } char text[256]; - if (Config::Get().general.UpperCaseBanners) + if (Config::Get().general.upperCaseBanners) { FormatStringToUpper(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 70273d48ca..a29cb8ab7d 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -317,7 +317,7 @@ static void PaintLargeSceneryScrollingText( banner->formatTextTo(ft); char text[256]; - if (Config::Get().general.UpperCaseBanners) + if (Config::Get().general.upperCaseBanners) { FormatStringToUpper(text, sizeof(text), STR_SCROLLING_SIGN_TEXT, ft.Data()); } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index c17f4a47c5..072200084d 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -166,7 +166,7 @@ static void PathPaintQueueBanner( } utf8 bannerBuffer[512]{}; - if (Config::Get().general.UpperCaseBanners) + if (Config::Get().general.upperCaseBanners) { FormatStringToUpper(bannerBuffer, sizeof(bannerBuffer), STR_BANNER_TEXT_FORMAT, ft.Data()); } @@ -194,7 +194,7 @@ static void PathPaintSlopedFences( PaintSession& session, const PathElement& pathElement, uint16_t height, ImageId imageId, bool isQueue) { auto queueOffset = isQueue ? 14 : 0; - switch ((pathElement.GetSlopeDirection() + session.CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + switch ((pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections) { case 0: PaintAddImageAsParent( @@ -630,7 +630,7 @@ static void PathPaintFencesAdditionsTunnels( } // This is about tunnel drawing - uint8_t direction = (pathElement.GetSlopeDirection() + session.CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK; + uint8_t direction = (pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections; bool sloped = pathElement.IsSloped(); if (connectedEdges & EDGE_SE) @@ -864,8 +864,7 @@ static ImageIndex PathPaintGetBaseImage( ImageIndex surfaceBaseImageIndex = pathPaintInfo.SurfaceImageId; if (pathElement.IsSloped()) { - auto directionOffset = (pathElement.GetSlopeDirection() + session.CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK; + auto directionOffset = (pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections; surfaceBaseImageIndex += 16 + directionOffset; } else @@ -973,8 +972,7 @@ void PathPaintBoxSupport( ImageIndex bridgeBaseImageIndex; if (pathElement.IsSloped()) { - auto directionOffset = (pathElement.GetSlopeDirection() + session.CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK; + auto directionOffset = (pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections; bridgeBaseImageIndex = pathPaintInfo.BridgeImageId + 51 + directionOffset; } else @@ -1028,8 +1026,7 @@ void PathPaintPoleSupport( ImageIndex bridgeBaseImageIndex; if (pathElement.IsSloped()) { - bridgeBaseImageIndex = ((pathElement.GetSlopeDirection() + session.CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + bridgeBaseImageIndex = ((pathElement.GetSlopeDirection() + session.CurrentRotation) % kNumOrthogonalDirections) + pathPaintInfo.BridgeImageId + 16; } else diff --git a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp index 5b708b0a9a..12279a7218 100644 --- a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp +++ b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp @@ -218,7 +218,7 @@ inline bool PathAdditionIsVisible(uint32_t viewFlags, const PathAdditionEntry& p if (isBroken) return true; - if (pathAdditionEntry.draw_type == PathAdditionDrawType::Bin) + if (pathAdditionEntry.draw_type == PathAdditionDrawType::bin) return true; return false; @@ -245,16 +245,16 @@ void Sub6A3F61PathAddition(PaintSession& session, const PathElement& pathElement switch (pathAddEntry->draw_type) { - case PathAdditionDrawType::Light: + case PathAdditionDrawType::light: PathAdditionLightsPaint(session, *pathAddEntry, pathElement, height, rotatedEdges, sceneryImageTemplate); break; - case PathAdditionDrawType::Bin: + case PathAdditionDrawType::bin: PathAdditionBinsPaint(session, *pathAddEntry, pathElement, height, rotatedEdges, sceneryImageTemplate); break; - case PathAdditionDrawType::Bench: + case PathAdditionDrawType::bench: PathAdditionBenchesPaint(session, *pathAddEntry, pathElement, height, rotatedEdges, sceneryImageTemplate); break; - case PathAdditionDrawType::JumpingFountain: + case PathAdditionDrawType::jumpingFountain: PathAdditionJumpingFountainsPaint(session, *pathAddEntry, height, sceneryImageTemplate, session.DPI); break; } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 76f46d1df6..448f8b2090 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1199,7 +1199,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con } if (zoomLevel <= ZoomLevel{ 0 } && has_surface && !(session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) - && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_BASE) && Config::Get().general.LandscapeSmoothing) + && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_BASE) && Config::Get().general.landscapeSmoothing) { ViewportSurfaceSmoothenEdge(session, EDGE_TOPLEFT, selfDescriptor, tileDescriptors[2]); ViewportSurfaceSmoothenEdge(session, EDGE_TOPRIGHT, selfDescriptor, tileDescriptors[3]); @@ -1229,7 +1229,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con const uint16_t waterHeight = tileElement.GetWaterHeight(); const bool waterGetsClipped = (session.ViewFlags & VIEWPORT_FLAG_CLIP_VIEW) && (waterHeight > gClipHeight * kCoordsZStep); - const bool waterIsTransparent = Config::Get().general.TransparentWater + const bool waterIsTransparent = Config::Get().general.transparentWater || (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); if (waterHeight > 0 && !gTrackDesignSaveMode && !waterGetsClipped) diff --git a/src/openrct2/paint/tile_element/Paint.Surface.h b/src/openrct2/paint/tile_element/Paint.Surface.h index 091b0adfdc..eeb36ffe5d 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.h +++ b/src/openrct2/paint/tile_element/Paint.Surface.h @@ -41,12 +41,12 @@ enum SPR_TERRAIN_MARTIAN = 2314, SPR_TERRAIN_MARTIAN_GRID = 2333, SPR_TERRAIN_MARTIAN_UNDERGROUND = 2352, - SPR_TERRAIN_CHECKERBOARD = 2371, - SPR_TERRAIN_CHECKERBOARD_GRID = 2390, - SPR_TERRAIN_CHECKERBOARD_UNDERGROUND = 2409, - SPR_TERRAIN_CHECKERBOARD_INVERTED = 2428, - SPR_TERRAIN_CHECKERBOARD_INVERTED_GRID = 2447, - SPR_TERRAIN_CHECKERBOARD_INVERTED_UNDERGROUND = 2466, + SPR_TERRAIN_CHEQUERBOARD = 2371, + SPR_TERRAIN_CHEQUERBOARD_GRID = 2390, + SPR_TERRAIN_CHEQUERBOARD_UNDERGROUND = 2409, + SPR_TERRAIN_CHEQUERBOARD_INVERTED = 2428, + SPR_TERRAIN_CHEQUERBOARD_INVERTED_GRID = 2447, + SPR_TERRAIN_CHEQUERBOARD_INVERTED_UNDERGROUND = 2466, SPR_TERRAIN_DIRT = 2485, SPR_TERRAIN_DIRT_GRID = 2504, SPR_TERRAIN_DIRT_UNDERGROUND = 2523, diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index cd88e9d559..f201a4b502 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -139,7 +139,7 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor bool partOfVirtualFloor = false; - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off) { partOfVirtualFloor = VirtualFloorTileIsFloor(session.MapPosition); } @@ -294,7 +294,7 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor session.MapPosition = mapPosition; } while (!(tile_element++)->IsLastForTile()); - if (Config::Get().general.VirtualFloorStyle != VirtualFloorStyles::Off && partOfVirtualFloor) + if (Config::Get().general.virtualFloorStyle != VirtualFloorStyles::Off && partOfVirtualFloor) { VirtualFloorPaint(session); } diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index c9a94f154f..a1fc5dd449 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -175,7 +175,7 @@ static void PaintWallScrollingText( auto ft = Formatter(); banner->formatTextTo(ft); char signString[256]; - if (Config::Get().general.UpperCaseBanners) + if (Config::Get().general.upperCaseBanners) { FormatStringToUpper(signString, sizeof(signString), STR_SCROLLING_SIGN_TEXT, ft.Data()); } diff --git a/src/openrct2/paint/tile_element/Segment.h b/src/openrct2/paint/tile_element/Segment.h index 1d7c9b8a2e..999bb89a18 100644 --- a/src/openrct2/paint/tile_element/Segment.h +++ b/src/openrct2/paint/tile_element/Segment.h @@ -10,23 +10,78 @@ #pragma once #include "../../core/EnumUtils.hpp" +#include "../../core/Numerics.hpp" +#include #include -// This controls in which segment of a tile something is drawn. -// This is from a screen perspective, e.g. top will always represent the part of top of the screen. -enum class PaintSegment : uint16_t +namespace OpenRCT2 { - top = 0, - topRight = 1, - right = 2, - bottomRight = 3, - bottom = 4, - bottomLeft = 5, - left = 6, - topLeft = 7, - centre = 8, -}; -constexpr int32_t kSegmentsAll = EnumsToFlags( - PaintSegment::top, PaintSegment::left, PaintSegment::right, PaintSegment::bottom, PaintSegment::centre, - PaintSegment::topLeft, PaintSegment::topRight, PaintSegment::bottomLeft, PaintSegment::bottomRight); + // This controls in which segment of a tile something is drawn. + // This is from a screen perspective, e.g. top will always represent the part of top of the screen. + enum class PaintSegment : uint16_t + { + top = 0, + topRight = 1, + right = 2, + bottomRight = 3, + bottom = 4, + bottomLeft = 5, + left = 6, + topLeft = 7, + centre = 8, + }; + constexpr uint16_t kSegmentsNone = 0; + constexpr int32_t kSegmentsAll = EnumsToFlags( + PaintSegment::top, PaintSegment::left, PaintSegment::right, PaintSegment::bottom, PaintSegment::centre, + PaintSegment::topLeft, PaintSegment::topRight, PaintSegment::bottomLeft, PaintSegment::bottomRight); + constexpr uint16_t kSegmentsUnimplemented = kSegmentsNone; + + constexpr uint16_t paintSegmentsRotate(const uint16_t segments, const uint8_t rotation) + { + uint8_t outerSegments = segments & 0xFF; + outerSegments = Numerics::rol8(outerSegments, rotation * 2); + return (segments & EnumToFlag(PaintSegment::centre)) | outerSegments; + } + + constexpr uint16_t paintSegmentsFlipXAxis(const uint16_t segments) + { + uint8_t outerSegments = segments & 0xFF; + outerSegments = (outerSegments * 0x0202020202 & 0x010884422010) % 1023; // reverse the bits, std::byteswap is c++23 + outerSegments = Numerics::rol8(outerSegments, 3); + return (segments & EnumToFlag(PaintSegment::centre)) | outerSegments; + }; + + enum class BlockedSegmentsType : uint8_t + { + narrow, + inverted, + wide, + }; + constexpr uint32_t kBlockedSegmentsTypeCount = 3; + + constexpr std::array blockedSegmentsAllTypes(const uint16_t segments) + { + return { segments, segments, segments }; + }; + + constexpr std::array blockedSegmentsRotate( + std::array blockedSegments, const uint8_t rotation) + { + for (auto& segments : blockedSegments) + { + segments = paintSegmentsRotate(segments, rotation); + } + return blockedSegments; + } + + constexpr std::array blockedSegmentsFlipXAxis( + std::array blockedSegments) + { + for (auto& segments : blockedSegments) + { + segments = paintSegmentsFlipXAxis(segments); + } + return blockedSegments; + } +} // namespace OpenRCT2 diff --git a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp index 961a4e3c9b..792cd9a992 100644 --- a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp +++ b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp @@ -95,10 +95,10 @@ namespace OpenRCT2::AlpineRC const TrackElement& trackElement, SupportType supportType) { static constexpr uint32_t imageIds[4][3] = { - { (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), SPR_STATION_BASE_B_SW_NE }, - { (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), SPR_STATION_BASE_B_NW_SE }, - { (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), SPR_STATION_BASE_B_SW_NE }, - { (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), SPR_STATION_BASE_B_NW_SE }, + { (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), SPR_STATION_BASE_MEDIUM_SW_NE }, + { (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), SPR_STATION_BASE_MEDIUM_NW_SE }, + { (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), (SPR_TRACKS_ALPINE_TRACK_FLAT + 0), SPR_STATION_BASE_MEDIUM_SW_NE }, + { (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), (SPR_TRACKS_ALPINE_TRACK_FLAT + 1), SPR_STATION_BASE_MEDIUM_NW_SE }, }; if (trackElement.GetTrackType() == TrackElemType::EndStation) diff --git a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp index 4c5b0d8e07..c1ee58fa8a 100644 --- a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp @@ -1070,7 +1070,7 @@ static void ClassicWoodenRCTrackRightQuarterTurn3Bank( static constexpr int blockedSegments[4] = { kSegmentsAll, - kSegmentsAll, + kSegmentsNone, EnumsToFlags(PaintSegment::bottom, PaintSegment::centre, PaintSegment::bottomLeft, PaintSegment::bottomRight), kSegmentsAll, }; diff --git a/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp index d2301e5ca0..b26a65204f 100644 --- a/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp @@ -10567,32 +10567,16 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( { { 0, 6, height + 4 }, { 32, 20, 3 } }); break; } - - if (direction == 2) - { - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - EnumsToFlags( - PaintSegment::top, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::topRight, - PaintSegment::bottomLeft), - direction), - 0xFFFF, 0); - } MetalASupportsPaintSetupRotated( session, supportType.metal, MetalSupportPlace::centre, direction, 0, height, session.SupportColours); - if (direction != 2) - { - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - EnumsToFlags( - PaintSegment::top, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::topRight, - PaintSegment::bottomLeft), - direction), - 0xFFFF, 0); - } - + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::top, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::topRight, + PaintSegment::bottomLeft), + direction), + 0xFFFF, 0); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, kTunnelGroup, TunnelSubType::Flat); @@ -17032,7 +17016,7 @@ static void CorkscrewRCTrack90DegToInvertedFlatQuarterLoopUp( } if (direction == 0 || direction == 3) { - PaintUtilPushTunnelRotated(session, direction, height + 16, kTunnelGroup, TunnelSubType::Flat); + PaintUtilPushTunnelRotated(session, direction, height, kTunnelGroup, TunnelSubType::Flat); } PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); diff --git a/src/openrct2/paint/track/coaster/HybridCoaster.cpp b/src/openrct2/paint/track/coaster/HybridCoaster.cpp index fe17236397..1c3663141a 100644 --- a/src/openrct2/paint/track/coaster/HybridCoaster.cpp +++ b/src/openrct2/paint/track/coaster/HybridCoaster.cpp @@ -1402,13 +1402,7 @@ namespace OpenRCT2::HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - EnumsToFlags( - PaintSegment::right, PaintSegment::centre, PaintSegment::topRight, PaintSegment::bottomRight), - direction), - 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 1: @@ -1504,13 +1498,7 @@ namespace OpenRCT2::HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - EnumsToFlags( - PaintSegment::right, PaintSegment::centre, PaintSegment::topRight, PaintSegment::bottomRight), - direction), - 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 1: @@ -11118,7 +11106,7 @@ namespace OpenRCT2::HybridRC const TrackElement& trackElement, SupportType supportType) { PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_TRACKS_HYBRID_TRACK_FLAT + (direction & 1)), { 0, 0, height }, { { 0, 6, height + 3 }, { 32, 20, 0 } }); diff --git a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp index 47109e5c7d..ef3ebab82e 100644 --- a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp @@ -5758,7 +5758,7 @@ static void JuniorRCTrackOnRidePhoto( { auto imageId = session.TrackColours.WithIndex(junior_rc_track_pieces_flat[0][direction]); PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); DrawSupportsSideBySide(session, direction, height, session.SupportColours, supportType.metal, 6); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { { 0, 6, height + 3 }, { 32, 20, 1 } }); diff --git a/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp index b53b4d1a73..c505605311 100644 --- a/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp @@ -1792,7 +1792,7 @@ static void LimLaunchedRCTrack90DegToInvertedFlatQuarterLoopUp( } if (direction == 0 || direction == 3) { - PaintUtilPushTunnelRotated(session, direction, height + 16, kTunnelGroup, TunnelSubType::Flat); + PaintUtilPushTunnelRotated(session, direction, height, kTunnelGroup, TunnelSubType::Flat); } PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); diff --git a/src/openrct2/paint/track/coaster/MineRide.cpp b/src/openrct2/paint/track/coaster/MineRide.cpp index b96e4db4a8..212523b583 100644 --- a/src/openrct2/paint/track/coaster/MineRide.cpp +++ b/src/openrct2/paint/track/coaster/MineRide.cpp @@ -3059,7 +3059,7 @@ static void MineRideTrackOnRidePhoto( const TrackElement& trackElement, SupportType supportType) { PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); DrawSupportsSideBySide(session, direction, height, session.SupportColours, supportType.metal, 6); switch (direction) diff --git a/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp b/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp index 15120c01e5..6f5abf347b 100644 --- a/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp @@ -3553,9 +3553,6 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(20348), { 0, 0, height }, { { 16, 16, height + 27 }, { 16, 16, 1 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(20178), { 0, 0, height }, - { { 16, 16, height + 27 }, { 16, 16, 1 } }); WoodenASupportsPaintSetup( session, supportType.wooden, WoodenSupportSubType::corner2, height, session.SupportColours); break; @@ -3610,9 +3607,6 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(20347), { 0, 0, height }, { { 0, 0, height + 27 }, { 16, 32, 1 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(20177), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 32, 1 } }); WoodenASupportsPaintSetup( session, supportType.wooden, WoodenSupportSubType::corner0, height, session.SupportColours); break; @@ -3832,9 +3826,6 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(20348), { 0, 0, height }, { { 16, 16, height + 27 }, { 16, 16, 1 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(20178), { 0, 0, height }, - { { 16, 16, height + 27 }, { 16, 16, 1 } }); WoodenASupportsPaintSetup( session, supportType.wooden, WoodenSupportSubType::corner2, height, session.SupportColours); break; @@ -3889,9 +3880,6 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(20347), { 0, 0, height }, { { 0, 0, height + 27 }, { 32, 16, 1 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(20177), { 0, 0, height }, - { { 0, 0, height + 27 }, { 32, 16, 1 } }); WoodenASupportsPaintSetup( session, supportType.wooden, WoodenSupportSubType::corner0, height, session.SupportColours); break; @@ -6980,8 +6968,6 @@ static void MineTrainRCTrackFlatTo60DegUpLongBase( { PaintUtilPushTunnelRotated(session, direction, height, kTunnelGroup, TunnelSubType::Flat); } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48); break; case 1: @@ -7011,8 +6997,6 @@ static void MineTrainRCTrackFlatTo60DegUpLongBase( WoodenASupportsPaintSetupRotated( session, supportType.wooden, WoodenSupportSubType::neSw, direction, height, session.SupportColours, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq1); - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48); break; case 2: @@ -7042,8 +7026,6 @@ static void MineTrainRCTrackFlatTo60DegUpLongBase( WoodenASupportsPaintSetupRotated( session, supportType.wooden, WoodenSupportSubType::neSw, direction, height, session.SupportColours, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq2); - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64); break; case 3: @@ -7082,11 +7064,10 @@ static void MineTrainRCTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelLeft(session, height + 24, kTunnelGroup, TunnelSubType::SlopeEnd); break; } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80); break; } + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); } static void MineTrainRCTrack60DegUpToFlatLongBase( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, @@ -7125,8 +7106,6 @@ static void MineTrainRCTrack60DegUpToFlatLongBase( { PaintUtilPushTunnelRotated(session, direction, height, kTunnelGroup, TunnelSubType::SlopeStart); } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80); break; case 1: @@ -7156,8 +7135,6 @@ static void MineTrainRCTrack60DegUpToFlatLongBase( WoodenASupportsPaintSetupRotated( session, supportType.wooden, WoodenSupportSubType::neSw, direction, height, session.SupportColours, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq1); - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80); break; case 2: @@ -7187,8 +7164,6 @@ static void MineTrainRCTrack60DegUpToFlatLongBase( WoodenASupportsPaintSetupRotated( session, supportType.wooden, WoodenSupportSubType::neSw, direction, height, session.SupportColours, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq2); - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56); break; case 3: @@ -7227,11 +7202,10 @@ static void MineTrainRCTrack60DegUpToFlatLongBase( PaintUtilPushTunnelLeft(session, height + 8, kTunnelGroup, TunnelSubType::FlatTo25Deg); break; } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40); break; } + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); } static void MineTrainRCTrackFlatTo60DegDownLongBase( diff --git a/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp b/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp index 10aaf8ce74..49b7bdc796 100644 --- a/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp @@ -4268,7 +4268,7 @@ static void MiniRCTrackOnRidePhoto( const TrackElement& trackElement, SupportType supportType) { PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); DrawSupportsSideBySide(session, direction, height, session.SupportColours, supportType.metal, 6); switch (direction) diff --git a/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp index b1d01b7bb5..c9360013d6 100644 --- a/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp @@ -5360,7 +5360,7 @@ static void MultiDimensionRCTrackOnRidePhoto( { case 0: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); MetalASupportsPaintSetup( session, supportType.metal, MetalSupportPlace::topLeftSide, 0, height, session.SupportColours); MetalASupportsPaintSetup( @@ -5371,7 +5371,7 @@ static void MultiDimensionRCTrackOnRidePhoto( break; case 1: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); MetalASupportsPaintSetup( session, supportType.metal, MetalSupportPlace::topRightSide, 0, height, session.SupportColours); MetalASupportsPaintSetup( @@ -5382,7 +5382,7 @@ static void MultiDimensionRCTrackOnRidePhoto( break; case 2: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); MetalASupportsPaintSetup( session, supportType.metal, MetalSupportPlace::topLeftSide, 0, height, session.SupportColours); MetalASupportsPaintSetup( @@ -5393,7 +5393,7 @@ static void MultiDimensionRCTrackOnRidePhoto( break; case 3: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); MetalASupportsPaintSetup( session, supportType.metal, MetalSupportPlace::topRightSide, 0, height, session.SupportColours); MetalASupportsPaintSetup( diff --git a/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp b/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp index e26c699a21..a0dfc817f9 100644 --- a/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp @@ -3825,6 +3825,14 @@ static void StandUpRCTrackLeftCorkscrewUp( break; } MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::centre, 1, height, session.SupportColours); + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::top, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::topRight, + PaintSegment::bottomLeft), + direction), + 0xFFFF, 0); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, kTunnelGroup, TunnelSubType::Flat); diff --git a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp index 19b12ce1c6..154da4a2ab 100644 --- a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp @@ -6576,7 +6576,7 @@ static void WoodenRCTrackWaterSplash( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement, SupportType supportType) { - const bool transparent = Config::Get().general.TransparentWater || (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); + const bool transparent = Config::Get().general.transparentWater || (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); const auto waterMask = ImageId(SPR_WATER_MASK).WithRemap(FilterPaletteID::paletteWater).WithBlended(true); const auto waterOverlay = ImageId(transparent ? EnumValue(SPR_WATER_OVERLAY) : EnumValue(SPR_G2_OPAQUE_WATER_OVERLAY)); diff --git a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.hpp b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.hpp index b89609d0ac..60ed53fa25 100644 --- a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.hpp +++ b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.hpp @@ -298,7 +298,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( static constexpr int blockedSegments[4] = { kSegmentsAll, - kSegmentsAll, + kSegmentsNone, EnumsToFlags(PaintSegment::left, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::bottomLeft), kSegmentsAll, }; diff --git a/src/openrct2/paint/track/gentle/Circus.cpp b/src/openrct2/paint/track/gentle/Circus.cpp index 41a84d2802..73caf42787 100644 --- a/src/openrct2/paint/track/gentle/Circus.cpp +++ b/src/openrct2/paint/track/gentle/Circus.cpp @@ -66,7 +66,7 @@ static void PaintCircus( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, session.SupportColours, height, kFenceSpritesRope, diff --git a/src/openrct2/paint/track/gentle/CrookedHouse.cpp b/src/openrct2/paint/track/gentle/CrookedHouse.cpp index e9c5031e9a..9182782c91 100644 --- a/src/openrct2/paint/track/gentle/CrookedHouse.cpp +++ b/src/openrct2/paint/track/gentle/CrookedHouse.cpp @@ -100,7 +100,7 @@ static void PaintCrookedHouse( GetStationColourScheme(session, trackElement)); const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, GetStationColourScheme(session, trackElement), height, diff --git a/src/openrct2/paint/track/gentle/FerrisWheel.cpp b/src/openrct2/paint/track/gentle/FerrisWheel.cpp index f3a527d9f1..08a1eefeb7 100644 --- a/src/openrct2/paint/track/gentle/FerrisWheel.cpp +++ b/src/openrct2/paint/track/gentle/FerrisWheel.cpp @@ -53,7 +53,7 @@ static void PaintFerrisWheelRiders( for (int32_t i = 0; i < 32; i += 2) { auto* peep = getGameState().entities.GetEntity(vehicle.peep[i]); - if (peep == nullptr || peep->State != PeepState::OnRide) + if (peep == nullptr || peep->State != PeepState::onRide) continue; auto frameNum = (vehicle.flatRideAnimationFrame + i * 4) % 128; @@ -127,7 +127,7 @@ static void PaintFerrisWheel( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); ImageId imageId; uint8_t rotation = session.CurrentRotation; diff --git a/src/openrct2/paint/track/gentle/HauntedHouse.cpp b/src/openrct2/paint/track/gentle/HauntedHouse.cpp index a23f569c0b..5cd3deaf7c 100644 --- a/src/openrct2/paint/track/gentle/HauntedHouse.cpp +++ b/src/openrct2/paint/track/gentle/HauntedHouse.cpp @@ -79,7 +79,7 @@ static void PaintHauntedHouse( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, GetStationColourScheme(session, trackElement), height, diff --git a/src/openrct2/paint/track/gentle/MerryGoRound.cpp b/src/openrct2/paint/track/gentle/MerryGoRound.cpp index dbd185cf2b..bfae0f618a 100644 --- a/src/openrct2/paint/track/gentle/MerryGoRound.cpp +++ b/src/openrct2/paint/track/gentle/MerryGoRound.cpp @@ -120,7 +120,7 @@ static void PaintMerryGoRound( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, GetStationColourScheme(session, trackElement), height, diff --git a/src/openrct2/paint/track/gentle/ObservationTower.cpp b/src/openrct2/paint/track/gentle/ObservationTower.cpp index a6210b34a1..4c851a6272 100644 --- a/src/openrct2/paint/track/gentle/ObservationTower.cpp +++ b/src/openrct2/paint/track/gentle/ObservationTower.cpp @@ -47,10 +47,10 @@ static void PaintObservationTowerBase( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesMetalB, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesTileDiamond, stationObject); TrackPaintUtilPaintFences( - session, edges, position, trackElement, ride, session.TrackColours, height, kFenceSpritesMetalB, + session, edges, position, trackElement, ride, session.TrackColours, height, kFenceSpritesPicketDuplicate, session.CurrentRotation); if (trackSequence == 0) diff --git a/src/openrct2/paint/track/gentle/SpaceRings.cpp b/src/openrct2/paint/track/gentle/SpaceRings.cpp index 7577e8b1c6..9452a4079b 100644 --- a/src/openrct2/paint/track/gentle/SpaceRings.cpp +++ b/src/openrct2/paint/track/gentle/SpaceRings.cpp @@ -106,7 +106,7 @@ static void PaintSpaceRings( session, supportType.wooden, trackSequence, direction, height, GetStationColourScheme(session, trackElement)); const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); switch (trackSequence) { diff --git a/src/openrct2/paint/track/thrill/3dCinema.cpp b/src/openrct2/paint/track/thrill/3dCinema.cpp index bd0d1d6021..1f2ac60b0f 100644 --- a/src/openrct2/paint/track/thrill/3dCinema.cpp +++ b/src/openrct2/paint/track/thrill/3dCinema.cpp @@ -67,7 +67,7 @@ static void Paint3dCinema( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, stationColour, height, kFenceSpritesRope, diff --git a/src/openrct2/paint/track/thrill/Enterprise.cpp b/src/openrct2/paint/track/thrill/Enterprise.cpp index 82d4630f48..6ca32d7ce5 100644 --- a/src/openrct2/paint/track/thrill/Enterprise.cpp +++ b/src/openrct2/paint/track/thrill/Enterprise.cpp @@ -106,7 +106,7 @@ static void PaintEnterprise( GetStationColourScheme(session, trackElement)); const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, kFenceSpritesRope, diff --git a/src/openrct2/paint/track/thrill/GoKarts.cpp b/src/openrct2/paint/track/thrill/GoKarts.cpp index dd6eeb6108..23912c60d7 100644 --- a/src/openrct2/paint/track/thrill/GoKarts.cpp +++ b/src/openrct2/paint/track/thrill/GoKarts.cpp @@ -1940,7 +1940,7 @@ static void TrackLeftQuarterTurn3Tiles( TrackPaintUtilLeftQuarterTurn3TilesTunnel(session, kTunnelGroup, TunnelSubType::Flat, height, direction, trackSequence); static constexpr std::array blockedSegments = { kSegmentsAll, - kSegmentsAll, + EnumsToFlags(PaintSegment::right, PaintSegment::topRight, PaintSegment::bottomRight), EnumsToFlags(PaintSegment::left, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::bottomLeft), kSegmentsAll, }; @@ -1982,17 +1982,19 @@ static void TrackLeftQuarterTurn5Tiles( PaintUtilPushTunnelRotated(session, DirectionPrev(direction), height, kTunnelGroup, TunnelSubType::Flat); } static constexpr std::array blockedSegments = { - EnumsToFlags(PaintSegment::top, PaintSegment::centre, PaintSegment::topRight, PaintSegment::bottomLeft), kSegmentsAll, + EnumsToFlags(PaintSegment::right, PaintSegment::topRight, PaintSegment::bottomRight), EnumsToFlags( PaintSegment::top, PaintSegment::left, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::topRight, PaintSegment::bottomLeft), - EnumsToFlags(PaintSegment::right, PaintSegment::centre, PaintSegment::topRight, PaintSegment::bottomRight), - kSegmentsAll, + EnumsToFlags( + PaintSegment::top, PaintSegment::right, PaintSegment::bottom, PaintSegment::centre, PaintSegment::topLeft, + PaintSegment::topRight, PaintSegment::bottomLeft, PaintSegment::bottomRight), + EnumsToFlags(PaintSegment::right, PaintSegment::topRight, PaintSegment::bottomRight), EnumsToFlags( PaintSegment::left, PaintSegment::bottom, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::bottomLeft, PaintSegment::bottomRight), - EnumsToFlags(PaintSegment::bottom, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::bottomRight), + kSegmentsAll, }; PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments[trackSequence], direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -2294,7 +2296,7 @@ static void TrackLeftQuarterTurn3TilesUp25( static constexpr std::array blockedSegments = { kSegmentsAll, - kSegmentsAll, + EnumsToFlags(PaintSegment::right, PaintSegment::topRight, PaintSegment::bottomRight), EnumsToFlags(PaintSegment::left, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::bottomLeft), kSegmentsAll, }; @@ -2352,8 +2354,8 @@ static void TrackRightQuarterTurn3TilesUp25( static constexpr std::array blockedSegments = { kSegmentsAll, - kSegmentsAll, - EnumsToFlags(PaintSegment::left, PaintSegment::centre, PaintSegment::topLeft, PaintSegment::bottomLeft), + EnumsToFlags(PaintSegment::topLeft, PaintSegment::top, PaintSegment::topRight), + EnumsToFlags(PaintSegment::bottom, PaintSegment::centre, PaintSegment::bottomLeft, PaintSegment::bottomRight), kSegmentsAll, }; PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments[trackSequence], direction), 0xFFFF, 0); @@ -2474,7 +2476,7 @@ static void TrackRightQuarterTurn5TilesUp25( { PaintUtilPushTunnelRotated(session, direction, height - 8, kTunnelGroup, TunnelSubType::SlopeStart); } - else if (trackSequence == 6 && (direction == 2 || direction == 3)) + else if (trackSequence == 6 && (direction == 0 || direction == 1)) { PaintUtilPushTunnelRotated(session, DirectionNext(direction), height + 8, kTunnelGroup, TunnelSubType::SlopeEnd); } diff --git a/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp b/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp index 65b3159d62..820aa4bef9 100644 --- a/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp @@ -46,10 +46,10 @@ static void PaintLaunchedFreefallBase( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesMetal, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesTileChequerboard, stationObject); TrackPaintUtilPaintFences( - session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, kFenceSpritesMetal, + session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, kFenceSpritesPicket, session.CurrentRotation); if (trackSequence == 0) diff --git a/src/openrct2/paint/track/thrill/MagicCarpet.cpp b/src/openrct2/paint/track/thrill/MagicCarpet.cpp index 203b8a6895..41e417a62e 100644 --- a/src/openrct2/paint/track/thrill/MagicCarpet.cpp +++ b/src/openrct2/paint/track/thrill/MagicCarpet.cpp @@ -230,7 +230,7 @@ static void PaintMagicCarpet( if (stationObject != nullptr && !(stationObject->Flags & StationObjectFlags::noPlatforms)) { - auto imageId = session.SupportColours.WithIndex(SPR_STATION_BASE_D); + auto imageId = session.SupportColours.WithIndex(SPR_STATION_BASE_BORDERLESS); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } break; diff --git a/src/openrct2/paint/track/thrill/MotionSimulator.cpp b/src/openrct2/paint/track/thrill/MotionSimulator.cpp index 3f527d6f3a..39638b4fc5 100644 --- a/src/openrct2/paint/track/thrill/MotionSimulator.cpp +++ b/src/openrct2/paint/track/thrill/MotionSimulator.cpp @@ -119,7 +119,7 @@ static void PaintMotionSimulator( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, session.SupportColours, height, kFenceSpritesRope, diff --git a/src/openrct2/paint/track/thrill/RotoDrop.cpp b/src/openrct2/paint/track/thrill/RotoDrop.cpp index bc31314dda..c73273549e 100644 --- a/src/openrct2/paint/track/thrill/RotoDrop.cpp +++ b/src/openrct2/paint/track/thrill/RotoDrop.cpp @@ -50,10 +50,10 @@ static void PaintRotoDropBase( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesMetalB, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.SupportColours, height, kFloorSpritesTileDiamond, stationObject); TrackPaintUtilPaintFences( - session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, kFenceSpritesMetalB, + session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, kFenceSpritesPicketDuplicate, session.CurrentRotation); if (trackSequence == 0) diff --git a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp index 8ad8cd8b6a..d20b7078c7 100644 --- a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp @@ -50,17 +50,17 @@ static constexpr BoundBoxXY kSwingingInverterShipBounds[] = { enum { - SPR_SWINGING_INVERTER_SHIP_FRAME_0 = 21998, - SPR_SWINGING_INVERTER_SHIP_FRAME_1 = 21999, - SPR_SWINGING_INVERTER_SHIP_FRAME_2 = 22000, - SPR_SWINGING_INVERTER_SHIP_FRAME_3 = 22001, + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_NW = 21998, + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_NE = 21999, + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_SE = 22000, + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_SW = 22001, }; -static constexpr uint32_t kSwingingInverterShipFrameSprites[] = { - SPR_SWINGING_INVERTER_SHIP_FRAME_0, - SPR_SWINGING_INVERTER_SHIP_FRAME_1, - SPR_SWINGING_INVERTER_SHIP_FRAME_2, - SPR_SWINGING_INVERTER_SHIP_FRAME_3, +static constexpr uint32_t kSwingingInverterShipMainSupportSprites[] = { + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_NW, + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_NE, + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_SE, + SPR_SWINGING_INVERTER_SHIP_MAIN_SUPPORT_SW, }; static void PaintSwingingInverterShipStructure( @@ -111,16 +111,16 @@ static void PaintSwingingInverterShipStructure( } auto frameImageTemplate = session.TrackColours; auto vehicleImageId = vehicleImageTemplate.WithIndex(vehicleImageIndex); - auto frameImageId = frameImageTemplate.WithIndex(kSwingingInverterShipFrameSprites[direction]); + auto mainSupportImageId = frameImageTemplate.WithIndex(kSwingingInverterShipMainSupportSprites[direction]); if (direction & 2) { PaintAddImageAsParent(session, vehicleImageId, offset, bb); - PaintAddImageAsChild(session, frameImageId, offset, bb); + PaintAddImageAsChild(session, mainSupportImageId, offset, bb); } else { - PaintAddImageAsParent(session, frameImageId, offset, bb); + PaintAddImageAsParent(session, mainSupportImageId, offset, bb); PaintAddImageAsChild(session, vehicleImageId, offset, bb); } @@ -143,7 +143,7 @@ static void PaintSwingingInverterShip( if (stationObject != nullptr && !(stationObject->Flags & StationObjectFlags::noPlatforms)) { - imageId = session.SupportColours.WithIndex(SPR_STATION_BASE_D); + imageId = session.SupportColours.WithIndex(SPR_STATION_BASE_BORDERLESS); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); switch (direction) diff --git a/src/openrct2/paint/track/thrill/SwingingShip.cpp b/src/openrct2/paint/track/thrill/SwingingShip.cpp index 4883ef26d1..57e3a4fcd0 100644 --- a/src/openrct2/paint/track/thrill/SwingingShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingShip.cpp @@ -175,7 +175,7 @@ static void PaintSwingingShip( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::tubes); if (stationObject != nullptr && !(stationObject->Flags & StationObjectFlags::noPlatforms)) { - ImageIndex base = (direction & 1) ? SPR_STATION_BASE_A_NW_SE : SPR_STATION_BASE_A_SW_NE; + ImageIndex base = (direction & 1) ? SPR_STATION_BASE_TALL_NW_SE : SPR_STATION_BASE_TALL_SW_NE; imageId = session.SupportColours.WithIndex(base); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } diff --git a/src/openrct2/paint/track/thrill/TopSpin.cpp b/src/openrct2/paint/track/thrill/TopSpin.cpp index e538331fa2..58fa7d81d2 100644 --- a/src/openrct2/paint/track/thrill/TopSpin.cpp +++ b/src/openrct2/paint/track/thrill/TopSpin.cpp @@ -195,7 +195,7 @@ static void PaintTopSpin( const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, session.TrackColours, height, kFloorSpritesMulch, stationObject); TrackPaintUtilPaintFences( session, edges, session.MapPosition, trackElement, ride, stationColour, height, kFenceSpritesRope, diff --git a/src/openrct2/paint/track/thrill/Twist.cpp b/src/openrct2/paint/track/thrill/Twist.cpp index 992c1f96da..406ddaa469 100644 --- a/src/openrct2/paint/track/thrill/Twist.cpp +++ b/src/openrct2/paint/track/thrill/Twist.cpp @@ -100,7 +100,7 @@ static void PaintTwist( session, WoodenSupportType::truss, WoodenSupportSubType::neSw, direction, height, stationColour); const StationObject* stationObject = ride.getStationObject(); - TrackPaintUtilPaintFloor(session, edges, stationColour, height, kFloorSpritesCork, stationObject); + TrackPaintUtilPaintFloor(session, edges, stationColour, height, kFloorSpritesMulch, stationObject); switch (trackSequence) { diff --git a/src/openrct2/paint/track/transport/Chairlift.cpp b/src/openrct2/paint/track/transport/Chairlift.cpp index 8139261682..c79ba3da5e 100644 --- a/src/openrct2/paint/track/transport/Chairlift.cpp +++ b/src/openrct2/paint/track/transport/Chairlift.cpp @@ -211,27 +211,27 @@ static void ChairliftPaintStationNeSw( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 22 }, { 32, 6, 1 } }); } - imageId = session.SupportColours.WithIndex(SPR_FLOOR_METAL); + imageId = session.SupportColours.WithIndex(SPR_FLOOR_TILE_CHEQUERBOARD); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 1 } }); bool hasFence = TrackPaintUtilHasFence(EDGE_NW, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_NW); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_NW); PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 2, height + 2 }, { 32, 1, 7 } }); } TrackPaintUtilDrawStationCovers(session, EDGE_NW, hasFence, stationObj, height, stationColour); if ((direction == 2 && isStart) || (direction == 0 && isEnd)) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_NE); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_NE); PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 2, height + 4 }, { 1, 28, 7 } }); } hasFence = TrackPaintUtilHasFence(EDGE_SE, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_SE); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_SE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 30, height + 2 }, { 32, 1, 20 } }); } TrackPaintUtilDrawStationCovers(session, EDGE_SE, hasFence, stationObj, height, stationColour); @@ -240,7 +240,7 @@ static void ChairliftPaintStationNeSw( bool drawBackColumn = true; if ((direction == 0 && isStart) || (direction == 2 && isEnd)) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_SW); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_SW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 30, 2, height + 4 }, { 1, 28, 27 } }); imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairliftBullwheelRotation / 16384]); @@ -304,27 +304,27 @@ static void ChairliftPaintStationSeNw( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 22 }, { 6, 32, 1 } }); } - imageId = session.SupportColours.WithIndex(SPR_FLOOR_METAL); + imageId = session.SupportColours.WithIndex(SPR_FLOOR_TILE_CHEQUERBOARD); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 1 } }); bool hasFence = TrackPaintUtilHasFence(EDGE_NE, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_NE); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_NE); PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 0, height + 2 }, { 1, 32, 7 } }); } TrackPaintUtilDrawStationCovers(session, EDGE_NE, hasFence, stationObj, height, stationColour); if ((direction == 1 && isStart) || (direction == 3 && isEnd)) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_NW); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_NW); PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 2, height + 4 }, { 28, 1, 7 } }); } hasFence = TrackPaintUtilHasFence(EDGE_SW, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_SW); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_SW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 30, 0, height + 2 }, { 1, 32, 20 } }); } TrackPaintUtilDrawStationCovers(session, EDGE_SW, hasFence, stationObj, height, stationColour); @@ -343,7 +343,7 @@ static void ChairliftPaintStationSeNw( } else if ((direction == 3 && isStart) || (direction == 1 && isEnd)) { - imageId = session.TrackColours.WithIndex(SPR_FENCE_METAL_SE); + imageId = session.TrackColours.WithIndex(SPR_FENCE_PICKET_SE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 30, height + 4 }, { 28, 1, 27 } }); imageId = session.TrackColours.WithIndex(chairlift_bullwheel_frames[ride.chairliftBullwheelRotation / 16384]); diff --git a/src/openrct2/paint/track/transport/Lift.cpp b/src/openrct2/paint/track/transport/Lift.cpp index 0bab68339d..b8047e9c42 100644 --- a/src/openrct2/paint/track/transport/Lift.cpp +++ b/src/openrct2/paint/track/transport/Lift.cpp @@ -74,11 +74,11 @@ static void PaintLiftBase( int32_t edges = kEdges3x3[trackSequence]; - auto imageId = session.SupportColours.WithIndex(SPR_FLOOR_METAL_B); + auto imageId = session.SupportColours.WithIndex(SPR_FLOOR_TILE_DIAMOND); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 1 } }); TrackPaintUtilPaintFences( - session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, kFenceSpritesMetalB, + session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, kFenceSpritesPicketDuplicate, session.CurrentRotation); int32_t blockedSegments = 0; diff --git a/src/openrct2/paint/track/water/SplashBoats.cpp b/src/openrct2/paint/track/water/SplashBoats.cpp index 0df83e5953..16da6f10c1 100644 --- a/src/openrct2/paint/track/water/SplashBoats.cpp +++ b/src/openrct2/paint/track/water/SplashBoats.cpp @@ -1185,19 +1185,19 @@ static void PaintSplashBoatsTrackOnRidePhoto( { case 0: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); break; case 1: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); break; case 2: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); break; case 3: PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); + session, direction, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 0, 1 }); break; } diff --git a/src/openrct2/park/Legacy.cpp b/src/openrct2/park/Legacy.cpp index 4c577e29c9..162020dda6 100644 --- a/src/openrct2/park/Legacy.cpp +++ b/src/openrct2/park/Legacy.cpp @@ -2313,7 +2313,7 @@ static AnimObjectConversionTable BuildPeepAnimObjectConversionTable() { auto pag = PeepAnimationGroup(j); auto legacyPosition = object->GetLegacyPosition(pag); - if (legacyPosition == RCT12PeepAnimationGroup::Invalid) + if (legacyPosition == RCT12PeepAnimationGroup::invalid) continue; table[legacyPosition] = { i, pag }; @@ -2342,12 +2342,12 @@ static bool ConvertPeepAnimationType(TPeepType* peep, AnimObjectConversionTable& // Assigned sprites were found to be identical to those of 'Wave2', hence the mapping. // However, it appears to have been used by JavaScript plugins, still, hence the // need to convert any existing sprites. - if (peep->AnimationType == PeepAnimationType::EatFood) - peep->AnimationType = PeepAnimationType::Wave2; + if (peep->AnimationType == PeepAnimationType::eatFood) + peep->AnimationType = PeepAnimationType::wave2; // NB: this is likely unnecessary, but a precautionary measure considering the above. - if (peep->NextAnimationType == PeepAnimationType::EatFood) - peep->NextAnimationType = PeepAnimationType::Wave2; + if (peep->NextAnimationType == PeepAnimationType::eatFood) + peep->NextAnimationType = PeepAnimationType::wave2; return true; } diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index e8c3e2c534..48bce8d6e4 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -211,7 +211,7 @@ namespace OpenRCT2::PathFinding } peep.PeepDirection = direction; - if (peep.State != PeepState::Queuing) + if (peep.State != PeepState::queuing) { // When peeps are walking along a path, we would like them to be spread out across the width of the path, // instead of all walking along the exact centre line of the path. @@ -584,7 +584,7 @@ namespace OpenRCT2::PathFinding if (isLeavingPark) return kMaxJunctionsGuestLeavingPark; - if (guest->HasItem(ShopItem::Map)) + if (guest->HasItem(ShopItem::map)) return kMaxJunctionsGuestWithMap; return kMaxJunctionsGuest; @@ -1966,9 +1966,9 @@ namespace OpenRCT2::PathFinding switch (peep.State) { - case PeepState::EnteringPark: + case PeepState::enteringPark: return GuestPathFindParkEntranceEntering(peep, edges); - case PeepState::LeavingPark: + case PeepState::leavingPark: return GuestPathFindPeepSpawn(peep, edges); default: return GuestPathfindAimless(peep, edges); @@ -2010,7 +2010,7 @@ namespace OpenRCT2::PathFinding /* If there are still multiple directions to choose from, * peeps with maps will randomly read the map: probability of doing so * is much higher when heading for a ride or the park exit. */ - if (peep.HasItem(ShopItem::Map)) + if (peep.HasItem(ShopItem::map)) { // If at least 2 directions consult map if (std::popcount(edges) >= 2) diff --git a/src/openrct2/peep/PeepAnimations.cpp b/src/openrct2/peep/PeepAnimations.cpp index 5b86a1fa43..dad5851183 100644 --- a/src/openrct2/peep/PeepAnimations.cpp +++ b/src/openrct2/peep/PeepAnimations.cpp @@ -25,92 +25,92 @@ namespace OpenRCT2 { static const EnumMap availableGuestAnimations( { - { "walking", PeepAnimationType::Walking }, - { "checkTime", PeepAnimationType::CheckTime }, - { "watchRide", PeepAnimationType::WatchRide }, - { "eatFood", PeepAnimationType::EatFood }, - { "shakeHead", PeepAnimationType::ShakeHead }, - { "emptyPockets", PeepAnimationType::EmptyPockets }, - { "holdMat", PeepAnimationType::HoldMat }, - { "sittingIdle", PeepAnimationType::SittingIdle }, - { "sittingEatFood", PeepAnimationType::SittingEatFood }, - { "sittingLookAroundLeft", PeepAnimationType::SittingLookAroundLeft }, - { "sittingLookAroundRight", PeepAnimationType::SittingLookAroundRight }, - { "hanging", PeepAnimationType::Hanging }, - { "wow", PeepAnimationType::Wow }, - { "throwUp", PeepAnimationType::ThrowUp }, - { "jump", PeepAnimationType::Jump }, - { "drowning", PeepAnimationType::Drowning }, - { "joy", PeepAnimationType::Joy }, - { "readMap", PeepAnimationType::ReadMap }, - { "wave", PeepAnimationType::Wave }, - { "wave2", PeepAnimationType::Wave2 }, - { "takePhoto", PeepAnimationType::TakePhoto }, - { "clap", PeepAnimationType::Clap }, - { "disgust", PeepAnimationType::Disgust }, - { "drawPicture", PeepAnimationType::DrawPicture }, - { "beingWatched", PeepAnimationType::BeingWatched }, - { "withdrawMoney", PeepAnimationType::WithdrawMoney }, + { "walking", PeepAnimationType::walking }, + { "checkTime", PeepAnimationType::checkTime }, + { "watchRide", PeepAnimationType::watchRide }, + { "eatFood", PeepAnimationType::eatFood }, + { "shakeHead", PeepAnimationType::shakeHead }, + { "emptyPockets", PeepAnimationType::emptyPockets }, + { "holdMat", PeepAnimationType::holdMat }, + { "sittingIdle", PeepAnimationType::sittingIdle }, + { "sittingEatFood", PeepAnimationType::sittingEatFood }, + { "sittingLookAroundLeft", PeepAnimationType::sittingLookAroundLeft }, + { "sittingLookAroundRight", PeepAnimationType::sittingLookAroundRight }, + { "hanging", PeepAnimationType::hanging }, + { "wow", PeepAnimationType::wow }, + { "throwUp", PeepAnimationType::throwUp }, + { "jump", PeepAnimationType::jump }, + { "drowning", PeepAnimationType::drowning }, + { "joy", PeepAnimationType::joy }, + { "readMap", PeepAnimationType::readMap }, + { "wave", PeepAnimationType::wave }, + { "wave2", PeepAnimationType::wave2 }, + { "takePhoto", PeepAnimationType::takePhoto }, + { "clap", PeepAnimationType::clap }, + { "disgust", PeepAnimationType::disgust }, + { "drawPicture", PeepAnimationType::drawPicture }, + { "beingWatched", PeepAnimationType::beingWatched }, + { "withdrawMoney", PeepAnimationType::withdrawMoney }, }); static const EnumMap availableHandymanAnimations( { - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "staffMower", PeepAnimationType::StaffMower }, - { "staffSweep", PeepAnimationType::StaffSweep }, - { "drowning", PeepAnimationType::Drowning }, - { "staffWatering", PeepAnimationType::StaffWatering }, - { "staffEmptyBin", PeepAnimationType::StaffEmptyBin }, + { "walking", PeepAnimationType::walking }, + { "watchRide", PeepAnimationType::watchRide }, + { "hanging", PeepAnimationType::hanging }, + { "staffMower", PeepAnimationType::staffMower }, + { "staffSweep", PeepAnimationType::staffSweep }, + { "drowning", PeepAnimationType::drowning }, + { "staffWatering", PeepAnimationType::staffWatering }, + { "staffEmptyBin", PeepAnimationType::staffEmptyBin }, }); static const EnumMap availableMechanicAnimations( { - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "drowning", PeepAnimationType::Drowning }, - { "staffAnswerCall", PeepAnimationType::StaffAnswerCall }, - { "staffAnswerCall2", PeepAnimationType::StaffAnswerCall2 }, - { "staffCheckBoard", PeepAnimationType::StaffCheckBoard }, - { "staffFix", PeepAnimationType::StaffFix }, - { "staffFix2", PeepAnimationType::StaffFix2 }, - { "staffFixGround", PeepAnimationType::StaffFixGround }, - { "staffFix3", PeepAnimationType::StaffFix3 }, + { "walking", PeepAnimationType::walking }, + { "watchRide", PeepAnimationType::watchRide }, + { "hanging", PeepAnimationType::hanging }, + { "drowning", PeepAnimationType::drowning }, + { "staffAnswerCall", PeepAnimationType::staffAnswerCall }, + { "staffAnswerCall2", PeepAnimationType::staffAnswerCall2 }, + { "staffCheckBoard", PeepAnimationType::staffCheckBoard }, + { "staffFix", PeepAnimationType::staffFix }, + { "staffFix2", PeepAnimationType::staffFix2 }, + { "staffFixGround", PeepAnimationType::staffFixGround }, + { "staffFix3", PeepAnimationType::staffFix3 }, }); static const EnumMap availableSecurityAnimations( { - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "drowning", PeepAnimationType::Drowning }, + { "walking", PeepAnimationType::walking }, + { "watchRide", PeepAnimationType::watchRide }, + { "hanging", PeepAnimationType::hanging }, + { "drowning", PeepAnimationType::drowning }, }); static const EnumMap availableEntertainerAnimations( { - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "drowning", PeepAnimationType::Drowning }, - { "joy", PeepAnimationType::Joy }, - { "wave2", PeepAnimationType::Wave2 }, + { "walking", PeepAnimationType::walking }, + { "watchRide", PeepAnimationType::watchRide }, + { "hanging", PeepAnimationType::hanging }, + { "drowning", PeepAnimationType::drowning }, + { "joy", PeepAnimationType::joy }, + { "wave2", PeepAnimationType::wave2 }, }); const EnumMap& getAnimationsByPeepType(AnimationPeepType peepType) { switch (peepType) { - case AnimationPeepType::Guest: + case AnimationPeepType::guest: return availableGuestAnimations; - case AnimationPeepType::Handyman: + case AnimationPeepType::handyman: return availableHandymanAnimations; - case AnimationPeepType::Mechanic: + case AnimationPeepType::mechanic: return availableMechanicAnimations; - case AnimationPeepType::Security: + case AnimationPeepType::security: return availableSecurityAnimations; - case AnimationPeepType::Entertainer: + case AnimationPeepType::entertainer: default: return availableEntertainerAnimations; } @@ -120,15 +120,15 @@ namespace OpenRCT2 { switch (staffType) { - case StaffType::Handyman: - return AnimationPeepType::Handyman; - case StaffType::Mechanic: - return AnimationPeepType::Mechanic; - case StaffType::Security: - return AnimationPeepType::Security; - case StaffType::Entertainer: + case StaffType::handyman: + return AnimationPeepType::handyman; + case StaffType::mechanic: + return AnimationPeepType::mechanic; + case StaffType::security: + return AnimationPeepType::security; + case StaffType::entertainer: default: - return AnimationPeepType::Entertainer; + return AnimationPeepType::entertainer; } } @@ -299,10 +299,10 @@ namespace OpenRCT2 .zoom_level = ZoomLevel{ 0 }, }; - const auto numImages = *(std::max_element(anim.frame_offsets.begin(), anim.frame_offsets.end())) + 1; + const auto numImages = *(std::max_element(anim.frameOffsets.begin(), anim.frameOffsets.end())) + 1; for (int32_t i = 0; i < numImages; ++i) { - GfxDrawSpriteSoftware(rt, ImageId(anim.base_image + i), { 0, 0 }); + GfxDrawSpriteSoftware(rt, ImageId(anim.baseImage + i), { 0, 0 }); } int32_t spriteWidth = -1; @@ -369,9 +369,9 @@ namespace OpenRCT2 spriteHeightPositive++; return { - .sprite_width = static_cast(spriteWidth), - .sprite_height_negative = static_cast(spriteHeightNegative), - .sprite_height_positive = static_cast(spriteHeightPositive), + .spriteWidth = static_cast(spriteWidth), + .spriteHeightNegative = static_cast(spriteHeightNegative), + .spriteHeightPositive = static_cast(spriteHeightPositive), }; } } // namespace OpenRCT2 diff --git a/src/openrct2/peep/PeepAnimations.h b/src/openrct2/peep/PeepAnimations.h index 284fd6b2b8..67c6d83ec9 100644 --- a/src/openrct2/peep/PeepAnimations.h +++ b/src/openrct2/peep/PeepAnimations.h @@ -26,11 +26,11 @@ namespace OpenRCT2 enum class AnimationPeepType : uint8_t { - Guest, - Handyman, - Mechanic, - Security, - Entertainer, + guest, + handyman, + mechanic, + security, + entertainer, }; const EnumMap& getAnimationsByPeepType(AnimationPeepType peepType); @@ -38,16 +38,16 @@ namespace OpenRCT2 struct SpriteBounds { - uint8_t sprite_width; // 0x00 - uint8_t sprite_height_negative; // 0x01 - uint8_t sprite_height_positive; // 0x02 + uint8_t spriteWidth; // 0x00 + uint8_t spriteHeightNegative; // 0x01 + uint8_t spriteHeightPositive; // 0x02 }; struct PeepAnimation { ImageIndex imageTableOffset; - std::vector frame_offsets; - uint32_t base_image{}; + std::vector frameOffsets; + uint32_t baseImage{}; SpriteBounds bounds{}; }; diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index a7565a8ce2..8291a76bb5 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -58,7 +58,7 @@ static const wchar_t* _wszArchitecture = WSZ(OPENRCT2_ARCHITECTURE); static std::map _uploadFiles; static std::mutex _uploadFilesMutex; - #define BACKTRACE_TOKEN "b5ede38e89aaf5db19dd58afe0aeae1dba849d27b22f19734d6b60bf8c9d6351" + #define BACKTRACE_TOKEN "da613916de2ddb54c7bded715421516fd96e8072d42bd3d72412f7e083eb0e63" using namespace OpenRCT2; diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp index e8a3d947e5..a64aed2942 100644 --- a/src/openrct2/platform/Platform.Common.cpp +++ b/src/openrct2/platform/Platform.Common.cpp @@ -52,10 +52,10 @@ namespace OpenRCT2::Platform { if (currCode == nullptr || strlen(currCode) < 3) { - return CurrencyType::Pounds; + return CurrencyType::pounds; } - for (int32_t currency = 0; currency < EnumValue(CurrencyType::Count); ++currency) + for (int32_t currency = 0; currency < EnumValue(CurrencyType::count); ++currency) { if (strncmp(currCode, CurrencyDescriptors[currency].isoCode, 3) == 0) { @@ -63,7 +63,7 @@ namespace OpenRCT2::Platform } } - return CurrencyType::Pounds; + return CurrencyType::pounds; } RealWorldDate GetDateLocal() diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp index dfeda0de99..5329756f19 100644 --- a/src/openrct2/platform/Platform.Posix.cpp +++ b/src/openrct2/platform/Platform.Posix.cpp @@ -29,6 +29,7 @@ #include #include #include + #include #include // The name of the mutex used to prevent multiple instances of the game from running @@ -113,55 +114,101 @@ namespace OpenRCT2::Platform bool FindApp(std::string_view app, std::string* output) { - return Execute(String::stdFormat("which %s 2> /dev/null", std::string(app).c_str()), output) == 0; + std::string appStr = std::string(app); + const char* args[] = { appStr.c_str(), "--version", nullptr }; + int result = Execute(args, nullptr); + if (result == 0 && output) + { + *output = appStr; + } + return result == 0; } - int32_t Execute(std::string_view command, std::string* output) + int32_t Execute(const char* args[], std::string* output) { - #ifndef __EMSCRIPTEN__ - LOG_VERBOSE("executing \"%s\"...", std::string(command).c_str()); - FILE* fpipe = popen(std::string(command).c_str(), "r"); - if (fpipe == nullptr) + // Build the command string from args for logging + std::string commandLine; + if (args && args[0]) { + for (size_t i = 0; args[i]; ++i) + { + if (i > 0) + commandLine += " "; + commandLine += args[i]; + } + } + #ifndef __EMSCRIPTEN__ + int status; + pid_t pid1; + + LOG_INFO("Executing command: %s", commandLine.c_str()); + int fd_pipe[2]; + if (pipe(fd_pipe) != 0) + { /* create a pipe */ return -1; } - if (output != nullptr) - { - // Read output into buffer - std::vector outputBuffer; - char buffer[1024]; - size_t readBytes; - while ((readBytes = fread(buffer, 1, sizeof(buffer), fpipe)) > 0) + + pid1 = fork(); + if (pid1 == 0) + { /* child process */ + close(fd_pipe[0]); /* no reading from pipe */ + /* write stdout in pipe */ + if (dup2(fd_pipe[1], STDOUT_FILENO) == -1) { - outputBuffer.insert(outputBuffer.begin(), buffer, buffer + readBytes); + _exit(128); } - // Trim line breaks - size_t outputLength = outputBuffer.size(); - for (size_t i = outputLength - 1; i != SIZE_MAX; i--) - { - if (outputBuffer[i] == '\n') - { - outputLength = i; - } - else - { - break; - } - } - - // Convert to string - *output = std::string(outputBuffer.data(), outputLength); + /* const casting argv is fine: + * https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html -> rational + */ + execvp(args[0], const_cast(args)); + _exit(129); + } + else if (pid1 < 0) + { /* fork() failed */ + return -128; } else - { - fflush(fpipe); - } + { /* parent process */ + close(fd_pipe[1]); /* no writing to the pipe */ + if (waitpid(pid1, &status, 0) != pid1) + { + return -errno; + } - // Return exit code - return pclose(fpipe); + if (!WIFEXITED(status)) + { + return -129; + } + + if (WEXITSTATUS(status) >= 128) + { + return -130 - WEXITSTATUS(status); + } + + // Optionally, read output from fd_pipe[0] if output != nullptr + if (output != nullptr) + { + std::vector outputBuffer; + char buffer[1024]; + ssize_t readBytes; + while ((readBytes = read(fd_pipe[0], buffer, sizeof(buffer))) > 0) + { + outputBuffer.insert(outputBuffer.end(), buffer, buffer + readBytes); + } + // Trim line breaks + size_t outputLength = outputBuffer.size(); + while (outputLength > 0 && outputBuffer[outputLength - 1] == '\n') + { + --outputLength; + } + *output = std::string(outputBuffer.data(), outputLength); + } + close(fd_pipe[0]); + return 0; /* success! */ + } #else - LOG_WARNING("Emscripten cannot execute processes. The commandline was '%s'.", std::string(command).c_str()); + LOG_WARNING("Emscripten cannot execute processes. The commandline was '%s'.", commandLine.c_str()); return -1; #endif // __EMSCRIPTEN__ } diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 8da9216b3b..47e835a15f 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -494,7 +494,7 @@ namespace OpenRCT2::Platform return false; } - int32_t Execute(std::string_view command, std::string* output) + int32_t Execute(const char* args[], std::string* output) { LOG_WARNING("Execute() not implemented for Windows!"); return -1; diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h index b2f3ccbdeb..00603ad076 100644 --- a/src/openrct2/platform/Platform.h +++ b/src/openrct2/platform/Platform.h @@ -92,7 +92,7 @@ namespace OpenRCT2::Platform RealWorldDate GetDateLocal(); bool FindApp(std::string_view app, std::string* output); - int32_t Execute(std::string_view command, std::string* output = nullptr); + int32_t Execute(const char* args[], std::string* output = nullptr); bool ProcessIsElevated(); float GetDefaultScale(); diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 8aa0eaeaaf..68b705a316 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -30,204 +30,204 @@ namespace OpenRCT2::RCT1 enum class RideType : uint8_t { - WoodenRollerCoaster = 0, - StandUpSteelRollerCoaster, - SuspendedRollerCoaster, - InvertedRollerCoaster, - SteelMiniRollerCoaster, - MiniatureRailway, - Monorail, - SuspendedSingleRailRollerCoaster, - BoatHire, - WoodenCrazyRodentRollerCoaster, - SingleRailRollerCoaster, - CarRide, - LaunchedFreefall, - BobsledRollerCoaster, - ObservationTower, - SteelRollerCoaster, - WaterSlide, - MineTrainRollerCoaster, - Chairlift, - SteelCorkscrewRollerCoaster, - HedgeMaze, - SpiralSlide, - GoKarts, - LogFlume, - RiverRapids, - Dodgems, - SwingingShip, - SwingingInverterShip, - IceCreamStall, - ChipsStall, - DrinkStall, - CandyflossStall, - BurgerBar, - MerryGoRound, - BalloonStall, - InformationKiosk, - Toilets, - FerrisWheel, - MotionSimulator, + woodenRollerCoaster = 0, + standUpSteelRollerCoaster, + suspendedRollerCoaster, + invertedRollerCoaster, + steelMiniRollerCoaster, + miniatureRailway, + monorail, + suspendedSingleRailRollerCoaster, + boatHire, + woodenCrazyRodentRollerCoaster, + singleRailRollerCoaster, + carRide, + launchedFreefall, + bobsledRollerCoaster, + observationTower, + steelRollerCoaster, + waterSlide, + mineTrainRollerCoaster, + chairlift, + steelCorkscrewRollerCoaster, + hedgeMaze, + spiralSlide, + goKarts, + logFlume, + riverRapids, + dodgems, + swingingShip, + swingingInverterShip, + iceCreamStall, + chipsStall, + drinkStall, + candyflossStall, + burgerBar, + merryGoRound, + balloonStall, + informationKiosk, + toilets, + ferrisWheel, + motionSimulator, _3DCinema, - TopSpin, - SpaceRings, - ReverseFreefallRollerCoaster, - SouvenirStall, - VerticalRollerCoaster, - PizzaStall, - Twist, - HauntedHouse, - PopcornStall, - Circus, - GhostTrain, - SteelTwisterRollerCoaster, - WoodenTwisterRollerCoaster, - WoodenSideFrictionRollerCoaster, - SteelWildMouseRollerCoaster, - HotDogStall, - ExoticSeaFoodStall, - HatStall, - ToffeeAppleStall, - VirginiaReel, - RiverRide, - CycleMonorail, - FlyingRollerCoaster, - SuspendedMonorail, + topSpin, + spaceRings, + reverseFreefallRollerCoaster, + souvenirStall, + verticalRollerCoaster, + pizzaStall, + twist, + hauntedHouse, + popcornStall, + circus, + ghostTrain, + steelTwisterRollerCoaster, + woodenTwisterRollerCoaster, + woodenSideFrictionRollerCoaster, + steelWildMouseRollerCoaster, + hotDogStall, + exoticSeaFoodStall, + hatStall, + toffeeAppleStall, + virginiaReel, + riverRide, + cycleMonorail, + flyingRollerCoaster, + suspendedMonorail, _40, - WoodenReverseRollerCoaster, - HeartlineTwisterRollerCoaster, - MiniatureGolf, + woodenReverseRollerCoaster, + heartlineTwisterRollerCoaster, + miniatureGolf, _44, - RotoDrop, - FlyingSaucers, - CrookedHouse, - CycleRailway, - SuspendedLoopingRollerCoaster, - WaterCoaster, - AirPoweredVerticalCoaster, - InvertedWildMouseCoaster, - JetSkis, - TShirtStall, - RaftRide, - DoughnutShop, - Enterprise, - CoffeeShop, - FriedChickenStall, - LemonadeStall, + rotoDrop, + flyingSaucers, + crookedHouse, + cycleRailway, + suspendedLoopingRollerCoaster, + waterCoaster, + airPoweredVerticalCoaster, + invertedWildMouseCoaster, + jetSkis, + tShirtStall, + raftRide, + doughnutShop, + enterprise, + coffeeShop, + friedChickenStall, + lemonadeStall, - Count, - Null = 255, + count, + null = 255, }; enum class VehicleType : uint8_t { - SteelRollerCoasterTrain, - SteelRollerCoasterTrainBackwards, - WoodenRollerCoasterTrain, - InvertedCoasterTrain, // Not in RCT2 - SuspendedSwingingCars, - LadybirdCars, - StandUpRollerCoasterCars, - SpinningCars, - SinglePersonSwingingChairs, - SwansPedalBoats, - LargeMonorailTrain, - Canoes, - RowingBoats, - SteamTrain, - WoodenMouseCars, - BumperBoats, - WoodenRollerCoasterTrainBackwards, - RocketCars, - Horses, // Steeplechase - Sportscars, - LyingDownSwingingCars, // Inverted single-rail - WoodenMineCars, - SuspendedSwingingAirplaneCars, - SmallMonorailCars, - WaterTricycles, - LaunchedFreefallCar, - BobsleighCars, - Dinghies, - RotatingCabin, - MineTrain, - ChairliftCars, - CorkscrewRollerCoasterTrain, - Motorbikes, - RacingCars, - Trucks, - GoKarts, - RapidsBoats, - LogFlumeBoats, - Dodgems, - SwingingShip, - SwingingInverterShip, - MerryGoRound, - FerrisWheel, - SimulatorPod, - CinemaBuilding, - TopspinCar, - SpaceRings, - ReverseFreefallRollerCoasterCar, - VerticalRollerCoasterCars, - CatCars, - TwistArmsAndCars, - HauntedHouseBuilding, - LogCars, - CircusTent, - GhostTrainCars, - SteelTwisterRollerCoasterTrain, - WoodenTwisterRollerCoasterTrain, - WoodenSideFrictionCars, - VintageCars, - SteamTrainCoveredCars, - StandUpSteelTwisterRollerCoasterTrain, - FloorlessSteelTwisterRollerCoasterTrain, - SteelMouseCars, - ChairliftCarsAlternative, - SuspendedMonorailTrain, - HelicopterCars, - VirginiaReelTubs, - ReverserCars, - Golfers, - RiverRideBoats, - FlyingRollerCoasterTrain, - NonLoopingSteelTwisterRollerCoasterTrain, - HeartlineTwisterCars, - HeartlineTwisterCarsReversed, - Reserved, - RotodropCar, - FlyingSaucers, - CrookedHouseBuilding, - Bicycles, - HypercoasterTrain, + steelRollerCoasterTrain, + steelRollerCoasterTrainBackwards, + woodenRollerCoasterTrain, + invertedCoasterTrain, // Not in RCT2 + suspendedSwingingCars, + ladybirdCars, + standUpRollerCoasterCars, + spinningCars, + singlePersonSwingingChairs, + swansPedalBoats, + largeMonorailTrain, + canoes, + rowingBoats, + steamTrain, + woodenMouseCars, + bumperBoats, + woodenRollerCoasterTrainBackwards, + rocketCars, + horses, // Steeplechase + sportscars, + lyingDownSwingingCars, // Inverted single-rail + woodenMineCars, + suspendedSwingingAirplaneCars, + smallMonorailCars, + waterTricycles, + launchedFreefallCar, + bobsleighCars, + dinghies, + rotatingCabin, + mineTrain, + chairliftCars, + corkscrewRollerCoasterTrain, + motorbikes, + racingCars, + trucks, + goKarts, + rapidsBoats, + logFlumeBoats, + dodgems, + swingingShip, + swingingInverterShip, + merryGoRound, + ferrisWheel, + simulatorPod, + cinemaBuilding, + topspinCar, + spaceRings, + reverseFreefallRollerCoasterCar, + verticalRollerCoasterCars, + catCars, + twistArmsAndCars, + hauntedHouseBuilding, + logCars, + circusTent, + ghostTrainCars, + steelTwisterRollerCoasterTrain, + woodenTwisterRollerCoasterTrain, + woodenSideFrictionCars, + vintageCars, + steamTrainCoveredCars, + standUpSteelTwisterRollerCoasterTrain, + floorlessSteelTwisterRollerCoasterTrain, + steelMouseCars, + chairliftCarsAlternative, + suspendedMonorailTrain, + helicopterCars, + virginiaReelTubs, + reverserCars, + golfers, + riverRideBoats, + flyingRollerCoasterTrain, + nonLoopingSteelTwisterRollerCoasterTrain, + heartlineTwisterCars, + heartlineTwisterCarsReversed, + reserved, + rotodropCar, + flyingSaucers, + crookedHouseBuilding, + bicycles, + hypercoasterTrain, _4AcrossInvertedCoasterTrain, - WaterCoasterBoats, - FaceoffCars, - JetSkis, - RaftBoats, - AmericanStyleSteamTrain, - AirPoweredCoasterTrain, - SuspendedWildMouseCars, // Inverted Hairpin in RCT2 - EnterpriseWheel, + waterCoasterBoats, + faceoffCars, + jetSkis, + raftBoats, + americanStyleSteamTrain, + airPoweredCoasterTrain, + suspendedWildMouseCars, // Inverted Hairpin in RCT2 + enterpriseWheel, - Count, + count, }; enum class BannerType : uint8_t { - Plain = 0, - Jungle, - Roman, - Egyptian, - Mine, - Jurassic, - Oriental, - Snow, - Space, + plain = 0, + jungle, + roman, + egyptian, + mine, + jurassic, + oriental, + snow, + space, - Null = 255, + null = 255, }; #pragma pack(push, 1) @@ -517,41 +517,41 @@ namespace OpenRCT2::RCT1 enum class PeepAnimationGroup : uint8_t { - Normal = 0, - Handyman = 1, - Mechanic = 2, - Security = 3, - EntertainerPanda = 4, - EntertainerTiger = 5, - EntertainerElephant = 6, - EntertainerRoman = 7, - EntertainerGorilla = 8, - EntertainerSnowman = 9, - EntertainerKnight = 10, - EntertainerAstronaut = 11, - IceCream = 12, - Chips = 13, - Burger = 14, - Drink = 15, - Balloon = 16, - Candyfloss = 17, - Umbrella = 18, - Pizza = 19, - SecurityAlt = 20, - Popcorn = 21, - ArmsCrossed = 22, - HeadDown = 23, - Nauseous = 24, - VeryNauseous = 25, - RequireToilet = 26, - Hat = 27, - HotDog = 28, - Tentacle = 29, - ToffeeApple = 30, - Doughnut = 31, - Coffee = 32, - Chicken = 33, - Lemonade = 34, + normal = 0, + handyman = 1, + mechanic = 2, + security = 3, + entertainerPanda = 4, + entertainerTiger = 5, + entertainerElephant = 6, + entertainerRoman = 7, + entertainerGorilla = 8, + entertainerSnowman = 9, + entertainerKnight = 10, + entertainerAstronaut = 11, + iceCream = 12, + chips = 13, + burger = 14, + drink = 15, + balloon = 16, + candyfloss = 17, + umbrella = 18, + pizza = 19, + securityAlt = 20, + popcorn = 21, + armsCrossed = 22, + headDown = 23, + nauseous = 24, + veryNauseous = 25, + requireToilet = 26, + hat = 27, + hotDog = 28, + tentacle = 29, + toffeeApple = 30, + doughnut = 31, + coffee = 32, + chicken = 33, + lemonade = 34, }; struct Peep : RCT12EntityBase @@ -658,8 +658,16 @@ namespace OpenRCT2::RCT1 uint8_t StaffOrders; // 0xC6 uint8_t PeepIsLostCountdown; // 0xC6 }; - RCT12RideId Photo1RideRef; // 0xC7 - uint32_t PeepFlags; // 0xC8 + RCT12RideId Photo1RideRef; // 0xC7 + union + { + uint32_t peepFlagsLL; // 0xC8 + struct + { + uint16_t peepFlagsBaseAA; // 0xC8 + uint16_t itemFlagsBase; // 0xCA + }; + }; RCT12xyzd8 PathfindGoal; // 0xCC RCT12xyzd8 PathfindHistory[4]; // 0xD0 uint8_t NoActionFrameNum; // 0xE0 @@ -692,10 +700,15 @@ namespace OpenRCT2::RCT1 RCT12RideId FavouriteRide; // 0xF9 uint8_t FavouriteRideRating; // 0xFA uint8_t PadFB; - uint32_t ItemStandardFlags; // 0xFC - uint64_t GetItemFlags() const + uint32_t itemFlagsAALL; // 0xFC + + uint64_t GetItemFlags(bool isBase) const { - return ItemStandardFlags; + return isBase ? itemFlagsBase : itemFlagsAALL; + } + uint32_t getPeepFlags(bool isLL) const + { + return isLL ? peepFlagsLL : peepFlagsBaseAA; } }; static_assert(sizeof(Peep) == 0x100); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index e1c971856a..7e603fd9f0 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -74,6 +74,7 @@ #include "../world/tile_element/EntranceElement.h" #include "../world/tile_element/LargeSceneryElement.h" #include "../world/tile_element/PathElement.h" +#include "../world/tile_element/Slope.h" #include "../world/tile_element/SmallSceneryElement.h" #include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TileElement.h" @@ -120,8 +121,8 @@ namespace OpenRCT2::RCT1 RCT12::EntryList _footpathRailingsEntries; // Lookup tables for converting from RCT1 hard coded types to the new dynamic object entries - ObjectEntryIndex _rideTypeToRideEntryMap[EnumValue(RideType::Count)]{}; - ObjectEntryIndex _vehicleTypeToRideEntryMap[EnumValue(VehicleType::Count)]{}; + ObjectEntryIndex _rideTypeToRideEntryMap[EnumValue(RideType::count)]{}; + ObjectEntryIndex _vehicleTypeToRideEntryMap[EnumValue(VehicleType::count)]{}; ObjectEntryIndex _smallSceneryTypeToEntryMap[256]{}; ObjectEntryIndex _largeSceneryTypeToEntryMap[256]{}; ObjectEntryIndex _wallTypeToEntryMap[256]{}; @@ -132,11 +133,10 @@ namespace OpenRCT2::RCT1 ObjectEntryIndex _terrainSurfaceTypeToEntryMap[16]{}; ObjectEntryIndex _terrainEdgeTypeToEntryMap[16]{}; ObjectEntryIndex _footpathSurfaceTypeToEntryMap[32]{}; - ObjectEntryIndex _footpathRailingsTypeToEntryMap[4]{}; // Research BitSet _researchRideEntryUsed{}; - BitSet _researchRideTypeUsed{}; + BitSet _researchRideTypeUsed{}; // Scenario repository - used for determining scenario name IScenarioRepository* _scenarioRepository = GetScenarioRepository(); @@ -254,7 +254,7 @@ namespace OpenRCT2::RCT1 dst->ObjectiveArg3 = GetBuildTheBestRideId(); } - std::string name = RCT2StringToUTF8(_s4.ScenarioName, RCT2LanguageId::EnglishUK); + std::string name = RCT2StringToUTF8(_s4.ScenarioName, RCT2LanguageId::englishUK); std::string details; // TryGetById won't set this property if the scenario is not recognised, @@ -383,8 +383,6 @@ namespace OpenRCT2::RCT1 std::fill(std::begin(_terrainEdgeTypeToEntryMap), std::end(_terrainEdgeTypeToEntryMap), kObjectEntryIndexNull); std::fill( std::begin(_footpathSurfaceTypeToEntryMap), std::end(_footpathSurfaceTypeToEntryMap), kObjectEntryIndexNull); - std::fill( - std::begin(_footpathRailingsTypeToEntryMap), std::end(_footpathRailingsTypeToEntryMap), kObjectEntryIndexNull); } /** @@ -424,9 +422,14 @@ namespace OpenRCT2::RCT1 "rct1ll.footpath_surface.tiles_red", "rct1.footpath_surface.queue_blue", "rct1aa.footpath_surface.queue_red", "rct1aa.footpath_surface.queue_yellow", "rct1aa.footpath_surface.queue_green" }); + // All four are always available. By using the same order as RCT1, we don’t need to map the indices later on. _footpathRailingsEntries.AddRange( - { "rct2.footpath_railings.wood", "rct1ll.footpath_railings.space", "rct1ll.footpath_railings.bamboo", - "rct2.footpath_railings.concrete" }); + { + "rct2.footpath_railings.wood", // RCT1_PATH_SUPPORT_TYPE_TRUSS + "rct2.footpath_railings.concrete", // RCT1_PATH_SUPPORT_TYPE_COATED_WOOD + "rct1ll.footpath_railings.space", // RCT1_PATH_SUPPORT_TYPE_SPACE + "rct1ll.footpath_railings.bamboo", // RCT1_PATH_SUPPORT_TYPE_BAMBOO + }); // Add default surfaces _terrainSurfaceEntries.AddRange( @@ -450,7 +453,7 @@ namespace OpenRCT2::RCT1 { size_t researchListCount; const ResearchItem* researchList = GetResearchList(&researchListCount); - BitSet rideTypeInResearch = GetRideTypesPresentInResearchList( + BitSet rideTypeInResearch = GetRideTypesPresentInResearchList( researchList, researchListCount); for (size_t i = 0; i < researchListCount; i++) { @@ -499,7 +502,7 @@ namespace OpenRCT2::RCT1 { switch (tileElement->GetType()) { - case RCT12TileElementType::Surface: + case RCT12TileElementType::surface: { auto surfaceEl = tileElement->AsSurface(); auto surfaceStyle = surfaceEl->GetSurfaceStyle(); @@ -508,28 +511,22 @@ namespace OpenRCT2::RCT1 AddEntryForTerrainEdge(edgeStyle); break; } - case RCT12TileElementType::Path: + case RCT12TileElementType::path: { uint8_t pathType = tileElement->AsPath()->GetRCT1PathType(); uint8_t pathAdditionsType = tileElement->AsPath()->GetAddition(); - uint8_t footpathRailingsType = RCT1_PATH_SUPPORT_TYPE_TRUSS; - if (_gameVersion == FILE_VERSION_RCT1_LL) - { - footpathRailingsType = tileElement->AsPath()->GetRCT1SupportType(); - } AddEntryForPathAddition(pathAdditionsType); AddEntryForPathSurface(pathType); - AddEntryForFootpathRailings(footpathRailingsType); break; } - case RCT12TileElementType::SmallScenery: + case RCT12TileElementType::smallScenery: AddEntryForSmallScenery(tileElement->AsSmallScenery()->GetEntryIndex()); break; - case RCT12TileElementType::LargeScenery: + case RCT12TileElementType::largeScenery: AddEntryForLargeScenery(tileElement->AsLargeScenery()->GetEntryIndex()); break; - case RCT12TileElementType::Wall: + case RCT12TileElementType::wall: { for (int32_t edge = 0; edge < 4; edge++) { @@ -558,7 +555,7 @@ namespace OpenRCT2::RCT1 for (size_t i = 0; i < std::size(_s4.Rides); i++) { auto ride = &_s4.Rides[i]; - if (ride->type != RideType::Null) + if (ride->type != RideType::null) { if (RCT1::RideTypeUsesVehicles(ride->type)) AddEntryForVehicleType(ride->type, ride->vehicleType); @@ -620,7 +617,7 @@ namespace OpenRCT2::RCT1 { auto& banner = _s4.Banners[i]; auto type = static_cast(banner.Type); - if (type == BannerType::Null) + if (type == BannerType::null) continue; AddEntryForBanner(type); @@ -668,7 +665,7 @@ namespace OpenRCT2::RCT1 auto entryIndex = _rideEntries.GetOrAddEntry(entryName); _vehicleTypeToRideEntryMap[EnumValue(vehicleType)] = entryIndex; - if (rideType != RideType::Null) + if (rideType != RideType::null) AddEntryForRideType(rideType); } } @@ -808,25 +805,11 @@ namespace OpenRCT2::RCT1 } } - void AddEntryForFootpathRailings(ObjectEntryIndex railingsType) - { - assert(railingsType < std::size(_footpathRailingsTypeToEntryMap)); - if (_footpathRailingsTypeToEntryMap[railingsType] == kObjectEntryIndexNull) - { - auto identifier = RCT1::GetFootpathRailingsObject(railingsType); - if (!identifier.empty()) - { - auto entryIndex = _footpathRailingsEntries.GetOrAddEntry(identifier); - _footpathRailingsTypeToEntryMap[railingsType] = entryIndex; - } - } - } - void ImportRides() { for (int32_t i = 0; i < Limits::kMaxRidesInPark; i++) { - if (_s4.Rides[i].type != RideType::Null) + if (_s4.Rides[i].type != RideType::null) { const auto rideId = RideId::FromUnderlying(i); ImportRide(RideAllocateAtIndex(rideId), &_s4.Rides[i], rideId); @@ -840,7 +823,7 @@ namespace OpenRCT2::RCT1 dst->id = rideIndex; // This is a peculiarity of this exact version number, which only Heide-Park seems to use. - if (_s4.GameVersion == 110018 && src->type == RideType::InvertedRollerCoaster) + if (_s4.GameVersion == 110018 && src->type == RideType::invertedRollerCoaster) { dst->type = RIDE_TYPE_COMPACT_INVERTED_COASTER; } @@ -995,7 +978,7 @@ namespace OpenRCT2::RCT1 // Only merry-go-round and dodgems had music and used // the same flag as synchronise stations for the option to enable it - if (src->type == RideType::MerryGoRound || src->type == RideType::Dodgems) + if (src->type == RideType::merryGoRound || src->type == RideType::dodgems) { if (src->departFlags & RCT1_RIDE_DEPART_PLAY_MUSIC) { @@ -1058,7 +1041,7 @@ namespace OpenRCT2::RCT1 dst->startDropHeight = src->startDropHeight / 2; dst->highestDropHeight = src->highestDropHeight / 2; - if (src->type == RideType::MiniatureGolf) + if (src->type == RideType::miniatureGolf) dst->numHoles = src->numInversions & kRCT12InversionAndHoleMask; else dst->numInversions = src->numInversions & kRCT12InversionAndHoleMask; @@ -1128,11 +1111,11 @@ namespace OpenRCT2::RCT1 dst->trackColours[0].supports = RCT1::GetColour(src->trackSupportColour); // Balloons were always blue in the original RCT. - if (src->type == RideType::BalloonStall) + if (src->type == RideType::balloonStall) { dst->trackColours[0].main = COLOUR_LIGHT_BLUE; } - else if (src->type == RideType::RiverRapids) + else if (src->type == RideType::riverRapids) { dst->trackColours[0].main = COLOUR_WHITE; } @@ -1161,7 +1144,7 @@ namespace OpenRCT2::RCT1 } } - if (_gameVersion < FILE_VERSION_RCT1_LL && src->type == RideType::MerryGoRound) + if (_gameVersion < FILE_VERSION_RCT1_LL && src->type == RideType::merryGoRound) { // The merry-go-round in pre-LL versions was always yellow with red dst->vehicleColours[0].Body = COLOUR_YELLOW; @@ -1216,7 +1199,7 @@ namespace OpenRCT2::RCT1 // In RCT1 and AA, the maze was always hedges. // LL has 4 types, like RCT2. For LL, only guard against invalid values. - if (src->type == RideType::HedgeMaze) + if (src->type == RideType::hedgeMaze) { if (_gameVersion < FILE_VERSION_RCT1_LL || src->trackColourSupports[0] > 3) dst->trackColours[0].supports = MazeWallType::hedges; @@ -1274,13 +1257,13 @@ namespace OpenRCT2::RCT1 { // TODO: Entities are currently read from the global state, change this once entities are stored // in the passed gameState. - auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest); + auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest); for (auto* peep : EntityList()) { const auto& spriteBounds = animObj->GetSpriteBounds(peep->AnimationGroup, peep->AnimationType); - peep->SpriteData.Width = spriteBounds.sprite_width; - peep->SpriteData.HeightMin = spriteBounds.sprite_height_negative; - peep->SpriteData.HeightMax = spriteBounds.sprite_height_positive; + peep->SpriteData.Width = spriteBounds.spriteWidth; + peep->SpriteData.HeightMin = spriteBounds.spriteHeightNegative; + peep->SpriteData.HeightMax = spriteBounds.spriteHeightPositive; } auto& objManager = GetContext()->GetObjectManager(); @@ -1288,9 +1271,9 @@ namespace OpenRCT2::RCT1 { animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& spriteBounds = animObj->GetSpriteBounds(peep->AnimationGroup, peep->AnimationType); - peep->SpriteData.Width = spriteBounds.sprite_width; - peep->SpriteData.HeightMin = spriteBounds.sprite_height_negative; - peep->SpriteData.HeightMax = spriteBounds.sprite_height_positive; + peep->SpriteData.Width = spriteBounds.spriteWidth; + peep->SpriteData.HeightMin = spriteBounds.spriteHeightNegative; + peep->SpriteData.HeightMax = spriteBounds.spriteHeightPositive; } } @@ -1648,6 +1631,7 @@ namespace OpenRCT2::RCT1 SetTileElements(gameState, std::move(tileElements)); FixEntrancePositions(gameState); + FixSupportsOnGroundPath(gameState); } size_t ImportTileElement(TileElement* dst, const RCT12TileElement* src) @@ -1725,8 +1709,8 @@ namespace OpenRCT2::RCT1 { railingsType = src2->GetRCT1SupportType(); } - auto railingsEntryIndex = _footpathRailingsTypeToEntryMap[railingsType]; - dst2->SetRailingsEntryIndex(railingsEntryIndex); + // All types are already loaded, in the same order as RCT1. + dst2->SetRailingsEntryIndex(railingsType); // Additions ObjectEntryIndex additionType = src2->GetAddition(); @@ -1761,7 +1745,7 @@ namespace OpenRCT2::RCT1 dst2->SetStationIndex(StationIndex::FromUnderlying(src2->GetStationIndex())); dst2->SetHasGreenLight(src2->HasGreenLight()); dst2->SetIsIndestructible(src2->IsIndestructible()); - if (rct1RideType == RideType::GhostTrain) + if (rct1RideType == RideType::ghostTrain) { dst2->SetDoorAState(src2->GetDoorAState()); dst2->SetDoorBState(src2->GetDoorBState()); @@ -1785,7 +1769,7 @@ namespace OpenRCT2::RCT1 } // This has to be done last, since the maze entry shares fields with the colour and sequence fields. - if (rct1RideType == RideType::HedgeMaze) + if (rct1RideType == RideType::hedgeMaze) { dst2->SetMazeEntry(src2->GetMazeEntry()); } @@ -2100,25 +2084,25 @@ namespace OpenRCT2::RCT1 uint8_t activeResearchTypes = 0; if (_s4.ResearchPriority & RCT1_RESEARCH_CATEGORY_ROLLERCOASTERS) { - activeResearchTypes |= EnumToFlag(ResearchCategory::Rollercoaster); + activeResearchTypes |= EnumToFlag(ResearchCategory::rollercoaster); } if (_s4.ResearchPriority & RCT1_RESEARCH_CATEGORY_THRILL_RIDES) { - activeResearchTypes |= EnumToFlag(ResearchCategory::Thrill); - activeResearchTypes |= EnumToFlag(ResearchCategory::Water); + activeResearchTypes |= EnumToFlag(ResearchCategory::thrill); + activeResearchTypes |= EnumToFlag(ResearchCategory::water); } if (_s4.ResearchPriority & RCT1_RESEARCH_CATEGORY_GENTLE_TRANSPORT_RIDES) { - activeResearchTypes |= EnumToFlag(ResearchCategory::Gentle); - activeResearchTypes |= EnumToFlag(ResearchCategory::Transport); + activeResearchTypes |= EnumToFlag(ResearchCategory::gentle); + activeResearchTypes |= EnumToFlag(ResearchCategory::transport); } if (_s4.ResearchPriority & RCT1_RESEARCH_CATEGORY_SHOPS) { - activeResearchTypes |= EnumToFlag(ResearchCategory::Shop); + activeResearchTypes |= EnumToFlag(ResearchCategory::shop); } if (_s4.ResearchPriority & RCT1_RESEARCH_CATEGORY_SCENERY_THEMING) { - activeResearchTypes |= EnumToFlag(ResearchCategory::SceneryGroup); + activeResearchTypes |= EnumToFlag(ResearchCategory::sceneryGroup); } gameState.researchPriorities = activeResearchTypes; gameState.researchFundingLevel = _s4.ResearchLevel; @@ -2158,10 +2142,10 @@ namespace OpenRCT2::RCT1 } } - static BitSet GetRideTypesPresentInResearchList( + static BitSet GetRideTypesPresentInResearchList( const RCT1::ResearchItem* researchList, size_t researchListCount) { - BitSet ret = {}; + BitSet ret = {}; for (size_t i = 0; i < researchListCount; i++) { @@ -2358,7 +2342,7 @@ namespace OpenRCT2::RCT1 auto rideType = rideEntry->GetFirstNonNullRideType(); dst->entryIndex = entryIndex; dst->baseRideType = rideType; - dst->type = Research::EntryType::Ride; + dst->type = Research::EntryType::ride; dst->flags = 0; dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory(); } @@ -2377,7 +2361,7 @@ namespace OpenRCT2::RCT1 auto rideType = rideEntry->GetFirstNonNullRideType(); dst->entryIndex = entryIndex; dst->baseRideType = rideType; - dst->type = Research::EntryType::Ride; + dst->type = Research::EntryType::ride; dst->flags = 0; dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory(); } @@ -2390,8 +2374,8 @@ namespace OpenRCT2::RCT1 if (entryIndex != ObjectEntryIndexIgnore && entryIndex != kObjectEntryIndexNull) { dst->entryIndex = entryIndex; - dst->type = Research::EntryType::Scenery; - dst->category = ResearchCategory::SceneryGroup; + dst->type = Research::EntryType::scenery; + dst->category = ResearchCategory::sceneryGroup; dst->baseRideType = 0; dst->flags = 0; } @@ -2567,6 +2551,39 @@ namespace OpenRCT2::RCT1 } } + void FixSupportsOnGroundPath(GameState_t& gameState) + { + TileElementIterator it; + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it)) + { + if (it.element->GetType() != TileElementType::Path) + continue; + + auto* pathElement = it.element->AsPath(); + if (pathElement->IsSloped()) + continue; + + if (pathElement->IsQueue()) + continue; + + auto* surface = MapGetSurfaceElementAt(TileCoordsXY(it.x, it.y)); + if (surface == nullptr) + continue; + + if (surface->GetSlope() != kTileSlopeFlat) + continue; + + if (surface->GetBaseZ() != pathElement->GetBaseZ()) + continue; + + // RCT1 would always draw supports around a path if it was flat on the ground. + // In RCT2, this depends on the support type of the path, even though that isn’t even visible in this case. + // As such, always import footpath that is on the ground with box supports. + pathElement->SetRailingsEntryIndex(RCT1_PATH_SUPPORT_TYPE_TRUSS); + } + } + RCT12::EntryList* GetEntryList(ObjectType objectType) { switch (objectType) @@ -2614,7 +2631,7 @@ namespace OpenRCT2::RCT1 const auto originalString = _s4.StringTable[stringId % 1024]; auto originalStringView = std::string_view( originalString, RCT12::GetRCTStringBufferLen(originalString, kUserStringMaxLength)); - auto asUtf8 = RCT2StringToUTF8(originalStringView, RCT2LanguageId::EnglishUK); + auto asUtf8 = RCT2StringToUTF8(originalStringView, RCT2LanguageId::englishUK); auto justText = RCT12RemoveFormattingUTF8(asUtf8); return justText.data(); } @@ -2719,63 +2736,63 @@ namespace OpenRCT2::RCT1 // Very similar but not the same as S6Importer version (due to peeps) constexpr EntityType GetEntityTypeFromRCT1Sprite(const RCT12EntityBase& src) { - EntityType output = EntityType::Null; + EntityType output = EntityType::null; switch (src.EntityIdentifier) { - case RCT12EntityIdentifier::Vehicle: - output = EntityType::Vehicle; + case RCT12EntityIdentifier::vehicle: + output = EntityType::vehicle; break; - case RCT12EntityIdentifier::Peep: + case RCT12EntityIdentifier::peep: { const auto& peep = static_cast(src); - if (peep.PeepType == RCT12PeepType::Guest) + if (peep.PeepType == RCT12PeepType::guest) { - output = EntityType::Guest; + output = EntityType::guest; } else { - output = EntityType::Staff; + output = EntityType::staff; } break; } - case RCT12EntityIdentifier::Misc: + case RCT12EntityIdentifier::misc: switch (RCT12MiscEntityType(src.Type)) { - case RCT12MiscEntityType::SteamParticle: - output = EntityType::SteamParticle; + case RCT12MiscEntityType::steamParticle: + output = EntityType::steamParticle; break; - case RCT12MiscEntityType::MoneyEffect: - output = EntityType::MoneyEffect; + case RCT12MiscEntityType::moneyEffect: + output = EntityType::moneyEffect; break; - case RCT12MiscEntityType::CrashedVehicleParticle: - output = EntityType::CrashedVehicleParticle; + case RCT12MiscEntityType::crashedVehicleParticle: + output = EntityType::crashedVehicleParticle; break; - case RCT12MiscEntityType::ExplosionCloud: - output = EntityType::ExplosionCloud; + case RCT12MiscEntityType::explosionCloud: + output = EntityType::explosionCloud; break; - case RCT12MiscEntityType::CrashSplash: - output = EntityType::CrashSplash; + case RCT12MiscEntityType::crashSplash: + output = EntityType::crashSplash; break; - case RCT12MiscEntityType::ExplosionFlare: - output = EntityType::ExplosionFlare; + case RCT12MiscEntityType::explosionFlare: + output = EntityType::explosionFlare; break; - case RCT12MiscEntityType::JumpingFountainWater: - case RCT12MiscEntityType::JumpingFountainSnow: - output = EntityType::JumpingFountain; + case RCT12MiscEntityType::jumpingFountainWater: + case RCT12MiscEntityType::jumpingFountainSnow: + output = EntityType::jumpingFountain; break; - case RCT12MiscEntityType::Balloon: - output = EntityType::Balloon; + case RCT12MiscEntityType::balloon: + output = EntityType::balloon; break; - case RCT12MiscEntityType::Duck: - output = EntityType::Duck; + case RCT12MiscEntityType::duck: + output = EntityType::duck; break; default: break; } break; - case RCT12EntityIdentifier::Litter: - output = EntityType::Litter; + case RCT12EntityIdentifier::litter: + output = EntityType::litter; break; default: break; @@ -2916,18 +2933,20 @@ namespace OpenRCT2::RCT1 dst->OutsideOfPark = static_cast(src->OutsideOfPark); dst->TimeToConsume = src->TimeToConsume; dst->VandalismSeen = src->VandalismSeen; - dst->UmbrellaColour = RCT1::GetColour(src->UmbrellaColour); - dst->HatColour = RCT1::GetColour(src->HatColour); - // Balloons were always blue in RCT1 without AA/LL + // Balloons were always blue in RCT1 without AA/LL, umbrellas always red if (_gameVersion == FILE_VERSION_RCT1) { + dst->UmbrellaColour = COLOUR_BRIGHT_RED; dst->BalloonColour = COLOUR_LIGHT_BLUE; } else { + dst->UmbrellaColour = RCT1::GetColour(src->UmbrellaColour); dst->BalloonColour = RCT1::GetColour(src->BalloonColour); } + dst->HatColour = RCT1::GetColour(src->HatColour); + dst->Happiness = src->Happiness; dst->HappinessTarget = src->HappinessTarget; dst->Nausea = src->Nausea; @@ -2963,6 +2982,7 @@ namespace OpenRCT2::RCT1 OpenRCT2::RideUse::GetTypeHistory().Set(dst->Id, RCT12GetRideTypesBeenOn(src)); dst->Photo1RideRef = RCT12RideIdToOpenRCT2RideId(src->Photo1RideRef); + dst->PeepFlags = src->getPeepFlags(_gameVersion == FILE_VERSION_RCT1_LL); for (size_t i = 0; i < std::size(src->Thoughts); i++) { @@ -2995,7 +3015,7 @@ namespace OpenRCT2::RCT1 dst->FavouriteRideRating = 0; } - dst->SetItemFlags(src->GetItemFlags()); + dst->SetItemFlags(src->GetItemFlags(_gameVersion == FILE_VERSION_RCT1)); } template<> @@ -3107,7 +3127,7 @@ namespace OpenRCT2::RCT1 auto* src = static_cast(&srcBase); auto fountainType = JumpingFountainType::Water; - if (RCT12MiscEntityType(src->Type) == RCT12MiscEntityType::JumpingFountainSnow) + if (RCT12MiscEntityType(src->Type) == RCT12MiscEntityType::jumpingFountainSnow) fountainType = JumpingFountainType::Snow; ImportEntityCommonProperties(dst, src); @@ -3158,43 +3178,43 @@ namespace OpenRCT2::RCT1 { switch (GetEntityTypeFromRCT1Sprite(src)) { - case EntityType::Vehicle: + case EntityType::vehicle: ImportEntity<::Vehicle>(gameState, src); break; - case EntityType::Guest: + case EntityType::guest: ImportEntity(gameState, src); break; - case EntityType::Staff: + case EntityType::staff: ImportEntity(gameState, src); break; - case EntityType::SteamParticle: + case EntityType::steamParticle: ImportEntity(gameState, src); break; - case EntityType::MoneyEffect: + case EntityType::moneyEffect: ImportEntity(gameState, src); break; - case EntityType::CrashedVehicleParticle: + case EntityType::crashedVehicleParticle: ImportEntity(gameState, src); break; - case EntityType::ExplosionCloud: + case EntityType::explosionCloud: ImportEntity(gameState, src); break; - case EntityType::ExplosionFlare: + case EntityType::explosionFlare: ImportEntity(gameState, src); break; - case EntityType::CrashSplash: + case EntityType::crashSplash: ImportEntity(gameState, src); break; - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: ImportEntity(gameState, src); break; - case EntityType::Balloon: + case EntityType::balloon: ImportEntity(gameState, src); break; - case EntityType::Duck: + case EntityType::duck: ImportEntity(gameState, src); break; - case EntityType::Litter: + case EntityType::litter: ImportEntity(gameState, src); break; default: diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index 522163bbf4..12f6f0e90e 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -103,7 +103,7 @@ namespace OpenRCT2::RCT1 } // The maze style is saved in the support colour, but taking it through the conversion function // will mess up style 3 (wooden fences). - if (td4aa.Type == RideType::HedgeMaze) + if (td4aa.Type == RideType::hedgeMaze) { td->appearance.trackColours[0].supports = td4aa.TrackSupportColour[0]; } @@ -123,11 +123,11 @@ namespace OpenRCT2::RCT1 td->appearance.trackColours[i].supports = RCT1::GetColour(td4.TrackSupportColourV0); // Mazes were only hedges - if (td4.Type == RideType::HedgeMaze) + if (td4.Type == RideType::hedgeMaze) { td->appearance.trackColours[i].supports = MazeWallType::hedges; } - else if (td4.Type == RideType::RiverRapids) + else if (td4.Type == RideType::riverRapids) { td->appearance.trackColours[i].main = COLOUR_WHITE; td->appearance.trackColours[i].additional = COLOUR_WHITE; @@ -149,7 +149,7 @@ namespace OpenRCT2::RCT1 } std::string_view vehicleObject; - if (td4Base.Type == RideType::HedgeMaze) + if (td4Base.Type == RideType::hedgeMaze) { vehicleObject = RCT1::GetRideTypeObject(td4Base.Type, false); } @@ -227,7 +227,7 @@ namespace OpenRCT2::RCT1 td->statistics.maxNegativeVerticalG = td4Base.MaxNegativeVerticalG * kTD46GForcesMultiplier; td->statistics.maxLateralG = td4Base.MaxLateralG * kTD46GForcesMultiplier; - if (td4Base.Type == RideType::MiniatureGolf) + if (td4Base.Type == RideType::miniatureGolf) td->statistics.holes = td4Base.NumHoles & kRCT12InversionAndHoleMask; else td->statistics.inversions = td4Base.NumInversions & kRCT12InversionAndHoleMask; diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index acd10dbbb4..1b702dcf72 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -71,46 +71,46 @@ namespace OpenRCT2::RCT1 { static constexpr RCT12PeepAnimationGroup map[] = { - RCT12PeepAnimationGroup::Normal, // 0x00 - RCT12PeepAnimationGroup::Handyman, // 0x01 - RCT12PeepAnimationGroup::Mechanic, // 0x02 - RCT12PeepAnimationGroup::Security, // 0x03 - RCT12PeepAnimationGroup::EntertainerPanda, // 0x04 - RCT12PeepAnimationGroup::EntertainerTiger, // 0x05 - RCT12PeepAnimationGroup::EntertainerElephant, // 0x06 - RCT12PeepAnimationGroup::EntertainerRoman, // 0x07 - RCT12PeepAnimationGroup::EntertainerGorilla, // 0x08 - RCT12PeepAnimationGroup::EntertainerSnowman, // 0x09 - RCT12PeepAnimationGroup::EntertainerKnight, // 0x0A - RCT12PeepAnimationGroup::EntertainerAstronaut, // 0x0B - RCT12PeepAnimationGroup::IceCream, // 0x0C - RCT12PeepAnimationGroup::Chips, // 0x0D - RCT12PeepAnimationGroup::Burger, // 0x0E - RCT12PeepAnimationGroup::Drink, // 0x0F - RCT12PeepAnimationGroup::Balloon, // 0x10 - RCT12PeepAnimationGroup::Candyfloss, // 0x11 - RCT12PeepAnimationGroup::Umbrella, // 0x12 - RCT12PeepAnimationGroup::Pizza, // 0x13 - RCT12PeepAnimationGroup::SecurityAlt, // 0x14 - RCT12PeepAnimationGroup::Popcorn, // 0x15 - RCT12PeepAnimationGroup::ArmsCrossed, // 0x16 - RCT12PeepAnimationGroup::HeadDown, // 0x17 - RCT12PeepAnimationGroup::Nauseous, // 0x18 - RCT12PeepAnimationGroup::VeryNauseous, // 0x19 - RCT12PeepAnimationGroup::RequireToilet, // 0x1A - RCT12PeepAnimationGroup::Hat, // 0x1B - RCT12PeepAnimationGroup::HotDog, // 0x1C - RCT12PeepAnimationGroup::Tentacle, // 0x1D - RCT12PeepAnimationGroup::ToffeeApple, // 0x1E - RCT12PeepAnimationGroup::Doughnut, // 0x1F - RCT12PeepAnimationGroup::Coffee, // 0x20 - RCT12PeepAnimationGroup::Chicken, // 0x21 - RCT12PeepAnimationGroup::Lemonade, // 0x22 + RCT12PeepAnimationGroup::normal, // 0x00 + RCT12PeepAnimationGroup::handyman, // 0x01 + RCT12PeepAnimationGroup::mechanic, // 0x02 + RCT12PeepAnimationGroup::security, // 0x03 + RCT12PeepAnimationGroup::entertainerPanda, // 0x04 + RCT12PeepAnimationGroup::entertainerTiger, // 0x05 + RCT12PeepAnimationGroup::entertainerElephant, // 0x06 + RCT12PeepAnimationGroup::entertainerRoman, // 0x07 + RCT12PeepAnimationGroup::entertainerGorilla, // 0x08 + RCT12PeepAnimationGroup::entertainerSnowman, // 0x09 + RCT12PeepAnimationGroup::entertainerKnight, // 0x0A + RCT12PeepAnimationGroup::entertainerAstronaut, // 0x0B + RCT12PeepAnimationGroup::iceCream, // 0x0C + RCT12PeepAnimationGroup::chips, // 0x0D + RCT12PeepAnimationGroup::burger, // 0x0E + RCT12PeepAnimationGroup::drink, // 0x0F + RCT12PeepAnimationGroup::balloon, // 0x10 + RCT12PeepAnimationGroup::candyfloss, // 0x11 + RCT12PeepAnimationGroup::umbrella, // 0x12 + RCT12PeepAnimationGroup::pizza, // 0x13 + RCT12PeepAnimationGroup::securityAlt, // 0x14 + RCT12PeepAnimationGroup::popcorn, // 0x15 + RCT12PeepAnimationGroup::armsCrossed, // 0x16 + RCT12PeepAnimationGroup::headDown, // 0x17 + RCT12PeepAnimationGroup::nauseous, // 0x18 + RCT12PeepAnimationGroup::veryNauseous, // 0x19 + RCT12PeepAnimationGroup::requireToilet, // 0x1A + RCT12PeepAnimationGroup::hat, // 0x1B + RCT12PeepAnimationGroup::hotDog, // 0x1C + RCT12PeepAnimationGroup::tentacle, // 0x1D + RCT12PeepAnimationGroup::toffeeApple, // 0x1E + RCT12PeepAnimationGroup::doughnut, // 0x1F + RCT12PeepAnimationGroup::coffee, // 0x20 + RCT12PeepAnimationGroup::chicken, // 0x21 + RCT12PeepAnimationGroup::lemonade, // 0x22 }; if (EnumValue(rct1AnimationGroup) >= std::size(map)) { LOG_WARNING("Unsupported RCT1 peep sprite type: %d.", EnumValue(rct1AnimationGroup)); - return RCT12PeepAnimationGroup::Normal; + return RCT12PeepAnimationGroup::normal; } return map[EnumValue(rct1AnimationGroup)]; } @@ -164,9 +164,9 @@ namespace OpenRCT2::RCT1 uint8_t GetRideType(RideType rideType, VehicleType vehicleType) { - if (rideType == RideType::SteelTwisterRollerCoaster && vehicleType == VehicleType::NonLoopingSteelTwisterRollerCoasterTrain) + if (rideType == RideType::steelTwisterRollerCoaster && vehicleType == VehicleType::nonLoopingSteelTwisterRollerCoasterTrain) return RIDE_TYPE_HYPER_TWISTER; - if (rideType == RideType::SteelCorkscrewRollerCoaster && vehicleType == VehicleType::HypercoasterTrain) + if (rideType == RideType::steelCorkscrewRollerCoaster && vehicleType == VehicleType::hypercoasterTrain) return RIDE_TYPE_HYPERCOASTER; static uint8_t map[] = @@ -366,30 +366,30 @@ namespace OpenRCT2::RCT1 bool RideTypeUsesVehicles(RideType rideType) { switch (rideType) { - case RideType::HedgeMaze: - case RideType::SpiralSlide: - case RideType::IceCreamStall: - case RideType::ChipsStall: - case RideType::DrinkStall: - case RideType::CandyflossStall: - case RideType::BurgerBar: - case RideType::BalloonStall: - case RideType::InformationKiosk: - case RideType::Toilets: - case RideType::SouvenirStall: - case RideType::PizzaStall: - case RideType::PopcornStall: - case RideType::HotDogStall: - case RideType::ExoticSeaFoodStall: - case RideType::HatStall: - case RideType::ToffeeAppleStall: + case RideType::hedgeMaze: + case RideType::spiralSlide: + case RideType::iceCreamStall: + case RideType::chipsStall: + case RideType::drinkStall: + case RideType::candyflossStall: + case RideType::burgerBar: + case RideType::balloonStall: + case RideType::informationKiosk: + case RideType::toilets: + case RideType::souvenirStall: + case RideType::pizzaStall: + case RideType::popcornStall: + case RideType::hotDogStall: + case RideType::exoticSeaFoodStall: + case RideType::hatStall: + case RideType::toffeeAppleStall: case RideType::_40: case RideType::_44: - case RideType::TShirtStall: - case RideType::DoughnutShop: - case RideType::CoffeeShop: - case RideType::FriedChickenStall: - case RideType::LemonadeStall: + case RideType::tShirtStall: + case RideType::doughnutShop: + case RideType::coffeeShop: + case RideType::friedChickenStall: + case RideType::lemonadeStall: return false; default: return true; @@ -683,11 +683,11 @@ namespace OpenRCT2::RCT1 0, }; - if (rct1VehicleType == VehicleType::HeartlineTwisterCars) + if (rct1VehicleType == VehicleType::heartlineTwisterCars) { return vehicleSubEntry == HEARTLINE_TWISTER_FORWARDS ? 0 : 1; } - if (rct1VehicleType == VehicleType::HeartlineTwisterCarsReversed) + if (rct1VehicleType == VehicleType::heartlineTwisterCarsReversed) { return vehicleSubEntry == HEARTLINE_TWISTER_BACKWARDS ? 0 : 1; } @@ -697,7 +697,7 @@ namespace OpenRCT2::RCT1 std::string_view GetRideTypeObject(RideType rideType, bool isLL) { - if (rideType == RideType::InvertedRollerCoaster && !isLL) { + if (rideType == RideType::invertedRollerCoaster && !isLL) { return "rct1.ride.inverted_trains"; } @@ -800,95 +800,95 @@ namespace OpenRCT2::RCT1 { static constexpr const char * map[] = { - "rct1.ride.steel_rc_trains", // VehicleType::SteelRollerCoasterTrain - "rct1.ride.steel_rc_trains", // VehicleType::SteelRollerCoasterTrainBackwards - "rct1.ride.wooden_rc_trains", // VehicleType::WoodenRollerCoasterTrain - "rct1.ride.inverted_trains", // VehicleType::InvertedCoasterTrain//NotinRCT2 - "rct1.ride.suspended_swinging_cars", // VehicleType::SuspendedSwingingCars - "rct1.ride.ladybird_trains", // VehicleType::LadybirdCars - "rct1.ride.stand_up_trains", // VehicleType::StandupRollerCoasterCars - "rct2.ride.wmspin", // VehicleType::SpinningCars - "rct1.ride.single_person_swinging_cars", // VehicleType::SinglePersonSwingingChairs - "rct2.ride.swans", // VehicleType::SwansPedalBoats - "rct1.ride.streamlined_monorail_trains", // VehicleType::LargeMonorailTrain - "rct2.ride.cboat", // VehicleType::Canoes - "rct2.ride.rboat", // VehicleType::RowingBoats - "rct1.ride.steam_trains", // VehicleType::SteamTrain - "rct1.ride.mouse_cars", // VehicleType::WoodenMouseCars - "rct1.ride.bumper_boats", // VehicleType::BumperBoats - "rct1.ride.wooden_rc_trains", // VehicleType::WoodenRollerCoasterTrainBackwards - "rct1.ride.rocket_cars", // VehicleType::RocketCars - "rct1.ride.horses", // VehicleType::Horses//Steeplechase - "rct1.ride.sports_cars", // VehicleType::Sportscars - "rct1.ride.swinging_lay_down_cars", // VehicleType::LyingDownSwingingCars//Invertedsingle-rail - "rct1.ride.mine_cars", // VehicleType::WoodenMineCars - "rct1.ride.suspended_swinging_aeroplane_cars", // VehicleType::SuspendedSwingingAirplaneCars - "rct1.ride.small_monorail_cars", // VehicleType::SmallMonorailCars - "rct2.ride.trike", // VehicleType::WaterTricycles - "rct2.ride.ssc1", // VehicleType::LaunchedFreefallCar - "rct1.ride.bobsleigh_trains", // VehicleType::BobsleighCars - "rct1.ride.dinghies", // VehicleType::Dinghies - "rct2.ride.obs1", // VehicleType::RotatingCabin - "rct1.ride.mine_trains", // VehicleType::MineTrain - "rct1.ride.chairlift_cars", // VehicleType::ChairliftCars - "rct1.ride.corkscrew_trains", // VehicleType::CorkscrewRollerCoasterTrain - "rct1.ride.motorbikes", // VehicleType::Motorbikes - "rct1.ride.racing_cars", // VehicleType::RacingCars - "rct1.ride.pickup_trucks", // VehicleType::Trucks - "rct1.ride.go_karts", // VehicleType::GoKarts - "rct1.ride.river_rapids_boats", // VehicleType::RapidsBoats - "rct1.ride.logs", // VehicleType::LogFlumeBoats - "rct1.ride.dodgems", // VehicleType::Dodgems - "rct2.ride.swsh1", // VehicleType::SwingingShip - "rct2.ride.swsh2", // VehicleType::SwingingInverterShip - "rct2.ride.mgr1", // VehicleType::MerryGoRound - "rct2.ride.fwh1", // VehicleType::FerrisWheel - "rct2.ride.simpod", // VehicleType::SimulatorPod - "rct2.ride.c3d", // VehicleType::CinemaBuilding - "rct2.ride.topsp1", // VehicleType::TopspinCar - "rct2.ride.srings", // VehicleType::SpaceRings - "rct1.ride.reverse_freefall_car", // VehicleType::ReverseFreefallRollerCoasterCar - "rct1.ride.vertical_drop_trains", // VehicleType::VerticalRollerCoasterCars - "rct1.ride.cat_cars", // VehicleType::CatCars - "rct2.ride.twist1", // VehicleType::TwistArmsAndCars - "rct2.ride.hhbuild", // VehicleType::HauntedHouseBuilding - "rct1.ride.log_trains", // VehicleType::LogCars - "rct2.ride.circus1", // VehicleType::CircusTent - "rct1aa.ride.ghost_train_cars", // VehicleType::GhostTrainCars - "rct1aa.ride.twister_trains", // VehicleType::SteelTwisterRollerCoasterTrain - "rct1aa.ride.wooden_articulated_trains", // VehicleType::WoodenTwisterRollerCoasterTrain - "rct1aa.ride.side_friction_cars", // VehicleType::WoodenSideFrictionCars - "rct1aa.ride.vintage_cars", // VehicleType::VintageCars - "rct1aa.ride.steam_trains_covered", // VehicleType::SteamTrainCoveredCars - "rct1aa.ride.stand_up_twister_trains", // VehicleType::StandUpSteelTwisterRollerCoasterTrain - "rct1aa.ride.floorless_twister_trains", // VehicleType::FloorlessSteelTwisterRollerCoasterTrain - "rct1aa.ride.steel_wild_mouse_cars", // VehicleType::SteelMouseCars - "rct1aa.ride.ski_lift_cars", // VehicleType::ChairliftCarsAlternative - "rct1aa.ride.suspended_monorail_trains", // VehicleType::SuspendedMonorailTrain - "rct1aa.ride.mini_helicopters", // VehicleType::HelicopterCars - "rct1aa.ride.virginia_reel_tubs", // VehicleType::VirginiaReelTubs - "rct1aa.ride.reverser_cars", // VehicleType::ReverserCars - "rct2.ride.golf1", // VehicleType::Golfers - "rct1aa.ride.splash_boats", // VehicleType::RiverRideBoats - "rct1aa.ride.lay_down_trains", // VehicleType::FlyingRollerCoasterTrain - "rct1aa.ride.hyper_twister_trains", // VehicleType::NonLoopingSteelTwisterRollerCoasterTrain - "rct1aa.ride.heartline_twister_cars", // VehicleType::HeartlineTwisterCars - "rct1aa.ride.heartline_twister_cars", // VehicleType::HeartlineTwisterCarsReversed - "", // VehicleType::Reserved - "rct2.ride.gdrop1", // VehicleType::RotodropCar - "rct1aa.ride.flying_saucers", // VehicleType::FlyingSaucers - "rct2.ride.chbuild", // VehicleType::CrookedHouseBuilding - "rct1aa.ride.bicycles", // VehicleType::Bicycles - "rct1ll.ride.hypercoaster_trains", // VehicleType::HypercoasterTrain + "rct1.ride.steel_rc_trains", // VehicleType::steelRollerCoasterTrain + "rct1.ride.steel_rc_trains", // VehicleType::steelRollerCoasterTrainBackwards + "rct1.ride.wooden_rc_trains", // VehicleType::woodenRollerCoasterTrain + "rct1.ride.inverted_trains", // VehicleType::invertedCoasterTrain//NotinRCT2 + "rct1.ride.suspended_swinging_cars", // VehicleType::suspendedSwingingCars + "rct1.ride.ladybird_trains", // VehicleType::ladybirdCars + "rct1.ride.stand_up_trains", // VehicleType::standupRollerCoasterCars + "rct2.ride.wmspin", // VehicleType::spinningCars + "rct1.ride.single_person_swinging_cars", // VehicleType::singlePersonSwingingChairs + "rct2.ride.swans", // VehicleType::swansPedalBoats + "rct1.ride.streamlined_monorail_trains", // VehicleType::largeMonorailTrain + "rct2.ride.cboat", // VehicleType::canoes + "rct2.ride.rboat", // VehicleType::rowingBoats + "rct1.ride.steam_trains", // VehicleType::steamTrain + "rct1.ride.mouse_cars", // VehicleType::woodenMouseCars + "rct1.ride.bumper_boats", // VehicleType::bumperBoats + "rct1.ride.wooden_rc_trains", // VehicleType::woodenRollerCoasterTrainBackwards + "rct1.ride.rocket_cars", // VehicleType::rocketCars + "rct1.ride.horses", // VehicleType::horses//Steeplechase + "rct1.ride.sports_cars", // VehicleType::sportscars + "rct1.ride.swinging_lay_down_cars", // VehicleType::lyingDownSwingingCars//Invertedsingle-rail + "rct1.ride.mine_cars", // VehicleType::woodenMineCars + "rct1.ride.suspended_swinging_aeroplane_cars", // VehicleType::suspendedSwingingAirplaneCars + "rct1.ride.small_monorail_cars", // VehicleType::smallMonorailCars + "rct2.ride.trike", // VehicleType::waterTricycles + "rct2.ride.ssc1", // VehicleType::launchedFreefallCar + "rct1.ride.bobsleigh_trains", // VehicleType::bobsleighCars + "rct1.ride.dinghies", // VehicleType::dinghies + "rct2.ride.obs1", // VehicleType::rotatingCabin + "rct1.ride.mine_trains", // VehicleType::mineTrain + "rct1.ride.chairlift_cars", // VehicleType::chairliftCars + "rct1.ride.corkscrew_trains", // VehicleType::corkscrewRollerCoasterTrain + "rct1.ride.motorbikes", // VehicleType::motorbikes + "rct1.ride.racing_cars", // VehicleType::racingCars + "rct1.ride.pickup_trucks", // VehicleType::trucks + "rct1.ride.go_karts", // VehicleType::goKarts + "rct1.ride.river_rapids_boats", // VehicleType::rapidsBoats + "rct1.ride.logs", // VehicleType::logFlumeBoats + "rct1.ride.dodgems", // VehicleType::dodgems + "rct2.ride.swsh1", // VehicleType::swingingShip + "rct2.ride.swsh2", // VehicleType::swingingInverterShip + "rct2.ride.mgr1", // VehicleType::merryGoRound + "rct2.ride.fwh1", // VehicleType::ferrisWheel + "rct2.ride.simpod", // VehicleType::simulatorPod + "rct2.ride.c3d", // VehicleType::cinemaBuilding + "rct2.ride.topsp1", // VehicleType::topspinCar + "rct2.ride.srings", // VehicleType::spaceRings + "rct1.ride.reverse_freefall_car", // VehicleType::reverseFreefallRollerCoasterCar + "rct1.ride.vertical_drop_trains", // VehicleType::verticalRollerCoasterCars + "rct1.ride.cat_cars", // VehicleType::catCars + "rct2.ride.twist1", // VehicleType::twistArmsAndCars + "rct2.ride.hhbuild", // VehicleType::hauntedHouseBuilding + "rct1.ride.log_trains", // VehicleType::logCars + "rct2.ride.circus1", // VehicleType::circusTent + "rct1aa.ride.ghost_train_cars", // VehicleType::ghostTrainCars + "rct1aa.ride.twister_trains", // VehicleType::steelTwisterRollerCoasterTrain + "rct1aa.ride.wooden_articulated_trains", // VehicleType::woodenTwisterRollerCoasterTrain + "rct1aa.ride.side_friction_cars", // VehicleType::woodenSideFrictionCars + "rct1aa.ride.vintage_cars", // VehicleType::vintageCars + "rct1aa.ride.steam_trains_covered", // VehicleType::steamTrainCoveredCars + "rct1aa.ride.stand_up_twister_trains", // VehicleType::standUpSteelTwisterRollerCoasterTrain + "rct1aa.ride.floorless_twister_trains", // VehicleType::floorlessSteelTwisterRollerCoasterTrain + "rct1aa.ride.steel_wild_mouse_cars", // VehicleType::steelMouseCars + "rct1aa.ride.ski_lift_cars", // VehicleType::chairliftCarsAlternative + "rct1aa.ride.suspended_monorail_trains", // VehicleType::suspendedMonorailTrain + "rct1aa.ride.mini_helicopters", // VehicleType::helicopterCars + "rct1aa.ride.virginia_reel_tubs", // VehicleType::virginiaReelTubs + "rct1aa.ride.reverser_cars", // VehicleType::reverserCars + "rct2.ride.golf1", // VehicleType::golfers + "rct1aa.ride.splash_boats", // VehicleType::riverRideBoats + "rct1aa.ride.lay_down_trains", // VehicleType::flyingRollerCoasterTrain + "rct1aa.ride.hyper_twister_trains", // VehicleType::nonLoopingSteelTwisterRollerCoasterTrain + "rct1aa.ride.heartline_twister_cars", // VehicleType::heartlineTwisterCars + "rct1aa.ride.heartline_twister_cars", // VehicleType::heartlineTwisterCarsReversed + "", // VehicleType::reserved + "rct2.ride.gdrop1", // VehicleType::rotodropCar + "rct1aa.ride.flying_saucers", // VehicleType::flyingSaucers + "rct2.ride.chbuild", // VehicleType::crookedHouseBuilding + "rct1aa.ride.bicycles", // VehicleType::bicycles + "rct1ll.ride.hypercoaster_trains", // VehicleType::hypercoasterTrain "rct1ll.ride.4_across_inverted_trains", // VehicleType::_4_Across_Inverted_Coaster_Train - "rct1ll.ride.coaster_boats", // VehicleType::WaterCoasterBoats - "rct1ll.ride.face_off_cars", // VehicleType::FaceoffCars - "rct1ll.ride.jet_skis", // VehicleType::JetSkis - "rct1ll.ride.rafts", // VehicleType::RaftBoats - "rct1ll.ride.steam_trains_american", // VehicleType::AmericanStyleSteamTrain - "rct1ll.ride.air_powered_trains", // VehicleType::AirPoweredCoasterTrain - "rct1ll.ride.inverted_hairpin_cars", // VehicleType::SuspendedWildMouseCars - "rct2.ride.enterp", // VehicleType::EnterpriseWheel + "rct1ll.ride.coaster_boats", // VehicleType::waterCoasterBoats + "rct1ll.ride.face_off_cars", // VehicleType::faceoffCars + "rct1ll.ride.jet_skis", // VehicleType::jetSkis + "rct1ll.ride.rafts", // VehicleType::raftBoats + "rct1ll.ride.steam_trains_american", // VehicleType::americanStyleSteamTrain + "rct1ll.ride.air_powered_trains", // VehicleType::airPoweredCoasterTrain + "rct1ll.ride.inverted_hairpin_cars", // VehicleType::suspendedWildMouseCars + "rct2.ride.enterp", // VehicleType::enterpriseWheel }; Guard::ArgumentInRange(EnumValue(vehicleType), 0, std::size(map) - 1, "Unsupported RCT1 vehicle type."); @@ -1325,15 +1325,15 @@ namespace OpenRCT2::RCT1 { static constexpr const char * map[] = { - "rct2.footpath_banner.bn1", // BannerType::Plain - "rct2.footpath_banner.bn2", // BannerType::Jungle - "rct2.footpath_banner.bn3", // BannerType::Roman - "rct2.footpath_banner.bn4", // BannerType::Egyptian - "rct2.footpath_banner.bn5", // BannerType::Mine - "rct2.footpath_banner.bn6", // BannerType::Jurassic - "rct2.footpath_banner.bn7", // BannerType::Oriental - "rct2.footpath_banner.bn8", // BannerType::Snow - "rct2.footpath_banner.bn9", // BannerType::Space + "rct2.footpath_banner.bn1", // BannerType::plain + "rct2.footpath_banner.bn2", // BannerType::jungle + "rct2.footpath_banner.bn3", // BannerType::roman + "rct2.footpath_banner.bn4", // BannerType::egyptian + "rct2.footpath_banner.bn5", // BannerType::mine + "rct2.footpath_banner.bn6", // BannerType::jurassic + "rct2.footpath_banner.bn7", // BannerType::oriental + "rct2.footpath_banner.bn8", // BannerType::snow + "rct2.footpath_banner.bn9", // BannerType::space }; return map[EnumValue(bannerType)]; } @@ -1508,9 +1508,9 @@ namespace OpenRCT2::RCT1 { switch (vehicleType) { - case VehicleType::SteelRollerCoasterTrainBackwards: - case VehicleType::WoodenRollerCoasterTrainBackwards: - case VehicleType::HeartlineTwisterCarsReversed: + case VehicleType::steelRollerCoasterTrainBackwards: + case VehicleType::woodenRollerCoasterTrainBackwards: + case VehicleType::heartlineTwisterCarsReversed: return true; default: return false; diff --git a/src/openrct2/rct12/CSStringConverter.cpp b/src/openrct2/rct12/CSStringConverter.cpp index 6d4a96d390..39b0644d1d 100644 --- a/src/openrct2/rct12/CSStringConverter.cpp +++ b/src/openrct2/rct12/CSStringConverter.cpp @@ -204,13 +204,13 @@ namespace OpenRCT2 { switch (languageId) { - case RCT2LanguageId::Japanese: + case RCT2LanguageId::japanese: return CodePage::CP_932; - case RCT2LanguageId::ChineseSimplified: + case RCT2LanguageId::chineseSimplified: return CodePage::CP_936; - case RCT2LanguageId::Korean: + case RCT2LanguageId::korean: return CodePage::CP_949; - case RCT2LanguageId::ChineseTraditional: + case RCT2LanguageId::chineseTraditional: return CodePage::CP_950; default: return CodePage::CP_1252; diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 1cc8be764c..c69be1e1bd 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -35,21 +35,21 @@ RCT12TileElementType RCT12TileElementBase::GetType() const auto elem_type = static_cast((this->Type & kTileElementTypeMask) >> 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: + 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; + return RCT12TileElementType::eightCarsCorrupt15; } } @@ -223,7 +223,7 @@ RideColourScheme RCT12TrackElement::GetColourScheme() const uint8_t RCT12TrackElement::GetStationIndex() const { - if (TrackTypeIsStation(TrackType) || TrackType == OpenRCT2::RCT12::TrackElemType::TowerBase) + if (TrackTypeIsStation(TrackType) || TrackType == OpenRCT2::RCT12::TrackElemType::towerBase) { return (Sequence & RCT12_TRACK_ELEMENT_SEQUENCE_STATION_INDEX_MASK) >> 4; } @@ -275,7 +275,7 @@ uint16_t RCT12TrackElement::GetMazeEntry() const uint8_t RCT12TrackElement::GetPhotoTimeout() const { - if (TrackType == OpenRCT2::RCT12::TrackElemType::OnRidePhoto) + if (TrackType == OpenRCT2::RCT12::TrackElemType::onRidePhoto) { return Sequence >> 4; } @@ -599,39 +599,39 @@ static FormatToken GetFormatTokenFromRCT12Code(codepoint_t codepoint) switch (codepoint) { case RCT12FormatCode::Newline: - return FormatToken::Newline; + return FormatToken::newline; case RCT12FormatCode::NewlineSmall: - return FormatToken::NewlineSmall; + return FormatToken::newlineSmall; case RCT12FormatCode::ColourBlack: - return FormatToken::ColourBlack; + return FormatToken::colourBlack; case RCT12FormatCode::ColourGrey: - return FormatToken::ColourGrey; + return FormatToken::colourGrey; case RCT12FormatCode::ColourWhite: - return FormatToken::ColourWhite; + return FormatToken::colourWhite; case RCT12FormatCode::ColourRed: - return FormatToken::ColourRed; + return FormatToken::colourRed; case RCT12FormatCode::ColourGreen: - return FormatToken::ColourGreen; + return FormatToken::colourGreen; case RCT12FormatCode::ColourYellow: - return FormatToken::ColourYellow; + return FormatToken::colourYellow; case RCT12FormatCode::ColourTopaz: - return FormatToken::ColourTopaz; + return FormatToken::colourTopaz; case RCT12FormatCode::ColourCeladon: - return FormatToken::ColourCeladon; + return FormatToken::colourCeladon; case RCT12FormatCode::ColourBabyBlue: - return FormatToken::ColourBabyBlue; + return FormatToken::colourBabyBlue; case RCT12FormatCode::ColourPaleLavender: - return FormatToken::ColourPaleLavender; + return FormatToken::colourPaleLavender; case RCT12FormatCode::ColourPaleGold: - return FormatToken::ColourPaleGold; + return FormatToken::colourPaleGold; case RCT12FormatCode::ColourLightPink: - return FormatToken::ColourLightPink; + return FormatToken::colourLightPink; case RCT12FormatCode::ColourPearlAqua: - return FormatToken::ColourPearlAqua; + return FormatToken::colourPearlAqua; case RCT12FormatCode::ColourPaleSilver: - return FormatToken::ColourPaleSilver; + return FormatToken::colourPaleSilver; default: - return FormatToken::Unknown; + return FormatToken::unknown; } } @@ -642,14 +642,14 @@ std::string ConvertFormattedStringToOpenRCT2(std::string_view buffer) { buffer = buffer.substr(0, nullTerminator); } - auto asUtf8 = RCT2StringToUTF8(buffer, RCT2LanguageId::EnglishUK); + auto asUtf8 = RCT2StringToUTF8(buffer, RCT2LanguageId::englishUK); std::string result; CodepointView codepoints(asUtf8); for (auto codepoint : codepoints) { auto token = GetFormatTokenFromRCT12Code(codepoint); - if (token != FormatToken::Unknown) + if (token != FormatToken::unknown) { result += FormatTokenToStringWithBraces(token); } @@ -665,25 +665,25 @@ OpenRCT2::TrackElemType RCT12FlatTrackTypeToOpenRCT2(OpenRCT2::RCT12::TrackElemT { switch (origTrackType) { - case OpenRCT2::RCT12::TrackElemType::FlatTrack1x4A_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack1x4A_Alias: return TrackElemType::FlatTrack1x4A; - case OpenRCT2::RCT12::TrackElemType::FlatTrack2x2_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack2x2_Alias: return TrackElemType::FlatTrack2x2; - case OpenRCT2::RCT12::TrackElemType::FlatTrack4x4_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack4x4_Alias: return TrackElemType::FlatTrack4x4; - case OpenRCT2::RCT12::TrackElemType::FlatTrack2x4_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack2x4_Alias: return TrackElemType::FlatTrack2x4; - case OpenRCT2::RCT12::TrackElemType::FlatTrack1x5_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack1x5_Alias: return TrackElemType::FlatTrack1x5; - case OpenRCT2::RCT12::TrackElemType::FlatTrack1x1A_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack1x1A_Alias: return TrackElemType::FlatTrack1x1A; - case OpenRCT2::RCT12::TrackElemType::FlatTrack1x4B_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack1x4B_Alias: return TrackElemType::FlatTrack1x4B; - case OpenRCT2::RCT12::TrackElemType::FlatTrack1x1B_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack1x1B_Alias: return TrackElemType::FlatTrack1x1B; - case OpenRCT2::RCT12::TrackElemType::FlatTrack1x4C_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack1x4C_Alias: return TrackElemType::FlatTrack1x4C; - case OpenRCT2::RCT12::TrackElemType::FlatTrack3x3_Alias: + case OpenRCT2::RCT12::TrackElemType::flatTrack3x3_Alias: return TrackElemType::FlatTrack3x3; default: return static_cast(origTrackType); @@ -695,25 +695,25 @@ OpenRCT2::RCT12::TrackElemType OpenRCT2FlatTrackTypeToRCT12(OpenRCT2::TrackElemT switch (origTrackType) { case TrackElemType::FlatTrack1x4A: - return OpenRCT2::RCT12::TrackElemType::FlatTrack1x4A_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack1x4A_Alias; case TrackElemType::FlatTrack2x2: - return OpenRCT2::RCT12::TrackElemType::FlatTrack2x2_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack2x2_Alias; case TrackElemType::FlatTrack4x4: - return OpenRCT2::RCT12::TrackElemType::FlatTrack4x4_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack4x4_Alias; case TrackElemType::FlatTrack2x4: - return OpenRCT2::RCT12::TrackElemType::FlatTrack2x4_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack2x4_Alias; case TrackElemType::FlatTrack1x5: - return OpenRCT2::RCT12::TrackElemType::FlatTrack1x5_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack1x5_Alias; case TrackElemType::FlatTrack1x1A: - return OpenRCT2::RCT12::TrackElemType::FlatTrack1x1A_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack1x1A_Alias; case TrackElemType::FlatTrack1x4B: - return OpenRCT2::RCT12::TrackElemType::FlatTrack1x4B_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack1x4B_Alias; case TrackElemType::FlatTrack1x1B: - return OpenRCT2::RCT12::TrackElemType::FlatTrack1x1B_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack1x1B_Alias; case TrackElemType::FlatTrack1x4C: - return OpenRCT2::RCT12::TrackElemType::FlatTrack1x4C_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack1x4C_Alias; case TrackElemType::FlatTrack3x3: - return OpenRCT2::RCT12::TrackElemType::FlatTrack3x3_Alias; + return OpenRCT2::RCT12::TrackElemType::flatTrack3x3_Alias; default: return static_cast(origTrackType); } @@ -846,7 +846,7 @@ ResearchItem RCT12ResearchItem::ToResearchItem() const { newResearchItem.rawValue = 0; newResearchItem.flags = 0; - newResearchItem.category = ResearchCategory::Transport; + newResearchItem.category = ResearchCategory::transport; newResearchItem.SetNull(); } else @@ -855,7 +855,7 @@ ResearchItem RCT12ResearchItem::ToResearchItem() const newResearchItem.entryIndex = RCTEntryIndexToOpenRCT2EntryIndex(EntryIndex); newResearchItem.flags = Flags; newResearchItem.category = static_cast(Category); - if (newResearchItem.type == Research::EntryType::Ride) + if (newResearchItem.type == Research::EntryType::ride) { auto* rideEntry = GetRideEntryByIndex(newResearchItem.entryIndex); newResearchItem.baseRideType = rideEntry != nullptr ? RCT2::RCT2RideTypeToOpenRCT2RideType(BaseRideType, *rideEntry) @@ -903,16 +903,16 @@ namespace OpenRCT2::RCT12 bool TrackTypeHasSpeedSetting(TrackElemType trackType) { - return trackType == TrackElemType::Booster || trackType == TrackElemType::Brakes; + return trackType == TrackElemType::booster || trackType == TrackElemType::brakes; } bool TrackTypeIsStation(TrackElemType trackType) { switch (trackType) { - case TrackElemType::EndStation: - case TrackElemType::BeginStation: - case TrackElemType::MiddleStation: + case TrackElemType::endStation: + case TrackElemType::beginStation: + case TrackElemType::middleStation: return true; default: return false; diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 270367ab91..be5cd889ab 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -49,276 +49,276 @@ namespace OpenRCT2::RCT12 enum class TrackElemType : uint8_t { - Flat = 0, - EndStation = 1, - BeginStation = 2, - MiddleStation = 3, - Up25 = 4, - Up60 = 5, - FlatToUp25 = 6, - Up25ToUp60 = 7, - Up60ToUp25 = 8, - Up25ToFlat = 9, - Down25 = 10, - Down60 = 11, - FlatToDown25 = 12, - Down25ToDown60 = 13, - Down60ToDown25 = 14, - Down25ToFlat = 15, - LeftQuarterTurn5Tiles = 16, - RightQuarterTurn5Tiles = 17, - FlatToLeftBank = 18, - FlatToRightBank = 19, - LeftBankToFlat = 20, - RightBankToFlat = 21, - BankedLeftQuarterTurn5Tiles = 22, - BankedRightQuarterTurn5Tiles = 23, - LeftBankToUp25 = 24, - RightBankToUp25 = 25, - Up25ToLeftBank = 26, - Up25ToRightBank = 27, - LeftBankToDown25 = 28, - RightBankToDown25 = 29, - Down25ToLeftBank = 30, - Down25ToRightBank = 31, - LeftBank = 32, - RightBank = 33, - LeftQuarterTurn5TilesUp25 = 34, - RightQuarterTurn5TilesUp25 = 35, - LeftQuarterTurn5TilesDown25 = 36, - RightQuarterTurn5TilesDown25 = 37, - SBendLeft = 38, - SBendRight = 39, - LeftVerticalLoop = 40, - RightVerticalLoop = 41, - LeftQuarterTurn3Tiles = 42, - RightQuarterTurn3Tiles = 43, - LeftBankedQuarterTurn3Tiles = 44, - RightBankedQuarterTurn3Tiles = 45, - LeftQuarterTurn3TilesUp25 = 46, - RightQuarterTurn3TilesUp25 = 47, - LeftQuarterTurn3TilesDown25 = 48, - RightQuarterTurn3TilesDown25 = 49, - LeftQuarterTurn1Tile = 50, - RightQuarterTurn1Tile = 51, - LeftTwistDownToUp = 52, - RightTwistDownToUp = 53, - LeftTwistUpToDown = 54, - RightTwistUpToDown = 55, - HalfLoopUp = 56, - HalfLoopDown = 57, - LeftCorkscrewUp = 58, - RightCorkscrewUp = 59, - LeftCorkscrewDown = 60, - RightCorkscrewDown = 61, - FlatToUp60 = 62, - Up60ToFlat = 63, - FlatToDown60 = 64, - Down60ToFlat = 65, - TowerBase = 66, - TowerSection = 67, - FlatCovered = 68, - Up25Covered = 69, - Up60Covered = 70, - FlatToUp25Covered = 71, - Up25ToUp60Covered = 72, - Up60ToUp25Covered = 73, - Up25ToFlatCovered = 74, - Down25Covered = 75, - Down60Covered = 76, - FlatToDown25Covered = 77, - Down25ToDown60Covered = 78, - Down60ToDown25Covered = 79, - Down25ToFlatCovered = 80, - LeftQuarterTurn5TilesCovered = 81, - RightQuarterTurn5TilesCovered = 82, - SBendLeftCovered = 83, - SBendRightCovered = 84, - LeftQuarterTurn3TilesCovered = 85, - RightQuarterTurn3TilesCovered = 86, - LeftHalfBankedHelixUpSmall = 87, - RightHalfBankedHelixUpSmall = 88, - LeftHalfBankedHelixDownSmall = 89, - RightHalfBankedHelixDownSmall = 90, - LeftHalfBankedHelixUpLarge = 91, - RightHalfBankedHelixUpLarge = 92, - LeftHalfBankedHelixDownLarge = 93, - RightHalfBankedHelixDownLarge = 94, - LeftQuarterTurn1TileUp60 = 95, - RightQuarterTurn1TileUp60 = 96, - LeftQuarterTurn1TileDown60 = 97, - RightQuarterTurn1TileDown60 = 98, - Brakes = 99, - Booster = 100, - Maze = 101, - LeftQuarterBankedHelixLargeUp = 102, - RightQuarterBankedHelixLargeUp = 103, - LeftQuarterBankedHelixLargeDown = 104, - RightQuarterBankedHelixLargeDown = 105, - LeftQuarterHelixLargeUp = 106, - RightQuarterHelixLargeUp = 107, - LeftQuarterHelixLargeDown = 108, - RightQuarterHelixLargeDown = 109, - Up25LeftBanked = 110, - Up25RightBanked = 111, - Waterfall = 112, - Rapids = 113, - OnRidePhoto = 114, - Down25LeftBanked = 115, - Down25RightBanked = 116, - Watersplash = 117, - FlatToUp60LongBase = 118, - Up60ToFlatLongBase = 119, - Whirlpool = 120, - Down60ToFlatLongBase = 121, - FlatToDown60LongBase = 122, - CableLiftHill = 123, - ReverseFreefallSlope = 124, - ReverseFreefallVertical = 125, - Up90 = 126, - Down90 = 127, - Up60ToUp90 = 128, - Down90ToDown60 = 129, - Up90ToUp60 = 130, - Down60ToDown90 = 131, - BrakeForDrop = 132, - LeftEighthToDiag = 133, - RightEighthToDiag = 134, - LeftEighthToOrthogonal = 135, - RightEighthToOrthogonal = 136, - LeftEighthBankToDiag = 137, - RightEighthBankToDiag = 138, - LeftEighthBankToOrthogonal = 139, - RightEighthBankToOrthogonal = 140, - DiagFlat = 141, - DiagUp25 = 142, - DiagUp60 = 143, - DiagFlatToUp25 = 144, - DiagUp25ToUp60 = 145, - DiagUp60ToUp25 = 146, - DiagUp25ToFlat = 147, - DiagDown25 = 148, - DiagDown60 = 149, - DiagFlatToDown25 = 150, - DiagDown25ToDown60 = 151, - DiagDown60ToDown25 = 152, - DiagDown25ToFlat = 153, - DiagFlatToUp60 = 154, - DiagUp60ToFlat = 155, - DiagFlatToDown60 = 156, - DiagDown60ToFlat = 157, - DiagFlatToLeftBank = 158, - DiagFlatToRightBank = 159, - DiagLeftBankToFlat = 160, - DiagRightBankToFlat = 161, - DiagLeftBankToUp25 = 162, - DiagRightBankToUp25 = 163, - DiagUp25ToLeftBank = 164, - DiagUp25ToRightBank = 165, - DiagLeftBankToDown25 = 166, - DiagRightBankToDown25 = 167, - DiagDown25ToLeftBank = 168, - DiagDown25ToRightBank = 169, - DiagLeftBank = 170, - DiagRightBank = 171, - LogFlumeReverser = 172, - SpinningTunnel = 173, - LeftBarrelRollUpToDown = 174, - RightBarrelRollUpToDown = 175, - LeftBarrelRollDownToUp = 176, - RightBarrelRollDownToUp = 177, - LeftBankToLeftQuarterTurn3TilesUp25 = 178, - RightBankToRightQuarterTurn3TilesUp25 = 179, - LeftQuarterTurn3TilesDown25ToLeftBank = 180, - RightQuarterTurn3TilesDown25ToRightBank = 181, - PoweredLift = 182, - LeftLargeHalfLoopUp = 183, - RightLargeHalfLoopUp = 184, - LeftLargeHalfLoopDown = 185, - RightLargeHalfLoopDown = 186, - LeftFlyerTwistUp = 187, - RightFlyerTwistUp = 188, - LeftFlyerTwistDown = 189, - RightFlyerTwistDown = 190, - FlyerHalfLoopUninvertedUp = 191, - FlyerHalfLoopInvertedDown = 192, - LeftFlyerCorkscrewUp = 193, - RightFlyerCorkscrewUp = 194, - LeftFlyerCorkscrewDown = 195, - RightFlyerCorkscrewDown = 196, - HeartLineTransferUp = 197, - HeartLineTransferDown = 198, - LeftHeartLineRoll = 199, - RightHeartLineRoll = 200, - MinigolfHoleA = 201, - MinigolfHoleB = 202, - MinigolfHoleC = 203, - MinigolfHoleD = 204, - MinigolfHoleE = 205, - MultiDimInvertedFlatToDown90QuarterLoop = 206, - Up90ToInvertedFlatQuarterLoop = 207, - InvertedFlatToDown90QuarterLoop = 208, - LeftCurvedLiftHill = 209, - RightCurvedLiftHill = 210, - LeftReverser = 211, - RightReverser = 212, - AirThrustTopCap = 213, - AirThrustVerticalDown = 214, - AirThrustVerticalDownToLevel = 215, - BlockBrakes = 216, - LeftBankedQuarterTurn3TileUp25 = 217, - RightBankedQuarterTurn3TileUp25 = 218, - LeftBankedQuarterTurn3TileDown25 = 219, - RightBankedQuarterTurn3TileDown25 = 220, - LeftBankedQuarterTurn5TileUp25 = 221, - RightBankedQuarterTurn5TileUp25 = 222, - LeftBankedQuarterTurn5TileDown25 = 223, - RightBankedQuarterTurn5TileDown25 = 224, - Up25ToLeftBankedUp25 = 225, - Up25ToRightBankedUp25 = 226, - LeftBankedUp25ToUp25 = 227, - RightBankedUp25ToUp25 = 228, - Down25ToLeftBankedDown25 = 229, - Down25ToRightBankedDown25 = 230, - LeftBankedDown25ToDown25 = 231, - RightBankedDown25ToDown25 = 232, - LeftBankedFlatToLeftBankedUp25 = 233, - RightBankedFlatToRightBankedUp25 = 234, - LeftBankedUp25ToLeftBankedFlat = 235, - RightBankedUp25ToRightBankedFlat = 236, - LeftBankedFlatToLeftBankedDown25 = 237, - RightBankedFlatToRightBankedDown25 = 238, - LeftBankedDown25ToLeftBankedFlat = 239, - RightBankedDown25ToRightBankedFlat = 240, - FlatToLeftBankedUp25 = 241, - FlatToRightBankedUp25 = 242, - LeftBankedUp25ToFlat = 243, - RightBankedUp25ToFlat = 244, - FlatToLeftBankedDown25 = 245, - FlatToRightBankedDown25 = 246, - LeftBankedDown25ToFlat = 247, - RightBankedDown25ToFlat = 248, - LeftQuarterTurn1TileUp90 = 249, - RightQuarterTurn1TileUp90 = 250, - LeftQuarterTurn1TileDown90 = 251, - RightQuarterTurn1TileDown90 = 252, - MultiDimUp90ToInvertedFlatQuarterLoop = 253, - MultiDimFlatToDown90QuarterLoop = 254, - MultiDimInvertedUp90ToFlatQuarterLoop = 255, + flat = 0, + endStation = 1, + beginStation = 2, + middleStation = 3, + up25 = 4, + up60 = 5, + flatToUp25 = 6, + up25ToUp60 = 7, + up60ToUp25 = 8, + up25ToFlat = 9, + down25 = 10, + down60 = 11, + flatToDown25 = 12, + down25ToDown60 = 13, + down60ToDown25 = 14, + down25ToFlat = 15, + leftQuarterTurn5Tiles = 16, + rightQuarterTurn5Tiles = 17, + flatToLeftBank = 18, + flatToRightBank = 19, + leftBankToFlat = 20, + rightBankToFlat = 21, + bankedLeftQuarterTurn5Tiles = 22, + bankedRightQuarterTurn5Tiles = 23, + leftBankToUp25 = 24, + rightBankToUp25 = 25, + up25ToLeftBank = 26, + up25ToRightBank = 27, + leftBankToDown25 = 28, + rightBankToDown25 = 29, + down25ToLeftBank = 30, + down25ToRightBank = 31, + leftBank = 32, + rightBank = 33, + leftQuarterTurn5TilesUp25 = 34, + rightQuarterTurn5TilesUp25 = 35, + leftQuarterTurn5TilesDown25 = 36, + rightQuarterTurn5TilesDown25 = 37, + sBendLeft = 38, + sBendRight = 39, + leftVerticalLoop = 40, + rightVerticalLoop = 41, + leftQuarterTurn3Tiles = 42, + rightQuarterTurn3Tiles = 43, + leftBankedQuarterTurn3Tiles = 44, + rightBankedQuarterTurn3Tiles = 45, + leftQuarterTurn3TilesUp25 = 46, + rightQuarterTurn3TilesUp25 = 47, + leftQuarterTurn3TilesDown25 = 48, + rightQuarterTurn3TilesDown25 = 49, + leftQuarterTurn1Tile = 50, + rightQuarterTurn1Tile = 51, + leftTwistDownToUp = 52, + rightTwistDownToUp = 53, + leftTwistUpToDown = 54, + rightTwistUpToDown = 55, + halfLoopUp = 56, + halfLoopDown = 57, + leftCorkscrewUp = 58, + rightCorkscrewUp = 59, + leftCorkscrewDown = 60, + rightCorkscrewDown = 61, + flatToUp60 = 62, + up60ToFlat = 63, + flatToDown60 = 64, + down60ToFlat = 65, + towerBase = 66, + towerSection = 67, + flatCovered = 68, + up25Covered = 69, + up60Covered = 70, + flatToUp25Covered = 71, + up25ToUp60Covered = 72, + up60ToUp25Covered = 73, + up25ToFlatCovered = 74, + down25Covered = 75, + down60Covered = 76, + flatToDown25Covered = 77, + down25ToDown60Covered = 78, + down60ToDown25Covered = 79, + down25ToFlatCovered = 80, + leftQuarterTurn5TilesCovered = 81, + rightQuarterTurn5TilesCovered = 82, + sBendLeftCovered = 83, + sBendRightCovered = 84, + leftQuarterTurn3TilesCovered = 85, + rightQuarterTurn3TilesCovered = 86, + leftHalfBankedHelixUpSmall = 87, + rightHalfBankedHelixUpSmall = 88, + leftHalfBankedHelixDownSmall = 89, + rightHalfBankedHelixDownSmall = 90, + leftHalfBankedHelixUpLarge = 91, + rightHalfBankedHelixUpLarge = 92, + leftHalfBankedHelixDownLarge = 93, + rightHalfBankedHelixDownLarge = 94, + leftQuarterTurn1TileUp60 = 95, + rightQuarterTurn1TileUp60 = 96, + leftQuarterTurn1TileDown60 = 97, + rightQuarterTurn1TileDown60 = 98, + brakes = 99, + booster = 100, + maze = 101, + leftQuarterBankedHelixLargeUp = 102, + rightQuarterBankedHelixLargeUp = 103, + leftQuarterBankedHelixLargeDown = 104, + rightQuarterBankedHelixLargeDown = 105, + leftQuarterHelixLargeUp = 106, + rightQuarterHelixLargeUp = 107, + leftQuarterHelixLargeDown = 108, + rightQuarterHelixLargeDown = 109, + up25LeftBanked = 110, + up25RightBanked = 111, + waterfall = 112, + rapids = 113, + onRidePhoto = 114, + down25LeftBanked = 115, + down25RightBanked = 116, + watersplash = 117, + flatToUp60LongBase = 118, + up60ToFlatLongBase = 119, + whirlpool = 120, + down60ToFlatLongBase = 121, + flatToDown60LongBase = 122, + cableLiftHill = 123, + reverseFreefallSlope = 124, + reverseFreefallVertical = 125, + up90 = 126, + down90 = 127, + up60ToUp90 = 128, + down90ToDown60 = 129, + up90ToUp60 = 130, + down60ToDown90 = 131, + brakeForDrop = 132, + leftEighthToDiag = 133, + rightEighthToDiag = 134, + leftEighthToOrthogonal = 135, + rightEighthToOrthogonal = 136, + leftEighthBankToDiag = 137, + rightEighthBankToDiag = 138, + leftEighthBankToOrthogonal = 139, + rightEighthBankToOrthogonal = 140, + diagFlat = 141, + diagUp25 = 142, + diagUp60 = 143, + diagFlatToUp25 = 144, + diagUp25ToUp60 = 145, + diagUp60ToUp25 = 146, + diagUp25ToFlat = 147, + diagDown25 = 148, + diagDown60 = 149, + diagFlatToDown25 = 150, + diagDown25ToDown60 = 151, + diagDown60ToDown25 = 152, + diagDown25ToFlat = 153, + diagFlatToUp60 = 154, + diagUp60ToFlat = 155, + diagFlatToDown60 = 156, + diagDown60ToFlat = 157, + diagFlatToLeftBank = 158, + diagFlatToRightBank = 159, + diagLeftBankToFlat = 160, + diagRightBankToFlat = 161, + diagLeftBankToUp25 = 162, + diagRightBankToUp25 = 163, + diagUp25ToLeftBank = 164, + diagUp25ToRightBank = 165, + diagLeftBankToDown25 = 166, + diagRightBankToDown25 = 167, + diagDown25ToLeftBank = 168, + diagDown25ToRightBank = 169, + diagLeftBank = 170, + diagRightBank = 171, + logFlumeReverser = 172, + spinningTunnel = 173, + leftBarrelRollUpToDown = 174, + rightBarrelRollUpToDown = 175, + leftBarrelRollDownToUp = 176, + rightBarrelRollDownToUp = 177, + leftBankToLeftQuarterTurn3TilesUp25 = 178, + rightBankToRightQuarterTurn3TilesUp25 = 179, + leftQuarterTurn3TilesDown25ToLeftBank = 180, + rightQuarterTurn3TilesDown25ToRightBank = 181, + poweredLift = 182, + leftLargeHalfLoopUp = 183, + rightLargeHalfLoopUp = 184, + leftLargeHalfLoopDown = 185, + rightLargeHalfLoopDown = 186, + leftFlyerTwistUp = 187, + rightFlyerTwistUp = 188, + leftFlyerTwistDown = 189, + rightFlyerTwistDown = 190, + flyerHalfLoopUninvertedUp = 191, + flyerHalfLoopInvertedDown = 192, + leftFlyerCorkscrewUp = 193, + rightFlyerCorkscrewUp = 194, + leftFlyerCorkscrewDown = 195, + rightFlyerCorkscrewDown = 196, + heartLineTransferUp = 197, + heartLineTransferDown = 198, + leftHeartLineRoll = 199, + rightHeartLineRoll = 200, + minigolfHoleA = 201, + minigolfHoleB = 202, + minigolfHoleC = 203, + minigolfHoleD = 204, + minigolfHoleE = 205, + multiDimInvertedFlatToDown90QuarterLoop = 206, + up90ToInvertedFlatQuarterLoop = 207, + invertedFlatToDown90QuarterLoop = 208, + leftCurvedLiftHill = 209, + rightCurvedLiftHill = 210, + leftReverser = 211, + rightReverser = 212, + airThrustTopCap = 213, + airThrustVerticalDown = 214, + airThrustVerticalDownToLevel = 215, + blockBrakes = 216, + leftBankedQuarterTurn3TileUp25 = 217, + rightBankedQuarterTurn3TileUp25 = 218, + leftBankedQuarterTurn3TileDown25 = 219, + rightBankedQuarterTurn3TileDown25 = 220, + leftBankedQuarterTurn5TileUp25 = 221, + rightBankedQuarterTurn5TileUp25 = 222, + leftBankedQuarterTurn5TileDown25 = 223, + rightBankedQuarterTurn5TileDown25 = 224, + up25ToLeftBankedUp25 = 225, + up25ToRightBankedUp25 = 226, + leftBankedUp25ToUp25 = 227, + rightBankedUp25ToUp25 = 228, + down25ToLeftBankedDown25 = 229, + down25ToRightBankedDown25 = 230, + leftBankedDown25ToDown25 = 231, + rightBankedDown25ToDown25 = 232, + leftBankedFlatToLeftBankedUp25 = 233, + rightBankedFlatToRightBankedUp25 = 234, + leftBankedUp25ToLeftBankedFlat = 235, + rightBankedUp25ToRightBankedFlat = 236, + leftBankedFlatToLeftBankedDown25 = 237, + rightBankedFlatToRightBankedDown25 = 238, + leftBankedDown25ToLeftBankedFlat = 239, + rightBankedDown25ToRightBankedFlat = 240, + flatToLeftBankedUp25 = 241, + flatToRightBankedUp25 = 242, + leftBankedUp25ToFlat = 243, + rightBankedUp25ToFlat = 244, + flatToLeftBankedDown25 = 245, + flatToRightBankedDown25 = 246, + leftBankedDown25ToFlat = 247, + rightBankedDown25ToFlat = 248, + leftQuarterTurn1TileUp90 = 249, + rightQuarterTurn1TileUp90 = 250, + leftQuarterTurn1TileDown90 = 251, + rightQuarterTurn1TileDown90 = 252, + multiDimUp90ToInvertedFlatQuarterLoop = 253, + multiDimFlatToDown90QuarterLoop = 254, + multiDimInvertedUp90ToFlatQuarterLoop = 255, // SV6/TD6 element aliases - RotationControlToggleAlias = 100, - InvertedUp90ToFlatQuarterLoopAlias = 101, - FlatTrack1x4A_Alias = 95, - FlatTrack2x2_Alias = 110, - FlatTrack4x4_Alias = 111, - FlatTrack2x4_Alias = 115, - FlatTrack1x5_Alias = 116, - FlatTrack1x1A_Alias = 118, - FlatTrack1x4B_Alias = 119, - FlatTrack1x1B_Alias = 121, - FlatTrack1x4C_Alias = 122, - FlatTrack3x3_Alias = 123, + rotationControlToggleAlias = 100, + invertedUp90ToFlatQuarterLoopAlias = 101, + flatTrack1x4A_Alias = 95, + flatTrack2x2_Alias = 110, + flatTrack4x4_Alias = 111, + flatTrack2x4_Alias = 115, + flatTrack1x5_Alias = 116, + flatTrack1x1A_Alias = 118, + flatTrack1x4B_Alias = 119, + flatTrack1x1B_Alias = 121, + flatTrack1x4C_Alias = 122, + flatTrack3x3_Alias = 123, }; } // namespace OpenRCT2::RCT12 @@ -548,31 +548,31 @@ static_assert(sizeof(RCT12PeepSpawn) == 6); enum class RCT12TileElementType : uint8_t { - Surface = 0, - Path = 1, - Track = 2, - SmallScenery = 3, - Entrance = 4, - Wall = 5, - LargeScenery = 6, - Banner = 7, - Corrupt = 8, - EightCarsCorrupt14 = 14, - EightCarsCorrupt15 = 15, + surface = 0, + path = 1, + track = 2, + smallScenery = 3, + entrance = 4, + wall = 5, + largeScenery = 6, + banner = 7, + corrupt = 8, + eightCarsCorrupt14 = 14, + eightCarsCorrupt15 = 15, }; constexpr OpenRCT2::TileElementType ToOpenRCT2TileElementType(RCT12TileElementType rct12type) { switch (rct12type) { - 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::surface: + case RCT12TileElementType::path: + case RCT12TileElementType::track: + case RCT12TileElementType::smallScenery: + case RCT12TileElementType::entrance: + case RCT12TileElementType::wall: + case RCT12TileElementType::largeScenery: + case RCT12TileElementType::banner: return static_cast(rct12type); default: @@ -628,67 +628,67 @@ struct RCT12TileElement : public RCT12TileElementBase const RCT12SurfaceElement* AsSurface() const { - return as(); + return as(); } RCT12SurfaceElement* AsSurface() { - return as(); + return as(); } const RCT12PathElement* AsPath() const { - return as(); + return as(); } RCT12PathElement* AsPath() { - return as(); + return as(); } const RCT12TrackElement* AsTrack() const { - return as(); + return as(); } RCT12TrackElement* AsTrack() { - return as(); + return as(); } const RCT12SmallSceneryElement* AsSmallScenery() const { - return as(); + return as(); } RCT12SmallSceneryElement* AsSmallScenery() { - return as(); + return as(); } const RCT12LargeSceneryElement* AsLargeScenery() const { - return as(); + return as(); } RCT12LargeSceneryElement* AsLargeScenery() { - return as(); + return as(); } const RCT12WallElement* AsWall() const { - return as(); + return as(); } RCT12WallElement* AsWall() { - return as(); + return as(); } const RCT12EntranceElement* AsEntrance() const { - return as(); + return as(); } RCT12EntranceElement* AsEntrance() { - return as(); + return as(); } const RCT12BannerElement* AsBanner() const { - return as(); + return as(); } RCT12BannerElement* AsBanner() { - return as(); + return as(); } }; static_assert(sizeof(RCT12TileElement) == 8); @@ -900,98 +900,98 @@ static_assert(sizeof(RCT12EightCarsCorruptElement15) == 8); // Offset into EntityListHead and EntityListCount enum class RCT12EntityLinkListOffset : uint8_t { - Free = 0, - TrainHead = 1 * sizeof(uint16_t), - Peep = 2 * sizeof(uint16_t), - Misc = 3 * sizeof(uint16_t), - Litter = 4 * sizeof(uint16_t), - Vehicle = 5 * sizeof(uint16_t), + free = 0, + trainHead = 1 * sizeof(uint16_t), + peep = 2 * sizeof(uint16_t), + misc = 3 * sizeof(uint16_t), + litter = 4 * sizeof(uint16_t), + vehicle = 5 * sizeof(uint16_t), }; enum class RCT12EntityIdentifier : uint8_t { - Vehicle = 0, - Peep = 1, - Misc = 2, - Litter = 3, - Null = 255 + vehicle = 0, + peep = 1, + misc = 2, + litter = 3, + null = 255 }; enum class RCT12MiscEntityType : uint8_t { - SteamParticle, - MoneyEffect, - CrashedVehicleParticle, - ExplosionCloud, - CrashSplash, - ExplosionFlare, - JumpingFountainWater, - Balloon, - Duck, - JumpingFountainSnow + steamParticle, + moneyEffect, + crashedVehicleParticle, + explosionCloud, + crashSplash, + explosionFlare, + jumpingFountainWater, + balloon, + duck, + jumpingFountainSnow }; enum class RCT12PeepType : uint8_t { - Guest, - Staff, + guest, + staff, - Invalid = 0xFF + invalid = 0xFF }; enum class RCT12PeepAnimationGroup : uint8_t { - Normal = 0, - Handyman = 1, - Mechanic = 2, - Security = 3, - EntertainerPanda = 4, - EntertainerTiger = 5, - EntertainerElephant = 6, - EntertainerRoman = 7, - EntertainerGorilla = 8, - EntertainerSnowman = 9, - EntertainerKnight = 10, - EntertainerAstronaut = 11, - EntertainerBandit = 12, - EntertainerSheriff = 13, - EntertainerPirate = 14, - IceCream = 15, - Chips = 16, - Burger = 17, - Drink = 18, - Balloon = 19, - Candyfloss = 20, - Umbrella = 21, - Pizza = 22, - SecurityAlt = 23, - Popcorn = 24, - ArmsCrossed = 25, - HeadDown = 26, - Nauseous = 27, - VeryNauseous = 28, - RequireToilet = 29, - Hat = 30, - HotDog = 31, - Tentacle = 32, - ToffeeApple = 33, - Doughnut = 34, - Coffee = 35, - Chicken = 36, - Lemonade = 37, - Watching = 38, - Pretzel = 39, - Sunglasses = 40, - Sujeonggwa = 41, - Juice = 42, - FunnelCake = 43, - Noodles = 44, - Sausage = 45, - Soup = 46, - Sandwich = 47, - Count = 48, + normal = 0, + handyman = 1, + mechanic = 2, + security = 3, + entertainerPanda = 4, + entertainerTiger = 5, + entertainerElephant = 6, + entertainerRoman = 7, + entertainerGorilla = 8, + entertainerSnowman = 9, + entertainerKnight = 10, + entertainerAstronaut = 11, + entertainerBandit = 12, + entertainerSheriff = 13, + entertainerPirate = 14, + iceCream = 15, + chips = 16, + burger = 17, + drink = 18, + balloon = 19, + candyfloss = 20, + umbrella = 21, + pizza = 22, + securityAlt = 23, + popcorn = 24, + armsCrossed = 25, + headDown = 26, + nauseous = 27, + veryNauseous = 28, + requireToilet = 29, + hat = 30, + hotDog = 31, + tentacle = 32, + toffeeApple = 33, + doughnut = 34, + coffee = 35, + chicken = 36, + lemonade = 37, + watching = 38, + pretzel = 39, + sunglasses = 40, + sujeonggwa = 41, + juice = 42, + funnelCake = 43, + noodles = 44, + sausage = 45, + soup = 46, + sandwich = 47, + count = 48, - Invalid = 255 + invalid = 255 }; struct RCT12EntityBase diff --git a/src/openrct2/rct12/ScenarioPatcher.cpp b/src/openrct2/rct12/ScenarioPatcher.cpp index 519095a30c..93ffe5787d 100644 --- a/src/openrct2/rct12/ScenarioPatcher.cpp +++ b/src/openrct2/rct12/ScenarioPatcher.cpp @@ -505,10 +505,10 @@ static void SwapRideEntranceAndExit(RideId rideId) // First, make the queuing peep exit for (auto peep : EntityList()) { - if (peep->State == PeepState::QueuingFront && peep->CurrentRide == rideId) + if (peep->State == PeepState::queuingFront && peep->CurrentRide == rideId) { peep->RemoveFromQueue(); - peep->SetState(PeepState::Falling); + peep->SetState(PeepState::falling); break; } } @@ -655,7 +655,9 @@ static void ApplyPathFixes(const json_t& scenarioPatch) for (auto coordinate : coordinates) { - auto slope = direction != kInvalidDirection ? direction + 4 : 0; + auto slope = FootpathSlope(FootpathSlopeType::flat, 0); + if (direction != kInvalidDirection) + slope = { FootpathSlopeType::sloped, direction }; auto footpathPlaceAction = GameActions::FootpathPlaceAction( coordinate.ToCoordsXYZ(), slope, surfaceObjIndex, railingsObjIndex, direction, constructionFlags); auto& gameState = getGameState(); diff --git a/src/openrct2/rct2/RCT2.cpp b/src/openrct2/rct2/RCT2.cpp index a89326cc5a..2dce7aab21 100644 --- a/src/openrct2/rct2/RCT2.cpp +++ b/src/openrct2/rct2/RCT2.cpp @@ -100,11 +100,11 @@ namespace OpenRCT2::RCT2 OpenRCT2::TrackElemType RCT2TrackTypeToOpenRCT2( OpenRCT2::RCT12::TrackElemType origTrackType, ride_type_t rideType, bool isFlatRide) { - auto originalClass = OriginalRideClass::Regular; + auto originalClass = OriginalRideClass::regular; if (rideType == RIDE_TYPE_STEEL_WILD_MOUSE || rideType == RIDE_TYPE_SPINNING_WILD_MOUSE) - originalClass = OriginalRideClass::WildMouse; + originalClass = OriginalRideClass::wildMouse; if (isFlatRide) - originalClass = OriginalRideClass::FlatRide; + originalClass = OriginalRideClass::flatRide; return RCT2TrackTypeToOpenRCT2(origTrackType, originalClass); } @@ -114,14 +114,14 @@ namespace OpenRCT2::RCT2 { switch (originalClass) { - case OriginalRideClass::FlatRide: + case OriginalRideClass::flatRide: return RCT12FlatTrackTypeToOpenRCT2(origTrackType); - case OriginalRideClass::WildMouse: + case OriginalRideClass::wildMouse: // Boosters share their ID with the Spinning Control track. - if (origTrackType == OpenRCT2::RCT12::TrackElemType::RotationControlToggleAlias) + if (origTrackType == OpenRCT2::RCT12::TrackElemType::rotationControlToggleAlias) return OpenRCT2::TrackElemType::RotationControlToggle; return static_cast(origTrackType); - case OriginalRideClass::Regular: + case OriginalRideClass::regular: default: return static_cast(origTrackType); } @@ -130,7 +130,7 @@ namespace OpenRCT2::RCT2 OpenRCT2::RCT12::TrackElemType OpenRCT2TrackTypeToRCT2(OpenRCT2::TrackElemType origTrackType) { if (origTrackType == TrackElemType::RotationControlToggle) - return OpenRCT2::RCT12::TrackElemType::RotationControlToggleAlias; + return OpenRCT2::RCT12::TrackElemType::rotationControlToggleAlias; // This function is safe to run this way round. return OpenRCT2FlatTrackTypeToRCT12(origTrackType); diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 2161eee372..59c02fcf1e 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -82,7 +82,7 @@ namespace OpenRCT2::RCT2 enum class EntityListId : uint8_t { - Count = 6, + count = 6, }; #pragma pack(push, 1) /** @@ -709,9 +709,9 @@ namespace OpenRCT2::RCT2 enum class StaffMode : uint8_t { - None, - Walk, - Patrol = 3 + none, + walk, + patrol = 3 }; union Entity @@ -833,8 +833,8 @@ namespace OpenRCT2::RCT2 // SC6[6] uint32_t NextFreeTileElementPointerIndex; Entity Entities[Limits::kMaxEntitiesRCTCExtended]; - uint16_t EntityListsHead[EnumValue(EntityListId::Count)]; - uint16_t EntityListsCount[EnumValue(EntityListId::Count)]; + uint16_t EntityListsHead[EnumValue(EntityListId::count)]; + uint16_t EntityListsCount[EnumValue(EntityListId::count)]; StringId ParkName; uint8_t Pad013573D6[2]; uint32_t ParkNameArgs; @@ -1036,9 +1036,9 @@ namespace OpenRCT2::RCT2 enum class OriginalRideClass { - Regular, - WildMouse, - FlatRide, + regular, + wildMouse, + flatRide, }; OpenRCT2::TrackElemType RCT2TrackTypeToOpenRCT2( diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index f08cbc2f7e..5bb9ee2961 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -329,7 +329,7 @@ namespace OpenRCT2::RCT2 // Some scenarios have their scenario details in UTF-8, due to earlier bugs in OpenRCT2. auto loadMaybeUTF8 = [](std::string_view str) -> std::string { - return !IsLikelyUTF8(str) ? RCT2StringToUTF8(str, RCT2LanguageId::EnglishUK) : std::string(str); + return !IsLikelyUTF8(str) ? RCT2StringToUTF8(str, RCT2LanguageId::englishUK) : std::string(str); }; if (_s6.Header.Type == S6_TYPE_SCENARIO) @@ -423,7 +423,7 @@ namespace OpenRCT2::RCT2 gameState.researchProgressStage = _s6.ResearchProgressStage; if (_s6.LastResearchedItemSubject != kRCT12ResearchedItemsSeparator) gameState.researchLastItem = RCT12ResearchItem{ _s6.LastResearchedItemSubject, - EnumValue(ResearchCategory::Transport) } + EnumValue(ResearchCategory::transport) } .ToResearchItem(); else gameState.researchLastItem = std::nullopt; @@ -617,9 +617,9 @@ namespace OpenRCT2::RCT2 void ConvertScenarioStringsToUTF8(GameState_t& gameState) { // Scenario details - gameState.scenarioCompletedBy = RCT2StringToUTF8(gameState.scenarioCompletedBy, RCT2LanguageId::EnglishUK); - gameState.scenarioOptions.name = RCT2StringToUTF8(gameState.scenarioOptions.name, RCT2LanguageId::EnglishUK); - gameState.scenarioOptions.details = RCT2StringToUTF8(gameState.scenarioOptions.details, RCT2LanguageId::EnglishUK); + gameState.scenarioCompletedBy = RCT2StringToUTF8(gameState.scenarioCompletedBy, RCT2LanguageId::englishUK); + gameState.scenarioOptions.name = RCT2StringToUTF8(gameState.scenarioOptions.name, RCT2LanguageId::englishUK); + gameState.scenarioOptions.details = RCT2StringToUTF8(gameState.scenarioOptions.details, RCT2LanguageId::englishUK); } void ImportRides() @@ -1212,11 +1212,11 @@ namespace OpenRCT2::RCT2 for (int32_t i = 0; i < GetMaxEntities(); i++) { const auto& entity = _s6.Entities[i]; - if (entity.Unknown.EntityIdentifier == RCT12EntityIdentifier::Peep) + if (entity.Unknown.EntityIdentifier == RCT12EntityIdentifier::peep) { if (entity.Peep.CurrentRide == static_cast(rideIndex.ToUnderlying()) - && (static_cast(entity.Peep.State) == PeepState::OnRide - || static_cast(entity.Peep.State) == PeepState::EnteringRide)) + && (static_cast(entity.Peep.State) == PeepState::onRide + || static_cast(entity.Peep.State) == PeepState::enteringRide)) { numRiders++; } @@ -1256,7 +1256,7 @@ namespace OpenRCT2::RCT2 } auto tileElementType = srcElement->GetType(); - if (tileElementType == RCT12TileElementType::Corrupt) + if (tileElementType == RCT12TileElementType::corrupt) { // One property of corrupt elements was to hide tops of tower tracks, and to avoid the next // element from being hidden, multiple consecutive corrupt elements were sometimes used. @@ -1265,8 +1265,8 @@ namespace OpenRCT2::RCT2 nextElementInvisible = !nextElementInvisible; continue; } - if (tileElementType == RCT12TileElementType::EightCarsCorrupt14 - || tileElementType == RCT12TileElementType::EightCarsCorrupt15) + if (tileElementType == RCT12TileElementType::eightCarsCorrupt14 + || tileElementType == RCT12TileElementType::eightCarsCorrupt15) { restOfTileInvisible = true; continue; @@ -1314,7 +1314,7 @@ namespace OpenRCT2::RCT2 switch (rct12Type) { - case RCT12TileElementType::Surface: + case RCT12TileElementType::surface: { auto dst2 = dst->AsSurface(); auto src2 = src->AsSurface(); @@ -1332,7 +1332,7 @@ namespace OpenRCT2::RCT2 break; } - case RCT12TileElementType::Path: + case RCT12TileElementType::path: { auto dst2 = dst->AsPath(); auto src2 = src->AsPath(); @@ -1370,7 +1370,7 @@ namespace OpenRCT2::RCT2 break; } - case RCT12TileElementType::Track: + case RCT12TileElementType::track: { auto dst2 = dst->AsTrack(); auto src2 = src->AsTrack(); @@ -1432,7 +1432,7 @@ namespace OpenRCT2::RCT2 break; } - case RCT12TileElementType::SmallScenery: + case RCT12TileElementType::smallScenery: { auto dst2 = dst->AsSmallScenery(); auto src2 = src->AsSmallScenery(); @@ -1447,7 +1447,7 @@ namespace OpenRCT2::RCT2 break; } - case RCT12TileElementType::Entrance: + case RCT12TileElementType::entrance: { auto dst2 = dst->AsEntrance(); auto src2 = src->AsEntrance(); @@ -1478,7 +1478,7 @@ namespace OpenRCT2::RCT2 } break; } - case RCT12TileElementType::Wall: + case RCT12TileElementType::wall: { auto dst2 = dst->AsWall(); auto src2 = src->AsWall(); @@ -1515,7 +1515,7 @@ namespace OpenRCT2::RCT2 } break; } - case RCT12TileElementType::LargeScenery: + case RCT12TileElementType::largeScenery: { auto dst2 = dst->AsLargeScenery(); auto src2 = src->AsLargeScenery(); @@ -1548,7 +1548,7 @@ namespace OpenRCT2::RCT2 } break; } - case RCT12TileElementType::Banner: + case RCT12TileElementType::banner: { auto dst2 = dst->AsBanner(); auto src2 = src->AsBanner(); @@ -1612,7 +1612,7 @@ namespace OpenRCT2::RCT2 { // First check staff mode as vanilla did not clean up patrol areas when switching from patrol to walk // without doing this we could accidentally add a patrol when it didn't exist. - if (_s6.StaffModes[staffId] != StaffMode::Patrol) + if (_s6.StaffModes[staffId] != StaffMode::patrol) { return; } @@ -1735,63 +1735,63 @@ namespace OpenRCT2::RCT2 constexpr EntityType GetEntityTypeFromRCT2Sprite(const RCT12EntityBase* src) { - EntityType output = EntityType::Null; + EntityType output = EntityType::null; switch (src->EntityIdentifier) { - case RCT12EntityIdentifier::Vehicle: - output = EntityType::Vehicle; + case RCT12EntityIdentifier::vehicle: + output = EntityType::vehicle; break; - case RCT12EntityIdentifier::Peep: + case RCT12EntityIdentifier::peep: { const auto& peep = static_cast(*src); - if (RCT12PeepType(peep.PeepType) == RCT12PeepType::Guest) + if (RCT12PeepType(peep.PeepType) == RCT12PeepType::guest) { - output = EntityType::Guest; + output = EntityType::guest; } else { - output = EntityType::Staff; + output = EntityType::staff; } break; } - case RCT12EntityIdentifier::Misc: + case RCT12EntityIdentifier::misc: switch (RCT12MiscEntityType(src->Type)) { - case RCT12MiscEntityType::SteamParticle: - output = EntityType::SteamParticle; + case RCT12MiscEntityType::steamParticle: + output = EntityType::steamParticle; break; - case RCT12MiscEntityType::MoneyEffect: - output = EntityType::MoneyEffect; + case RCT12MiscEntityType::moneyEffect: + output = EntityType::moneyEffect; break; - case RCT12MiscEntityType::CrashedVehicleParticle: - output = EntityType::CrashedVehicleParticle; + case RCT12MiscEntityType::crashedVehicleParticle: + output = EntityType::crashedVehicleParticle; break; - case RCT12MiscEntityType::ExplosionCloud: - output = EntityType::ExplosionCloud; + case RCT12MiscEntityType::explosionCloud: + output = EntityType::explosionCloud; break; - case RCT12MiscEntityType::CrashSplash: - output = EntityType::CrashSplash; + case RCT12MiscEntityType::crashSplash: + output = EntityType::crashSplash; break; - case RCT12MiscEntityType::ExplosionFlare: - output = EntityType::ExplosionFlare; + case RCT12MiscEntityType::explosionFlare: + output = EntityType::explosionFlare; break; - case RCT12MiscEntityType::JumpingFountainWater: - case RCT12MiscEntityType::JumpingFountainSnow: - output = EntityType::JumpingFountain; + case RCT12MiscEntityType::jumpingFountainWater: + case RCT12MiscEntityType::jumpingFountainSnow: + output = EntityType::jumpingFountain; break; - case RCT12MiscEntityType::Balloon: - output = EntityType::Balloon; + case RCT12MiscEntityType::balloon: + output = EntityType::balloon; break; - case RCT12MiscEntityType::Duck: - output = EntityType::Duck; + case RCT12MiscEntityType::duck: + output = EntityType::duck; break; default: break; } break; - case RCT12EntityIdentifier::Litter: - output = EntityType::Litter; + case RCT12EntityIdentifier::litter: + output = EntityType::litter; break; default: break; @@ -1820,7 +1820,7 @@ namespace OpenRCT2::RCT2 const auto originalString = _s6.CustomStrings[stringId % 1024]; auto originalStringView = std::string_view( originalString, RCT12::GetRCTStringBufferLen(originalString, kUserStringMaxLength)); - auto asUtf8 = RCT2StringToUTF8(originalStringView, RCT2LanguageId::EnglishUK); + auto asUtf8 = RCT2StringToUTF8(originalStringView, RCT2LanguageId::englishUK); auto justText = RCT12RemoveFormattingUTF8(asUtf8); return justText.data(); } @@ -1969,13 +1969,13 @@ namespace OpenRCT2::RCT2 { dst->BoatLocation.SetNull(); dst->SetTrackDirection(src->GetTrackDirection()); - // Skipping OriginalRideClass::WildMouse - this is handled specifically. - auto originalClass = IsFlatRide(src->Ride) ? OriginalRideClass::FlatRide : OriginalRideClass::Regular; + // Skipping OriginalRideClass::wildMouse - this is handled specifically. + auto originalClass = IsFlatRide(src->Ride) ? OriginalRideClass::flatRide : OriginalRideClass::regular; auto convertedType = RCT2TrackTypeToOpenRCT2(src->GetTrackType(), originalClass); dst->SetTrackType(convertedType); // RotationControlToggle and Booster are saved as the same track piece ID // Which one the vehicle is using must be determined - if (src->GetTrackType() == OpenRCT2::RCT12::TrackElemType::RotationControlToggleAlias) + if (src->GetTrackType() == OpenRCT2::RCT12::TrackElemType::rotationControlToggleAlias) { // Merging hacks mean the track type that's appropriate for the ride type is not necessarily the track type the // ride is on. It's possible to create unwanted behavior if a user layers spinning control track on top of @@ -1987,7 +1987,7 @@ namespace OpenRCT2::RCT2 if (tileElement2 != nullptr) dst->SetTrackType(TrackElemType::RotationControlToggle); } - else if (src->GetTrackType() == OpenRCT2::RCT12::TrackElemType::BlockBrakes) + else if (src->GetTrackType() == OpenRCT2::RCT12::TrackElemType::blockBrakes) { dst->brake_speed = kRCT2DefaultBlockBrakeSpeed; } @@ -2249,7 +2249,7 @@ namespace OpenRCT2::RCT2 dst->TargetX = src->TargetX; dst->TargetY = src->TargetY; dst->Iteration = src->Iteration; - dst->FountainType = RCT12MiscEntityType(src->Type) == RCT12MiscEntityType::JumpingFountainSnow + dst->FountainType = RCT12MiscEntityType(src->Type) == RCT12MiscEntityType::jumpingFountainSnow ? ::JumpingFountainType::Snow : ::JumpingFountainType::Water; } @@ -2292,43 +2292,43 @@ namespace OpenRCT2::RCT2 { switch (GetEntityTypeFromRCT2Sprite(&src)) { - case EntityType::Vehicle: + case EntityType::vehicle: ImportEntity<::Vehicle>(gameState, src); break; - case EntityType::Guest: + case EntityType::guest: ImportEntity<::Guest>(gameState, src); break; - case EntityType::Staff: + case EntityType::staff: ImportEntity<::Staff>(gameState, src); break; - case EntityType::SteamParticle: + case EntityType::steamParticle: ImportEntity<::SteamParticle>(gameState, src); break; - case EntityType::MoneyEffect: + case EntityType::moneyEffect: ImportEntity<::MoneyEffect>(gameState, src); break; - case EntityType::CrashedVehicleParticle: + case EntityType::crashedVehicleParticle: ImportEntity<::VehicleCrashParticle>(gameState, src); break; - case EntityType::ExplosionCloud: + case EntityType::explosionCloud: ImportEntity<::ExplosionCloud>(gameState, src); break; - case EntityType::ExplosionFlare: + case EntityType::explosionFlare: ImportEntity<::ExplosionFlare>(gameState, src); break; - case EntityType::CrashSplash: + case EntityType::crashSplash: ImportEntity<::CrashSplashParticle>(gameState, src); break; - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: ImportEntity<::JumpingFountain>(gameState, src); break; - case EntityType::Balloon: + case EntityType::balloon: ImportEntity<::Balloon>(gameState, src); break; - case EntityType::Duck: + case EntityType::duck: ImportEntity<::Duck>(gameState, src); break; - case EntityType::Litter: + case EntityType::litter: ImportEntity<::Litter>(gameState, src); break; default: diff --git a/src/openrct2/rct2/T6Exporter.cpp b/src/openrct2/rct2/T6Exporter.cpp index ce3300a710..c577e8ffe5 100644 --- a/src/openrct2/rct2/T6Exporter.cpp +++ b/src/openrct2/rct2/T6Exporter.cpp @@ -155,7 +155,7 @@ namespace OpenRCT2::RCT2 auto trackType = OpenRCT2TrackTypeToRCT2(trackElement.type); if (trackElement.type == TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop) { - trackType = OpenRCT2::RCT12::TrackElemType::InvertedUp90ToFlatQuarterLoopAlias; + trackType = OpenRCT2::RCT12::TrackElemType::invertedUp90ToFlatQuarterLoopAlias; } tempStream.WriteValue(static_cast(trackType)); auto flags = RCT12::convertToTD46Flags(trackElement); diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index 07119ae81b..f5742fb2c4 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -160,7 +160,7 @@ namespace OpenRCT2::RCT2 TrackDesignTrackElement trackElement{}; OpenRCT2::TrackElemType trackType; - if (t6TrackElement.Type == OpenRCT2::RCT12::TrackElemType::InvertedUp90ToFlatQuarterLoopAlias) + if (t6TrackElement.Type == OpenRCT2::RCT12::TrackElemType::invertedUp90ToFlatQuarterLoopAlias) { trackType = TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop; } diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index c7466697fc..44818b2259 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -21,8 +21,10 @@ #include "Track.h" #include "Vehicle.h" #include "VehicleData.h" +#include "VehicleGeometry.h" using namespace OpenRCT2; +using namespace OpenRCT2::RideVehicle; Vehicle* CableLiftSegmentCreate( Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance, bool head) @@ -274,19 +276,10 @@ bool Vehicle::CableLiftUpdateTrackMotionForwards() const auto moveInfo = GetMoveInfo(); auto nextVehiclePosition = CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z } + TrackLocation; - uint8_t remainingDistanceFlags = 0; nextVehiclePosition.z += GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset; - if (nextVehiclePosition.x != _vehicleCurPosition.x) - remainingDistanceFlags |= (1 << 0); - if (nextVehiclePosition.y != _vehicleCurPosition.y) - remainingDistanceFlags |= (1 << 1); - if (nextVehiclePosition.z != _vehicleCurPosition.z) - remainingDistanceFlags |= (1 << 2); - remaining_distance -= SubpositionTranslationDistances[remainingDistanceFlags]; - _vehicleCurPosition.x = nextVehiclePosition.x; - _vehicleCurPosition.y = nextVehiclePosition.y; - _vehicleCurPosition.z = nextVehiclePosition.z; + remaining_distance -= Geometry::getTranslationDistance(nextVehiclePosition - _vehicleCurPosition, false); + _vehicleCurPosition = nextVehiclePosition; Orientation = moveInfo->direction; roll = moveInfo->roll; @@ -294,7 +287,7 @@ bool Vehicle::CableLiftUpdateTrackMotionForwards() if (remaining_distance >= 13962) { - acceleration += AccelerationFromPitch[EnumValue(pitch)]; + acceleration += Geometry::getAccelerationFromPitch(pitch); } } return true; @@ -341,29 +334,20 @@ bool Vehicle::CableLiftUpdateTrackMotionBackwards() } track_progress = trackProgress; const auto moveInfo = GetMoveInfo(); - auto unk = CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z } + TrackLocation; + auto nextVehiclePosition = CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z } + TrackLocation; - uint8_t remainingDistanceFlags = 0; - unk.z += GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset; - if (unk.x != _vehicleCurPosition.x) - remainingDistanceFlags |= (1 << 0); - if (unk.y != _vehicleCurPosition.y) - remainingDistanceFlags |= (1 << 1); - if (unk.z != _vehicleCurPosition.z) - remainingDistanceFlags |= (1 << 2); + nextVehiclePosition.z += GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset; - remaining_distance += SubpositionTranslationDistances[remainingDistanceFlags]; - _vehicleCurPosition.x = unk.x; - _vehicleCurPosition.y = unk.y; - _vehicleCurPosition.z = unk.z; + remaining_distance += Geometry::getTranslationDistance(nextVehiclePosition - _vehicleCurPosition, false); + _vehicleCurPosition = nextVehiclePosition; Orientation = moveInfo->direction; roll = moveInfo->roll; pitch = moveInfo->pitch; if (remaining_distance < 0) { - acceleration += AccelerationFromPitch[EnumValue(pitch)]; + acceleration += Geometry::getAccelerationFromPitch(pitch); } } return true; @@ -394,7 +378,7 @@ int32_t Vehicle::CableLiftUpdateTrackMotion() for (Vehicle* vehicle = frontVehicle; vehicle != nullptr;) { - vehicle->acceleration = AccelerationFromPitch[EnumValue(vehicle->pitch)]; + vehicle->acceleration = Geometry::getAccelerationFromPitch(vehicle->pitch); _vehicleUnkF64E10 = 1; vehicle->remaining_distance += _vehicleVelocityF64E0C; @@ -415,7 +399,7 @@ int32_t Vehicle::CableLiftUpdateTrackMotion() _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; _vehicleVelocityF64E0C -= vehicle->remaining_distance - 13962; vehicle->remaining_distance = 13962; - vehicle->acceleration += AccelerationFromPitch[EnumValue(vehicle->pitch)]; + vehicle->acceleration += Geometry::getAccelerationFromPitch(vehicle->pitch); _vehicleUnkF64E10++; continue; } @@ -428,7 +412,7 @@ int32_t Vehicle::CableLiftUpdateTrackMotion() _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; _vehicleVelocityF64E0C -= vehicle->remaining_distance + 1; vehicle->remaining_distance = -1; - vehicle->acceleration += AccelerationFromPitch[EnumValue(vehicle->pitch)]; + vehicle->acceleration += Geometry::getAccelerationFromPitch(vehicle->pitch); _vehicleUnkF64E10++; } vehicle->MoveTo(_vehicleCurPosition); diff --git a/src/openrct2/ride/CarEntry.cpp b/src/openrct2/ride/CarEntry.cpp index 2a1b1360ab..028978beb8 100644 --- a/src/openrct2/ride/CarEntry.cpp +++ b/src/openrct2/ride/CarEntry.cpp @@ -138,9 +138,9 @@ void CarEntrySetImageMaxSizes(CarEntry& carEntry, int32_t numImages) spriteHeightNegative += 16; } - carEntry.sprite_width = spriteWidth; - carEntry.sprite_height_negative = spriteHeightNegative; - carEntry.sprite_height_positive = spriteHeightPositive; + carEntry.spriteWidth = spriteWidth; + carEntry.spriteHeightNegative = spriteHeightNegative; + carEntry.spriteHeightPositive = spriteHeightPositive; } bool CarEntry::isVisible() const diff --git a/src/openrct2/ride/CarEntry.h b/src/openrct2/ride/CarEntry.h index 2ed0ab62d3..1e65ca613f 100644 --- a/src/openrct2/ride/CarEntry.h +++ b/src/openrct2/ride/CarEntry.h @@ -179,9 +179,9 @@ struct CarEntry uint16_t car_mass; int8_t tab_height; uint8_t num_seats; - uint8_t sprite_width; - uint8_t sprite_height_negative; - uint8_t sprite_height_positive; + uint8_t spriteWidth; + uint8_t spriteHeightNegative; + uint8_t spriteHeightPositive; CarEntryAnimation animation; uint64_t flags; uint16_t base_num_frames; // The number of sprites of animation or swinging per rotation frame diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 02a9eaf890..d344c755b7 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -246,7 +246,6 @@ Ride* GetRide(RideId index) auto& gameState = getGameState(); const auto idx = index.ToUnderlying(); - assert(idx < gameState.rides.size()); if (idx >= gameState.rides.size()) { return nullptr; @@ -325,7 +324,7 @@ size_t Ride::getNumPrices() const { result++; } - else if (rideEntry->shop_item[1] != ShopItem::None) + else if (rideEntry->shop_item[1] != ShopItem::none) { result++; } @@ -445,14 +444,14 @@ money64 Ride::calculateIncomePerHour() const money64 priceMinusCost = RideGetPrice(*this); ShopItem currentShopItem = entry->shop_item[0]; - if (currentShopItem != ShopItem::None) + if (currentShopItem != ShopItem::none) { priceMinusCost -= GetShopItemDescriptor(currentShopItem).Cost; } currentShopItem = (lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? getRideTypeDescriptor().PhotoItem : entry->shop_item[1]; - if (currentShopItem != ShopItem::None) + if (currentShopItem != ShopItem::none) { const money64 shopItemProfit = price[1] - GetShopItemDescriptor(currentShopItem).Cost; @@ -473,7 +472,7 @@ money64 Ride::calculateIncomePerHour() const priceMinusCost += shopItemProfit; } - if (entry->shop_item[0] != ShopItem::None) + if (entry->shop_item[0] != ShopItem::none) priceMinusCost /= 2; } @@ -1175,18 +1174,9 @@ void Ride::update() // If ride is simulating but crashed, reset the vehicles if (status == RideStatus::simulating && (lifecycleFlags & RIDE_LIFECYCLE_CRASHED)) { - if (mode == RideMode::continuousCircuitBlockSectioned || mode == RideMode::poweredLaunchBlockSectioned) - { - // We require this to execute right away during the simulation, always ignore network and queue. - auto gameAction = GameActions::RideSetStatusAction(id, RideStatus::closed); - GameActions::ExecuteNested(&gameAction, getGameState()); - } - else - { - // We require this to execute right away during the simulation, always ignore network and queue. - auto gameAction = GameActions::RideSetStatusAction(id, RideStatus::simulating); - GameActions::ExecuteNested(&gameAction, getGameState()); - } + // We require this to execute right away during the simulation, always ignore network and queue. + auto gameAction = GameActions::RideSetStatusAction(id, RideStatus::simulating); + GameActions::ExecuteNested(&gameAction, getGameState()); } } @@ -1302,9 +1292,7 @@ void updateSpiralSlide(Ride& ride) auto* peep = getGameState().entities.GetEntity(ride.slidePeep); if (peep != nullptr) { - auto destination = peep->GetDestination(); - destination.x++; - peep->SetDestination(destination); + peep->spiralSlideSubstate = PeepSpiralSlideSubState::finishedSliding; } } @@ -1646,7 +1634,7 @@ void RidePrepareBreakdown(Ride& ride, int32_t breakdownReason) */ void RideBreakdownAddNewsItem(const Ride& ride) { - if (Config::Get().notifications.RideBrokenDown) + if (Config::Get().notifications.rideBrokenDown) { Formatter ft; ride.formatNameTo(ft); @@ -1673,7 +1661,7 @@ static void RideBreakdownStatusUpdate(Ride& ride) if (!(ride.notFixedTimeout & 15) && ride.mechanicStatus != RIDE_MECHANIC_STATUS_FIXING && ride.mechanicStatus != RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) { - if (Config::Get().notifications.RideWarnings) + if (Config::Get().notifications.rideWarnings) { Formatter ft; ride.formatNameTo(ft); @@ -1730,7 +1718,7 @@ static void RideMechanicStatusUpdate(Ride& ride, int32_t mechanicStatus) auto mechanic = RideGetMechanic(ride); bool rideNeedsRepair = (ride.lifecycleFlags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)); if (mechanic == nullptr - || (mechanic->State != PeepState::HeadingToInspection && mechanic->State != PeepState::Answering) + || (mechanic->State != PeepState::headingToInspection && mechanic->State != PeepState::answering) || mechanic->CurrentRide != ride.id) { ride.mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; @@ -1738,10 +1726,10 @@ static void RideMechanicStatusUpdate(Ride& ride, int32_t mechanicStatus) RideMechanicStatusUpdate(ride, RIDE_MECHANIC_STATUS_CALLING); } // if the ride is broken down, but a mechanic was heading for an inspection, update orders to fix - else if (rideNeedsRepair && mechanic->State == PeepState::HeadingToInspection) + else if (rideNeedsRepair && mechanic->State == PeepState::headingToInspection) { // updates orders for mechanic already heading to inspect ride - // forInspection == false means start repair (goes to PeepState::Answering) + // forInspection == false means start repair (goes to PeepState::answering) RideCallMechanic(ride, mechanic, false); } break; @@ -1750,8 +1738,8 @@ static void RideMechanicStatusUpdate(Ride& ride, int32_t mechanicStatus) { auto mechanic = RideGetMechanic(ride); if (mechanic == nullptr - || (mechanic->State != PeepState::HeadingToInspection && mechanic->State != PeepState::Fixing - && mechanic->State != PeepState::Inspecting && mechanic->State != PeepState::Answering)) + || (mechanic->State != PeepState::headingToInspection && mechanic->State != PeepState::fixing + && mechanic->State != PeepState::inspecting && mechanic->State != PeepState::answering)) { ride.mechanicStatus = RIDE_MECHANIC_STATUS_CALLING; ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -1768,7 +1756,7 @@ static void RideMechanicStatusUpdate(Ride& ride, int32_t mechanicStatus) */ static void RideCallMechanic(Ride& ride, Peep* mechanic, int32_t forInspection) { - mechanic->SetState(forInspection ? PeepState::HeadingToInspection : PeepState::Answering); + mechanic->SetState(forInspection ? PeepState::headingToInspection : PeepState::answering); mechanic->SubState = 0; ride.mechanicStatus = RIDE_MECHANIC_STATUS_HEADING; ride.windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -1830,12 +1818,12 @@ Staff* FindClosestMechanic(const CoordsXY& entrancePosition, int32_t forInspecti if (!forInspection) { - if (peep->State == PeepState::HeadingToInspection) + if (peep->State == PeepState::headingToInspection) { if (peep->SubState >= 4) continue; } - else if (peep->State != PeepState::Patrolling) + else if (peep->State != PeepState::patrolling) continue; if (!(peep->StaffOrders & STAFF_ORDERS_FIX_RIDES)) @@ -1843,7 +1831,7 @@ Staff* FindClosestMechanic(const CoordsXY& entrancePosition, int32_t forInspecti } else { - if (peep->State != PeepState::Patrolling || !(peep->StaffOrders & STAFF_ORDERS_INSPECT_RIDES)) + if (peep->State != PeepState::patrolling || !(peep->StaffOrders & STAFF_ORDERS_INSPECT_RIDES)) continue; } @@ -2360,7 +2348,7 @@ static void RideEntranceExitConnected(Ride& ride) // name of ride is parameter of the format string Formatter ft; ride.formatNameTo(ft); - if (Config::Get().notifications.RideWarnings) + if (Config::Get().notifications.rideWarnings) { News::AddItemToQueue(News::ItemType::ride, STR_ENTRANCE_NOT_CONNECTED, ride.id.ToUnderlying(), ft); } @@ -2372,7 +2360,7 @@ static void RideEntranceExitConnected(Ride& ride) // name of ride is parameter of the format string Formatter ft; ride.formatNameTo(ft); - if (Config::Get().notifications.RideWarnings) + if (Config::Get().notifications.rideWarnings) { News::AddItemToQueue(News::ItemType::ride, STR_EXIT_NOT_CONNECTED, ride.id.ToUnderlying(), ft); } @@ -2437,7 +2425,7 @@ static void RideShopConnected(const Ride& ride) } // Name of ride is parameter of the format string - if (Config::Get().notifications.RideWarnings) + if (Config::Get().notifications.rideWarnings) { Formatter ft; ride2->formatNameTo(ft); @@ -3218,7 +3206,7 @@ static void RideSetStartFinishPoints(RideId rideIndex, const CoordsXYE& startEle const auto& rtd = ride->getRideTypeDescriptor(); if (rtd.specialType == RtdSpecialType::maze) RideSetMazeEntranceExitPoints(*ride); - else if (ride->type == RIDE_TYPE_BOAT_HIRE) + else if (rtd.specialType == RtdSpecialType::boatHire) RideSetBoatHireReturnPoint(*ride, startElement); if (ride->isBlockSectioned() && !(ride->lifecycleFlags & RIDE_LIFECYCLE_ON_TRACK)) @@ -3298,9 +3286,9 @@ static Vehicle* VehicleCreateCar( } // Loc6DD9A5: - vehicle->SpriteData.Width = carEntry.sprite_width; - vehicle->SpriteData.HeightMin = carEntry.sprite_height_negative; - vehicle->SpriteData.HeightMax = carEntry.sprite_height_positive; + vehicle->SpriteData.Width = carEntry.spriteWidth; + vehicle->SpriteData.HeightMin = carEntry.spriteHeightNegative; + vehicle->SpriteData.HeightMax = carEntry.spriteHeightPositive; vehicle->mass = carEntry.car_mass; vehicle->num_seats = carEntry.num_seats; vehicle->speed = carEntry.powered_max_speed; @@ -3408,7 +3396,7 @@ static Vehicle* VehicleCreateCar( int32_t direction = trackElement->GetDirection(); vehicle->Orientation = direction << 3; - if (ride.type == RIDE_TYPE_SPACE_RINGS) + if (ride.getRideTypeDescriptor().specialType == RtdSpecialType::spaceRings) { direction = 4; } @@ -3420,7 +3408,7 @@ static Vehicle* VehicleCreateCar( { if (rtd.StartTrackPiece != TrackElemType::FlatTrack1x4A) { - if (ride.type == RIDE_TYPE_ENTERPRISE) + if (ride.getRideTypeDescriptor().specialType == RtdSpecialType::enterprise) { direction += 5; } @@ -3688,8 +3676,8 @@ ResultWithMessage Ride::createVehicles(const CoordsXYE& element, bool isApplying stations[i].Depart = (stations[i].Depart & kStationDepartFlag) | 1; } - // - if (type != RIDE_TYPE_SPACE_RINGS && !getRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) + const auto& rtd = getRideTypeDescriptor(); + if (rtd.specialType != RtdSpecialType::spaceRings && !rtd.HasFlag(RtdFlag::vehicleIsIntegral)) { if (isBlockSectioned() && !isSimulating) { @@ -4271,13 +4259,13 @@ void Ride::stopGuestsQueuing() { for (auto peep : EntityList()) { - if (peep->State != PeepState::Queuing) + if (peep->State != PeepState::queuing) continue; if (peep->CurrentRide != id) continue; peep->RemoveFromQueue(); - peep->SetState(PeepState::Falling); + peep->SetState(PeepState::falling); } } @@ -4419,15 +4407,15 @@ void Ride::setNameToDefault() /** * This will return the name of the ride, as seen in the New Ride window. */ -RideNaming GetRideNaming(const ride_type_t rideType, const RideObjectEntry& rideEntry) +RideNaming GetRideNaming(const ride_type_t rideType, const RideObjectEntry* rideEntry) { const auto& rtd = GetRideTypeDescriptor(rideType); - if (!rtd.HasFlag(RtdFlag::listVehiclesSeparately)) + if (rtd.HasFlag(RtdFlag::listVehiclesSeparately) && rideEntry != nullptr) { - return rtd.Naming; + return rideEntry->naming; } - return rideEntry.naming; + return rtd.Naming; } /* @@ -4749,7 +4737,8 @@ void RideFixBreakdown(Ride& ride, int32_t reliabilityIncreaseFactor) */ void RideUpdateVehicleColours(const Ride& ride) { - if (ride.type == RIDE_TYPE_SPACE_RINGS || ride.getRideTypeDescriptor().HasFlag(RtdFlag::vehicleIsIntegral)) + const auto& rtd = ride.getRideTypeDescriptor(); + if (rtd.specialType == RtdSpecialType::spaceRings || rtd.HasFlag(RtdFlag::vehicleIsIntegral)) { GfxInvalidateScreen(); } @@ -5310,7 +5299,7 @@ void Ride::setReversedTrains(bool reverseTrains) void Ride::setToDefaultInspectionInterval() { - uint8_t defaultInspectionInterval = Config::Get().general.DefaultInspectionInterval; + uint8_t defaultInspectionInterval = Config::Get().general.defaultInspectionInterval; if (inspectionInterval != defaultInspectionInterval) { if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER) @@ -5342,7 +5331,7 @@ void Ride::crash(uint8_t vehicleIndex) } } - if (Config::Get().notifications.RideCrashed) + if (Config::Get().notifications.rideCrashed) { Formatter ft; formatNameTo(ft); @@ -5554,15 +5543,15 @@ void FixInvalidVehicleSpriteSizes() if (vehicle->SpriteData.Width == 0) { - vehicle->SpriteData.Width = carEntry->sprite_width; + vehicle->SpriteData.Width = carEntry->spriteWidth; } if (vehicle->SpriteData.HeightMin == 0) { - vehicle->SpriteData.HeightMin = carEntry->sprite_height_negative; + vehicle->SpriteData.HeightMin = carEntry->spriteHeightNegative; } if (vehicle->SpriteData.HeightMax == 0) { - vehicle->SpriteData.HeightMax = carEntry->sprite_height_positive; + vehicle->SpriteData.HeightMax = carEntry->spriteHeightPositive; } } } @@ -5808,16 +5797,7 @@ void Ride::formatNameTo(Formatter& ft) const } else { - const auto& rtd = getRideTypeDescriptor(); - auto rideTypeName = rtd.Naming.Name; - if (rtd.HasFlag(RtdFlag::listVehiclesSeparately)) - { - auto rideEntry = getRideEntry(); - if (rideEntry != nullptr) - { - rideTypeName = rideEntry->naming.Name; - } - } + const auto rideTypeName = getTypeNaming().Name; ft.Add(1).Add(rideTypeName).Add(defaultNameNumber); } } @@ -5835,6 +5815,11 @@ const RideTypeDescriptor& Ride::getRideTypeDescriptor() const return ::GetRideTypeDescriptor(type); } +RideNaming Ride::getTypeNaming() const +{ + return GetRideNaming(type, getRideEntry()); +} + uint8_t Ride::getNumShelteredSections() const { return numShelteredSections & ShelteredSectionsBits::kNumShelteredSectionsMask; @@ -5898,7 +5883,7 @@ bool Ride::hasRecolourableShopItems() const for (size_t itemIndex = 0; itemIndex < std::size(rideEntry->shop_item); itemIndex++) { const ShopItem currentItem = rideEntry->shop_item[itemIndex]; - if (currentItem != ShopItem::None && GetShopItemDescriptor(currentItem).IsRecolourable()) + if (currentItem != ShopItem::none && GetShopItemDescriptor(currentItem).IsRecolourable()) { return true; } diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 21da95f2c7..3bcef56b5e 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -403,6 +403,7 @@ public: uint64_t getAvailableModes() const; const RideTypeDescriptor& getRideTypeDescriptor() const; + RideNaming getTypeNaming() const; OpenRCT2::TrackElement* getOriginElement(StationIndex stationIndex) const; std::pair getMeasurement(); @@ -497,11 +498,9 @@ enum RIDE_ENTRY_FLAG_NO_INVERSIONS = 1 << 1, RIDE_ENTRY_FLAG_NO_BANKED_TRACK = 1 << 2, RIDE_ENTRY_FLAG_PLAY_DEPART_SOUND = 1 << 3, - RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_1 = 1 << 4, - // Twist type rotation ride - RIDE_ENTRY_FLAG_ALTERNATIVE_ROTATION_MODE_1 = 1 << 5, - // Lifting arm rotation ride (enterprise) - RIDE_ENTRY_FLAG_ALTERNATIVE_ROTATION_MODE_2 = 1 << 6, + RIDE_ENTRY_FLAG_INVERTER_SHIP_SWING_MODE = 1 << 4, + RIDE_ENTRY_FLAG_TWIST_ROTATION_TYPE = 1 << 5, + RIDE_ENTRY_FLAG_ENTERPRISE_ROTATION_TYPE = 1 << 6, RIDE_ENTRY_FLAG_DISABLE_WANDERING_DEPRECATED = 1 << 7, RIDE_ENTRY_FLAG_PLAY_SPLASH_SOUND = 1 << 8, RIDE_ENTRY_FLAG_PLAY_SPLASH_SOUND_SLIDE = 1 << 9, @@ -515,8 +514,8 @@ enum RIDE_ENTRY_DISABLE_FIRST_TWO_OPERATING_MODES_DEPRECATED = 1 << 17, RIDE_ENTRY_FLAG_DISABLE_COLLISION_CRASHES = 1 << 18, RIDE_ENTRY_FLAG_DISABLE_COLOUR_TAB = 1 << 19, - // Must be set with swing mode 1 as well. - RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_2 = 1 << 20, + // Must be set with Inverter Ship swing mode as well. + RIDE_ENTRY_FLAG_MAGIC_CARPET_SWING_MODE = 1 << 20, RIDE_ENTRY_FLAG_RIDER_CONTROLS_SPEED = 1 << 21, RIDE_ENTRY_FLAG_HIDE_EMPTY_TRAINS = 1 << 22, }; diff --git a/src/openrct2/ride/RideAudio.cpp b/src/openrct2/ride/RideAudio.cpp index 2f9125dbf1..b43e53e528 100644 --- a/src/openrct2/ride/RideAudio.cpp +++ b/src/openrct2/ride/RideAudio.cpp @@ -258,7 +258,7 @@ namespace OpenRCT2::RideAudio return; // TODO Allow circus music (CSS24) to play if ride music is disabled (that should be sound) - if (gGameSoundsOff || !Config::Get().sound.RideMusicEnabled) + if (gGameSoundsOff || !Config::Get().sound.rideMusicEnabled) return; StopInactiveRideMusicChannels(); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 0e63a38d63..589a0899d3 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -236,6 +236,12 @@ void RideClearForConstruction(Ride& ride) ride.removeVehicles(); RideClearBlockedTiles(ride); + // Force close simulating rides, to reset flag widget in Construction UI + if (ride.status == RideStatus::simulating) + { + ride.status = RideStatus::closed; + } + auto* windowMgr = Ui::GetWindowManager(); auto w = windowMgr->FindByNumber(WindowClass::ride, ride.id.ToUnderlying()); if (w != nullptr) @@ -274,14 +280,14 @@ void Ride::removePeeps() // Place all the guests at exit for (auto peep : EntityList()) { - if (peep->State == PeepState::QueuingFront || peep->State == PeepState::EnteringRide - || peep->State == PeepState::LeavingRide || peep->State == PeepState::OnRide) + if (peep->State == PeepState::queuingFront || peep->State == PeepState::enteringRide + || peep->State == PeepState::leavingRide || peep->State == PeepState::onRide) { if (peep->CurrentRide != id) continue; PeepDecrementNumRiders(peep); - if (peep->State == PeepState::QueuingFront && peep->RideSubState == PeepRideSubState::AtEntrance) + if (peep->State == PeepState::queuingFront && peep->RideSubState == PeepRideSubState::atEntrance) peep->RemoveFromQueue(); if (exitPosition.direction == kInvalidDirection) @@ -298,7 +304,7 @@ void Ride::removePeeps() peep->Orientation = exitPosition.direction; } - peep->State = PeepState::Falling; + peep->State = PeepState::falling; peep->SwitchToSpecialSprite(0); peep->Happiness = std::min(peep->Happiness, peep->HappinessTarget) / 2; @@ -309,7 +315,7 @@ void Ride::removePeeps() // Place all the staff at exit for (auto peep : EntityList()) { - if (peep->State == PeepState::Fixing || peep->State == PeepState::Inspecting) + if (peep->State == PeepState::fixing || peep->State == PeepState::inspecting) { if (peep->CurrentRide != id) continue; @@ -328,7 +334,7 @@ void Ride::removePeeps() peep->Orientation = exitPosition.direction; } - peep->State = PeepState::Falling; + peep->State = PeepState::falling; peep->SwitchToSpecialSprite(0); peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_STATS; diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index 6f56d7658f..8be9c9abbb 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -135,9 +135,9 @@ const CarEntry kCableLiftVehicle = { .car_mass = 0, .tab_height = 0, .num_seats = 0, - .sprite_width = 0, - .sprite_height_negative = 0, - .sprite_height_positive = 0, + .spriteWidth = 0, + .spriteHeightNegative = 0, + .spriteHeightPositive = 0, .animation = CarEntryAnimation::None, .flags = 0, .base_num_frames = 1, @@ -377,22 +377,22 @@ ResearchCategory RideTypeDescriptor::GetResearchCategory() const switch (Category) { case RideCategory::transport: - return ResearchCategory::Transport; + return ResearchCategory::transport; case RideCategory::gentle: - return ResearchCategory::Gentle; + return ResearchCategory::gentle; case RideCategory::rollerCoaster: - return ResearchCategory::Rollercoaster; + return ResearchCategory::rollercoaster; case RideCategory::thrill: - return ResearchCategory::Thrill; + return ResearchCategory::thrill; case RideCategory::water: - return ResearchCategory::Water; + return ResearchCategory::water; case RideCategory::shop: - return ResearchCategory::Shop; + return ResearchCategory::shop; case RideCategory::none: break; } LOG_ERROR("Cannot get Research Category of invalid RideCategory"); - return ResearchCategory::Transport; + return ResearchCategory::transport; } bool RideTypeDescriptor::SupportsRideMode(RideMode rideMode) const diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 0487cf9a07..d76afc8bfd 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -433,6 +433,12 @@ enum class RtdFlag : uint8_t allowReversedTrains, requireExplicitListingInMusicObjects, + + hasRoofOverWholeRide, + + runningSpeedAffectsReliability, + poweredLaunchAffectsReliability, + reverseInclineLaunchAffectsReliability, }; /** @@ -450,6 +456,10 @@ enum class RtdSpecialType toilet, cashMachine, firstAid, + enterprise, + motionSimulator, + spaceRings, + boatHire, }; // Set on ride types that have a main colour, additional colour and support colour. @@ -629,7 +639,7 @@ constexpr RideTypeDescriptor kDummyRTD = .BuildCosts = { 0.00_GBP, 0.00_GBP, 1 }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 0, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { kSpriteIdNull, kSpriteIdNull }, diff --git a/src/openrct2/ride/RideEntry.h b/src/openrct2/ride/RideEntry.h index d64ef7f3de..f2ce9ddea0 100644 --- a/src/openrct2/ride/RideEntry.h +++ b/src/openrct2/ride/RideEntry.h @@ -99,4 +99,4 @@ struct RideObjectEntry } }; -RideNaming GetRideNaming(const ride_type_t rideType, const RideObjectEntry& rideEntry); +RideNaming GetRideNaming(const ride_type_t rideType, const RideObjectEntry* rideEntry); diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 7d62bc8b18..23714254c8 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -1335,16 +1335,17 @@ static void RideRatingsApplyIntensityPenalty(RideRating::Tuple& ratings) */ static void SetUnreliabilityFactor(Ride& ride) { + const auto& rtd = ride.getRideTypeDescriptor(); // Special unreliability for a few ride types - if (ride.type == RIDE_TYPE_COMPACT_INVERTED_COASTER && ride.mode == RideMode::reverseInclineLaunchedShuttle) + if (rtd.HasFlag(RtdFlag::reverseInclineLaunchAffectsReliability) && ride.mode == RideMode::reverseInclineLaunchedShuttle) { ride.unreliabilityFactor += 10; } - else if (ride.type == RIDE_TYPE_LOOPING_ROLLER_COASTER && ride.isPoweredLaunched()) + else if (rtd.HasFlag(RtdFlag::poweredLaunchAffectsReliability) && ride.isPoweredLaunched()) { ride.unreliabilityFactor += 5; } - else if (ride.type == RIDE_TYPE_CHAIRLIFT) + else if (rtd.HasFlag(RtdFlag::runningSpeedAffectsReliability)) { ride.unreliabilityFactor += (ride.speed * 2); } diff --git a/src/openrct2/ride/ShopItem.cpp b/src/openrct2/ride/ShopItem.cpp index 66afed501d..e7d64ed010 100644 --- a/src/openrct2/ride/ShopItem.cpp +++ b/src/openrct2/ride/ShopItem.cpp @@ -20,74 +20,74 @@ using namespace OpenRCT2; ShopItem& operator++(ShopItem& d, int) { - return d = (d == ShopItem::Count) ? ShopItem::Balloon : ShopItem(EnumValue(d) + 1); + return d = (d == ShopItem::count) ? ShopItem::balloon : ShopItem(EnumValue(d) + 1); } // clang-format off /** rct2: 0x00982164 (cost, base value, hot and cold value); 0x00982358 (default price) */ -constexpr ShopItemDescriptor ShopItems[EnumValue(ShopItem::Count)] = { +constexpr ShopItemDescriptor ShopItems[EnumValue(ShopItem::count)] = { // Item, Cost, Base value, Hot value, Cold value, Default price, Image, Price label, Singular, Plural, Indefinite, Display (in guest inventory), Shop Item Flag, Litter type, Consumption time, Discard Container, Peep thought price too much, Peep thought price good value, - /* ShopItem::Balloon */ { 0.30_GBP, 1.40_GBP, 1.40_GBP, 1.40_GBP, 0.90_GBP, SPR_SHOP_ITEM_BALLOON, { STR_SHOP_ITEM_PRICE_LABEL_BALLOON, STR_SHOP_ITEM_SINGULAR_BALLOON, STR_SHOP_ITEM_PLURAL_BALLOON, STR_SHOP_ITEM_INDEFINITE_BALLOON, STR_SHOP_ITEM_DISPLAY_BALLOON }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::BalloonMuch, PeepThoughtType::Balloon }, - /* ShopItem::Toy */ { 1.50_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 2.50_GBP, SPR_SHOP_ITEM_TOY, { STR_SHOP_ITEM_PRICE_LABEL_CUDDLY_TOY, STR_SHOP_ITEM_SINGULAR_CUDDLY_TOY, STR_SHOP_ITEM_PLURAL_CUDDLY_TOY, STR_SHOP_ITEM_INDEFINITE_CUDDLY_TOY, STR_SHOP_ITEM_DISPLAY_CUDDLY_TOY }, SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::ToyMuch, PeepThoughtType::Toy }, - /* ShopItem::Map */ { 0.10_GBP, 0.70_GBP, 0.70_GBP, 0.80_GBP, 0.60_GBP, SPR_SHOP_ITEM_MAP, { STR_SHOP_ITEM_PRICE_LABEL_PARK_MAP, STR_SHOP_ITEM_SINGULAR_PARK_MAP, STR_SHOP_ITEM_PLURAL_PARK_MAP, STR_SHOP_ITEM_INDEFINITE_PARK_MAP, STR_SHOP_ITEM_DISPLAY_PARK_MAP }, SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::MapMuch, PeepThoughtType::Map }, - /* ShopItem::Photo */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::PhotoMuch, PeepThoughtType::Photo }, - /* ShopItem::Umbrella */ { 2.00_GBP, 3.50_GBP, 2.50_GBP, 5.00_GBP, 2.50_GBP, SPR_SHOP_ITEM_UMBRELLA, { STR_SHOP_ITEM_PRICE_LABEL_UMBRELLA, STR_SHOP_ITEM_SINGULAR_UMBRELLA, STR_SHOP_ITEM_PLURAL_UMBRELLA, STR_SHOP_ITEM_INDEFINITE_UMBRELLA, STR_SHOP_ITEM_DISPLAY_UMBRELLA }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::UmbrellaMuch, PeepThoughtType::Umbrella }, - /* ShopItem::Drink */ { 0.30_GBP, 1.20_GBP, 2.00_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_DRINK, { STR_SHOP_ITEM_PRICE_LABEL_DRINK, STR_SHOP_ITEM_SINGULAR_DRINK, STR_SHOP_ITEM_PLURAL_DRINK, STR_SHOP_ITEM_INDEFINITE_DRINK, STR_SHOP_ITEM_DISPLAY_DRINK }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::Rubbish, 100, ShopItem::EmptyCan, PeepThoughtType::DrinkMuch, PeepThoughtType::Drink }, - /* ShopItem::Burger */ { 0.50_GBP, 1.90_GBP, 1.90_GBP, 2.20_GBP, 1.50_GBP, SPR_SHOP_ITEM_BURGER, { STR_SHOP_ITEM_PRICE_LABEL_BURGER, STR_SHOP_ITEM_SINGULAR_BURGER, STR_SHOP_ITEM_PLURAL_BURGER, STR_SHOP_ITEM_INDEFINITE_BURGER, STR_SHOP_ITEM_DISPLAY_BURGER }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 150, ShopItem::EmptyBurgerBox, PeepThoughtType::BurgerMuch, PeepThoughtType::Burger }, - /* ShopItem::Chips */ { 0.40_GBP, 1.60_GBP, 1.60_GBP, 1.80_GBP, 1.50_GBP, SPR_SHOP_ITEM_CHIPS, { STR_SHOP_ITEM_PRICE_LABEL_CHIPS, STR_SHOP_ITEM_SINGULAR_CHIPS, STR_SHOP_ITEM_PLURAL_CHIPS, STR_SHOP_ITEM_INDEFINITE_CHIPS, STR_SHOP_ITEM_DISPLAY_CHIPS }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 120, ShopItem::Rubbish, PeepThoughtType::ChipsMuch, PeepThoughtType::Chips }, - /* ShopItem::IceCream */ { 0.40_GBP, 1.00_GBP, 1.50_GBP, 0.60_GBP, 0.90_GBP, SPR_SHOP_ITEM_ICE_CREAM, { STR_SHOP_ITEM_PRICE_LABEL_ICE_CREAM, STR_SHOP_ITEM_SINGULAR_ICE_CREAM, STR_SHOP_ITEM_PLURAL_ICE_CREAM, STR_SHOP_ITEM_INDEFINITE_ICE_CREAM, STR_SHOP_ITEM_DISPLAY_ICE_CREAM }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 60, ShopItem::None, PeepThoughtType::IceCreamMuch, PeepThoughtType::IceCream }, - /* ShopItem::Candyfloss */ { 0.30_GBP, 0.90_GBP, 0.90_GBP, 0.60_GBP, 0.80_GBP, SPR_SHOP_ITEM_CANDYFLOSS, { STR_SHOP_ITEM_PRICE_LABEL_CANDYFLOSS, STR_SHOP_ITEM_SINGULAR_CANDYFLOSS, STR_SHOP_ITEM_PLURAL_CANDYFLOSS, STR_SHOP_ITEM_INDEFINITE_CANDYFLOSS, STR_SHOP_ITEM_DISPLAY_CANDYFLOSS }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 50, ShopItem::None, PeepThoughtType::CandyflossMuch, PeepThoughtType::Candyfloss }, - /* ShopItem::EmptyCan */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_CAN, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_CAN, STR_SHOP_ITEM_SINGULAR_EMPTY_CAN, STR_SHOP_ITEM_PLURAL_EMPTY_CAN, STR_SHOP_ITEM_INDEFINITE_EMPTY_CAN, STR_SHOP_ITEM_DISPLAY_EMPTY_CAN }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyCan, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Rubbish */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_RUBBISH, { STR_SHOP_ITEM_PRICE_LABEL_RUBBISH, STR_SHOP_ITEM_SINGULAR_RUBBISH, STR_SHOP_ITEM_PLURAL_RUBBISH, STR_SHOP_ITEM_INDEFINITE_RUBBISH, STR_SHOP_ITEM_DISPLAY_RUBBISH }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::EmptyBurgerBox */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BURGER_BOX, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BURGER_BOX, STR_SHOP_ITEM_SINGULAR_EMPTY_BURGER_BOX, STR_SHOP_ITEM_PLURAL_EMPTY_BURGER_BOX, STR_SHOP_ITEM_INDEFINITE_EMPTY_BURGER_BOX, STR_SHOP_ITEM_DISPLAY_EMPTY_BURGER_BOX }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::BurgerBox, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Pizza */ { 0.60_GBP, 2.10_GBP, 2.10_GBP, 2.50_GBP, 1.60_GBP, SPR_SHOP_ITEM_PIZZA, { STR_SHOP_ITEM_PRICE_LABEL_PIZZA, STR_SHOP_ITEM_SINGULAR_PIZZA, STR_SHOP_ITEM_PLURAL_PIZZA, STR_SHOP_ITEM_INDEFINITE_PIZZA, STR_SHOP_ITEM_DISPLAY_PIZZA }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 150, ShopItem::Rubbish, PeepThoughtType::PizzaMuch, PeepThoughtType::Pizza }, - /* ShopItem::Voucher */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_VOUCHER, { STR_SHOP_ITEM_PRICE_LABEL_VOUCHER, STR_SHOP_ITEM_SINGULAR_VOUCHER, STR_SHOP_ITEM_PLURAL_VOUCHER, STR_SHOP_ITEM_INDEFINITE_VOUCHER, STR_SHOP_ITEM_DISPLAY_VOUCHER }, 0, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Popcorn */ { 0.50_GBP, 1.30_GBP, 1.30_GBP, 1.10_GBP, 1.20_GBP, SPR_SHOP_ITEM_POPCORN, { STR_SHOP_ITEM_PRICE_LABEL_POPCORN, STR_SHOP_ITEM_SINGULAR_POPCORN, STR_SHOP_ITEM_PLURAL_POPCORN, STR_SHOP_ITEM_INDEFINITE_POPCORN, STR_SHOP_ITEM_DISPLAY_POPCORN }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 75, ShopItem::Rubbish, PeepThoughtType::PopcornMuch, PeepThoughtType::Popcorn }, - /* ShopItem::HotDog */ { 0.50_GBP, 1.70_GBP, 1.70_GBP, 2.00_GBP, 1.00_GBP, SPR_SHOP_ITEM_HOT_DOG, { STR_SHOP_ITEM_PRICE_LABEL_HOT_DOG, STR_SHOP_ITEM_SINGULAR_HOT_DOG, STR_SHOP_ITEM_PLURAL_HOT_DOG, STR_SHOP_ITEM_INDEFINITE_HOT_DOG, STR_SHOP_ITEM_DISPLAY_HOT_DOG }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 133, ShopItem::None, PeepThoughtType::HotDogMuch, PeepThoughtType::HotDog }, - /* ShopItem::Tentacle */ { 1.10_GBP, 2.20_GBP, 2.00_GBP, 1.80_GBP, 1.50_GBP, SPR_SHOP_ITEM_TENTACLE, { STR_SHOP_ITEM_PRICE_LABEL_TENTACLE, STR_SHOP_ITEM_SINGULAR_TENTACLE, STR_SHOP_ITEM_PLURAL_TENTACLE, STR_SHOP_ITEM_INDEFINITE_TENTACLE, STR_SHOP_ITEM_DISPLAY_TENTACLE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 110, ShopItem::None, PeepThoughtType::TentacleMuch, PeepThoughtType::Tentacle }, - /* ShopItem::Hat */ { 0.90_GBP, 2.70_GBP, 3.20_GBP, 2.40_GBP, 1.50_GBP, SPR_SHOP_ITEM_HAT, { STR_SHOP_ITEM_PRICE_LABEL_HAT, STR_SHOP_ITEM_SINGULAR_HAT, STR_SHOP_ITEM_PLURAL_HAT, STR_SHOP_ITEM_INDEFINITE_HAT, STR_SHOP_ITEM_DISPLAY_HAT }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::HatMuch, PeepThoughtType::Hat }, - /* ShopItem::ToffeeApple */ { 0.40_GBP, 1.00_GBP, 1.00_GBP, 1.00_GBP, 0.70_GBP, SPR_SHOP_ITEM_TOFFEE_APPLE, { STR_SHOP_ITEM_PRICE_LABEL_TOFFEE_APPLE, STR_SHOP_ITEM_SINGULAR_TOFFEE_APPLE, STR_SHOP_ITEM_PLURAL_TOFFEE_APPLE, STR_SHOP_ITEM_INDEFINITE_TOFFEE_APPLE, STR_SHOP_ITEM_DISPLAY_TOFFEE_APPLE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 50, ShopItem::None, PeepThoughtType::ToffeeAppleMuch, PeepThoughtType::ToffeeApple }, - /* ShopItem::TShirt */ { 2.00_GBP, 3.70_GBP, 3.70_GBP, 3.70_GBP, 3.00_GBP, SPR_SHOP_ITEM_TSHIRT, { STR_SHOP_ITEM_PRICE_LABEL_T_SHIRT, STR_SHOP_ITEM_SINGULAR_T_SHIRT, STR_SHOP_ITEM_PLURAL_T_SHIRT, STR_SHOP_ITEM_INDEFINITE_T_SHIRT, STR_SHOP_ITEM_DISPLAY_T_SHIRT }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::TshirtMuch, PeepThoughtType::Tshirt }, - /* ShopItem::Doughnut */ { 0.40_GBP, 0.80_GBP, 0.70_GBP, 1.00_GBP, 0.70_GBP, SPR_SHOP_ITEM_DOUGHNUT, { STR_SHOP_ITEM_PRICE_LABEL_DOUGHNUT, STR_SHOP_ITEM_SINGULAR_DOUGHNUT, STR_SHOP_ITEM_PLURAL_DOUGHNUT, STR_SHOP_ITEM_INDEFINITE_DOUGHNUT, STR_SHOP_ITEM_DISPLAY_DOUGHNUT }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 80, ShopItem::None, PeepThoughtType::DoughnutMuch, PeepThoughtType::Doughnut }, - /* ShopItem::Coffee */ { 0.30_GBP, 1.10_GBP, 1.50_GBP, 2.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_COFFEE, { STR_SHOP_ITEM_PRICE_LABEL_COFFEE, STR_SHOP_ITEM_SINGULAR_COFFEE, STR_SHOP_ITEM_PLURAL_COFFEE, STR_SHOP_ITEM_INDEFINITE_COFFEE, STR_SHOP_ITEM_DISPLAY_COFFEE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::Rubbish, 90, ShopItem::EmptyCup, PeepThoughtType::CoffeeMuch, PeepThoughtType::Coffee }, - /* ShopItem::EmptyCup */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_CUP, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_CUP, STR_SHOP_ITEM_SINGULAR_EMPTY_CUP, STR_SHOP_ITEM_PLURAL_EMPTY_CUP, STR_SHOP_ITEM_INDEFINITE_EMPTY_CUP, STR_SHOP_ITEM_DISPLAY_EMPTY_CUP }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyCup, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Chicken */ { 0.50_GBP, 1.90_GBP, 1.90_GBP, 2.20_GBP, 1.50_GBP, SPR_SHOP_ITEM_CHICKEN, { STR_SHOP_ITEM_PRICE_LABEL_FRIED_CHICKEN, STR_SHOP_ITEM_SINGULAR_FRIED_CHICKEN, STR_SHOP_ITEM_PLURAL_FRIED_CHICKEN, STR_SHOP_ITEM_INDEFINITE_FRIED_CHICKEN, STR_SHOP_ITEM_DISPLAY_FRIED_CHICKEN }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::EmptyBox, 170, ShopItem::EmptyBox, PeepThoughtType::ChickenMuch, PeepThoughtType::Chicken }, - /* ShopItem::Lemonade */ { 0.40_GBP, 1.10_GBP, 2.10_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_LEMONADE, { STR_SHOP_ITEM_PRICE_LABEL_LEMONADE, STR_SHOP_ITEM_SINGULAR_LEMONADE, STR_SHOP_ITEM_PLURAL_LEMONADE, STR_SHOP_ITEM_INDEFINITE_LEMONADE, STR_SHOP_ITEM_DISPLAY_LEMONADE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::EmptyBottle, 115, ShopItem::EmptyBottle, PeepThoughtType::LemonadeMuch, PeepThoughtType::Lemonade }, - /* ShopItem::EmptyBox */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOX, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOX, STR_SHOP_ITEM_SINGULAR_EMPTY_BOX, STR_SHOP_ITEM_PLURAL_EMPTY_BOX, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOX, STR_SHOP_ITEM_DISPLAY_EMPTY_BOX }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBox, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::EmptyBottle */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOTTLE, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOTTLE, STR_SHOP_ITEM_SINGULAR_EMPTY_BOTTLE, STR_SHOP_ITEM_PLURAL_EMPTY_BOTTLE, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOTTLE, STR_SHOP_ITEM_DISPLAY_EMPTY_BOTTLE }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBottle, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 28 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 29 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 30 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Admission */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Photo2 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO2, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo2Much, PeepThoughtType::Photo2 }, - /* ShopItem::Photo3 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO3, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo3Much, PeepThoughtType::Photo3 }, - /* ShopItem::Photo4 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO4, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo4Much, PeepThoughtType::Photo4 }, - /* ShopItem::Pretzel */ { 0.50_GBP, 1.10_GBP, 1.10_GBP, 1.10_GBP, 1.10_GBP, SPR_SHOP_ITEM_PRETZEL, { STR_SHOP_ITEM_PRICE_LABEL_PRETZEL, STR_SHOP_ITEM_SINGULAR_PRETZEL, STR_SHOP_ITEM_PLURAL_PRETZEL, STR_SHOP_ITEM_INDEFINITE_PRETZEL, STR_SHOP_ITEM_DISPLAY_PRETZEL }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 70, ShopItem::None, PeepThoughtType::PretzelMuch, PeepThoughtType::Pretzel }, - /* ShopItem::Chocolate */ { 0.40_GBP, 1.30_GBP, 1.30_GBP, 2.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_CHOCOLATE, { STR_SHOP_ITEM_PRICE_LABEL_HOT_CHOCOLATE, STR_SHOP_ITEM_SINGULAR_HOT_CHOCOLATE, STR_SHOP_ITEM_PLURAL_HOT_CHOCOLATE, STR_SHOP_ITEM_INDEFINITE_HOT_CHOCOLATE, STR_SHOP_ITEM_DISPLAY_HOT_CHOCOLATE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::Rubbish, 85, ShopItem::EmptyCup, PeepThoughtType::HotChocolateMuch, PeepThoughtType::HotChocolate }, - /* ShopItem::IcedTea */ { 0.30_GBP, 1.00_GBP, 2.00_GBP, 1.00_GBP, 1.10_GBP, SPR_SHOP_ITEM_ICED_TEA, { STR_SHOP_ITEM_PRICE_LABEL_ICED_TEA, STR_SHOP_ITEM_SINGULAR_ICED_TEA, STR_SHOP_ITEM_PLURAL_ICED_TEA, STR_SHOP_ITEM_INDEFINITE_ICED_TEA, STR_SHOP_ITEM_DISPLAY_ICED_TEA }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::Rubbish, 95, ShopItem::EmptyCup, PeepThoughtType::IcedTeaMuch, PeepThoughtType::IcedTea }, - /* ShopItem::FunnelCake */ { 0.50_GBP, 1.30_GBP, 1.10_GBP, 1.40_GBP, 1.20_GBP, SPR_SHOP_ITEM_FUNNEL_CAKE, { STR_SHOP_ITEM_PRICE_LABEL_FUNNEL_CAKE, STR_SHOP_ITEM_SINGULAR_FUNNEL_CAKE, STR_SHOP_ITEM_PLURAL_FUNNEL_CAKE, STR_SHOP_ITEM_INDEFINITE_FUNNEL_CAKE, STR_SHOP_ITEM_DISPLAY_FUNNEL_CAKE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 90, ShopItem::None, PeepThoughtType::FunnelCakeMuch, PeepThoughtType::FunnelCake }, - /* ShopItem::Sunglasses */ { 0.80_GBP, 1.50_GBP, 2.00_GBP, 1.20_GBP, 1.50_GBP, SPR_SHOP_ITEM_SUNGLASSES, { STR_SHOP_ITEM_PRICE_LABEL_SUNGLASSES, STR_SHOP_ITEM_SINGULAR_SUNGLASSES, STR_SHOP_ITEM_PLURAL_SUNGLASSES, STR_SHOP_ITEM_INDEFINITE_SUNGLASSES, STR_SHOP_ITEM_DISPLAY_SUNGLASSES }, SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::SunglassesMuch, PeepThoughtType::Sunglasses }, - /* ShopItem::BeefNoodles */ { 0.70_GBP, 1.70_GBP, 1.70_GBP, 2.00_GBP, 1.50_GBP, SPR_SHOP_ITEM_BEEF_NOODLES, { STR_SHOP_ITEM_PRICE_LABEL_BEEF_NOODLES, STR_SHOP_ITEM_SINGULAR_BEEF_NOODLES, STR_SHOP_ITEM_PLURAL_BEEF_NOODLES, STR_SHOP_ITEM_INDEFINITE_BEEF_NOODLES, STR_SHOP_ITEM_DISPLAY_BEEF_NOODLES }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 130, ShopItem::EmptyBowlBlue, PeepThoughtType::BeefNoodlesMuch, PeepThoughtType::BeefNoodles }, - /* ShopItem::FriedRiceNoodles */ { 0.60_GBP, 1.70_GBP, 1.70_GBP, 2.00_GBP, 1.50_GBP, SPR_SHOP_ITEM_FRIED_RICE_NOODLES, { STR_SHOP_ITEM_PRICE_LABEL_FRIED_RICE_NOODLES, STR_SHOP_ITEM_SINGULAR_FRIED_RICE_NOODLES, STR_SHOP_ITEM_PLURAL_FRIED_RICE_NOODLES, STR_SHOP_ITEM_INDEFINITE_FRIED_RICE_NOODLES, STR_SHOP_ITEM_DISPLAY_FRIED_RICE_NOODLES }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 120, ShopItem::EmptyBowlBlue, PeepThoughtType::FriedRiceNoodlesMuch, PeepThoughtType::FriedRiceNoodles }, - /* ShopItem::WontonSoup */ { 0.40_GBP, 1.30_GBP, 1.30_GBP, 1.50_GBP, 1.50_GBP, SPR_SHOP_ITEM_WONTON_SOUP, { STR_SHOP_ITEM_PRICE_LABEL_WONTON_SOUP, STR_SHOP_ITEM_SINGULAR_WONTON_SOUP, STR_SHOP_ITEM_PLURAL_WONTON_SOUP, STR_SHOP_ITEM_INDEFINITE_WONTON_SOUP, STR_SHOP_ITEM_DISPLAY_WONTON_SOUP }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 100, ShopItem::EmptyBowlRed, PeepThoughtType::WontonSoupMuch, PeepThoughtType::WontonSoup }, - /* ShopItem::MeatballSoup */ { 0.50_GBP, 1.40_GBP, 1.40_GBP, 1.60_GBP, 1.50_GBP, SPR_SHOP_ITEM_MEATBALL_SOUP, { STR_SHOP_ITEM_PRICE_LABEL_MEATBALL_SOUP, STR_SHOP_ITEM_SINGULAR_MEATBALL_SOUP, STR_SHOP_ITEM_PLURAL_MEATBALL_SOUP, STR_SHOP_ITEM_INDEFINITE_MEATBALL_SOUP, STR_SHOP_ITEM_DISPLAY_MEATBALL_SOUP }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 110, ShopItem::EmptyBowlRed, PeepThoughtType::MeatballSoupMuch, PeepThoughtType::MeatballSoup }, - /* ShopItem::FruitJuice */ { 0.40_GBP, 1.10_GBP, 1.90_GBP, 1.10_GBP, 1.20_GBP, SPR_SHOP_ITEM_FRUIT_JUICE, { STR_SHOP_ITEM_PRICE_LABEL_FRUIT_JUICE, STR_SHOP_ITEM_SINGULAR_FRUIT_JUICE, STR_SHOP_ITEM_PLURAL_FRUIT_JUICE, STR_SHOP_ITEM_INDEFINITE_FRUIT_JUICE, STR_SHOP_ITEM_DISPLAY_FRUIT_JUICE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::Rubbish, 110, ShopItem::EmptyJuiceCup, PeepThoughtType::FruitJuiceMuch, PeepThoughtType::FruitJuice }, - /* ShopItem::SoybeanMilk */ { 0.40_GBP, 1.00_GBP, 1.40_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_SOYBEAN_MILK, { STR_SHOP_ITEM_PRICE_LABEL_SOYBEAN_MILK, STR_SHOP_ITEM_SINGULAR_SOYBEAN_MILK, STR_SHOP_ITEM_PLURAL_SOYBEAN_MILK, STR_SHOP_ITEM_INDEFINITE_SOYBEAN_MILK, STR_SHOP_ITEM_DISPLAY_SOYBEAN_MILK }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::Rubbish, 90, ShopItem::EmptyDrinkCarton, PeepThoughtType::SoybeanMilkMuch, PeepThoughtType::SoybeanMilk }, - /* ShopItem::Sujeonggwa */ { 0.30_GBP, 1.10_GBP, 1.40_GBP, 1.10_GBP, 1.20_GBP, SPR_SHOP_ITEM_SUJEONGGWA, { STR_SHOP_ITEM_PRICE_LABEL_SUJONGKWA, STR_SHOP_ITEM_SINGULAR_SUJONGKWA, STR_SHOP_ITEM_PLURAL_SUJONGKWA, STR_SHOP_ITEM_INDEFINITE_SUJONGKWA, STR_SHOP_ITEM_DISPLAY_SUJONGKWA }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::Rubbish, 100, ShopItem::EmptyDrinkCarton, PeepThoughtType::SujongkwaMuch, PeepThoughtType::Sujongkwa }, - /* ShopItem::SubSandwich */ { 0.50_GBP, 1.90_GBP, 1.90_GBP, 1.70_GBP, 1.50_GBP, SPR_SHOP_ITEM_SUB_SANDWICH, { STR_SHOP_ITEM_PRICE_LABEL_SUB_SANDWICH, STR_SHOP_ITEM_SINGULAR_SUB_SANDWICH, STR_SHOP_ITEM_PLURAL_SUB_SANDWICH, STR_SHOP_ITEM_INDEFINITE_SUB_SANDWICH, STR_SHOP_ITEM_DISPLAY_SUB_SANDWICH }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 130, ShopItem::None, PeepThoughtType::SubSandwichMuch, PeepThoughtType::SubSandwich }, - /* ShopItem::Cookie */ { 0.40_GBP, 0.80_GBP, 0.80_GBP, 0.80_GBP, 0.70_GBP, SPR_SHOP_ITEM_COOKIE, { STR_SHOP_ITEM_PRICE_LABEL_COOKIE, STR_SHOP_ITEM_SINGULAR_COOKIE, STR_SHOP_ITEM_PLURAL_COOKIE, STR_SHOP_ITEM_INDEFINITE_COOKIE, STR_SHOP_ITEM_DISPLAY_COOKIE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 75, ShopItem::None, PeepThoughtType::CookieMuch, PeepThoughtType::Cookie }, - /* ShopItem::EmptyBowlRed */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOWL_RED, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOWL_RED, STR_SHOP_ITEM_SINGULAR_EMPTY_BOWL_RED, STR_SHOP_ITEM_PLURAL_EMPTY_BOWL_RED, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOWL_RED, STR_SHOP_ITEM_DISPLAY_EMPTY_BOWL_RED }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBowlRed, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::EmptyDrinkCarton */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_DRINK_CARTON, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_SINGULAR_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_PLURAL_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_INDEFINITE_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_DISPLAY_EMPTY_DRINK_CARTON }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyDrinkCarton, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::EmptyJuiceCup */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_JUICE_CUP, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_JUICE_CUP, STR_SHOP_ITEM_SINGULAR_EMPTY_JUICE_CUP, STR_SHOP_ITEM_PLURAL_EMPTY_JUICE_CUP, STR_SHOP_ITEM_INDEFINITE_EMPTY_JUICE_CUP, STR_SHOP_ITEM_DISPLAY_EMPTY_JUICE_CUP }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyJuiceCup, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::RoastSausage */ { 0.50_GBP, 1.60_GBP, 1.60_GBP, 2.00_GBP, 1.50_GBP, SPR_SHOP_ITEM_ROAST_SAUSAGE, { STR_SHOP_ITEM_PRICE_LABEL_ROAST_SAUSAGE, STR_SHOP_ITEM_SINGULAR_ROAST_SAUSAGE, STR_SHOP_ITEM_PLURAL_ROAST_SAUSAGE, STR_SHOP_ITEM_INDEFINITE_ROAST_SAUSAGE, STR_SHOP_ITEM_DISPLAY_ROAST_SAUSAGE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::Rubbish, 115, ShopItem::None, PeepThoughtType::RoastSausageMuch, PeepThoughtType::RoastSausage }, - /* ShopItem::EmptyBowlBlue */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOWL_BLUE, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_SINGULAR_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_PLURAL_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_DISPLAY_EMPTY_BOWL_BLUE }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBowlBlue, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::balloon */ { 0.30_GBP, 1.40_GBP, 1.40_GBP, 1.40_GBP, 0.90_GBP, SPR_SHOP_ITEM_BALLOON, { STR_SHOP_ITEM_PRICE_LABEL_BALLOON, STR_SHOP_ITEM_SINGULAR_BALLOON, STR_SHOP_ITEM_PLURAL_BALLOON, STR_SHOP_ITEM_INDEFINITE_BALLOON, STR_SHOP_ITEM_DISPLAY_BALLOON }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::BalloonMuch, PeepThoughtType::Balloon }, + /* ShopItem::toy */ { 1.50_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 2.50_GBP, SPR_SHOP_ITEM_TOY, { STR_SHOP_ITEM_PRICE_LABEL_CUDDLY_TOY, STR_SHOP_ITEM_SINGULAR_CUDDLY_TOY, STR_SHOP_ITEM_PLURAL_CUDDLY_TOY, STR_SHOP_ITEM_INDEFINITE_CUDDLY_TOY, STR_SHOP_ITEM_DISPLAY_CUDDLY_TOY }, SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::ToyMuch, PeepThoughtType::Toy }, + /* ShopItem::map */ { 0.10_GBP, 0.70_GBP, 0.70_GBP, 0.80_GBP, 0.60_GBP, SPR_SHOP_ITEM_MAP, { STR_SHOP_ITEM_PRICE_LABEL_PARK_MAP, STR_SHOP_ITEM_SINGULAR_PARK_MAP, STR_SHOP_ITEM_PLURAL_PARK_MAP, STR_SHOP_ITEM_INDEFINITE_PARK_MAP, STR_SHOP_ITEM_DISPLAY_PARK_MAP }, SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::MapMuch, PeepThoughtType::Map }, + /* ShopItem::photo */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::PhotoMuch, PeepThoughtType::Photo }, + /* ShopItem::umbrella */ { 2.00_GBP, 3.50_GBP, 2.50_GBP, 5.00_GBP, 2.50_GBP, SPR_SHOP_ITEM_UMBRELLA, { STR_SHOP_ITEM_PRICE_LABEL_UMBRELLA, STR_SHOP_ITEM_SINGULAR_UMBRELLA, STR_SHOP_ITEM_PLURAL_UMBRELLA, STR_SHOP_ITEM_INDEFINITE_UMBRELLA, STR_SHOP_ITEM_DISPLAY_UMBRELLA }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::UmbrellaMuch, PeepThoughtType::Umbrella }, + /* ShopItem::drink */ { 0.30_GBP, 1.20_GBP, 2.00_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_DRINK, { STR_SHOP_ITEM_PRICE_LABEL_DRINK, STR_SHOP_ITEM_SINGULAR_DRINK, STR_SHOP_ITEM_PLURAL_DRINK, STR_SHOP_ITEM_INDEFINITE_DRINK, STR_SHOP_ITEM_DISPLAY_DRINK }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::rubbish, 100, ShopItem::emptyCan, PeepThoughtType::DrinkMuch, PeepThoughtType::Drink }, + /* ShopItem::burger */ { 0.50_GBP, 1.90_GBP, 1.90_GBP, 2.20_GBP, 1.50_GBP, SPR_SHOP_ITEM_BURGER, { STR_SHOP_ITEM_PRICE_LABEL_BURGER, STR_SHOP_ITEM_SINGULAR_BURGER, STR_SHOP_ITEM_PLURAL_BURGER, STR_SHOP_ITEM_INDEFINITE_BURGER, STR_SHOP_ITEM_DISPLAY_BURGER }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 150, ShopItem::emptyBurgerBox, PeepThoughtType::BurgerMuch, PeepThoughtType::Burger }, + /* ShopItem::chips */ { 0.40_GBP, 1.60_GBP, 1.60_GBP, 1.80_GBP, 1.50_GBP, SPR_SHOP_ITEM_CHIPS, { STR_SHOP_ITEM_PRICE_LABEL_CHIPS, STR_SHOP_ITEM_SINGULAR_CHIPS, STR_SHOP_ITEM_PLURAL_CHIPS, STR_SHOP_ITEM_INDEFINITE_CHIPS, STR_SHOP_ITEM_DISPLAY_CHIPS }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 120, ShopItem::rubbish, PeepThoughtType::ChipsMuch, PeepThoughtType::Chips }, + /* ShopItem::iceCream */ { 0.40_GBP, 1.00_GBP, 1.50_GBP, 0.60_GBP, 0.90_GBP, SPR_SHOP_ITEM_ICE_CREAM, { STR_SHOP_ITEM_PRICE_LABEL_ICE_CREAM, STR_SHOP_ITEM_SINGULAR_ICE_CREAM, STR_SHOP_ITEM_PLURAL_ICE_CREAM, STR_SHOP_ITEM_INDEFINITE_ICE_CREAM, STR_SHOP_ITEM_DISPLAY_ICE_CREAM }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 60, ShopItem::none, PeepThoughtType::IceCreamMuch, PeepThoughtType::IceCream }, + /* ShopItem::candyfloss */ { 0.30_GBP, 0.90_GBP, 0.90_GBP, 0.60_GBP, 0.80_GBP, SPR_SHOP_ITEM_CANDYFLOSS, { STR_SHOP_ITEM_PRICE_LABEL_CANDYFLOSS, STR_SHOP_ITEM_SINGULAR_CANDYFLOSS, STR_SHOP_ITEM_PLURAL_CANDYFLOSS, STR_SHOP_ITEM_INDEFINITE_CANDYFLOSS, STR_SHOP_ITEM_DISPLAY_CANDYFLOSS }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 50, ShopItem::none, PeepThoughtType::CandyflossMuch, PeepThoughtType::Candyfloss }, + /* ShopItem::emptyCan */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_CAN, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_CAN, STR_SHOP_ITEM_SINGULAR_EMPTY_CAN, STR_SHOP_ITEM_PLURAL_EMPTY_CAN, STR_SHOP_ITEM_INDEFINITE_EMPTY_CAN, STR_SHOP_ITEM_DISPLAY_EMPTY_CAN }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyCan, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::rubbish */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_RUBBISH, { STR_SHOP_ITEM_PRICE_LABEL_RUBBISH, STR_SHOP_ITEM_SINGULAR_RUBBISH, STR_SHOP_ITEM_PLURAL_RUBBISH, STR_SHOP_ITEM_INDEFINITE_RUBBISH, STR_SHOP_ITEM_DISPLAY_RUBBISH }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::emptyBurgerBox */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BURGER_BOX, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BURGER_BOX, STR_SHOP_ITEM_SINGULAR_EMPTY_BURGER_BOX, STR_SHOP_ITEM_PLURAL_EMPTY_BURGER_BOX, STR_SHOP_ITEM_INDEFINITE_EMPTY_BURGER_BOX, STR_SHOP_ITEM_DISPLAY_EMPTY_BURGER_BOX }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::burgerBox, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::pizza */ { 0.60_GBP, 2.10_GBP, 2.10_GBP, 2.50_GBP, 1.60_GBP, SPR_SHOP_ITEM_PIZZA, { STR_SHOP_ITEM_PRICE_LABEL_PIZZA, STR_SHOP_ITEM_SINGULAR_PIZZA, STR_SHOP_ITEM_PLURAL_PIZZA, STR_SHOP_ITEM_INDEFINITE_PIZZA, STR_SHOP_ITEM_DISPLAY_PIZZA }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 150, ShopItem::rubbish, PeepThoughtType::PizzaMuch, PeepThoughtType::Pizza }, + /* ShopItem::voucher */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_VOUCHER, { STR_SHOP_ITEM_PRICE_LABEL_VOUCHER, STR_SHOP_ITEM_SINGULAR_VOUCHER, STR_SHOP_ITEM_PLURAL_VOUCHER, STR_SHOP_ITEM_INDEFINITE_VOUCHER, STR_SHOP_ITEM_DISPLAY_VOUCHER }, 0, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::popcorn */ { 0.50_GBP, 1.30_GBP, 1.30_GBP, 1.10_GBP, 1.20_GBP, SPR_SHOP_ITEM_POPCORN, { STR_SHOP_ITEM_PRICE_LABEL_POPCORN, STR_SHOP_ITEM_SINGULAR_POPCORN, STR_SHOP_ITEM_PLURAL_POPCORN, STR_SHOP_ITEM_INDEFINITE_POPCORN, STR_SHOP_ITEM_DISPLAY_POPCORN }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 75, ShopItem::rubbish, PeepThoughtType::PopcornMuch, PeepThoughtType::Popcorn }, + /* ShopItem::hotDog */ { 0.50_GBP, 1.70_GBP, 1.70_GBP, 2.00_GBP, 1.00_GBP, SPR_SHOP_ITEM_HOT_DOG, { STR_SHOP_ITEM_PRICE_LABEL_HOT_DOG, STR_SHOP_ITEM_SINGULAR_HOT_DOG, STR_SHOP_ITEM_PLURAL_HOT_DOG, STR_SHOP_ITEM_INDEFINITE_HOT_DOG, STR_SHOP_ITEM_DISPLAY_HOT_DOG }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 133, ShopItem::none, PeepThoughtType::HotDogMuch, PeepThoughtType::HotDog }, + /* ShopItem::tentacle */ { 1.10_GBP, 2.20_GBP, 2.00_GBP, 1.80_GBP, 1.50_GBP, SPR_SHOP_ITEM_TENTACLE, { STR_SHOP_ITEM_PRICE_LABEL_TENTACLE, STR_SHOP_ITEM_SINGULAR_TENTACLE, STR_SHOP_ITEM_PLURAL_TENTACLE, STR_SHOP_ITEM_INDEFINITE_TENTACLE, STR_SHOP_ITEM_DISPLAY_TENTACLE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 110, ShopItem::none, PeepThoughtType::TentacleMuch, PeepThoughtType::Tentacle }, + /* ShopItem::hat */ { 0.90_GBP, 2.70_GBP, 3.20_GBP, 2.40_GBP, 1.50_GBP, SPR_SHOP_ITEM_HAT, { STR_SHOP_ITEM_PRICE_LABEL_HAT, STR_SHOP_ITEM_SINGULAR_HAT, STR_SHOP_ITEM_PLURAL_HAT, STR_SHOP_ITEM_INDEFINITE_HAT, STR_SHOP_ITEM_DISPLAY_HAT }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::HatMuch, PeepThoughtType::Hat }, + /* ShopItem::toffeeApple */ { 0.40_GBP, 1.00_GBP, 1.00_GBP, 1.00_GBP, 0.70_GBP, SPR_SHOP_ITEM_TOFFEE_APPLE, { STR_SHOP_ITEM_PRICE_LABEL_TOFFEE_APPLE, STR_SHOP_ITEM_SINGULAR_TOFFEE_APPLE, STR_SHOP_ITEM_PLURAL_TOFFEE_APPLE, STR_SHOP_ITEM_INDEFINITE_TOFFEE_APPLE, STR_SHOP_ITEM_DISPLAY_TOFFEE_APPLE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 50, ShopItem::none, PeepThoughtType::ToffeeAppleMuch, PeepThoughtType::ToffeeApple }, + /* ShopItem::tShirt */ { 2.00_GBP, 3.70_GBP, 3.70_GBP, 3.70_GBP, 3.00_GBP, SPR_SHOP_ITEM_TSHIRT, { STR_SHOP_ITEM_PRICE_LABEL_T_SHIRT, STR_SHOP_ITEM_SINGULAR_T_SHIRT, STR_SHOP_ITEM_PLURAL_T_SHIRT, STR_SHOP_ITEM_INDEFINITE_T_SHIRT, STR_SHOP_ITEM_DISPLAY_T_SHIRT }, SHOP_ITEM_FLAG_IS_SOUVENIR | SHOP_ITEM_FLAG_IS_RECOLOURABLE, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::TshirtMuch, PeepThoughtType::Tshirt }, + /* ShopItem::doughnut */ { 0.40_GBP, 0.80_GBP, 0.70_GBP, 1.00_GBP, 0.70_GBP, SPR_SHOP_ITEM_DOUGHNUT, { STR_SHOP_ITEM_PRICE_LABEL_DOUGHNUT, STR_SHOP_ITEM_SINGULAR_DOUGHNUT, STR_SHOP_ITEM_PLURAL_DOUGHNUT, STR_SHOP_ITEM_INDEFINITE_DOUGHNUT, STR_SHOP_ITEM_DISPLAY_DOUGHNUT }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 80, ShopItem::none, PeepThoughtType::DoughnutMuch, PeepThoughtType::Doughnut }, + /* ShopItem::coffee */ { 0.30_GBP, 1.10_GBP, 1.50_GBP, 2.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_COFFEE, { STR_SHOP_ITEM_PRICE_LABEL_COFFEE, STR_SHOP_ITEM_SINGULAR_COFFEE, STR_SHOP_ITEM_PLURAL_COFFEE, STR_SHOP_ITEM_INDEFINITE_COFFEE, STR_SHOP_ITEM_DISPLAY_COFFEE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::rubbish, 90, ShopItem::emptyCup, PeepThoughtType::CoffeeMuch, PeepThoughtType::Coffee }, + /* ShopItem::emptyCup */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_CUP, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_CUP, STR_SHOP_ITEM_SINGULAR_EMPTY_CUP, STR_SHOP_ITEM_PLURAL_EMPTY_CUP, STR_SHOP_ITEM_INDEFINITE_EMPTY_CUP, STR_SHOP_ITEM_DISPLAY_EMPTY_CUP }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyCup, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::chicken */ { 0.50_GBP, 1.90_GBP, 1.90_GBP, 2.20_GBP, 1.50_GBP, SPR_SHOP_ITEM_CHICKEN, { STR_SHOP_ITEM_PRICE_LABEL_FRIED_CHICKEN, STR_SHOP_ITEM_SINGULAR_FRIED_CHICKEN, STR_SHOP_ITEM_PLURAL_FRIED_CHICKEN, STR_SHOP_ITEM_INDEFINITE_FRIED_CHICKEN, STR_SHOP_ITEM_DISPLAY_FRIED_CHICKEN }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::emptyBox, 170, ShopItem::emptyBox, PeepThoughtType::ChickenMuch, PeepThoughtType::Chicken }, + /* ShopItem::lemonade */ { 0.40_GBP, 1.10_GBP, 2.10_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_LEMONADE, { STR_SHOP_ITEM_PRICE_LABEL_LEMONADE, STR_SHOP_ITEM_SINGULAR_LEMONADE, STR_SHOP_ITEM_PLURAL_LEMONADE, STR_SHOP_ITEM_INDEFINITE_LEMONADE, STR_SHOP_ITEM_DISPLAY_LEMONADE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::emptyBottle, 115, ShopItem::emptyBottle, PeepThoughtType::LemonadeMuch, PeepThoughtType::Lemonade }, + /* ShopItem::emptyBox */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOX, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOX, STR_SHOP_ITEM_SINGULAR_EMPTY_BOX, STR_SHOP_ITEM_PLURAL_EMPTY_BOX, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOX, STR_SHOP_ITEM_DISPLAY_EMPTY_BOX }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyBox, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::emptyBottle */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOTTLE, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOTTLE, STR_SHOP_ITEM_SINGULAR_EMPTY_BOTTLE, STR_SHOP_ITEM_PLURAL_EMPTY_BOTTLE, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOTTLE, STR_SHOP_ITEM_DISPLAY_EMPTY_BOTTLE }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyBottle, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* 28 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::vomit, 0xFF, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* 29 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::vomit, 0xFF, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* 30 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::vomit, 0xFF, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::admission */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::vomit, 0xFF, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::photo2 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO2, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::Photo2Much, PeepThoughtType::Photo2 }, + /* ShopItem::photo3 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO3, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::Photo3Much, PeepThoughtType::Photo3 }, + /* ShopItem::photo4 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO4, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::Photo4Much, PeepThoughtType::Photo4 }, + /* ShopItem::pretzel */ { 0.50_GBP, 1.10_GBP, 1.10_GBP, 1.10_GBP, 1.10_GBP, SPR_SHOP_ITEM_PRETZEL, { STR_SHOP_ITEM_PRICE_LABEL_PRETZEL, STR_SHOP_ITEM_SINGULAR_PRETZEL, STR_SHOP_ITEM_PLURAL_PRETZEL, STR_SHOP_ITEM_INDEFINITE_PRETZEL, STR_SHOP_ITEM_DISPLAY_PRETZEL }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 70, ShopItem::none, PeepThoughtType::PretzelMuch, PeepThoughtType::Pretzel }, + /* ShopItem::chocolate */ { 0.40_GBP, 1.30_GBP, 1.30_GBP, 2.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_CHOCOLATE, { STR_SHOP_ITEM_PRICE_LABEL_HOT_CHOCOLATE, STR_SHOP_ITEM_SINGULAR_HOT_CHOCOLATE, STR_SHOP_ITEM_PLURAL_HOT_CHOCOLATE, STR_SHOP_ITEM_INDEFINITE_HOT_CHOCOLATE, STR_SHOP_ITEM_DISPLAY_HOT_CHOCOLATE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::rubbish, 85, ShopItem::emptyCup, PeepThoughtType::HotChocolateMuch, PeepThoughtType::HotChocolate }, + /* ShopItem::icedTea */ { 0.30_GBP, 1.00_GBP, 2.00_GBP, 1.00_GBP, 1.10_GBP, SPR_SHOP_ITEM_ICED_TEA, { STR_SHOP_ITEM_PRICE_LABEL_ICED_TEA, STR_SHOP_ITEM_SINGULAR_ICED_TEA, STR_SHOP_ITEM_PLURAL_ICED_TEA, STR_SHOP_ITEM_INDEFINITE_ICED_TEA, STR_SHOP_ITEM_DISPLAY_ICED_TEA }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::rubbish, 95, ShopItem::emptyCup, PeepThoughtType::IcedTeaMuch, PeepThoughtType::IcedTea }, + /* ShopItem::funnelCake */ { 0.50_GBP, 1.30_GBP, 1.10_GBP, 1.40_GBP, 1.20_GBP, SPR_SHOP_ITEM_FUNNEL_CAKE, { STR_SHOP_ITEM_PRICE_LABEL_FUNNEL_CAKE, STR_SHOP_ITEM_SINGULAR_FUNNEL_CAKE, STR_SHOP_ITEM_PLURAL_FUNNEL_CAKE, STR_SHOP_ITEM_INDEFINITE_FUNNEL_CAKE, STR_SHOP_ITEM_DISPLAY_FUNNEL_CAKE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 90, ShopItem::none, PeepThoughtType::FunnelCakeMuch, PeepThoughtType::FunnelCake }, + /* ShopItem::sunglasses */ { 0.80_GBP, 1.50_GBP, 2.00_GBP, 1.20_GBP, 1.50_GBP, SPR_SHOP_ITEM_SUNGLASSES, { STR_SHOP_ITEM_PRICE_LABEL_SUNGLASSES, STR_SHOP_ITEM_SINGULAR_SUNGLASSES, STR_SHOP_ITEM_PLURAL_SUNGLASSES, STR_SHOP_ITEM_INDEFINITE_SUNGLASSES, STR_SHOP_ITEM_DISPLAY_SUNGLASSES }, SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::rubbish, 0, ShopItem::none, PeepThoughtType::SunglassesMuch, PeepThoughtType::Sunglasses }, + /* ShopItem::beefNoodles */ { 0.70_GBP, 1.70_GBP, 1.70_GBP, 2.00_GBP, 1.50_GBP, SPR_SHOP_ITEM_BEEF_NOODLES, { STR_SHOP_ITEM_PRICE_LABEL_BEEF_NOODLES, STR_SHOP_ITEM_SINGULAR_BEEF_NOODLES, STR_SHOP_ITEM_PLURAL_BEEF_NOODLES, STR_SHOP_ITEM_INDEFINITE_BEEF_NOODLES, STR_SHOP_ITEM_DISPLAY_BEEF_NOODLES }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 130, ShopItem::emptyBowlBlue, PeepThoughtType::BeefNoodlesMuch, PeepThoughtType::BeefNoodles }, + /* ShopItem::friedRiceNoodles */ { 0.60_GBP, 1.70_GBP, 1.70_GBP, 2.00_GBP, 1.50_GBP, SPR_SHOP_ITEM_FRIED_RICE_NOODLES, { STR_SHOP_ITEM_PRICE_LABEL_FRIED_RICE_NOODLES, STR_SHOP_ITEM_SINGULAR_FRIED_RICE_NOODLES, STR_SHOP_ITEM_PLURAL_FRIED_RICE_NOODLES, STR_SHOP_ITEM_INDEFINITE_FRIED_RICE_NOODLES, STR_SHOP_ITEM_DISPLAY_FRIED_RICE_NOODLES }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 120, ShopItem::emptyBowlBlue, PeepThoughtType::FriedRiceNoodlesMuch, PeepThoughtType::FriedRiceNoodles }, + /* ShopItem::wontonSoup */ { 0.40_GBP, 1.30_GBP, 1.30_GBP, 1.50_GBP, 1.50_GBP, SPR_SHOP_ITEM_WONTON_SOUP, { STR_SHOP_ITEM_PRICE_LABEL_WONTON_SOUP, STR_SHOP_ITEM_SINGULAR_WONTON_SOUP, STR_SHOP_ITEM_PLURAL_WONTON_SOUP, STR_SHOP_ITEM_INDEFINITE_WONTON_SOUP, STR_SHOP_ITEM_DISPLAY_WONTON_SOUP }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 100, ShopItem::emptyBowlRed, PeepThoughtType::WontonSoupMuch, PeepThoughtType::WontonSoup }, + /* ShopItem::meatballSoup */ { 0.50_GBP, 1.40_GBP, 1.40_GBP, 1.60_GBP, 1.50_GBP, SPR_SHOP_ITEM_MEATBALL_SOUP, { STR_SHOP_ITEM_PRICE_LABEL_MEATBALL_SOUP, STR_SHOP_ITEM_SINGULAR_MEATBALL_SOUP, STR_SHOP_ITEM_PLURAL_MEATBALL_SOUP, STR_SHOP_ITEM_INDEFINITE_MEATBALL_SOUP, STR_SHOP_ITEM_DISPLAY_MEATBALL_SOUP }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 110, ShopItem::emptyBowlRed, PeepThoughtType::MeatballSoupMuch, PeepThoughtType::MeatballSoup }, + /* ShopItem::fruitJuice */ { 0.40_GBP, 1.10_GBP, 1.90_GBP, 1.10_GBP, 1.20_GBP, SPR_SHOP_ITEM_FRUIT_JUICE, { STR_SHOP_ITEM_PRICE_LABEL_FRUIT_JUICE, STR_SHOP_ITEM_SINGULAR_FRUIT_JUICE, STR_SHOP_ITEM_PLURAL_FRUIT_JUICE, STR_SHOP_ITEM_INDEFINITE_FRUIT_JUICE, STR_SHOP_ITEM_DISPLAY_FRUIT_JUICE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::rubbish, 110, ShopItem::emptyJuiceCup, PeepThoughtType::FruitJuiceMuch, PeepThoughtType::FruitJuice }, + /* ShopItem::soybeanMilk */ { 0.40_GBP, 1.00_GBP, 1.40_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_SOYBEAN_MILK, { STR_SHOP_ITEM_PRICE_LABEL_SOYBEAN_MILK, STR_SHOP_ITEM_SINGULAR_SOYBEAN_MILK, STR_SHOP_ITEM_PLURAL_SOYBEAN_MILK, STR_SHOP_ITEM_INDEFINITE_SOYBEAN_MILK, STR_SHOP_ITEM_DISPLAY_SOYBEAN_MILK }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::rubbish, 90, ShopItem::emptyDrinkCarton, PeepThoughtType::SoybeanMilkMuch, PeepThoughtType::SoybeanMilk }, + /* ShopItem::sujeonggwa */ { 0.30_GBP, 1.10_GBP, 1.40_GBP, 1.10_GBP, 1.20_GBP, SPR_SHOP_ITEM_SUJEONGGWA, { STR_SHOP_ITEM_PRICE_LABEL_SUJONGKWA, STR_SHOP_ITEM_SINGULAR_SUJONGKWA, STR_SHOP_ITEM_PLURAL_SUJONGKWA, STR_SHOP_ITEM_INDEFINITE_SUJONGKWA, STR_SHOP_ITEM_DISPLAY_SUJONGKWA }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::rubbish, 100, ShopItem::emptyDrinkCarton, PeepThoughtType::SujongkwaMuch, PeepThoughtType::Sujongkwa }, + /* ShopItem::subSandwich */ { 0.50_GBP, 1.90_GBP, 1.90_GBP, 1.70_GBP, 1.50_GBP, SPR_SHOP_ITEM_SUB_SANDWICH, { STR_SHOP_ITEM_PRICE_LABEL_SUB_SANDWICH, STR_SHOP_ITEM_SINGULAR_SUB_SANDWICH, STR_SHOP_ITEM_PLURAL_SUB_SANDWICH, STR_SHOP_ITEM_INDEFINITE_SUB_SANDWICH, STR_SHOP_ITEM_DISPLAY_SUB_SANDWICH }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 130, ShopItem::none, PeepThoughtType::SubSandwichMuch, PeepThoughtType::SubSandwich }, + /* ShopItem::cookie */ { 0.40_GBP, 0.80_GBP, 0.80_GBP, 0.80_GBP, 0.70_GBP, SPR_SHOP_ITEM_COOKIE, { STR_SHOP_ITEM_PRICE_LABEL_COOKIE, STR_SHOP_ITEM_SINGULAR_COOKIE, STR_SHOP_ITEM_PLURAL_COOKIE, STR_SHOP_ITEM_INDEFINITE_COOKIE, STR_SHOP_ITEM_DISPLAY_COOKIE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 75, ShopItem::none, PeepThoughtType::CookieMuch, PeepThoughtType::Cookie }, + /* ShopItem::emptyBowlRed */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOWL_RED, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOWL_RED, STR_SHOP_ITEM_SINGULAR_EMPTY_BOWL_RED, STR_SHOP_ITEM_PLURAL_EMPTY_BOWL_RED, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOWL_RED, STR_SHOP_ITEM_DISPLAY_EMPTY_BOWL_RED }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyBowlRed, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::emptyDrinkCarton */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_DRINK_CARTON, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_SINGULAR_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_PLURAL_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_INDEFINITE_EMPTY_DRINK_CARTON, STR_SHOP_ITEM_DISPLAY_EMPTY_DRINK_CARTON }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyDrinkCarton, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::emptyJuiceCup */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_JUICE_CUP, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_JUICE_CUP, STR_SHOP_ITEM_SINGULAR_EMPTY_JUICE_CUP, STR_SHOP_ITEM_PLURAL_EMPTY_JUICE_CUP, STR_SHOP_ITEM_INDEFINITE_EMPTY_JUICE_CUP, STR_SHOP_ITEM_DISPLAY_EMPTY_JUICE_CUP }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyJuiceCup, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::roastSausage */ { 0.50_GBP, 1.60_GBP, 1.60_GBP, 2.00_GBP, 1.50_GBP, SPR_SHOP_ITEM_ROAST_SAUSAGE, { STR_SHOP_ITEM_PRICE_LABEL_ROAST_SAUSAGE, STR_SHOP_ITEM_SINGULAR_ROAST_SAUSAGE, STR_SHOP_ITEM_PLURAL_ROAST_SAUSAGE, STR_SHOP_ITEM_INDEFINITE_ROAST_SAUSAGE, STR_SHOP_ITEM_DISPLAY_ROAST_SAUSAGE }, SHOP_ITEM_FLAG_IS_FOOD, Litter::Type::rubbish, 115, ShopItem::none, PeepThoughtType::RoastSausageMuch, PeepThoughtType::RoastSausage }, + /* ShopItem::emptyBowlBlue */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOWL_BLUE, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_SINGULAR_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_PLURAL_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOWL_BLUE, STR_SHOP_ITEM_DISPLAY_EMPTY_BOWL_BLUE }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::emptyBowlBlue, 0, ShopItem::none, PeepThoughtType::None, PeepThoughtType::None }, }; // clang-format on constexpr uint64_t GetAllShopItemsWithFlag(uint16_t flag) { uint64_t ret = 0; - for (auto i = 0; i < EnumValue(ShopItem::Count); ++i) + for (auto i = 0; i < EnumValue(ShopItem::count); ++i) { const auto& sid = ShopItems[i]; if (sid.HasFlag(flag)) diff --git a/src/openrct2/ride/ShopItem.h b/src/openrct2/ride/ShopItem.h index 5990afd3dd..84b9581b4d 100644 --- a/src/openrct2/ride/ShopItem.h +++ b/src/openrct2/ride/ShopItem.h @@ -18,59 +18,59 @@ enum class PeepThoughtType : uint8_t; enum class ShopItem : uint8_t { - Balloon, - Toy, - Map, - Photo, - Umbrella, - Drink, - Burger, - Chips, - IceCream, - Candyfloss, - EmptyCan, - Rubbish, - EmptyBurgerBox, - Pizza, - Voucher, - Popcorn, - HotDog, - Tentacle, - Hat, - ToffeeApple, - TShirt, - Doughnut, - Coffee, - EmptyCup, - Chicken, - Lemonade, - EmptyBox, - EmptyBottle = 27, - Admission = 31, - Photo2 = 32, - Photo3, - Photo4, - Pretzel, - Chocolate, - IcedTea, - FunnelCake, - Sunglasses, - BeefNoodles, - FriedRiceNoodles, - WontonSoup, - MeatballSoup, - FruitJuice, - SoybeanMilk, - Sujeonggwa, - SubSandwich, - Cookie, - EmptyBowlRed, - EmptyDrinkCarton, - EmptyJuiceCup, - RoastSausage, - EmptyBowlBlue, - Count = 56, - None = 255 + balloon, + toy, + map, + photo, + umbrella, + drink, + burger, + chips, + iceCream, + candyfloss, + emptyCan, + rubbish, + emptyBurgerBox, + pizza, + voucher, + popcorn, + hotDog, + tentacle, + hat, + toffeeApple, + tShirt, + doughnut, + coffee, + emptyCup, + chicken, + lemonade, + emptyBox, + emptyBottle = 27, + admission = 31, + photo2 = 32, + photo3, + photo4, + pretzel, + chocolate, + icedTea, + funnelCake, + sunglasses, + beefNoodles, + friedRiceNoodles, + wontonSoup, + meatballSoup, + fruitJuice, + soybeanMilk, + sujeonggwa, + subSandwich, + cookie, + emptyBowlRed, + emptyDrinkCarton, + emptyJuiceCup, + roastSausage, + emptyBowlBlue, + count = 56, + none = 255 }; ShopItem& operator++(ShopItem& d, int); diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 2d675e1f93..16fc891c0c 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -4847,11 +4847,18 @@ namespace OpenRCT2::TrackMetaData #pragma region trackBlocks + using PS = OpenRCT2::PaintSegment; + static constexpr SequenceDescriptor kFlatSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kEndStationSeq0 = { @@ -4860,6 +4867,7 @@ namespace OpenRCT2::TrackMetaData | TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kBeginStationSeq0 = { @@ -4868,6 +4876,7 @@ namespace OpenRCT2::TrackMetaData | TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kMiddleStationSeq0 = { @@ -4876,6 +4885,7 @@ namespace OpenRCT2::TrackMetaData | TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kUp25Seq0 = { @@ -4883,6 +4893,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60Seq0 = { @@ -4890,6 +4901,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToUp25Seq0 = { @@ -4897,6 +4909,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp25ToUp60Seq0 = { @@ -4904,6 +4917,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToUp60Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToUp25Seq0 = { @@ -4911,6 +4925,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp25ToFlatSeq0 = { @@ -4918,48 +4933,61 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60Seq0 = { .clearance = { 0, 0, 0, 64, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down60Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown25ToDown60Seq0 = { .clearance = { 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToDown60Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToDown25Seq0 = { .clearance = { 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down60DegToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToUp60Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesSeq0 = { @@ -4967,43 +4995,76 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::null }, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + EnumsToFlags(PS::right, PS::topRight, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsAllTypes( + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft)), }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + EnumsToFlags( + PS::top, PS::right, PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, + PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesSeq4 = { .clearance = { -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::null }, + .extraSupportRotation = -1, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + EnumsToFlags(PS::right, PS::topRight, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesSeq5 = { .clearance = { -64, -32, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner0 }, + .extraSupportRotation = -1, + .blockedSegments = blockedSegmentsAllTypes( + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight)), }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesSeq6 = { .clearance = { -64, -64, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::nwSe }, + .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesSeq0 = { @@ -5011,43 +5072,52 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn5TilesSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::null }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn5TilesSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn5TilesSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn5TilesSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesSeq4 = { .clearance = { -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::null }, + .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn5TilesSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesSeq5 = { .clearance = { -64, 32, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, - .woodenSupports = { WoodenSupportSubType::corner2 }, + .woodenSupports = { WoodenSupportSubType::corner1 }, + .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn5TilesSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesSeq6 = { .clearance = { -64, 64, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::nwSe }, + .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn5TilesSeq6.blockedSegments), }; static constexpr SequenceDescriptor kFlatToLeftBankSeq0 = { @@ -5055,6 +5125,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kFlatToRightBankSeq0 = { @@ -5062,6 +5137,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsFlipXAxis(kFlatToLeftBankSeq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankToFlatSeq0 = { @@ -5069,6 +5145,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankToFlatSeq0 = { @@ -5076,6 +5157,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankToFlatSeq0.blockedSegments), }; static constexpr SequenceDescriptor kBankedLeftQuarterTurn5TilesSeq0 = { @@ -5083,43 +5165,52 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kBankedLeftQuarterTurn5TilesSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::null }, + .blockedSegments = kLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kBankedLeftQuarterTurn5TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kBankedLeftQuarterTurn5TilesSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kBankedLeftQuarterTurn5TilesSeq4 = { .clearance = { -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::null }, + .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kBankedLeftQuarterTurn5TilesSeq5 = { .clearance = { -64, -32, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner0 }, + .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kBankedLeftQuarterTurn5TilesSeq6 = { .clearance = { -64, -64, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::nwSe }, + .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kBankedRightQuarterTurn5TilesSeq0 = { @@ -5127,43 +5218,52 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kBankedRightQuarterTurn5TilesSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::null }, + .blockedSegments = kRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kBankedRightQuarterTurn5TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kBankedRightQuarterTurn5TilesSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kBankedRightQuarterTurn5TilesSeq4 = { .clearance = { -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::null }, + .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kBankedRightQuarterTurn5TilesSeq5 = { .clearance = { -64, 32, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, - .woodenSupports = { WoodenSupportSubType::corner2 }, + .woodenSupports = { WoodenSupportSubType::corner1 }, + .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kBankedRightQuarterTurn5TilesSeq6 = { .clearance = { -64, 64, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::nwSe }, + .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftBankToUp25Seq0 = { @@ -5171,6 +5271,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankToUp25Seq0 = { @@ -5178,6 +5283,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankToUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kUp25ToLeftBankSeq0 = { @@ -5185,6 +5291,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kUp25ToRightBankSeq0 = { @@ -5192,34 +5303,51 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsFlipXAxis(kUp25ToLeftBankSeq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankToDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankToDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankToDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kDown25ToLeftBankSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDown25ToRightBankSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kDown25ToLeftBankSeq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankSeq0 = { @@ -5227,6 +5355,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankSeq0 = { @@ -5234,6 +5367,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankSeq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesUp25Seq0 = { @@ -5241,33 +5375,41 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesUp25Seq1 = { .clearance = { 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesUp25Seq2 = { .clearance = { -32, 0, 16, 16, { 0b0111, 0b0100 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesUp25Seq3 = { .clearance = { -32, -32, 24, 16, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesUp25Seq4 = { .clearance = { -32, -64, 48, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesUp25Seq5 = { .clearance = { -64, -32, 32, 16, { 0b0111, 0b0100 }, 0 }, .allowedWallEdges = 0b0011, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner0 }, + .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesUp25Seq6 = { @@ -5276,6 +5418,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesUp25Seq0 = { @@ -5283,33 +5426,41 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesUp25Seq1 = { .clearance = { 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesUp25Seq2 = { .clearance = { -32, 0, 16, 16, { 0b1011, 0b1000 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesUp25Seq3 = { .clearance = { -32, 32, 24, 16, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesUp25Seq4 = { .clearance = { -32, 64, 48, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesUp25Seq5 = { .clearance = { -64, 32, 32, 16, { 0b1011, 0b1000 }, 0 }, .allowedWallEdges = 0b1001, - .woodenSupports = { WoodenSupportSubType::corner2 }, + .woodenSupports = { WoodenSupportSubType::corner1 }, + .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesUp25Seq6 = { @@ -5318,40 +5469,50 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesDown25Seq0 = { .clearance = { 0, 0, 48, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b0010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, + .extraSupportRotation = 2, + .blockedSegments = kLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesDown25Seq1 = { .clearance = { 0, -32, 48, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesDown25Seq2 = { .clearance = { -32, 0, 32, 16, { 0b0111, 0b0001 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesDown25Seq3 = { .clearance = { -32, -32, 24, 16, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesDown25Seq4 = { .clearance = { -32, -64, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesDown25Seq5 = { .clearance = { -64, -32, 16, 16, { 0b0111, 0b0001 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesDown25Seq6 = { @@ -5360,40 +5521,50 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesDown25Seq0 = { .clearance = { 0, 0, 48, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1000, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, + .extraSupportRotation = 2, + .blockedSegments = kRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesDown25Seq1 = { .clearance = { 0, 32, 48, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesDown25Seq2 = { .clearance = { -32, 0, 32, 16, { 0b1011, 0b0010 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesDown25Seq3 = { .clearance = { -32, 32, 24, 16, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesDown25Seq4 = { .clearance = { -32, 64, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesDown25Seq5 = { .clearance = { -64, 32, 16, 16, { 0b1011, 0b0010 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesDown25Seq6 = { @@ -5402,150 +5573,233 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kSBendLeftSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kSBendLeftSeq1 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsAllTypes( + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft)), }; static constexpr SequenceDescriptor kSBendLeftSeq2 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = blockedSegmentsAllTypes( + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight)), }; static constexpr SequenceDescriptor kSBendLeftSeq3 = { .clearance = { -64, -32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kSBendRightSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kSBendLeftSeq0.blockedSegments), }; static constexpr SequenceDescriptor kSBendRightSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kSBendLeftSeq1.blockedSegments), }; static constexpr SequenceDescriptor kSBendRightSeq2 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kSBendLeftSeq2.blockedSegments), }; static constexpr SequenceDescriptor kSBendRightSeq3 = { .clearance = { -64, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kSBendLeftSeq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags( + PS::top, PS::left, PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, + PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq1 = { .clearance = { -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq2 = { .clearance = { -64, 0, 32, 96, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq3 = { .clearance = { -32, 0, 120, 16, { 0b0110, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq4 = { .clearance = { -32, -32, 120, 0, { 0b0000, 0 }, 0 }, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq5 = { .clearance = { 0, 0, 120, 0, { 0b0000, 0 }, 0 }, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq6 = { .clearance = { 0, -32, 120, 16, { 0b1001, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq7 = { .clearance = { 32, -32, 32, 96, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq8 = { .clearance = { 0, -32, 16, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftVerticalLoopSeq9 = { .clearance = { -32, -32, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags( + PS::top, PS::right, PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, + PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightVerticalLoopSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq1 = { .clearance = { -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq2 = { .clearance = { -64, 0, 32, 96, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq3 = { .clearance = { -32, 0, 120, 16, { 0b1001, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq4 = { .clearance = { -32, 32, 120, 0, { 0b0000, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq5 = { .clearance = { 0, 0, 120, 0, { 0b0000, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq6 = { .clearance = { 0, 32, 120, 16, { 0b0110, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq6.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq7 = { .clearance = { 32, 32, 32, 96, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq7.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq8 = { .clearance = { 0, 32, 16, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq8.blockedSegments), }; static constexpr SequenceDescriptor kRightVerticalLoopSeq9 = { .clearance = { -32, 32, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftVerticalLoopSeq9.blockedSegments), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesSeq0 = { @@ -5553,6 +5807,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesSeq1 = { @@ -5563,14 +5822,20 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kLeftQuarterTurn3TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsAllTypes(EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft)), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesSeq3 = { .clearance = { -32, -32, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner0 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesSeq0 = { @@ -5578,24 +5843,28 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner2 }, + .woodenSupports = { WoodenSupportSubType::corner1 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesSeq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TilesSeq0 = { @@ -5603,6 +5872,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TilesSeq1 = { @@ -5613,14 +5887,20 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsAllTypes(EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft)), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TilesSeq3 = { .clearance = { -32, -32, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner0 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TilesSeq0 = { @@ -5628,24 +5908,28 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TilesSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TilesSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TilesSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TilesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TilesSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TilesSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner2 }, + .woodenSupports = { WoodenSupportSubType::corner1 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TilesSeq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesUp25Seq0 = { @@ -5653,6 +5937,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesUp25Seq1 = { @@ -5663,14 +5952,24 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kLeftQuarterTurn3TilesUp25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesUp25Seq3 = { .clearance = { -32, -32, 16, 16, { 0b0111, 0b0110 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner0 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesUp25Seq0 = { @@ -5678,24 +5977,28 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesUp25Seq1 = { .clearance = { 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesUp25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesUp25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesUp25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesUp25Seq3 = { .clearance = { -32, 32, 16, 16, { 0b1011, 0b1001 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesUp25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25Seq0 = { @@ -5703,24 +6006,28 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftQuarterTurn3TilesUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25Seq1 = { .clearance = { 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn3TilesUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn3TilesUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25Seq3 = { .clearance = { -32, -32, 0, 16, { 0b0111, 0b0001 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner0 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn3TilesUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25Seq0 = { @@ -5728,24 +6035,28 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightQuarterTurn3TilesUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25Seq1 = { .clearance = { 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn3TilesUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn3TilesUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b1011, 0b0010 }, 0 }, .allowedWallEdges = 0b0001, - .woodenSupports = { WoodenSupportSubType::corner3 }, + .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn3TilesUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn1TileSeq0 = { @@ -5753,6 +6064,11 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightQuarterTurn1TileSeq0 = { @@ -5760,180 +6076,281 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn1TileSeq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftTwistDownToUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftTwistDownToUpSeq1 = { .clearance = { -32, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftTwistDownToUpSeq2 = { .clearance = { -64, 0, 16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightTwistDownToUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftTwistDownToUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightTwistDownToUpSeq1 = { .clearance = { -32, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftTwistDownToUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightTwistDownToUpSeq2 = { .clearance = { -64, 0, 16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftTwistDownToUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kLeftTwistUpToDownSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftTwistDownToUpSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftTwistUpToDownSeq1 = { .clearance = { -32, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsRotate(kLeftTwistDownToUpSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftTwistUpToDownSeq2 = { .clearance = { -64, 0, -16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsRotate(kLeftTwistDownToUpSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightTwistUpToDownSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftTwistUpToDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightTwistUpToDownSeq1 = { .clearance = { -32, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftTwistUpToDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightTwistUpToDownSeq2 = { .clearance = { -64, 0, -16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftTwistUpToDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kHalfLoopUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kHalfLoopUpSeq1 = { .clearance = { -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kHalfLoopUpSeq2 = { .clearance = { -64, 0, 32, 96, { 0b0011, 0 }, 0 }, .allowedWallEdges = 0b1011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kHalfLoopUpSeq3 = { .clearance = { -32, 0, 120, 16, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kHalfLoopDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kHalfLoopDownSeq1 = { .clearance = { -32, 0, -120, 96, { 0b0011, 0 }, 0 }, .allowedWallEdges = 0b1011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kHalfLoopDownSeq2 = { .clearance = { 0, 0, -136, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kHalfLoopDownSeq3 = { .clearance = { 32, 0, -152, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftCorkscrewUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftCorkscrewUpSeq1 = { .clearance = { -32, 0, 24, 32, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftCorkscrewUpSeq2 = { .clearance = { -32, -32, 48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, .metalSupports = { MetalSupportPlace::centre }, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::top, PS::right, PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightCorkscrewUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftCorkscrewUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightCorkscrewUpSeq1 = { .clearance = { -32, 0, 24, 32, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftCorkscrewUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightCorkscrewUpSeq2 = { .clearance = { -32, 32, 48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, .metalSupports = { MetalSupportPlace::centre }, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::top, PS::left, PS::right, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftCorkscrewDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kRightCorkscrewUpSeq2.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftCorkscrewDownSeq1 = { .clearance = { -32, 0, -56, 32, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsRotate(kRightCorkscrewUpSeq1.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftCorkscrewDownSeq2 = { .clearance = { -32, -32, -80, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsRotate(kRightCorkscrewUpSeq0.blockedSegments, 1), }; static constexpr SequenceDescriptor kRightCorkscrewDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftCorkscrewUpSeq2.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightCorkscrewDownSeq1 = { .clearance = { -32, 0, -56, 32, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kLeftCorkscrewUpSeq1.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightCorkscrewDownSeq2 = { .clearance = { -32, 32, -80, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsRotate(kLeftCorkscrewUpSeq0.blockedSegments, 3), }; static constexpr SequenceDescriptor kFlatToUp60Seq0 = { @@ -5941,6 +6358,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToFlatSeq0 = { @@ -5948,20 +6366,25 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToDown60Seq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown60Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlat }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = -2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToFlatSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down60DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kTowerBaseSeq0 = { @@ -6030,108 +6453,127 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp25CoveredSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60CoveredSeq0 = { .clearance = { 0, 0, 0, 64, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kUp60Seq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToUp25CoveredSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatToUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kUp25ToUp60CoveredSeq0 = { .clearance = { 0, 0, 0, 32, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kUp25ToUp60Seq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToUp25CoveredSeq0 = { .clearance = { 0, 0, 0, 32, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kUp60ToUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kUp25ToFlatCoveredSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kUp25ToFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown25CoveredSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kDown25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60CoveredSeq0 = { .clearance = { 0, 0, 0, 64, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kDown60Seq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToDown25CoveredSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatToDown25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kDown25ToDown60CoveredSeq0 = { .clearance = { 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kDown25ToDown60Seq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToDown25CoveredSeq0 = { .clearance = { 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kDown60ToDown25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kDown25ToFlatCoveredSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kDown25ToFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesCoveredSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesCoveredSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesCoveredSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesCoveredSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesCoveredSeq4 = { .clearance = { -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesCoveredSeq5 = { .clearance = { -64, -32, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn5TilesCoveredSeq6 = { @@ -6139,36 +6581,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesCoveredSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesCoveredSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesCoveredSeq2 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesCoveredSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, + .blockedSegments = kRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesCoveredSeq4 = { .clearance = { -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesCoveredSeq5 = { .clearance = { -64, 32, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn5TilesCoveredSeq6 = { @@ -6176,62 +6625,74 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kSBendLeftCoveredSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kSBendLeftSeq0.blockedSegments, }; static constexpr SequenceDescriptor kSBendLeftCoveredSeq1 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kSBendLeftSeq1.blockedSegments, }; static constexpr SequenceDescriptor kSBendLeftCoveredSeq2 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kSBendLeftSeq2.blockedSegments, }; static constexpr SequenceDescriptor kSBendLeftCoveredSeq3 = { .clearance = { -64, -32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kSBendLeftSeq3.blockedSegments, }; static constexpr SequenceDescriptor kSBendRightCoveredSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kSBendRightSeq0.blockedSegments, }; static constexpr SequenceDescriptor kSBendRightCoveredSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kSBendRightSeq1.blockedSegments, }; static constexpr SequenceDescriptor kSBendRightCoveredSeq2 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kSBendRightSeq2.blockedSegments, }; static constexpr SequenceDescriptor kSBendRightCoveredSeq3 = { .clearance = { -64, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kSBendRightSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesCoveredSeq0 = { .clearance = { 0, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftQuarterTurn3TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesCoveredSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn3TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesCoveredSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn3TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesCoveredSeq3 = { @@ -6239,22 +6700,26 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn3TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesCoveredSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightQuarterTurn3TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesCoveredSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn3TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesCoveredSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn3TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesCoveredSeq3 = { @@ -6262,6 +6727,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn3TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq0 = { @@ -6269,17 +6735,32 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsNone, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq2 = { .clearance = { -32, 0, 0, 4, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq3 = { @@ -6288,6 +6769,11 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq4 = { @@ -6296,17 +6782,32 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq5 = { .clearance = { 0, -64, 8, 0, { 0b0100, 0b0000 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsNone, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq6 = { .clearance = { -32, -96, 8, 4, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpSmallSeq7 = { @@ -6315,6 +6816,11 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -2, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq0 = { @@ -6322,17 +6828,20 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0b0000 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq2 = { .clearance = { -32, 0, 0, 4, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq3 = { @@ -6341,6 +6850,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq4 = { @@ -6349,17 +6859,20 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq5 = { .clearance = { 0, 64, 8, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq6 = { .clearance = { -32, 96, 8, 4, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq6.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpSmallSeq7 = { @@ -6368,6 +6881,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpSmallSeq7.blockedSegments), }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq0 = { @@ -6375,17 +6889,20 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq1 = { .clearance = { 0, -32, 8, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq2 = { .clearance = { -32, 0, 8, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq3 = { @@ -6394,6 +6911,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq4 = { @@ -6402,17 +6920,20 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq5 = { .clearance = { 0, -64, 0, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq6 = { .clearance = { -32, -96, 0, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownSmallSeq7 = { @@ -6421,6 +6942,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -2, + .blockedSegments = kLeftHalfBankedHelixUpSmallSeq7.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq0 = { @@ -6428,17 +6950,20 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq1 = { .clearance = { 0, 32, 8, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq2 = { .clearance = { -32, 0, 8, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq3 = { @@ -6447,6 +6972,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq4 = { @@ -6455,17 +6981,20 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq5 = { .clearance = { 0, 64, 0, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq6 = { .clearance = { -32, 96, 0, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownSmallSeq7 = { @@ -6474,6 +7003,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 2, + .blockedSegments = kRightHalfBankedHelixUpSmallSeq7.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq0 = { @@ -6481,33 +7011,65 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::right, PS::topRight, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags( + PS::top, PS::right, PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, + PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq4 = { .clearance = { -32, -64, 0, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::right, PS::topRight, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq5 = { .clearance = { -64, -32, 0, 4, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq6 = { @@ -6516,6 +7078,11 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq7 = { @@ -6524,33 +7091,65 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq8 = { .clearance = { -32, -96, 8, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::top, PS::topLeft, PS::topRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq9 = { .clearance = { -64, -128, 8, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq10 = { .clearance = { -32, -128, 8, 0, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags( + PS::top, PS::left, PS::right, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, + PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq11 = { .clearance = { 0, -128, 8, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::top, PS::topLeft, PS::topRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq12 = { .clearance = { -32, -160, 8, 4, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixUpLargeSeq13 = { @@ -6559,6 +7158,11 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -2, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq0 = { @@ -6566,33 +7170,39 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq2 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq4 = { .clearance = { -32, 64, 0, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq5 = { .clearance = { -64, 32, 0, 4, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq6 = { @@ -6601,6 +7211,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq6.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq7 = { @@ -6609,33 +7220,39 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq7.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq8 = { .clearance = { -32, 96, 8, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq8.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq9 = { .clearance = { -64, 128, 8, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq9.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq10 = { .clearance = { -32, 128, 8, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq10.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq11 = { .clearance = { 0, 128, 8, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq11.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq12 = { .clearance = { -32, 160, 8, 4, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq12.blockedSegments), }; static constexpr SequenceDescriptor kRightHalfBankedHelixUpLargeSeq13 = { @@ -6644,6 +7261,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHalfBankedHelixUpLargeSeq13.blockedSegments), }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq0 = { @@ -6651,33 +7269,39 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq1 = { .clearance = { 0, -32, 8, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq2 = { .clearance = { -32, 0, 8, 4, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq3 = { .clearance = { -32, -32, 8, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq4 = { .clearance = { -32, -64, 8, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq5 = { .clearance = { -64, -32, 8, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq6 = { @@ -6686,6 +7310,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq7 = { @@ -6694,33 +7319,39 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq7.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq8 = { .clearance = { -32, -96, 0, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq8.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq9 = { .clearance = { -64, -128, 0, 4, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq9.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq10 = { .clearance = { -32, -128, 0, 0, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq10.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq11 = { .clearance = { 0, -128, 0, 0, { 0b0100, 0b0000 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq11.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq12 = { .clearance = { -32, -160, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq12.blockedSegments, }; static constexpr SequenceDescriptor kLeftHalfBankedHelixDownLargeSeq13 = { @@ -6729,6 +7360,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -2, + .blockedSegments = kLeftHalfBankedHelixUpLargeSeq13.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq0 = { @@ -6736,33 +7368,39 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq1 = { .clearance = { 0, 32, 8, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq2 = { .clearance = { -32, 0, 8, 4, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq3 = { .clearance = { -32, 32, 8, 0, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq4 = { .clearance = { -32, 64, 8, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq5 = { .clearance = { -64, 32, 8, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq6 = { @@ -6771,6 +7409,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq7 = { @@ -6779,33 +7418,39 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::nwSe }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq7.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq8 = { .clearance = { -32, 96, 0, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq8.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq9 = { .clearance = { -64, 128, 0, 4, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq9.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq10 = { .clearance = { -32, 128, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq10.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq11 = { .clearance = { 0, 128, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq11.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq12 = { .clearance = { -32, 160, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq12.blockedSegments, }; static constexpr SequenceDescriptor kRightHalfBankedHelixDownLargeSeq13 = { @@ -6814,6 +7459,7 @@ namespace OpenRCT2::TrackMetaData .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 2, + .blockedSegments = kRightHalfBankedHelixUpLargeSeq13.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterTurn1TileUp60Seq0 = { @@ -6821,6 +7467,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kRightQuarterTurn1TileUp60Seq0 = { @@ -6828,6 +7475,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kLeftQuarterTurn1TileDown60Seq0 = { @@ -6835,6 +7483,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner2 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kRightQuarterTurn1TileDown60Seq0 = { @@ -6842,6 +7491,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner3 }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kBrakesSeq0 = { @@ -6849,6 +7499,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kBoosterSeq0 = { @@ -6856,6 +7507,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMazeSeq0 = { @@ -6944,30 +7596,36 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeUpSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeUpSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeUpSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeUpSeq4 = { .clearance = { -32, -64, 0, 12, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeUpSeq5 = { .clearance = { -64, -32, 0, 12, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeUpSeq6 = { @@ -6975,36 +7633,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeUpSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeUpSeq2 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeUpSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeUpSeq4 = { .clearance = { -32, 64, 0, 12, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeUpSeq5 = { .clearance = { -64, 32, 0, 12, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeUpSeq6 = { @@ -7012,36 +7677,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeDownSeq0 = { .clearance = { 0, 0, 0, 12, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeDownSeq1 = { .clearance = { 0, -32, 0, 12, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeDownSeq2 = { .clearance = { -32, 0, 0, 12, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeDownSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeDownSeq4 = { .clearance = { -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeDownSeq5 = { .clearance = { -64, -32, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterBankedHelixLargeDownSeq6 = { @@ -7049,36 +7721,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kBankedLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeDownSeq0 = { .clearance = { 0, 0, 0, 12, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeDownSeq1 = { .clearance = { 0, 32, 0, 12, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeDownSeq2 = { .clearance = { -32, 0, 0, 12, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeDownSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeDownSeq4 = { .clearance = { -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeDownSeq5 = { .clearance = { -64, 32, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterBankedHelixLargeDownSeq6 = { @@ -7086,36 +7765,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kBankedRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeUpSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeUpSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeUpSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeUpSeq4 = { .clearance = { -32, -64, 0, 12, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeUpSeq5 = { .clearance = { -64, -32, 0, 12, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeUpSeq6 = { @@ -7123,36 +7809,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeUpSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeUpSeq2 = { .clearance = { -32, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeUpSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, + .blockedSegments = kRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeUpSeq4 = { .clearance = { -32, 64, 0, 12, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeUpSeq5 = { .clearance = { -64, 32, 0, 12, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeUpSeq6 = { @@ -7160,36 +7853,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeDownSeq0 = { .clearance = { 0, 0, 0, 12, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kLeftQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeDownSeq1 = { .clearance = { 0, -32, 0, 12, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeDownSeq2 = { .clearance = { -32, 0, 0, 12, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeDownSeq3 = { .clearance = { -32, -32, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = kLeftQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeDownSeq4 = { .clearance = { -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = kLeftQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeDownSeq5 = { .clearance = { -64, -32, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftQuarterHelixLargeDownSeq6 = { @@ -7197,36 +7897,43 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = -1, + .blockedSegments = kLeftQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeDownSeq0 = { .clearance = { 0, 0, 0, 12, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kRightQuarterTurn5TilesSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeDownSeq1 = { .clearance = { 0, 32, 0, 12, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeDownSeq2 = { .clearance = { -32, 0, 0, 12, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn5TilesSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeDownSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1110, 0 }, 0 }, + .blockedSegments = kRightQuarterTurn5TilesSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeDownSeq4 = { .clearance = { -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = kRightQuarterTurn5TilesSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeDownSeq5 = { .clearance = { -64, 32, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightQuarterTurn5TilesSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightQuarterHelixLargeDownSeq6 = { @@ -7234,6 +7941,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0001, .metalSupports = { MetalSupportPlace::centre }, .extraSupportRotation = 1, + .blockedSegments = kRightQuarterTurn5TilesSeq6.blockedSegments, }; static constexpr SequenceDescriptor kUp25LeftBankedSeq0 = { @@ -7241,6 +7949,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp25RightBankedSeq0 = { @@ -7248,68 +7957,105 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kWaterfallSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRapidsSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kOnRidePhotoSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsAllTypes(kSegmentsAll), }; static constexpr SequenceDescriptor kDown25LeftBankedSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown25RightBankedSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kWatersplashSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kWatersplashSeq1 = { .clearance = { -32, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kWatersplashSeq2 = { .clearance = { -64, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kWatersplashSeq3 = { .clearance = { -96, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kWatersplashSeq4 = { .clearance = { -128, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kFlatToUp60LongBaseSeq0 = { @@ -7317,6 +8063,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq0 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToUp60LongBaseSeq1 = { @@ -7324,6 +8071,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq1 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToUp60LongBaseSeq2 = { @@ -7331,6 +8079,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq2 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToUp60LongBaseSeq3 = { @@ -7338,6 +8087,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq3 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToFlatLongBaseSeq0 = { @@ -7345,6 +8095,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq0 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToFlatLongBaseSeq1 = { @@ -7352,6 +8103,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq1 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToFlatLongBaseSeq2 = { @@ -7359,6 +8111,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq2 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToFlatLongBaseSeq3 = { @@ -7366,146 +8119,182 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq3 }, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kWhirlpoolSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDown60ToFlatLongBaseSeq0 = { .clearance = { 0, 0, 40, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down60DegToFlatLongBaseSeq0 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq3 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToFlatLongBaseSeq1 = { .clearance = { -32, 0, 16, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down60DegToFlatLongBaseSeq1 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq2 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToFlatLongBaseSeq2 = { .clearance = { -64, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down60DegToFlatLongBaseSeq2 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq1 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToFlatLongBaseSeq3 = { .clearance = { -96, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down60DegToFlatLongBaseSeq3 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp60DegLongBaseSeq0 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToDown60LongBaseSeq0 = { .clearance = { 0, 0, 80, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown60DegLongBaseSeq0 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq3 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToDown60LongBaseSeq1 = { .clearance = { -32, 0, 64, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown60DegLongBaseSeq1 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq2 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToDown60LongBaseSeq2 = { .clearance = { -64, 0, 40, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown60DegLongBaseSeq2 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq1 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatToDown60LongBaseSeq3 = { .clearance = { -96, 0, 0, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown60DegLongBaseSeq3 }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up60DegToFlatLongBaseSeq0 }, .metalSupports = { MetalSupportPlace::centre, true }, + .extraSupportRotation = 2, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kCableLiftHillSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kCableLiftHillSeq1 = { .clearance = { -32, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kCableLiftHillSeq2 = { .clearance = { -64, 0, -32, 32, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kCableLiftHillSeq3 = { .clearance = { -96, 0, -96, 64, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, .metalSupports = { MetalSupportPlace::centre, true }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallSlopeSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallSlopeSeq1 = { .clearance = { -32, 0, 0, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallSlopeSeq2 = { .clearance = { -64, 0, 0, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallSlopeSeq3 = { .clearance = { -96, 0, 0, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallSlopeSeq4 = { .clearance = { -128, 0, 0, 160, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallSlopeSeq5 = { .clearance = { -192, 0, 0, 208, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1011, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallSlopeSeq6 = { .clearance = { -160, 0, 0, 208, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallVerticalSeq0 = { .clearance = { 0, 0, 0, 48, { 0b1111, 0 }, 0 }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kReverseFreefallVerticalSeq1 = { .clearance = { 32, 0, 0, 48, { 0b1111, 0 }, 0 }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp90Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1111, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp90Seq1 = { @@ -7515,6 +8304,7 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kDown90Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1111, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown90Seq1 = { @@ -7525,6 +8315,7 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 0, 32, { 0b1111, 0b1100 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1011, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp60ToUp90Seq1 = { @@ -7535,18 +8326,21 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 0, 32, { 0b1111, 0b0011 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1110, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kUp90ToUp60Seq0 = { .clearance = { 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1011, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToDown90Seq0 = { .clearance = { 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1110, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDown60ToDown90Seq1 = { @@ -7558,6 +8352,7 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToDiagSeq0 = { @@ -7565,29 +8360,54 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagSeq2 = { .clearance = { -32, -32, 0, 0, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagSeq3 = { .clearance = { -64, 0, 0, 0, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagSeq4 = { .clearance = { -64, -32, 0, 0, { 0b0001, 0 }, 0 }, .metalSupports = { MetalSupportPlace::bottomCorner }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightEighthToDiagSeq0 = { @@ -7595,822 +8415,1372 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, .metalSupports = { MetalSupportPlace::centre }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagSeq2 = { .clearance = { -32, 32, 0, 0, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagSeq3 = { .clearance = { -64, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagSeq4 = { .clearance = { -64, 32, 0, 0, { 0b0010, 0 }, 0 }, .metalSupports = { MetalSupportPlace::leftCorner }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagSeq4.blockedSegments), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagSeq4.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalSeq1 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalSeq2 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalSeq4 = { .clearance = { -64, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagSeq4.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0100, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagSeq2.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagSeq3.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagSeq1.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalSeq4 = { .clearance = { -32, 64, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagSeq0.blockedSegments, 3), }; static constexpr SequenceDescriptor kLeftEighthBankToDiagSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagSeq2 = { .clearance = { -32, -32, 0, 0, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagSeq3 = { .clearance = { -64, 0, 0, 0, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagSeq4 = { .clearance = { -64, -32, 0, 0, { 0b0001, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags( + PS::right, PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, + PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightEighthBankToDiagSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagSeq2 = { .clearance = { -32, 32, 0, 0, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagSeq3 = { .clearance = { -64, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagSeq4 = { .clearance = { -64, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagSeq4.blockedSegments), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagSeq4.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalSeq1 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalSeq2 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalSeq4 = { .clearance = { -64, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagSeq4.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0100, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagSeq2.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagSeq3.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagSeq1.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalSeq4 = { .clearance = { -32, 64, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagSeq0.blockedSegments, 3), }; static constexpr SequenceDescriptor kDiagFlatSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60Seq0 = { .clearance = { 0, 0, 0, 64, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60Seq1 = { .clearance = { 0, 32, 0, 64, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60Seq2 = { .clearance = { -32, 0, 0, 64, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60Seq3 = { .clearance = { -32, 32, 0, 64, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToUp60Seq0 = { .clearance = { 0, 0, 0, 32, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToUp60Seq1 = { .clearance = { 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToUp60Seq2 = { .clearance = { -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToUp60Seq3 = { .clearance = { -32, 32, 0, 32, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToUp25Seq0 = { .clearance = { 0, 0, 0, 32, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToUp25Seq1 = { .clearance = { 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToUp25Seq2 = { .clearance = { -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToUp25Seq3 = { .clearance = { -32, 32, 0, 32, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60Seq0 = { .clearance = { 0, 0, 0, 64, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60Seq1 = { .clearance = { 0, 32, 0, 64, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60Seq2 = { .clearance = { -32, 0, 0, 64, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60Seq3 = { .clearance = { -32, 32, 0, 64, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToFlatSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToFlatSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToFlatSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToFlatSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToDown60Seq0 = { .clearance = { 0, 0, 0, 32, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToUp25Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToDown60Seq1 = { .clearance = { 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToUp25Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToDown60Seq2 = { .clearance = { -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToUp25Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToDown60Seq3 = { .clearance = { -32, 32, 0, 32, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToUp25Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToDown25Seq0 = { .clearance = { 0, 0, 0, 32, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToUp60Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToDown25Seq1 = { .clearance = { 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToUp60Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToDown25Seq2 = { .clearance = { -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToUp60Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToDown25Seq3 = { .clearance = { -32, 32, 0, 32, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp25ToUp60Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp25Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp25Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp25Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown25ToFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp25Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToUp60Seq0 = { .clearance = { 0, 0, 0, 24, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60Seq1 = { .clearance = { 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60Seq2 = { .clearance = { -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60Seq3 = { .clearance = { -32, 32, 0, 24, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatSeq1 = { .clearance = { 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatSeq2 = { .clearance = { -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatSeq3 = { .clearance = { -32, 32, 0, 24, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToDown60Seq0 = { .clearance = { 0, 0, 0, 24, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60Seq1 = { .clearance = { 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60Seq2 = { .clearance = { -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60Seq3 = { .clearance = { -32, 32, 0, 24, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatSeq1 = { .clearance = { 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatSeq2 = { .clearance = { -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatSeq3 = { .clearance = { -32, 32, 0, 24, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToLeftBankSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToRightBankSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToRightBankSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToRightBankSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToRightBankSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToFlatSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToFlatSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToFlatSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToFlatSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToFlatSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToFlatSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToFlatSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToFlatSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToUp25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToUp25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToUp25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToUp25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToUp25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToUp25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToDown25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToDown25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankToDown25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToDown25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToDown25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankToDown25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagLeftBankSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDiagRightBankSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLogFlumeReverserSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kSpinningTunnelSeq0 = { @@ -8418,663 +9788,1000 @@ namespace OpenRCT2::TrackMetaData .allowedWallEdges = 0b1010, .flags = TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBarrelRollUpToDownSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBarrelRollUpToDownSeq1 = { .clearance = { -32, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBarrelRollUpToDownSeq2 = { .clearance = { -64, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBarrelRollUpToDownSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBarrelRollUpToDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBarrelRollUpToDownSeq1 = { .clearance = { -32, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBarrelRollUpToDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBarrelRollUpToDownSeq2 = { .clearance = { -64, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBarrelRollUpToDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kLeftBarrelRollDownToUpSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftBarrelRollUpToDownSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftBarrelRollDownToUpSeq1 = { .clearance = { -32, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftBarrelRollUpToDownSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftBarrelRollDownToUpSeq2 = { .clearance = { -64, 0, -32, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftBarrelRollUpToDownSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightBarrelRollDownToUpSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBarrelRollDownToUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBarrelRollDownToUpSeq1 = { .clearance = { -32, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBarrelRollDownToUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBarrelRollDownToUpSeq2 = { .clearance = { -64, 0, -32, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBarrelRollDownToUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankToLeftQuarterTurn3TilesUp25Seq0 = { .clearance = { 0, 0, 0, 0, { 0b0111, 0b0100 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBankToLeftQuarterTurn3TilesUp25Seq1 = { .clearance = { 0, -32, 0, 16, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsNone, // wide + } }, }; static constexpr SequenceDescriptor kLeftBankToLeftQuarterTurn3TilesUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // wide + } }, }; static constexpr SequenceDescriptor kLeftBankToLeftQuarterTurn3TilesUp25Seq3 = { .clearance = { -32, -32, 16, 16, { 0b0111, 0b0110 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankToRightQuarterTurn3TilesUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1011, 0b1000 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankToLeftQuarterTurn3TilesUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBankToRightQuarterTurn3TilesUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankToLeftQuarterTurn3TilesUp25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBankToRightQuarterTurn3TilesUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankToLeftQuarterTurn3TilesUp25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightBankToRightQuarterTurn3TilesUp25Seq3 = { .clearance = { -32, 32, 16, 16, { 0b1011, 0b1001 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankToLeftQuarterTurn3TilesUp25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25ToLeftBankSeq0 = { .clearance = { 0, 0, 16, 16, { 0b0111, 0b0011 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsRotate(kRightBankToRightQuarterTurn3TilesUp25Seq3.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25ToLeftBankSeq1 = { .clearance = { 0, -32, 0, 16, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsRotate(kRightBankToRightQuarterTurn3TilesUp25Seq1.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25ToLeftBankSeq2 = { .clearance = { -32, 0, 0, 16, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsRotate(kRightBankToRightQuarterTurn3TilesUp25Seq2.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftQuarterTurn3TilesDown25ToLeftBankSeq3 = { .clearance = { -32, -32, 0, 0, { 0b0111, 0b0001 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsRotate(kRightBankToRightQuarterTurn3TilesUp25Seq0.blockedSegments, 1), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25ToRightBankSeq0 = { .clearance = { 0, 0, 16, 16, { 0b1011, 0b0011 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesDown25ToLeftBankSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25ToRightBankSeq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesDown25ToLeftBankSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25ToRightBankSeq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesDown25ToLeftBankSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn3TilesDown25ToRightBankSeq3 = { .clearance = { -32, 32, 0, 0, { 0b1011, 0b0010 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn3TilesDown25ToLeftBankSeq3.blockedSegments), }; static constexpr SequenceDescriptor kPoweredLiftSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopUpSeq1 = { .clearance = { -32, 0, 16, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopUpSeq2 = { .clearance = { -64, 0, 32, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopUpSeq3 = { .clearance = { -96, 0, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopUpSeq4 = { .clearance = { -128, -32, 120, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopUpSeq5 = { .clearance = { -96, -32, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopUpSeq6 = { .clearance = { -64, -32, 248, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightLargeHalfLoopUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeHalfLoopUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeHalfLoopUpSeq1 = { .clearance = { -32, 0, 16, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeHalfLoopUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeHalfLoopUpSeq2 = { .clearance = { -64, 0, 32, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeHalfLoopUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeHalfLoopUpSeq3 = { .clearance = { -96, 0, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeHalfLoopUpSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeHalfLoopUpSeq4 = { .clearance = { -128, 32, 120, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeHalfLoopUpSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeHalfLoopUpSeq5 = { .clearance = { -96, 32, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeHalfLoopUpSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeHalfLoopUpSeq6 = { .clearance = { -64, 32, 248, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeHalfLoopUpSeq6.blockedSegments), }; static constexpr SequenceDescriptor kLeftLargeHalfLoopDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .invertSegmentBlocking = true, + .blockedSegments = kRightLargeHalfLoopUpSeq6.blockedSegments, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopDownSeq1 = { .clearance = { -32, 0, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = kRightLargeHalfLoopUpSeq5.blockedSegments, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopDownSeq2 = { .clearance = { -64, 0, -160, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kRightLargeHalfLoopUpSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopDownSeq3 = { .clearance = { -32, -32, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightLargeHalfLoopUpSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopDownSeq4 = { .clearance = { 0, -32, -248, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = kRightLargeHalfLoopUpSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopDownSeq5 = { .clearance = { 32, -32, -264, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kRightLargeHalfLoopUpSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftLargeHalfLoopDownSeq6 = { .clearance = { 64, -32, -280, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kRightLargeHalfLoopUpSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightLargeHalfLoopDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .invertSegmentBlocking = true, + .blockedSegments = kLeftLargeHalfLoopUpSeq6.blockedSegments, }; static constexpr SequenceDescriptor kRightLargeHalfLoopDownSeq1 = { .clearance = { -32, 0, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = kLeftLargeHalfLoopUpSeq5.blockedSegments, }; static constexpr SequenceDescriptor kRightLargeHalfLoopDownSeq2 = { .clearance = { -64, 0, -160, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kLeftLargeHalfLoopUpSeq4.blockedSegments, }; static constexpr SequenceDescriptor kRightLargeHalfLoopDownSeq3 = { .clearance = { -32, 32, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftLargeHalfLoopUpSeq3.blockedSegments, }; static constexpr SequenceDescriptor kRightLargeHalfLoopDownSeq4 = { .clearance = { 0, 32, -248, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = kLeftLargeHalfLoopUpSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightLargeHalfLoopDownSeq5 = { .clearance = { 32, 32, -264, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kLeftLargeHalfLoopUpSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightLargeHalfLoopDownSeq6 = { .clearance = { 64, 32, -280, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kLeftLargeHalfLoopUpSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftFlyerTwistUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerTwistUpSeq1 = { .clearance = { -32, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerTwistUpSeq2 = { .clearance = { -64, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightFlyerTwistUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerTwistUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerTwistUpSeq1 = { .clearance = { -32, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerTwistUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerTwistUpSeq2 = { .clearance = { -64, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerTwistUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kLeftFlyerTwistDownSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsRotate(kLeftFlyerTwistUpSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftFlyerTwistDownSeq1 = { .clearance = { -32, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsRotate(kLeftFlyerTwistUpSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftFlyerTwistDownSeq2 = { .clearance = { -64, 0, 16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftFlyerTwistUpSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightFlyerTwistDownSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerTwistDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerTwistDownSeq1 = { .clearance = { -32, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerTwistDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerTwistDownSeq2 = { .clearance = { -64, 0, 16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerTwistDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedUpSeq1 = { .clearance = { -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedUpSeq2 = { .clearance = { -64, 0, 32, 96, { 0b0011, 0 }, 0 }, .allowedWallEdges = 0b1011, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::bottomLeft, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::bottomLeft, PS::topLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedUpSeq3 = { .clearance = { -32, 0, 120, 16, { 0b1111, 0 }, 0 }, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedDownSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, + .blockedSegments = kFlyerHalfLoopUninvertedUpSeq3.blockedSegments, }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedDownSeq1 = { .clearance = { -32, 0, -88, 96, { 0b0011, 0 }, 0 }, .allowedWallEdges = 0b1011, + .blockedSegments = kFlyerHalfLoopUninvertedUpSeq2.blockedSegments, }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedDownSeq2 = { .clearance = { 0, 0, -104, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = kFlyerHalfLoopUninvertedUpSeq1.blockedSegments, }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedDownSeq3 = { .clearance = { 32, 0, -120, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = kFlyerHalfLoopUninvertedUpSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftFlyerCorkscrewUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kLeftCorkscrewUpSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftFlyerCorkscrewUpSeq1 = { .clearance = { -32, 0, 24, 32, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kLeftCorkscrewUpSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftFlyerCorkscrewUpSeq2 = { .clearance = { -32, -32, 48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = kLeftCorkscrewUpSeq2.blockedSegments, }; static constexpr SequenceDescriptor kRightFlyerCorkscrewUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kRightCorkscrewUpSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightFlyerCorkscrewUpSeq1 = { .clearance = { -32, 0, 24, 32, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightCorkscrewUpSeq1.blockedSegments, }; static constexpr SequenceDescriptor kRightFlyerCorkscrewUpSeq2 = { .clearance = { -32, 32, 48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = kRightCorkscrewUpSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftFlyerCorkscrewDownSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerCorkscrewDownSeq1 = { .clearance = { -32, 0, -24, 32, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerCorkscrewDownSeq2 = { .clearance = { -32, -32, -48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightFlyerCorkscrewDownSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightFlyerCorkscrewDownSeq1 = { .clearance = { -32, 0, -24, 32, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerCorkscrewDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerCorkscrewDownSeq2 = { .clearance = { -32, 32, -48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerCorkscrewDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kHeartLineTransferUpSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kHeartLineTransferUpSeq1 = { .clearance = { -32, 0, 0, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kHeartLineTransferUpSeq2 = { .clearance = { -64, 0, 16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kHeartLineTransferUpSeq3 = { .clearance = { 0, 0, 32, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kHeartLineTransferDownSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kHeartLineTransferUpSeq3.blockedSegments, }; static constexpr SequenceDescriptor kHeartLineTransferDownSeq1 = { .clearance = { -32, 0, -32, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .blockedSegments = kHeartLineTransferUpSeq2.blockedSegments, }; static constexpr SequenceDescriptor kHeartLineTransferDownSeq2 = { .clearance = { -64, 0, -16, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kHeartLineTransferUpSeq1.blockedSegments, }; static constexpr SequenceDescriptor kHeartLineTransferDownSeq3 = { .clearance = { 0, 0, -32, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .blockedSegments = kHeartLineTransferUpSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftHeartLineRollSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHeartLineRollSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHeartLineRollSeq2 = { .clearance = { -64, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHeartLineRollSeq3 = { .clearance = { -96, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHeartLineRollSeq4 = { .clearance = { -128, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftHeartLineRollSeq5 = { .clearance = { -160, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightHeartLineRollSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHeartLineRollSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightHeartLineRollSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHeartLineRollSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightHeartLineRollSeq2 = { .clearance = { -64, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHeartLineRollSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightHeartLineRollSeq3 = { .clearance = { -96, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHeartLineRollSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightHeartLineRollSeq4 = { .clearance = { -128, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHeartLineRollSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightHeartLineRollSeq5 = { .clearance = { -160, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftHeartLineRollSeq5.blockedSegments), }; static constexpr SequenceDescriptor kMinigolfHoleASeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleASeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleBSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleBSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleCSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleCSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleDSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleDSeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleDSeq2 = { .clearance = { -32, 32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::nwSe }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleESeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleESeq1 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMinigolfHoleESeq2 = { .clearance = { -32, -32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::nwSe }, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kMultiDimInvertedFlatToDown90QuarterLoopSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimInvertedFlatToDown90QuarterLoopSeq1 = { .clearance = { -32, 0, -40, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimInvertedFlatToDown90QuarterLoopSeq2 = { .clearance = { -64, 0, -96, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimInvertedFlatToDown90QuarterLoopSeq3 = { @@ -9084,220 +10791,386 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kUp90ToInvertedFlatQuarterLoopSeq0 = { .clearance = { 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kUp90ToInvertedFlatQuarterLoopSeq1 = { .clearance = { 32, 0, 56, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kUp90ToInvertedFlatQuarterLoopSeq2 = { .clearance = { 64, 0, 96, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kInvertedFlatToDown90QuarterLoopSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kInvertedFlatToDown90QuarterLoopSeq1 = { .clearance = { -32, 0, -72, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kInvertedFlatToDown90QuarterLoopSeq2 = { .clearance = { -64, 0, -128, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kInvertedFlatToDown90QuarterLoopSeq3 = { .clearance = { -96, 0, -128, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsNone, // wide + } }, }; static constexpr SequenceDescriptor kLeftCurvedLiftHillSeq0 = { .clearance = { 0, 0, 0, 0, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftCurvedLiftHillSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftCurvedLiftHillSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftCurvedLiftHillSeq3 = { .clearance = { -32, -32, 0, 8, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightCurvedLiftHillSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftCurvedLiftHillSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightCurvedLiftHillSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftCurvedLiftHillSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightCurvedLiftHillSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftCurvedLiftHillSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightCurvedLiftHillSeq3 = { .clearance = { -32, 32, 0, 8, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftCurvedLiftHillSeq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftReverserSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftReverserSeq1 = { .clearance = { 0, -32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftReverserSeq2 = { .clearance = { -32, -32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftReverserSeq3 = { .clearance = { -64, -32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftReverserSeq4 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftReverserSeq5 = { .clearance = { -64, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightReverserSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftReverserSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightReverserSeq1 = { .clearance = { 0, 32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftReverserSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightReverserSeq2 = { .clearance = { -32, 32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftReverserSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightReverserSeq3 = { .clearance = { -64, 32, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftReverserSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightReverserSeq4 = { .clearance = { -32, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftReverserSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightReverserSeq5 = { .clearance = { -64, 0, 0, 0, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftReverserSeq5.blockedSegments), }; static constexpr SequenceDescriptor kAirThrustTopCapSeq0 = { .clearance = { 0, 0, 0, 32, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustTopCapSeq1 = { .clearance = { 32, 0, 0, 32, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustTopCapSeq2 = { .clearance = { -64, 0, 0, 32, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustTopCapSeq3 = { .clearance = { -32, 0, 0, 32, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownSeq0 = { .clearance = { 0, 0, 0, 48, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownSeq1 = { .clearance = { 32, 0, 0, 48, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownToLevelSeq0 = { .clearance = { 0, 0, 0, 208, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownToLevelSeq1 = { .clearance = { 32, 0, 0, 208, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownToLevelSeq2 = { .clearance = { -32, 0, 0, 160, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownToLevelSeq3 = { .clearance = { -64, 0, 0, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownToLevelSeq4 = { .clearance = { -96, 0, 0, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownToLevelSeq5 = { .clearance = { -128, 0, 0, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kAirThrustVerticalDownToLevelSeq6 = { .clearance = { -160, 0, 0, 16, { 0b1111, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kBlockBrakesSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b0111, 0b0100 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileUp25Seq1 = { @@ -9308,116 +11181,169 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileUp25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileUp25Seq3 = { .clearance = { -32, -32, 16, 16, { 0b0111, 0b0110 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1011, 0b1000 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileUp25Seq1 = { .clearance = { 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileUp25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileUp25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileUp25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileUp25Seq3 = { .clearance = { -32, 32, 16, 16, { 0b1011, 0b1001 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileUp25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileDown25Seq0 = { .clearance = { 0, 0, 16, 16, { 0b0111, 0b0011 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn3TileUp25Seq3.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileDown25Seq1 = { .clearance = { 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn3TileUp25Seq1.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileDown25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn3TileUp25Seq2.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn3TileDown25Seq3 = { .clearance = { -32, -32, 0, 16, { 0b0111, 0b0001 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn3TileUp25Seq0.blockedSegments, 1), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileDown25Seq0 = { .clearance = { 0, 0, 16, 16, { 0b1011, 0b0011 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileDown25Seq1 = { .clearance = { 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileDown25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileDown25Seq2 = { .clearance = { -32, 0, 16, 0, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileDown25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn3TileDown25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b1011, 0b0010 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn3TileDown25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::top, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq1 = { .clearance = { 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + EnumsToFlags(PS::right, PS::topRight, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq2 = { .clearance = { -32, 0, 16, 16, { 0b0111, 0b0100 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsAllTypes( + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft)), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq3 = { .clearance = { -32, -32, 24, 16, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // inverted + EnumsToFlags( + PS::top, PS::right, PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, + PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq4 = { .clearance = { -32, -64, 48, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsNone, // inverted + EnumsToFlags(PS::right, PS::topRight, PS::bottomRight), // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq5 = { .clearance = { -64, -32, 32, 16, { 0b0111, 0b0100 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsAllTypes( + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight)), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq6 = { .clearance = { -64, -64, 48, 16, { 0b1111, 0b0110 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileUp25Seq7 = { @@ -9428,38 +11354,45 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileUp25Seq1 = { .clearance = { 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileUp25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileUp25Seq2 = { .clearance = { -32, 0, 16, 16, { 0b1011, 0b1000 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileUp25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileUp25Seq3 = { .clearance = { -32, 32, 24, 16, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileUp25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileUp25Seq4 = { .clearance = { -32, 64, 48, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileUp25Seq4.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileUp25Seq5 = { .clearance = { -64, 32, 32, 16, { 0b1011, 0b1000 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileUp25Seq5.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileUp25Seq6 = { .clearance = { -64, 64, 48, 16, { 0b1111, 0b1001 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileUp25Seq6.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileUp25Seq7 = { @@ -9470,38 +11403,45 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 48, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn5TileUp25Seq6.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileDown25Seq1 = { .clearance = { 0, -32, 48, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn5TileUp25Seq4.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileDown25Seq2 = { .clearance = { -32, 0, 32, 16, { 0b0111, 0b0001 }, 0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn5TileUp25Seq5.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileDown25Seq3 = { .clearance = { -32, -32, 24, 16, { 0b1101, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn5TileUp25Seq3.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileDown25Seq4 = { .clearance = { -32, -64, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn5TileUp25Seq1.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileDown25Seq5 = { .clearance = { -64, -32, 16, 16, { 0b0111, 0b0001 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn5TileUp25Seq2.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileDown25Seq6 = { .clearance = { -64, -64, 0, 16, { 0b1111, 0b1001 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightBankedQuarterTurn5TileUp25Seq0.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftBankedQuarterTurn5TileDown25Seq7 = { @@ -9512,38 +11452,45 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 48, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileDown25Seq1 = { .clearance = { 0, 32, 48, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileDown25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileDown25Seq2 = { .clearance = { -32, 0, 32, 16, { 0b1011, 0b0010 }, 0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileDown25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileDown25Seq3 = { .clearance = { -32, 32, 24, 16, { 0b1110, 0 }, 0 }, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileDown25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileDown25Seq4 = { .clearance = { -32, 64, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileDown25Seq4.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileDown25Seq5 = { .clearance = { -64, 32, 16, 16, { 0b1011, 0b0010 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileDown25Seq5.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileDown25Seq6 = { .clearance = { -64, 64, 0, 16, { 0b1111, 0b0110 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedQuarterTurn5TileDown25Seq6.blockedSegments), }; static constexpr SequenceDescriptor kRightBankedQuarterTurn5TileDown25Seq7 = { @@ -9554,149 +11501,238 @@ namespace OpenRCT2::TrackMetaData .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kUp25ToRightBankedUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = blockedSegmentsFlipXAxis(kUp25ToLeftBankedUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedUp25ToUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedUp25ToUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedUp25ToUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kDown25ToLeftBankedDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kDown25ToRightBankedDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kDown25ToLeftBankedDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedDown25ToDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedDown25ToDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedDown25ToDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedFlatToLeftBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedFlatToRightBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedFlatToLeftBankedUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedUp25ToLeftBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedUp25ToRightBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedUp25ToLeftBankedFlatSeq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedFlatToLeftBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedFlatToRightBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedFlatToLeftBankedDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedDown25ToLeftBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedDown25ToRightBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedDown25ToLeftBankedFlatSeq0.blockedSegments), }; static constexpr SequenceDescriptor kFlatToLeftBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kFlatToRightBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .blockedSegments = blockedSegmentsFlipXAxis(kFlatToLeftBankedUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedUp25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedUp25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedUp25ToFlatSeq0.blockedSegments), }; static constexpr SequenceDescriptor kFlatToLeftBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kFlatToRightBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToDown25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25DegToFlat }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kFlatToLeftBankedDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftBankedDown25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .extraSupportRotation = 2, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightBankedDown25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25DegToFlat }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::flatToUp25Deg }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftBankedDown25ToFlatSeq0.blockedSegments), }; static constexpr SequenceDescriptor kLeftQuarterTurn1TileUp90Seq0 = { .clearance = { 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1111, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn1TileUp90Seq1 = { @@ -9706,6 +11742,7 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kRightQuarterTurn1TileUp90Seq0 = { .clearance = { 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1111, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn1TileUp90Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn1TileUp90Seq1 = { @@ -9715,6 +11752,11 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kLeftQuarterTurn1TileDown90Seq0 = { .clearance = { 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1111, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topLeft, PS::bottomRight), // narrow + EnumsToFlags(PS::centre, PS::topLeft, PS::bottomRight), // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftQuarterTurn1TileDown90Seq1 = { @@ -9724,6 +11766,7 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kRightQuarterTurn1TileDown90Seq0 = { .clearance = { 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1111, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftQuarterTurn1TileDown90Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightQuarterTurn1TileDown90Seq1 = { @@ -9733,31 +11776,37 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kMultiDimUp90ToInvertedFlatQuarterLoopSeq0 = { .clearance = { 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimUp90ToInvertedFlatQuarterLoopSeq1 = { .clearance = { 32, 0, 56, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimUp90ToInvertedFlatQuarterLoopSeq2 = { .clearance = { 64, 0, 96, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimFlatToDown90QuarterLoopSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimFlatToDown90QuarterLoopSeq1 = { .clearance = { -32, 0, -72, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimFlatToDown90QuarterLoopSeq2 = { .clearance = { -64, 0, -128, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimFlatToDown90QuarterLoopSeq3 = { @@ -9767,22 +11816,26 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kMultiDimInvertedUp90ToFlatQuarterLoopSeq0 = { .clearance = { 0, 0, 32, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimInvertedUp90ToFlatQuarterLoopSeq1 = { .clearance = { 32, 0, 88, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kMultiDimInvertedUp90ToFlatQuarterLoopSeq2 = { .clearance = { 64, 0, 128, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, .allowedWallEdges = 0b1010, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRotationControlToggleSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kFlatTrack1x4ASeq0 = { @@ -10115,2012 +12168,2808 @@ namespace OpenRCT2::TrackMetaData static constexpr SequenceDescriptor kLeftLargeCorkscrewUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeCorkscrewUpSeq1 = { .clearance = { -32, 0, 8, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeCorkscrewUpSeq2 = { .clearance = { -64, 0, 32, 24, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeCorkscrewUpSeq3 = { .clearance = { -32, -32, 32, 24, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1100, + .blockedSegments = { { + kSegmentsNone, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeCorkscrewUpSeq4 = { .clearance = { -64, -32, 48, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeCorkscrewUpSeq5 = { .clearance = { -64, -64, 72, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightLargeCorkscrewUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewUpSeq1 = { .clearance = { -32, 0, 8, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewUpSeq2 = { .clearance = { -64, 0, 32, 24, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewUpSeq3 = { .clearance = { -32, 32, 32, 24, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewUpSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewUpSeq4 = { .clearance = { -64, 32, 48, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewUpSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewUpSeq5 = { .clearance = { -64, 64, 72, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewUpSeq5.blockedSegments), }; static constexpr SequenceDescriptor kLeftLargeCorkscrewDownSeq0 = { .clearance = { 0, 0, -40, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kRightLargeCorkscrewUpSeq5.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftLargeCorkscrewDownSeq1 = { .clearance = { -32, 0, -64, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kRightLargeCorkscrewUpSeq4.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftLargeCorkscrewDownSeq2 = { .clearance = { -32, -32, -80, 24, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsRotate(kRightLargeCorkscrewUpSeq3.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftLargeCorkscrewDownSeq3 = { .clearance = { -64, 0, -80, 24, { 0b0111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsRotate(kRightLargeCorkscrewUpSeq2.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftLargeCorkscrewDownSeq4 = { .clearance = { -64, -32, -104, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .blockedSegments = blockedSegmentsRotate(kRightLargeCorkscrewUpSeq1.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftLargeCorkscrewDownSeq5 = { .clearance = { -64, -64, -112, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .blockedSegments = blockedSegmentsRotate(kRightLargeCorkscrewUpSeq0.blockedSegments, 1), }; static constexpr SequenceDescriptor kRightLargeCorkscrewDownSeq0 = { .clearance = { 0, 0, -40, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewDownSeq1 = { .clearance = { -32, 0, -64, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewDownSeq2 = { .clearance = { -32, 32, -80, 24, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewDownSeq3 = { .clearance = { -64, 0, -80, 24, { 0b1011, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewDownSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewDownSeq4 = { .clearance = { -64, 32, -104, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewDownSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeCorkscrewDownSeq5 = { .clearance = { -64, 64, -112, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeCorkscrewDownSeq5.blockedSegments), }; static constexpr SequenceDescriptor kLeftMediumHalfLoopUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopUpSeq1 = { .clearance = { -32, 0, 16, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopUpSeq2 = { .clearance = { -64, 0, 56, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopUpSeq3 = { .clearance = { -64, -32, 56, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopUpSeq4 = { .clearance = { -32, -32, 168, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightMediumHalfLoopUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopUpSeq1 = { .clearance = { -32, 0, 16, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopUpSeq2 = { .clearance = { -64, 0, 56, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopUpSeq3 = { .clearance = { -64, 32, 56, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopUpSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopUpSeq4 = { .clearance = { -32, 32, 168, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopUpSeq4.blockedSegments), }; static constexpr SequenceDescriptor kLeftMediumHalfLoopDownSeq0 = { .clearance = { 0, 0, -48, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = kRightMediumHalfLoopUpSeq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopDownSeq1 = { .clearance = { -32, 0, -160, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = kRightMediumHalfLoopUpSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopDownSeq2 = { .clearance = { -32, -32, -160, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = kRightMediumHalfLoopUpSeq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopDownSeq3 = { .clearance = { 0, -32, -200, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = kRightMediumHalfLoopUpSeq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftMediumHalfLoopDownSeq4 = { .clearance = { 32, -32, -216, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = kRightMediumHalfLoopUpSeq0.blockedSegments, }; static constexpr SequenceDescriptor kRightMediumHalfLoopDownSeq0 = { .clearance = { 0, 0, -48, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopDownSeq1 = { .clearance = { -32, 0, -160, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopDownSeq2 = { .clearance = { -32, 32, -160, 120, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopDownSeq3 = { .clearance = { 0, 32, -200, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopDownSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightMediumHalfLoopDownSeq4 = { .clearance = { 32, 32, -216, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftMediumHalfLoopDownSeq4.blockedSegments), }; static constexpr SequenceDescriptor kLeftZeroGRollUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftZeroGRollUpSeq1 = { .clearance = { -32, 0, 8, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftZeroGRollUpSeq2 = { .clearance = { -64, 0, 24, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightZeroGRollUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftZeroGRollUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightZeroGRollUpSeq1 = { .clearance = { -32, 0, 8, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftZeroGRollUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightZeroGRollUpSeq2 = { .clearance = { -64, 0, 24, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftZeroGRollUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kLeftZeroGRollDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftZeroGRollUpSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftZeroGRollDownSeq1 = { .clearance = { -32, 0, -48, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftZeroGRollUpSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftZeroGRollDownSeq2 = { .clearance = { -64, 0, -56, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftZeroGRollUpSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightZeroGRollDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftZeroGRollDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightZeroGRollDownSeq1 = { .clearance = { -32, 0, -48, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftZeroGRollDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightZeroGRollDownSeq2 = { .clearance = { -64, 0, -56, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftZeroGRollDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kLeftLargeZeroGRollUpSeq0 = { .clearance = { 0, 0, 0, 64, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeZeroGRollUpSeq1 = { .clearance = { -32, 0, 56, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeZeroGRollUpSeq2 = { .clearance = { -64, 0, 96, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftLargeZeroGRollUpSeq3 = { .clearance = { -96, 0, 120, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightLargeZeroGRollUpSeq0 = { .clearance = { 0, 0, 0, 64, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeZeroGRollUpSeq1 = { .clearance = { -32, 0, 56, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeZeroGRollUpSeq2 = { .clearance = { -64, 0, 96, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeZeroGRollUpSeq3 = { .clearance = { -96, 0, 120, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollUpSeq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftLargeZeroGRollDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftLargeZeroGRollUpSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftLargeZeroGRollDownSeq1 = { .clearance = { -32, 0, -56, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftLargeZeroGRollUpSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftLargeZeroGRollDownSeq2 = { .clearance = { -64, 0, -96, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftLargeZeroGRollUpSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftLargeZeroGRollDownSeq3 = { .clearance = { -96, 0, -152, 64, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kLeftLargeZeroGRollUpSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightLargeZeroGRollDownSeq0 = { .clearance = { 0, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeZeroGRollDownSeq1 = { .clearance = { -32, 0, -56, 40, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeZeroGRollDownSeq2 = { .clearance = { -64, 0, -96, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightLargeZeroGRollDownSeq3 = { .clearance = { -96, 0, -152, 64, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftLargeZeroGRollDownSeq3.blockedSegments), }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedUpSeq1 = { .clearance = { -32, 0, 16, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedUpSeq2 = { .clearance = { -64, 0, 32, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedUpSeq3 = { .clearance = { -96, 0, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedUpSeq4 = { .clearance = { -128, -32, 120, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedUpSeq5 = { .clearance = { -96, -32, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedUpSeq6 = { .clearance = { -64, -32, 248, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedUpSeq1 = { .clearance = { -32, 0, 16, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedUpSeq2 = { .clearance = { -64, 0, 32, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedUpSeq3 = { .clearance = { -96, 0, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedUpSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedUpSeq4 = { .clearance = { -128, 32, 120, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedUpSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedUpSeq5 = { .clearance = { -96, 32, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedUpSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedUpSeq6 = { .clearance = { -64, 32, 248, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedUpSeq6.blockedSegments), }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedDownSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedDownSeq1 = { .clearance = { -32, 0, -184, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedDownSeq2 = { .clearance = { -64, 0, -128, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedDownSeq3 = { .clearance = { -32, -32, -184, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .invertSegmentBlocking = true, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedDownSeq4 = { .clearance = { 0, -32, -216, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .invertSegmentBlocking = true, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedDownSeq5 = { .clearance = { 32, -32, -232, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedDownSeq6 = { .clearance = { 64, -32, -248, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedDownSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedDownSeq1 = { .clearance = { -32, 0, -184, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedDownSeq2 = { .clearance = { -64, 0, -128, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedDownSeq3 = { .clearance = { -32, 32, -184, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedDownSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedDownSeq4 = { .clearance = { 0, 32, -216, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedDownSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedDownSeq5 = { .clearance = { 32, 32, -232, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedDownSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedDownSeq6 = { .clearance = { 64, 32, -248, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedDownSeq6.blockedSegments), }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedUpSeq1 = { .clearance = { -32, 0, 16, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedUpSeq2 = { .clearance = { -64, 0, 32, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedUpSeq3 = { .clearance = { -96, 0, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedUpSeq4 = { .clearance = { -128, -32, 120, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedUpSeq5 = { .clearance = { -96, -32, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopInvertedUpSeq6 = { .clearance = { -64, -32, 248, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .invertSegmentBlocking = true, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedUpSeq0 = { .clearance = { 0, 0, 0, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedUpSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedUpSeq1 = { .clearance = { -32, 0, 16, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedUpSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedUpSeq2 = { .clearance = { -64, 0, 32, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedUpSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedUpSeq3 = { .clearance = { -96, 0, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedUpSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedUpSeq4 = { .clearance = { -128, 32, 120, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedUpSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedUpSeq5 = { .clearance = { -96, 32, 64, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedUpSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopInvertedUpSeq6 = { .clearance = { -64, 32, 248, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopInvertedUpSeq6.blockedSegments), }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedDownSeq0 = { .clearance = { 0, 0, -32, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedDownSeq1 = { .clearance = { -32, 0, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedDownSeq2 = { .clearance = { -64, 0, -160, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedDownSeq3 = { .clearance = { -32, -32, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedDownSeq4 = { .clearance = { 0, -32, -248, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedDownSeq5 = { .clearance = { 32, -32, -264, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftFlyerLargeHalfLoopUninvertedDownSeq6 = { .clearance = { 64, -32, -280, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedDownSeq0 = { .clearance = { 0, 0, -32, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedDownSeq0.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedDownSeq1 = { .clearance = { -32, 0, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedDownSeq1.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedDownSeq2 = { .clearance = { -64, 0, -160, 96, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedDownSeq2.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedDownSeq3 = { .clearance = { -32, 32, -216, 192, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedDownSeq3.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedDownSeq4 = { .clearance = { 0, 32, -248, 56, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedDownSeq4.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedDownSeq5 = { .clearance = { 32, 32, -264, 40, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedDownSeq5.blockedSegments), }; static constexpr SequenceDescriptor kRightFlyerLargeHalfLoopUninvertedDownSeq6 = { .clearance = { 64, 32, -280, 24, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftFlyerLargeHalfLoopUninvertedDownSeq6.blockedSegments), }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedUpSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedUpSeq1 = { .clearance = { -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + kSegmentsAll, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedUpSeq2 = { .clearance = { -64, 0, 32, 96, { 0b0011, 0 }, 0 }, .allowedWallEdges = 0b1011, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags( + PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, + PS::bottomRight), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopInvertedUpSeq3 = { .clearance = { -32, 0, 120, 32, { 0b1111, 0 }, 0 }, + .invertSegmentBlocking = true, + .blockedSegments = { { + kSegmentsUnimplemented, // narrow + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedDownSeq0 = { .clearance = { 0, 0, -32, 32, { 0b1111, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedDownSeq1 = { .clearance = { -32, 0, -120, 96, { 0b0011, 0 }, 0 }, .allowedWallEdges = 0b1011, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::bottom, PS::centre, PS::topLeft, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedDownSeq2 = { .clearance = { 0, 0, -136, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .blockedSegments = { { + kSegmentsAll, // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kFlyerHalfLoopUninvertedDownSeq3 = { .clearance = { 32, 0, -152, 16, { 0b1111, 0b1100 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = { { + EnumsToFlags(PS::centre, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagUp25Seq1 = { .clearance = { -32, 0, 16, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagUp25Seq2 = { .clearance = { -32, -32, 32, 16, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::bottom, PS::centre, PS::topRight, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagUp25Seq3 = { .clearance = { -64, 0, 32, 16, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthToDiagUp25Seq4 = { .clearance = { -64, -32, 32, 24, { 0b0001, 0 }, 0 }, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsAll, // wide + } }, }; static constexpr SequenceDescriptor kRightEighthToDiagUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagUp25Seq1 = { .clearance = { -32, 0, 16, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagUp25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagUp25Seq2 = { .clearance = { -32, 32, 32, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagUp25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagUp25Seq3 = { .clearance = { -64, 0, 32, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagUp25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagUp25Seq4 = { .clearance = { -64, 32, 32, 24, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagUp25Seq4.blockedSegments), }; static constexpr SequenceDescriptor kLeftEighthToDiagDown25Seq0 = { .clearance = { 0, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = kLeftEighthToDiagUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToDiagDown25Seq1 = { .clearance = { -32, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kLeftEighthToDiagUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToDiagDown25Seq2 = { .clearance = { -32, -32, -48, 16, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftEighthToDiagUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToDiagDown25Seq3 = { .clearance = { -64, 0, -48, 16, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftEighthToDiagUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToDiagDown25Seq4 = { .clearance = { -64, -32, -48, 16, { 0b0001, 0 }, 0 }, + .blockedSegments = kLeftEighthToDiagUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthToDiagDown25Seq0 = { .clearance = { 0, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagDown25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagDown25Seq1 = { .clearance = { -32, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagDown25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagDown25Seq2 = { .clearance = { -32, 32, -48, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagDown25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagDown25Seq3 = { .clearance = { -64, 0, -48, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagDown25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthToDiagDown25Seq4 = { .clearance = { -64, 32, -48, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthToDiagDown25Seq4.blockedSegments), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagUp25Seq4.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalUp25Seq1 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagUp25Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalUp25Seq2 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagUp25Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalUp25Seq3 = { .clearance = { -32, 32, 16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagUp25Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalUp25Seq4 = { .clearance = { -64, 32, 32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthToDiagUp25Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagUp25Seq4.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0100, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagUp25Seq2.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagUp25Seq3.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalUp25Seq3 = { .clearance = { -32, 32, 16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::nwSe }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagUp25Seq1.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthToOrthogonalUp25Seq4 = { .clearance = { -32, 64, 32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::nwSe }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthToDiagUp25Seq0.blockedSegments, 3), }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalDown25Seq0 = { .clearance = { 0, 0, -16, 24, { 0b1101, 0 }, 0 }, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = kLeftEighthToOrthogonalUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalDown25Seq1 = { .clearance = { -32, 0, -16, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kLeftEighthToOrthogonalUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalDown25Seq2 = { .clearance = { 0, 32, -16, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kLeftEighthToOrthogonalUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalDown25Seq3 = { .clearance = { -32, 32, -32, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kLeftEighthToOrthogonalUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthToOrthogonalDown25Seq4 = { .clearance = { -64, 32, -48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = kLeftEighthToOrthogonalUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthToOrthogonalDown25Seq0 = { .clearance = { 0, 0, -16, 24, { 0b1101, 0 }, 0 }, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = kRightEighthToOrthogonalUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthToOrthogonalDown25Seq1 = { .clearance = { 0, 32, -16, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0100, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kRightEighthToOrthogonalUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthToOrthogonalDown25Seq2 = { .clearance = { -32, 0, -16, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kRightEighthToOrthogonalUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthToOrthogonalDown25Seq3 = { .clearance = { -32, 32, -32, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kRightEighthToOrthogonalUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthToOrthogonalDown25Seq4 = { .clearance = { -32, 64, -48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .blockedSegments = kRightEighthToOrthogonalUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankedUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankedUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankedUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToLeftBankedUp25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankedUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankedUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankedUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25ToRightBankedUp25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToUp25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToUp25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankedDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankedDown25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankedDown25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToLeftBankedDown25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankedDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankedDown25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankedDown25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25ToRightBankedDown25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToDown25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToDown25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToDown25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToDown25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToDown25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToDown25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToDown25Seq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedUp25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedUp25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedUp25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedUp25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedUp25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedUp25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToLeftBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToLeftBankedFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToLeftBankedFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToLeftBankedFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToRightBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToRightBankedFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToRightBankedFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToRightBankedFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedDown25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedDown25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedFlatToLeftBankedDown25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedDown25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedDown25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedFlatToRightBankedDown25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToLeftBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToLeftBankedFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToLeftBankedFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToLeftBankedFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToRightBankedFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToRightBankedFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToRightBankedFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToRightBankedFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedUp25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedUp25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedUp25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedUp25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedUp25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedUp25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedUp25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedUp25ToFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedUp25ToFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedDown25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedDown25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToLeftBankedDown25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedDown25Seq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedDown25Seq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedDown25Seq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToRightBankedDown25Seq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagLeftBankedDown25ToFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToFlatSeq0 = { .clearance = { 0, 0, 0, 8, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToFlatSeq1 = { .clearance = { 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToFlatSeq2 = { .clearance = { -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagRightBankedDown25ToFlatSeq3 = { .clearance = { -32, 32, 0, 8, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25LeftBankedSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25LeftBankedSeq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25LeftBankedSeq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25LeftBankedSeq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25RightBankedSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25RightBankedSeq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25RightBankedSeq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagUp25RightBankedSeq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25LeftBankedSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25LeftBankedSeq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25LeftBankedSeq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25LeftBankedSeq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25RightBankedSeq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25RightBankedSeq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25RightBankedSeq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagDown25RightBankedSeq3 = { .clearance = { -32, 32, 0, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = kLeftEighthToDiagUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagUp25Seq1 = { .clearance = { -32, 0, 16, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kLeftEighthToDiagUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagUp25Seq2 = { .clearance = { -32, -32, 32, 16, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftEighthToDiagUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagUp25Seq3 = { .clearance = { -64, 0, 32, 16, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftEighthToDiagUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagUp25Seq4 = { .clearance = { -64, -32, 32, 24, { 0b0001, 0 }, 0 }, + .blockedSegments = kLeftEighthToDiagUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToDiagUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagUp25Seq0.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagUp25Seq1 = { .clearance = { -32, 0, 16, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagUp25Seq1.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagUp25Seq2 = { .clearance = { -32, 32, 32, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagUp25Seq2.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagUp25Seq3 = { .clearance = { -64, 0, 32, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagUp25Seq3.blockedSegments), }; static constexpr SequenceDescriptor kRightEighthBankToDiagUp25Seq4 = { .clearance = { -64, 32, 32, 24, { 0b0010, 0 }, 0 }, + .blockedSegments = blockedSegmentsFlipXAxis(kLeftEighthBankToDiagUp25Seq4.blockedSegments), }; static constexpr SequenceDescriptor kLeftEighthBankToDiagDown25Seq0 = { .clearance = { 0, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = kLeftEighthBankToDiagUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagDown25Seq1 = { .clearance = { -32, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kLeftEighthBankToDiagUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagDown25Seq2 = { .clearance = { -32, -32, -48, 16, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kLeftEighthBankToDiagUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagDown25Seq3 = { .clearance = { -64, 0, -48, 16, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0011, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kLeftEighthBankToDiagUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToDiagDown25Seq4 = { .clearance = { -64, -32, -48, 16, { 0b0001, 0 }, 0 }, + .blockedSegments = kLeftEighthBankToDiagUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToDiagDown25Seq0 = { .clearance = { 0, 0, -16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = kRightEighthBankToDiagUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToDiagDown25Seq1 = { .clearance = { -32, 0, -32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kRightEighthBankToDiagUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToDiagDown25Seq2 = { .clearance = { -32, 32, -48, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kRightEighthBankToDiagUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToDiagDown25Seq3 = { .clearance = { -64, 0, -48, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kRightEighthBankToDiagUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToDiagDown25Seq4 = { .clearance = { -64, 32, -48, 16, { 0b0010, 0 }, 0 }, + .blockedSegments = kRightEighthBankToDiagUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagUp25Seq4.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalUp25Seq1 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagUp25Seq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalUp25Seq2 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagUp25Seq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalUp25Seq3 = { .clearance = { -32, 32, 16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagUp25Seq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalUp25Seq4 = { .clearance = { -64, 32, 32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = blockedSegmentsRotate(kRightEighthBankToDiagUp25Seq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalUp25Seq0 = { .clearance = { 0, 0, 0, 16, { 0b1101, 0 }, 0 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagUp25Seq4.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalUp25Seq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0100, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagUp25Seq2.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalUp25Seq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagUp25Seq3.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalUp25Seq3 = { .clearance = { -32, 32, 16, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::nwSe }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagUp25Seq1.blockedSegments, 3), }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalUp25Seq4 = { .clearance = { -32, 64, 32, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::nwSe }, + .blockedSegments = blockedSegmentsRotate(kLeftEighthBankToDiagUp25Seq0.blockedSegments, 3), }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalDown25Seq0 = { .clearance = { 0, 0, -16, 24, { 0b1101, 0 }, 0 }, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = kLeftEighthBankToOrthogonalUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalDown25Seq1 = { .clearance = { -32, 0, -16, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1000, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kLeftEighthBankToOrthogonalUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalDown25Seq2 = { .clearance = { 0, 32, -16, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kLeftEighthBankToOrthogonalUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalDown25Seq3 = { .clearance = { -32, 32, -32, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kLeftEighthBankToOrthogonalUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kLeftEighthBankToOrthogonalDown25Seq4 = { .clearance = { -64, 32, -48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = kLeftEighthBankToOrthogonalUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalDown25Seq0 = { .clearance = { 0, 0, -16, 24, { 0b1101, 0 }, 0 }, - .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::down25Deg }, + .woodenSupports = { WoodenSupportSubType::neSw, WoodenSupportTransitionType::up25Deg }, + .extraSupportRotation = 2, + .blockedSegments = kRightEighthBankToOrthogonalUp25Seq0.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalDown25Seq1 = { .clearance = { 0, 32, -16, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0100, .woodenSupports = { WoodenSupportSubType::neSw }, + .blockedSegments = kRightEighthBankToOrthogonalUp25Seq1.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalDown25Seq2 = { .clearance = { -32, 0, -16, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner1 }, + .blockedSegments = kRightEighthBankToOrthogonalUp25Seq2.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalDown25Seq3 = { .clearance = { -32, 32, -32, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, .woodenSupports = { WoodenSupportSubType::corner3 }, + .blockedSegments = kRightEighthBankToOrthogonalUp25Seq3.blockedSegments, }; static constexpr SequenceDescriptor kRightEighthBankToOrthogonalDown25Seq4 = { .clearance = { -32, 64, -48, 16, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .blockedSegments = kRightEighthBankToOrthogonalUp25Seq4.blockedSegments, }; static constexpr SequenceDescriptor kDiagBrakesSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagBrakesSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagBrakesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagBrakesSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagBlockBrakesSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq0.blockedSegments, }; static constexpr SequenceDescriptor kDiagBlockBrakesSeq1 = { .clearance = { 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b0110, .woodenSupports = { WoodenSupportSubType::corner0 }, + .blockedSegments = kDiagFlatSeq1.blockedSegments, }; static constexpr SequenceDescriptor kDiagBlockBrakesSeq2 = { .clearance = { -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, .allowedWallEdges = 0b1001, .woodenSupports = { WoodenSupportSubType::corner2 }, + .blockedSegments = kDiagFlatSeq2.blockedSegments, }; static constexpr SequenceDescriptor kDiagBlockBrakesSeq3 = { .clearance = { -32, 32, 0, 0, { 0b0010, 0 }, 0 }, + .blockedSegments = kDiagFlatSeq3.blockedSegments, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq0 = { .clearance = { 0, 0, 0, 0, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq1 = { .clearance = { 0, 32, 0, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq2 = { .clearance = { -32, 0, 0, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq3 = { .clearance = { -32, 32, 0, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::right, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq4 = { .clearance = { -32, 64, 8, 40, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq5 = { .clearance = { -64, 32, 8, 40, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq6 = { .clearance = { -64, 64, 8, 64, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::right, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq7 = { .clearance = { -64, 96, 40, 88, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq8 = { .clearance = { -96, 64, 40, 88, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToUp60LongBaseSeq9 = { .clearance = { -96, 96, 40, 104, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq0 = { .clearance = { 0, 0, 0, 64, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq1 = { .clearance = { 0, 32, 0, 72, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq2 = { .clearance = { -32, 0, 0, 72, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq3 = { .clearance = { -32, 32, 0, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::right, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq4 = { .clearance = { -32, 64, 56, 32, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq5 = { .clearance = { -64, 32, 56, 32, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq6 = { .clearance = { -64, 64, 56, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::right, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq7 = { .clearance = { -64, 96, 80, 8, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq8 = { .clearance = { -96, 64, 80, 8, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagUp60ToFlatLongBaseSeq9 = { .clearance = { -96, 96, 80, 8, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::left, PS::centre, PS::topLeft, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq0 = { .clearance = { 0, 0, 80, 8, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq9.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq1 = { .clearance = { 0, 32, 80, 8, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq8.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq2 = { .clearance = { -32, 0, 80, 8, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq7.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq3 = { .clearance = { -32, 32, 56, 8, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq6.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq4 = { .clearance = { -32, 64, 56, 32, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq5.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq5 = { .clearance = { -64, 32, 56, 32, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq4.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq6 = { .clearance = { -64, 64, 0, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq7 = { .clearance = { -64, 96, 0, 72, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq8 = { .clearance = { -96, 64, 0, 72, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagFlatToDown60LongBaseSeq9 = { .clearance = { -96, 96, 0, 64, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagUp60ToFlatLongBaseSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq0 = { .clearance = { 0, 0, 40, 104, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq9.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq1 = { .clearance = { 0, 32, 40, 88, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq8.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq2 = { .clearance = { -32, 0, 40, 88, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq7.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq3 = { .clearance = { -32, 32, 8, 64, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq6.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq4 = { .clearance = { -32, 64, 8, 40, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq5.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq5 = { .clearance = { -64, 32, 8, 40, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq4.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq6 = { .clearance = { -64, 64, 0, 32, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq7 = { .clearance = { -64, 96, 0, 16, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq8 = { .clearance = { -96, 64, 0, 16, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kDiagDown60ToFlatLongBaseSeq9 = { .clearance = { -96, 96, 0, 0, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kDiagFlatToUp60LongBaseSeq0.blockedSegments, 2), }; static constexpr SequenceDescriptor kLeftEighthDiveLoopUpToOrthogonalSeq0 = { .clearance = { 0, 0, 0, 64, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = { { + EnumsToFlags(PS::right, PS::centre, PS::topRight, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthDiveLoopUpToOrthogonalSeq1 = { .clearance = { 0, 32, 0, 88, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::centre, PS::topLeft, PS::topRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthDiveLoopUpToOrthogonalSeq2 = { .clearance = { -32, 0, 0, 88, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = { { + EnumsToFlags(PS::bottom, PS::centre, PS::bottomLeft, PS::bottomRight), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthDiveLoopUpToOrthogonalSeq3 = { .clearance = { -32, 32, 32, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthDiveLoopUpToOrthogonalSeq4 = { .clearance = { -64, 32, 80, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kLeftEighthDiveLoopUpToOrthogonalSeq5 = { .clearance = { -96, 32, 112, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = { { + EnumsToFlags(PS::top, PS::left, PS::centre, PS::topLeft, PS::topRight, PS::bottomLeft), // narrow + kSegmentsUnimplemented, // inverted + kSegmentsUnimplemented, // wide + } }, }; static constexpr SequenceDescriptor kRightEighthDiveLoopUpToOrthogonalSeq0 = { .clearance = { 0, 0, 0, 64, { 0b1101, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate( + blockedSegmentsFlipXAxis(kLeftEighthDiveLoopUpToOrthogonalSeq0.blockedSegments), 1), }; static constexpr SequenceDescriptor kRightEighthDiveLoopUpToOrthogonalSeq1 = { .clearance = { -32, 0, 0, 88, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate( + blockedSegmentsFlipXAxis(kLeftEighthDiveLoopUpToOrthogonalSeq1.blockedSegments), 1), }; static constexpr SequenceDescriptor kRightEighthDiveLoopUpToOrthogonalSeq2 = { .clearance = { 0, 32, 0, 88, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate( + blockedSegmentsFlipXAxis(kLeftEighthDiveLoopUpToOrthogonalSeq2.blockedSegments), 1), }; static constexpr SequenceDescriptor kRightEighthDiveLoopUpToOrthogonalSeq3 = { .clearance = { -32, 32, 32, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0001, + .blockedSegments = blockedSegmentsRotate( + blockedSegmentsFlipXAxis(kLeftEighthDiveLoopUpToOrthogonalSeq3.blockedSegments), 1), }; static constexpr SequenceDescriptor kRightEighthDiveLoopUpToOrthogonalSeq4 = { .clearance = { -32, 64, 80, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate( + blockedSegmentsFlipXAxis(kLeftEighthDiveLoopUpToOrthogonalSeq4.blockedSegments), 1), }; static constexpr SequenceDescriptor kRightEighthDiveLoopUpToOrthogonalSeq5 = { .clearance = { -32, 96, 112, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0101, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate( + blockedSegmentsFlipXAxis(kLeftEighthDiveLoopUpToOrthogonalSeq5.blockedSegments), 1), }; static constexpr SequenceDescriptor kLeftEighthDiveLoopDownToDiagSeq0 = { .clearance = { 0, 0, 112, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kRightEighthDiveLoopUpToOrthogonalSeq5.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftEighthDiveLoopDownToDiagSeq1 = { .clearance = { -32, 0, 80, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kRightEighthDiveLoopUpToOrthogonalSeq4.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftEighthDiveLoopDownToDiagSeq2 = { .clearance = { -64, 0, 32, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b0010, + .blockedSegments = blockedSegmentsRotate(kRightEighthDiveLoopUpToOrthogonalSeq3.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftEighthDiveLoopDownToDiagSeq3 = { .clearance = { -64, -32, 0, 88, { 0b1000, 0 }, 0 }, .allowedWallEdges = 0b1100, + .blockedSegments = blockedSegmentsRotate(kRightEighthDiveLoopUpToOrthogonalSeq2.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftEighthDiveLoopDownToDiagSeq4 = { .clearance = { -96, 0, 0, 88, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0011, + .blockedSegments = blockedSegmentsRotate(kRightEighthDiveLoopUpToOrthogonalSeq1.blockedSegments, 1), }; static constexpr SequenceDescriptor kLeftEighthDiveLoopDownToDiagSeq5 = { .clearance = { -96, -32, 0, 64, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kRightEighthDiveLoopUpToOrthogonalSeq0.blockedSegments, 1), }; static constexpr SequenceDescriptor kRightEighthDiveLoopDownToDiagSeq0 = { .clearance = { 0, 0, 112, 24, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftEighthDiveLoopUpToOrthogonalSeq5.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthDiveLoopDownToDiagSeq1 = { .clearance = { -32, 0, 80, 48, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1010, + .invertSegmentBlocking = true, + .blockedSegments = blockedSegmentsRotate(kLeftEighthDiveLoopUpToOrthogonalSeq4.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthDiveLoopDownToDiagSeq2 = { .clearance = { -64, 0, 32, 80, { 0b1111, 0 }, 0 }, .allowedWallEdges = 0b1000, + .blockedSegments = blockedSegmentsRotate(kLeftEighthDiveLoopUpToOrthogonalSeq3.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthDiveLoopDownToDiagSeq3 = { .clearance = { -64, 32, 0, 88, { 0b0100, 0 }, 0 }, .allowedWallEdges = 0b0110, + .blockedSegments = blockedSegmentsRotate(kLeftEighthDiveLoopUpToOrthogonalSeq2.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthDiveLoopDownToDiagSeq4 = { .clearance = { -96, 0, 0, 88, { 0b0001, 0 }, 0 }, .allowedWallEdges = 0b1001, + .blockedSegments = blockedSegmentsRotate(kLeftEighthDiveLoopUpToOrthogonalSeq1.blockedSegments, 2), }; static constexpr SequenceDescriptor kRightEighthDiveLoopDownToDiagSeq5 = { .clearance = { -96, 32, 0, 64, { 0b0010, 0 }, 0 }, .allowedWallEdges = 0b0000, + .blockedSegments = blockedSegmentsRotate(kLeftEighthDiveLoopUpToOrthogonalSeq0.blockedSegments, 2), }; static constexpr SequenceData kSequenceDescriptorsByElement[] = { diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index b329864520..6f497068ac 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -11,6 +11,7 @@ #include "../paint/support/MetalSupports.h" #include "../paint/support/WoodenSupports.h" +#include "../paint/tile_element/Segment.h" #include "Track.h" using namespace OpenRCT2; @@ -98,6 +99,8 @@ namespace OpenRCT2::TrackMetaData SequenceWoodenSupport woodenSupports{}; SequenceMetalSupport metalSupports{}; int8_t extraSupportRotation = 0; + bool invertSegmentBlocking = false; + std::array blockedSegments{ kSegmentsNone, kSegmentsNone, kSegmentsNone }; }; using TrackComputeFunction = int32_t (*)(const int16_t); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 40a26ba13b..307f45478c 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -340,7 +340,8 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con } } - TrackDesignPreviewDrawOutlines(tds, *this, RideGetTemporaryForPreview(), { 4096, 4096, 0, _currentTrackPieceDirection }); + TrackDesignPreviewDrawOutlines( + tds, *this, RideGetTemporaryForPreview(), { 4096, 4096, 0, _currentTrackPieceDirection }, false); // Resave global vars for scenery reasons. tds.origin = startPos; @@ -454,7 +455,8 @@ ResultWithMessage TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, cons // Save global vars as they are still used by scenery???? int32_t startZ = tds.origin.z; - TrackDesignPreviewDrawOutlines(tds, *this, RideGetTemporaryForPreview(), { 4096, 4096, 0, _currentTrackPieceDirection }); + TrackDesignPreviewDrawOutlines( + tds, *this, RideGetTemporaryForPreview(), { 4096, 4096, 0, _currentTrackPieceDirection }, false); tds.origin = { startLoc.x, startLoc.y, startZ }; gMapSelectFlags.unset(MapSelectFlag::enableConstruct); @@ -1196,9 +1198,10 @@ static GameActions::Result TrackDesignPlaceSceneryElement( { flags |= GAME_COMMAND_FLAG_REPLAY; } - uint8_t slope = (scenery.getSlopeDirection() + rotation) & 0x3; + uint8_t slopeDirection = (scenery.getSlopeDirection() + rotation) & 0x3; + FootpathSlope slope = { FootpathSlopeType::flat, slopeDirection }; if (scenery.hasSlope()) - slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; + slope.type = FootpathSlopeType::sloped; uint8_t edges = Numerics::rol4(scenery.getEdges(), rotation); PathConstructFlags constructFlags = 0; if (scenery.isQueue()) @@ -1298,11 +1301,17 @@ static GameActions::Result TrackDesignPlaceAllScenery( auto placementRes = TrackDesignPlaceSceneryElement(tds, mapCoord, mode, scenery, rotation, origin.z); if (placementRes.Error != GameActions::Status::Ok) { - // Allow operation to fail when its removing ghosts. if (tds.placeOperation != TrackPlaceOperation::removeGhost) { + // Allow operation to fail when its removing ghosts. return placementRes; } + + if (placementRes.Error == GameActions::Status::NoClearance) + { + // Some scenery might be obstructed, don't abort the entire operation. + continue; + } } cost += placementRes.Cost; } @@ -1767,11 +1776,6 @@ static GameActions::Result TrackDesignPlaceVirtual( tds.previewMax = coords; tds.placeSceneryZ = 0; - if (gTrackDesignSceneryToggle) - { - tds.placeScenery = false; - } - // NOTE: We need to save this, in networked games this would affect all clients otherwise. auto savedRideId = _currentRideIndex; auto savedTrackPieceDirection = _currentTrackPieceDirection; @@ -1839,9 +1843,10 @@ void TrackDesignPreviewRemoveGhosts(const TrackDesign& td, Ride& ride, const Coo TrackDesignPlaceVirtual(tds, td, TrackPlaceOperation::removeGhost, true, ride, coords); } -void TrackDesignPreviewDrawOutlines(TrackDesignState& tds, const TrackDesign& td, Ride& ride, const CoordsXYZD& coords) +void TrackDesignPreviewDrawOutlines( + TrackDesignState& tds, const TrackDesign& td, Ride& ride, const CoordsXYZD& coords, bool placeScenery) { - TrackDesignPlaceVirtual(tds, td, TrackPlaceOperation::drawOutlines, true, ride, coords); + TrackDesignPlaceVirtual(tds, td, TrackPlaceOperation::drawOutlines, placeScenery, ride, coords); } static int32_t TrackDesignGetZPlacement(TrackDesignState& tds, const TrackDesign& td, Ride& ride, const CoordsXYZD& coords) @@ -1887,7 +1892,7 @@ static money64 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flag * cost = edi */ static bool TrackDesignPlacePreview( - TrackDesignState& tds, const TrackDesign& td, Ride** outRide, TrackDesignGameStateData& gameStateData) + TrackDesignState& tds, const TrackDesign& td, Ride** outRide, TrackDesignGameStateData& gameStateData, bool placeScenery) { *outRide = nullptr; gameStateData.flags = 0; @@ -1947,7 +1952,6 @@ static bool TrackDesignPlacePreview( z += 16 - tds.placeSceneryZ; - bool placeScenery = true; if (_trackDesignPlaceStateSceneryUnavailable) { placeScenery = false; @@ -2072,7 +2076,7 @@ bool TrackDesignSceneryElement::operator!=(const TrackDesignSceneryElement& rhs) * * rct2: 0x006D1EF0 */ -void TrackDesignDrawPreview(TrackDesign& td, uint8_t* pixels) +void TrackDesignDrawPreview(TrackDesign& td, uint8_t* pixels, bool placeScenery) { StashMap(); TrackDesignPreviewClearMap(); @@ -2086,7 +2090,7 @@ void TrackDesignDrawPreview(TrackDesign& td, uint8_t* pixels) Ride* ride; TrackDesignGameStateData updatedGameStateData = td.gameStateData; - if (!TrackDesignPlacePreview(tds, td, &ride, updatedGameStateData)) + if (!TrackDesignPlacePreview(tds, td, &ride, updatedGameStateData, placeScenery)) { std::fill_n(pixels, kTrackPreviewImageSize * 4, 0x00); UnstashMap(); diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index d4d327a510..9738492bbb 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -240,13 +240,14 @@ void TrackDesignMirror(TrackDesign& td); OpenRCT2::GameActions::Result TrackDesignPlace( const TrackDesign& td, uint32_t flags, bool placeScenery, Ride& ride, const CoordsXYZD& coords); void TrackDesignPreviewRemoveGhosts(const TrackDesign& td, Ride& ride, const CoordsXYZD& coords); -void TrackDesignPreviewDrawOutlines(TrackDesignState& tds, const TrackDesign& td, Ride& ride, const CoordsXYZD& coords); +void TrackDesignPreviewDrawOutlines( + TrackDesignState& tds, const TrackDesign& td, Ride& ride, const CoordsXYZD& coords, bool placeScenery); int32_t TrackDesignGetZPlacement(const TrackDesign& td, Ride& ride, const CoordsXYZD& coords); /////////////////////////////////////////////////////////////////////////////// // Track design preview /////////////////////////////////////////////////////////////////////////////// -void TrackDesignDrawPreview(TrackDesign& td, uint8_t* pixels); +void TrackDesignDrawPreview(TrackDesign& td, uint8_t* pixels, bool placeScenery); /////////////////////////////////////////////////////////////////////////////// // Track design saving diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 1090493b90..3ffcf818a8 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -195,9 +195,9 @@ bool TrackPaintUtilShouldPaintSupports(const CoordsXY& position) static constexpr ImageIndex kStationBaseTypeSpriteIndexes[][2] = { { kImageIndexUndefined, kImageIndexUndefined }, - { SPR_STATION_BASE_A_SW_NE, SPR_STATION_BASE_A_NW_SE }, - { SPR_STATION_BASE_B_SW_NE, SPR_STATION_BASE_B_NW_SE }, - { SPR_STATION_BASE_C_SW_NE, SPR_STATION_BASE_C_NW_SE }, + { SPR_STATION_BASE_TALL_SW_NE, SPR_STATION_BASE_TALL_NW_SE }, + { SPR_STATION_BASE_MEDIUM_SW_NE, SPR_STATION_BASE_MEDIUM_NW_SE }, + { SPR_STATION_BASE_SHORT_SW_NE, SPR_STATION_BASE_SHORT_NW_SE }, }; static_assert(std::size(kStationBaseTypeSpriteIndexes) == kStationBaseTypeCount); @@ -1796,7 +1796,7 @@ void TrackPaintUtilSpinningTunnelPaint(PaintSession& session, int8_t thickness, void TrackPaintUtilOnridePhotoPlatformPaint( PaintSession& session, Direction direction, int32_t height, MetalSupportType supportType) { - PaintAddImageAsParent(session, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); + PaintAddImageAsParent(session, ImageId(SPR_STATION_BASE_BORDERLESS, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); DrawSupportsSideBySide(session, direction, height, session.SupportColours, supportType); } diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 82685b212b..50bcf26b94 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -107,17 +107,17 @@ enum SPR_FLOOR_PLANKS_E_SEGMENT = 3402, SPR_FLOOR_PLANKS_S_SEGMENT = 3403, SPR_FLOOR_PLANKS_W_SEGMENT = 3404, - SPR_FLOOR_METAL = 14567, - SPR_FENCE_METAL_NE = 14568, - SPR_FENCE_METAL_SE = 14569, - SPR_FENCE_METAL_SW = 14570, - SPR_FENCE_METAL_NW = 14571, + SPR_FLOOR_TILE_CHEQUERBOARD = 14567, + SPR_FENCE_PICKET_NE = 14568, + SPR_FENCE_PICKET_SE = 14569, + SPR_FENCE_PICKET_SW = 14570, + SPR_FENCE_PICKET_NW = 14571, - SPR_FLOOR_METAL_B = 14989, - SPR_FENCE_METAL_B_NE = 14990, - SPR_FENCE_METAL_B_SE = 14991, - SPR_FENCE_METAL_B_SW = 14992, - SPR_FENCE_METAL_B_NW = 14993, + SPR_FLOOR_TILE_DIAMOND = 14989, + SPR_FENCE_PICKET_DUPLICATE_NE = 14990, + SPR_FENCE_PICKET_DUPLICATE_SE = 14991, + SPR_FENCE_PICKET_DUPLICATE_SW = 14992, + SPR_FENCE_PICKET_DUPLICATE_NW = 14993, SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW = 16870, SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW = 16871, @@ -150,10 +150,10 @@ enum SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_1_TILE_NE_SE = 16898, SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_1_TILE_SE_SW = 16899, - SPR_FLOOR_CORK_SE_SW = 22134, - SPR_FLOOR_CORK_SW = 22135, - SPR_FLOOR_CORK_SE = 22136, - SPR_FLOOR_CORK = 22137, + SPR_FLOOR_MULCH_SE_SW = 22134, + SPR_FLOOR_MULCH_SW = 22135, + SPR_FLOOR_MULCH_SE = 22136, + SPR_FLOOR_MULCH = 22137, SPR_FENCE_ROPE_NE = 22138, SPR_FENCE_ROPE_SE = 22139, SPR_FENCE_ROPE_SW = 22140, @@ -220,13 +220,13 @@ enum SPR_STATION_INVERTED_BAR_A_NW_SE = 22423, SPR_STATION_INVERTED_BAR_B_SW_NE = 22424, SPR_STATION_INVERTED_BAR_B_NW_SE = 22425, - SPR_STATION_BASE_A_SW_NE = 22426, - SPR_STATION_BASE_A_NW_SE = 22427, - SPR_STATION_BASE_B_SW_NE = 22428, - SPR_STATION_BASE_B_NW_SE = 22429, - SPR_STATION_BASE_C_SW_NE = 22430, - SPR_STATION_BASE_C_NW_SE = 22431, - SPR_STATION_BASE_D = 22432, // Metal plate without borders, used for some stations and for the on-ride photo segment. + SPR_STATION_BASE_TALL_SW_NE = 22426, + SPR_STATION_BASE_TALL_NW_SE = 22427, + SPR_STATION_BASE_MEDIUM_SW_NE = 22428, + SPR_STATION_BASE_MEDIUM_NW_SE = 22429, + SPR_STATION_BASE_SHORT_SW_NE = 22430, + SPR_STATION_BASE_SHORT_NW_SE = 22431, + SPR_STATION_BASE_BORDERLESS = 22432, // Metal plate without borders, used for some stations and on-ride photo segments SPR_ON_RIDE_PHOTO_CAMERA_SMALL_N = 23485, SPR_ON_RIDE_PHOTO_CAMERA_SMALL_E = 23486, @@ -299,23 +299,25 @@ enum MAZE_ENTRY_FLAG_15 = (1 << 15), }; -constexpr uint32_t kFloorSpritesCork[] = { - SPR_FLOOR_CORK_SE_SW, - SPR_FLOOR_CORK_SW, - SPR_FLOOR_CORK_SE, - SPR_FLOOR_CORK, +constexpr uint32_t kFloorSpritesMulch[] = { + SPR_FLOOR_MULCH_SE_SW, + SPR_FLOOR_MULCH_SW, + SPR_FLOOR_MULCH_SE, + SPR_FLOOR_MULCH, }; -constexpr uint32_t kFloorSpritesMetal[] = { - SPR_FLOOR_METAL, - SPR_FLOOR_METAL, - SPR_FLOOR_METAL, - SPR_FLOOR_METAL, +// Tiles forming a chequerboard pattern (not to be confused with the one for the Spiral Slide) +constexpr uint32_t kFloorSpritesTileChequerboard[] = { + SPR_FLOOR_TILE_CHEQUERBOARD, + SPR_FLOOR_TILE_CHEQUERBOARD, + SPR_FLOOR_TILE_CHEQUERBOARD, + SPR_FLOOR_TILE_CHEQUERBOARD, }; -constexpr uint32_t kFloorSpritesMetalB[] = { - SPR_FLOOR_METAL_B, - SPR_FLOOR_METAL_B, - SPR_FLOOR_METAL_B, - SPR_FLOOR_METAL_B, +// Tiles forming a diamond motif +constexpr uint32_t kFloorSpritesTileDiamond[] = { + SPR_FLOOR_TILE_DIAMOND, + SPR_FLOOR_TILE_DIAMOND, + SPR_FLOOR_TILE_DIAMOND, + SPR_FLOOR_TILE_DIAMOND, }; constexpr uint32_t kFenceSpritesRope[] = { @@ -324,17 +326,19 @@ constexpr uint32_t kFenceSpritesRope[] = { SPR_FENCE_ROPE_SW, SPR_FENCE_ROPE_NW, }; -constexpr uint32_t kFenceSpritesMetal[] = { - SPR_FENCE_METAL_NE, - SPR_FENCE_METAL_SE, - SPR_FENCE_METAL_SW, - SPR_FENCE_METAL_NW, +// Used only by the Launched Freefall +constexpr uint32_t kFenceSpritesPicket[] = { + SPR_FENCE_PICKET_NE, + SPR_FENCE_PICKET_SE, + SPR_FENCE_PICKET_SW, + SPR_FENCE_PICKET_NW, }; -constexpr uint32_t kFenceSpritesMetalB[] = { - SPR_FENCE_METAL_B_NE, - SPR_FENCE_METAL_B_SE, - SPR_FENCE_METAL_B_SW, - SPR_FENCE_METAL_B_NW, +// Duplicate of the picket fence sprites for the other tracked vertical rides, possibly a development leftover +constexpr uint32_t kFenceSpritesPicketDuplicate[] = { + SPR_FENCE_PICKET_DUPLICATE_NE, + SPR_FENCE_PICKET_DUPLICATE_SE, + SPR_FENCE_PICKET_DUPLICATE_SW, + SPR_FENCE_PICKET_DUPLICATE_NW, }; constexpr uint32_t kTrackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[4][3] = { diff --git a/src/openrct2/ride/TrainManager.cpp b/src/openrct2/ride/TrainManager.cpp index 00a5773fff..4aad73ac89 100644 --- a/src/openrct2/ride/TrainManager.cpp +++ b/src/openrct2/ride/TrainManager.cpp @@ -32,6 +32,6 @@ namespace OpenRCT2::TrainManager View::View() { - vec = &getGameState().entities.GetEntityList(EntityType::Vehicle); + vec = &getGameState().entities.GetEntityList(EntityType::vehicle); } } // namespace OpenRCT2::TrainManager diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 9a031c38ae..0e4a0b9289 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -62,6 +62,7 @@ #include "TrackData.h" #include "TrainManager.h" #include "VehicleData.h" +#include "VehicleGeometry.h" #include "VehicleSubpositionData.h" #include @@ -71,6 +72,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Audio; using namespace OpenRCT2::TrackMetaData; using namespace OpenRCT2::Math::Trigonometry; +using namespace OpenRCT2::RideVehicle; static bool vehicle_boat_is_location_accessible(const CoordsXYZ& location); constexpr int16_t kVehicleMaxSpinSpeed = 1536; @@ -378,23 +380,6 @@ static constexpr const int8_t* SwingingTimeToSpriteMaps[] = { kSwingingTimeToSpriteMap8, kSwingingTimeToSpriteMap9, kSwingingTimeToSpriteMap10, kSwingingTimeToSpriteMap11, }; -struct Unk9A36C4Struct -{ - int16_t x; - int16_t y; - uint32_t distance; -}; - -/** rct2: 0x009A36C4 */ -static constexpr Unk9A36C4Struct kUnk9A36C4[] = { - { -1, 0, 8716 }, { -1, 0, 8716 }, { -1, 0, 8716 }, { -1, 1, 12327 }, { -1, 1, 12327 }, { -1, 1, 12327 }, - { 0, 1, 8716 }, { -1, 1, 12327 }, { 0, 1, 8716 }, { 0, 1, 8716 }, { 0, 1, 8716 }, { 1, 1, 12327 }, - { 1, 1, 12327 }, { 1, 1, 12327 }, { 1, 0, 8716 }, { 1, 1, 12327 }, { 1, 0, 8716 }, { 1, 0, 8716 }, - { 1, 0, 8716 }, { 1, -1, 12327 }, { 1, -1, 12327 }, { 1, -1, 12327 }, { 0, -1, 8716 }, { 1, -1, 12327 }, - { 0, -1, 8716 }, { 0, -1, 8716 }, { 0, -1, 8716 }, { -1, -1, 12327 }, { -1, -1, 12327 }, { -1, -1, 12327 }, - { -1, 0, 8716 }, { -1, -1, 12327 }, -}; - /** rct2: 0x009A37C4 */ static constexpr CoordsXY kSurroundingTiles[] = { { 0, 0 }, @@ -408,34 +393,6 @@ static constexpr CoordsXY kSurroundingTiles[] = { { 0, +kCoordsXYStep }, }; -/** rct2: 0x009A37E4 */ -static constexpr int32_t kUnk9A37E4[] = { - 2147483647, 2106585154, 1985590284, 1636362342, 1127484953, 2106585154, 1985590284, 1636362342, 1127484953, - 58579923, 0, -555809667, -1073741824, -1518500249, -1859775391, -2074309916, -2147483647, 58579923, - 0, -555809667, -1073741824, -1518500249, -1859775391, -2074309916, 1859775393, 1073741824, 0, - -1073741824, -1859775393, 1859775393, 1073741824, 0, -1073741824, -1859775393, 1859775393, 1073741824, - 0, -1073741824, -1859775393, 1859775393, 1073741824, 0, -1073741824, -1859775393, 2144540595, - 2139311823, 2144540595, 2139311823, 2135719507, 2135719507, 2125953864, 2061796213, 1411702590, 2125953864, - 2061796213, 1411702590, 1985590284, 1636362342, 1127484953, 2115506168, 2115506168, -}; - -/** rct2: 0x009A38D4 */ -static constexpr int32_t kUnk9A38D4[] = { - 0, 417115092, 817995863, 1390684831, 1827693544, -417115092, -817995863, -1390684831, -1827693544, - 2066040965, 2147483647, 2074309916, 1859775393, 1518500249, 1073741824, 555809666, 0, -2066040965, - -2147483647, -2074309916, -1859775393, -1518500249, -1073741824, -555809666, 1073741824, 1859775393, 2147483647, - 1859775393, 1073741824, -1073741824, -1859775393, -2147483647, -1859775393, -1073741824, 1073741824, 1859775393, - 2147483647, 1859775393, 1073741824, -1073741824, -1859775393, -2147483647, -1859775393, -1073741824, 112390610, - 187165532, -112390610, -187165532, 224473165, -224473165, 303325208, 600568389, 1618265062, -303325208, - -600568389, -1618265062, -817995863, -1390684831, -1827693544, 369214930, -369214930, -}; - -/** rct2: 0x009A39C4 */ -static constexpr int32_t kUnk9A39C4[] = { - 2147483647, 2096579710, 1946281152, 2096579710, 1946281152, 1380375879, 555809667, -372906620, -1231746017, -1859775391, - 1380375879, 555809667, -372906620, -1231746017, -1859775391, 0, 2096579710, 1946281152, 2096579710, 1946281152, -}; - static constexpr OpenRCT2::Audio::SoundId kDoorOpenSoundIds[] = { OpenRCT2::Audio::SoundId::null, // DoorSoundType::none OpenRCT2::Audio::SoundId::doorOpen, // DoorSoundType::door @@ -453,7 +410,7 @@ static_assert(std::size(kDoorCloseSoundIds) == OpenRCT2::Audio::kDoorSoundTypeCo template<> bool EntityBase::Is() const { - return Type == EntityType::Vehicle; + return Type == EntityType::vehicle; } #ifdef ENABLE_SCRIPTING @@ -1489,9 +1446,10 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se if (!(curRide->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { + const auto& rtd = curRide->getRideTypeDescriptor(); // Original code did not check if the ride was a boat hire, causing empty boats to leave the platform when closing a // Boat Hire with passengers on it. - if (curRide->status != RideStatus::closed || (curRide->numRiders != 0 && curRide->type != RIDE_TYPE_BOAT_HIRE)) + if (curRide->status != RideStatus::closed || (curRide->numRiders != 0 && rtd.specialType != RtdSpecialType::boatHire)) { curRide->getStation(current_station).TrainAtStation = RideStation::kNoTrain; sub_state = 2; @@ -2803,7 +2761,7 @@ void Vehicle::CheckIfMissing() curRide->lifecycleFlags |= RIDE_LIFECYCLE_HAS_STALLED_VEHICLE; - if (Config::Get().notifications.RideStalledVehicles) + if (Config::Get().notifications.rideStalledVehicles) { Formatter ft; ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).number); @@ -2925,12 +2883,6 @@ void Vehicle::UpdateCollisionSetup() velocity = 0; } -/** rct2: 0x009A3AC4, 0x009A3AC6 */ -static constexpr CoordsXY stru_9A3AC4[] = { - { -256, 0 }, { -236, 98 }, { -181, 181 }, { -98, 236 }, { 0, 256 }, { 98, 236 }, { 181, 181 }, { 236, 98 }, - { 256, 0 }, { 236, -98 }, { 181, -181 }, { 98, -236 }, { 0, -256 }, { -98, -236 }, { -181, -181 }, { -236, -98 }, -}; - /** * * rct2: 0x006D9EFE @@ -2964,11 +2916,14 @@ void Vehicle::UpdateCrashSetup() lastVehicle = trainVehicle; trainVehicle->sub_state = 0; - int32_t trainX = stru_9A3AC4[trainVehicle->Orientation / 2].x; - int32_t trainY = stru_9A3AC4[trainVehicle->Orientation / 2].y; - auto trainZ = kUnk9A38D4[EnumValue(trainVehicle->pitch)] >> 23; + auto crashDirection = Geometry::getCrashDirectionComponents(trainVehicle->Orientation); + int32_t trainX = crashDirection.x; + int32_t trainY = crashDirection.y; - int32_t ecx = kUnk9A37E4[EnumValue(trainVehicle->pitch)] >> 15; + auto carLaunchDirection = Geometry::getPitchVector32(trainVehicle->pitch); + + auto trainZ = carLaunchDirection.y >> 23; + int32_t ecx = carLaunchDirection.x >> 15; trainX *= ecx; trainY *= ecx; trainX >>= 16; @@ -3435,8 +3390,8 @@ void Vehicle::UpdateUnloadingPassengers() if (firstGuest != nullptr) { - firstGuest->SetState(PeepState::LeavingRide); - firstGuest->RideSubState = PeepRideSubState::LeaveVehicle; + firstGuest->SetState(PeepState::leavingRide); + firstGuest->RideSubState = PeepRideSubState::leaveVehicle; } auto secondGuest = getGameState().entities.GetEntity(peep[seat * 2 + 1]); @@ -3444,8 +3399,8 @@ void Vehicle::UpdateUnloadingPassengers() if (secondGuest != nullptr) { - secondGuest->SetState(PeepState::LeavingRide); - secondGuest->RideSubState = PeepRideSubState::LeaveVehicle; + secondGuest->SetState(PeepState::leavingRide); + secondGuest->RideSubState = PeepRideSubState::leaveVehicle; } } } @@ -3480,8 +3435,8 @@ void Vehicle::UpdateUnloadingPassengers() Peep* curPeep = getGameState().entities.GetEntity(train->peep[peepIndex]); if (curPeep != nullptr) { - curPeep->SetState(PeepState::LeavingRide); - curPeep->RideSubState = PeepRideSubState::LeaveVehicle; + curPeep->SetState(PeepState::leavingRide); + curPeep->RideSubState = PeepRideSubState::leaveVehicle; } } } @@ -3789,7 +3744,7 @@ void Vehicle::UpdateMotionBoatHire() } int32_t edi = (Orientation | (var_35 & 1)) & 0x1F; - loc2 = { x + kUnk9A36C4[edi].x, y + kUnk9A36C4[edi].y }; + loc2 = { x + Geometry::getFreeroamVehicleMovementData(edi).x, y + Geometry::getFreeroamVehicleMovementData(edi).y }; if (UpdateMotionCollisionDetection({ loc2, z }, nullptr)) { remaining_distance = 0; @@ -3887,7 +3842,7 @@ void Vehicle::UpdateMotionBoatHire() TrackLocation = { flooredLocation, TrackLocation.z }; } - remaining_distance -= kUnk9A36C4[edi].distance; + remaining_distance -= Geometry::getFreeroamVehicleMovementData(edi).distance; _vehicleCurPosition.x = loc2.x; _vehicleCurPosition.y = loc2.y; if (remaining_distance < 0x368A) @@ -4059,10 +4014,10 @@ void Vehicle::UpdateSwinging() // 0 == first swing // 3 == full swing uint8_t swingState = sub_state; - if (rideEntry->flags & RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_1) + if (rideEntry->flags & RIDE_ENTRY_FLAG_INVERTER_SHIP_SWING_MODE) { swingState += 4; - if (rideEntry->flags & RIDE_ENTRY_FLAG_ALTERNATIVE_SWING_MODE_2) + if (rideEntry->flags & RIDE_ENTRY_FLAG_MAGIC_CARPET_SWING_MODE) swingState += 4; } @@ -4271,17 +4226,17 @@ void Vehicle::UpdateRotating() } const uint8_t* timeToSpriteMap; - if (rideEntry->flags & RIDE_ENTRY_FLAG_ALTERNATIVE_ROTATION_MODE_1) + if (rideEntry->flags & RIDE_ENTRY_FLAG_TWIST_ROTATION_TYPE) { - timeToSpriteMap = Rotation1TimeToSpriteMaps[sub_state]; + timeToSpriteMap = kTwistTimeToSpriteMaps[sub_state]; } - else if (rideEntry->flags & RIDE_ENTRY_FLAG_ALTERNATIVE_ROTATION_MODE_2) + else if (rideEntry->flags & RIDE_ENTRY_FLAG_ENTERPRISE_ROTATION_TYPE) { - timeToSpriteMap = Rotation2TimeToSpriteMaps[sub_state]; + timeToSpriteMap = kEnterpriseTimeToSpriteMaps[sub_state]; } else { - timeToSpriteMap = Rotation3TimeToSpriteMaps[sub_state]; + timeToSpriteMap = kMerryGoRoundTimeToSpriteMaps[sub_state]; } uint16_t time = current_time; @@ -4310,7 +4265,7 @@ void Vehicle::UpdateRotating() if (curRide->status != RideStatus::closed) { sprite = NumRotations + 1; - if (curRide->type == RIDE_TYPE_ENTERPRISE) + if (curRide->getRideTypeDescriptor().specialType == RtdSpecialType::enterprise) sprite += 9; if (sprite < curRide->rotations) @@ -4444,7 +4399,7 @@ void Vehicle::UpdateTopSpinOperating() if (_vehicleBreakdown == 0) return; - const TopSpinTimeToSpriteMap* sprite_map = TopSpinTimeToSpriteMaps[sub_state]; + const TopSpinTimeToSpriteMap* sprite_map = kTopSpinTimeToSpriteMaps[sub_state]; uint8_t rotation = sprite_map[current_time + 1].arm_rotation; if (rotation != 0xFF) { @@ -4566,7 +4521,7 @@ static void ride_train_crash(Ride& ride, uint16_t numFatalities) if (numFatalities != 0) { - if (Config::Get().notifications.RideCasualties) + if (Config::Get().notifications.rideCasualties) { ride.formatNameTo(ft); News::AddItemToQueue( @@ -4962,7 +4917,7 @@ void Vehicle::UpdateSound() sound2_volume = soundIdVolume.volume; // Calculate Sound Vector (used for sound frequency calcs) - int32_t soundDirection = SpriteDirectionToSoundDirection[Orientation]; + int32_t soundDirection = Geometry::getSoundDirectionFromOrientation(Orientation); int32_t soundVector = ((velocity >> 14) * soundDirection) >> 14; soundVector = std::clamp(soundVector, -127, 127); @@ -5069,8 +5024,8 @@ OpenRCT2::Audio::SoundId Vehicle::ProduceScreamSound(const int32_t totalNumPeeps */ GForces Vehicle::GetGForces() const { - int32_t gForceVert = ((static_cast(0x280000)) * kUnk9A37E4[EnumValue(pitch)]) >> 32; - gForceVert = ((static_cast(gForceVert)) * kUnk9A39C4[EnumValue(roll)]) >> 32; + int32_t gForceVert = ((static_cast(0x280000)) * Geometry::getPitchVector32(pitch).x) >> 32; + gForceVert = ((static_cast(gForceVert)) * Geometry::getRollHorizontalComponent(roll)) >> 32; const auto& ted = GetTrackElementDescriptor(GetTrackType()); const int32_t vertFactor = ted.verticalFactor(track_progress); @@ -5226,10 +5181,10 @@ int32_t Vehicle::UpdateMotionDodgems() CoordsXYZ location = { x, y, z }; - location.x += kUnk9A36C4[oldCollisionDirection].x; - location.y += kUnk9A36C4[oldCollisionDirection].y; - location.x += kUnk9A36C4[oldCollisionDirection + 1].x; - location.y += kUnk9A36C4[oldCollisionDirection + 1].y; + location.x += Geometry::getFreeroamVehicleMovementData(oldCollisionDirection).x; + location.y += Geometry::getFreeroamVehicleMovementData(oldCollisionDirection).y; + location.x += Geometry::getFreeroamVehicleMovementData(oldCollisionDirection + 1).x; + location.y += Geometry::getFreeroamVehicleMovementData(oldCollisionDirection + 1).y; if (collideSprite = DodgemsCarWouldCollideAt(location); !collideSprite.has_value()) { @@ -5253,15 +5208,15 @@ int32_t Vehicle::UpdateMotionDodgems() direction |= var_35 & 1; CoordsXY location = _vehicleCurPosition; - location.x += kUnk9A36C4[direction].x; - location.y += kUnk9A36C4[direction].y; + location.x += Geometry::getFreeroamVehicleMovementData(direction).x; + location.y += Geometry::getFreeroamVehicleMovementData(direction).y; if (collideSprite = DodgemsCarWouldCollideAt(location); collideSprite.has_value()) { break; } - remaining_distance -= kUnk9A36C4[direction].distance; + remaining_distance -= Geometry::getFreeroamVehicleMovementData(direction).distance; _vehicleCurPosition.x = location.x; _vehicleCurPosition.y = location.y; if (remaining_distance < 13962) @@ -5419,7 +5374,7 @@ void Vehicle::UpdateTrackMotionUpStopCheck() const gForces.LateralG = std::abs(gForces.LateralG); if (gForces.LateralG <= 150) { - if (AccelerationFromPitch[EnumValue(pitch)] < 0) + if (Geometry::getAccelerationFromPitch(pitch) < 0) { if (gForces.VerticalG > -40) { @@ -5445,7 +5400,7 @@ void Vehicle::UpdateTrackMotionUpStopCheck() const { auto gForces = GetGForces(); - if (AccelerationFromPitch[EnumValue(pitch)] < 0) + if (Geometry::getAccelerationFromPitch(pitch) < 0) { if (gForces.VerticalG > -45) { @@ -7274,32 +7229,18 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu // Loc6DB706 const auto moveInfo = GetMoveInfo(); trackType = GetTrackType(); - uint8_t moveInfovehicleAnimationGroup; { auto nextVehiclePosition = TrackLocation + CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + GetRideTypeDescriptor(curRide.type).Heights.VehicleZOffset }; - uint8_t remainingDistanceFlags = 0; - if (nextVehiclePosition.x != _vehicleCurPosition.x) - { - remainingDistanceFlags |= 1; - } - if (nextVehiclePosition.y != _vehicleCurPosition.y) - { - remainingDistanceFlags |= 2; - } - if (nextVehiclePosition.z != _vehicleCurPosition.z) - { - remainingDistanceFlags |= 4; - } - - if (TrackSubposition == VehicleTrackSubposition::ReverserRCFrontBogie + bool useReverserDistance = TrackSubposition == VehicleTrackSubposition::ReverserRCFrontBogie && (trackType == TrackElemType::LeftReverser || trackType == TrackElemType::RightReverser) - && track_progress >= 30 && track_progress <= 66) - { - remainingDistanceFlags |= 8; - } + && track_progress >= 30 && track_progress <= 66; + + // Loc6DB8A5 + remaining_distance -= Geometry::getTranslationDistance( + nextVehiclePosition - _vehicleCurPosition, useReverserDistance); if (TrackSubposition == VehicleTrackSubposition::ReverserRCRearBogie && (trackType == TrackElemType::LeftReverser || trackType == TrackElemType::RightReverser) @@ -7312,15 +7253,11 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu nextVehiclePosition.y = y + moveInfo2->y; } - // Loc6DB8A5 - remaining_distance -= SubpositionTranslationDistances[remainingDistanceFlags]; _vehicleCurPosition = nextVehiclePosition; Orientation = moveInfo->direction; roll = moveInfo->roll; pitch = moveInfo->pitch; - moveInfovehicleAnimationGroup = EnumValue(moveInfo->pitch); - if ((carEntry->flags & CAR_ENTRY_FLAG_WOODEN_WILD_MOUSE_SWING) && moveInfo->pitch != VehiclePitch::flat) { SwingSprite = 0; @@ -7384,7 +7321,7 @@ bool Vehicle::UpdateTrackMotionForwards(const CarEntry* carEntry, const Ride& cu return true; } - acceleration += AccelerationFromPitch[moveInfovehicleAnimationGroup]; + acceleration += Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; } } @@ -7606,33 +7543,18 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c // Loc6DBD42 track_progress = newTrackProgress; - VehiclePitch moveInfoVehicleAnimationGroup; { const VehicleInfo* moveInfo = GetMoveInfo(); auto nextVehiclePosition = TrackLocation + CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + GetRideTypeDescriptor(curRide.type).Heights.VehicleZOffset }; - uint8_t remainingDistanceFlags = 0; - if (nextVehiclePosition.x != _vehicleCurPosition.x) - { - remainingDistanceFlags |= 1; - } - if (nextVehiclePosition.y != _vehicleCurPosition.y) - { - remainingDistanceFlags |= 2; - } - if (nextVehiclePosition.z != _vehicleCurPosition.z) - { - remainingDistanceFlags |= 4; - } - remaining_distance += SubpositionTranslationDistances[remainingDistanceFlags]; + remaining_distance += Geometry::getTranslationDistance(nextVehiclePosition - _vehicleCurPosition, false); _vehicleCurPosition = nextVehiclePosition; Orientation = moveInfo->direction; roll = moveInfo->roll; pitch = moveInfo->pitch; - moveInfoVehicleAnimationGroup = moveInfo->pitch; if ((carEntry->flags & CAR_ENTRY_FLAG_WOODEN_WILD_MOUSE_SWING) && pitch != VehiclePitch::flat) { @@ -7693,7 +7615,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c { return true; } - acceleration += AccelerationFromPitch[EnumValue(moveInfoVehicleAnimationGroup)]; + acceleration += Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; } } @@ -7714,7 +7636,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return Vehicle::UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -7736,7 +7658,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return Vehicle::UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -7764,7 +7686,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return Vehicle::UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -7781,7 +7703,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return Vehicle::UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -7810,7 +7732,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return Vehicle::UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -7827,7 +7749,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return Vehicle::UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -7863,7 +7785,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return Vehicle::UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -7902,7 +7824,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; _vehicleVelocityF64E0C -= remaining_distance + 1; remaining_distance = -1; - acceleration += AccelerationFromPitch[EnumValue(pitch)]; + acceleration += Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return UpdateMiniGolfSubroutineStatus::carryOn; } @@ -7919,7 +7841,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c { Loc6DCDE4(curRide); } - acceleration += AccelerationFromPitch[EnumValue(pitch)]; + acceleration += Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return UpdateMiniGolfSubroutineStatus::carryOn; } @@ -8077,7 +7999,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return UpdateMiniGolfSubroutineStatus::stop; } - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; } } @@ -8095,7 +8017,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; _vehicleVelocityF64E0C -= remaining_distance + 1; remaining_distance = -1; - acceleration += AccelerationFromPitch[EnumValue(pitch)]; + acceleration += Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; continue; } @@ -8108,7 +8030,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; _vehicleVelocityF64E0C -= remaining_distance - 0x368A; remaining_distance = 0x368A; - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return Vehicle::UpdateMiniGolfSubroutineStatus::restart; } @@ -8178,7 +8100,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c vEBP->velocity = vEDI->velocity >> 1; } _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_2; - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; return UpdateMiniGolfSubroutineStatus::restart; } @@ -8190,7 +8112,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c Loc6DCDE4(curRide); return UpdateMiniGolfSubroutineStatus::stop; } - acceleration += AccelerationFromPitch[EnumValue(pitch)]; + acceleration += Geometry::getAccelerationFromPitch(pitch); _vehicleUnkF64E10++; } } @@ -8204,7 +8126,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c void Vehicle::UpdateTrackMotionMiniGolfVehicle(const Ride& curRide, const RideObjectEntry& rideEntry, const CarEntry* carEntry) { _vehicleUnkF64E10 = 1; - acceleration = AccelerationFromPitch[EnumValue(pitch)]; + acceleration = Geometry::getAccelerationFromPitch(pitch); if (!HasFlag(VehicleFlags::MoveSingleCar)) { remaining_distance = _vehicleVelocityF64E0C + remaining_distance; @@ -8530,7 +8452,7 @@ void Vehicle::UpdateTrackMotionPreUpdate( { car.UpdateAdditionalAnimation(); } - car.acceleration = AccelerationFromPitch[EnumValue(car.pitch)]; + car.acceleration = Geometry::getAccelerationFromPitch(car.pitch); _vehicleUnkF64E10 = 1; if (!car.HasFlag(VehicleFlags::MoveSingleCar)) @@ -8558,7 +8480,7 @@ void Vehicle::UpdateTrackMotionPreUpdate( { break; } - car.acceleration += AccelerationFromPitch[EnumValue(car.pitch)]; + car.acceleration += Geometry::getAccelerationFromPitch(car.pitch); _vehicleUnkF64E10++; continue; } @@ -8576,7 +8498,7 @@ void Vehicle::UpdateTrackMotionPreUpdate( { break; } - car.acceleration = AccelerationFromPitch[EnumValue(car.pitch)]; + car.acceleration = Geometry::getAccelerationFromPitch(car.pitch); _vehicleUnkF64E10++; continue; } @@ -8849,6 +8771,7 @@ void Vehicle::UpdateCrossings() const if (!playedClaxon && !pathElement->IsBlockedByVehicle()) { Claxon(); + playedClaxon = true; } crossingBonus = 4; pathElement->SetIsBlockedByVehicle(true); diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 968ebfc7c5..8dfb21fc6a 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -61,7 +61,7 @@ enum class MiniGolfAnimation : uint8_t; struct Vehicle : EntityBase { - static constexpr auto cEntityType = EntityType::Vehicle; + static constexpr auto cEntityType = EntityType::vehicle; enum class Type : uint8_t { diff --git a/src/openrct2/ride/VehicleData.cpp b/src/openrct2/ride/VehicleData.cpp index 9bf2f47d27..9fd0a8ae13 100644 --- a/src/openrct2/ride/VehicleData.cpp +++ b/src/openrct2/ride/VehicleData.cpp @@ -13,7 +13,7 @@ // clang-format off /** rct2: 0x0099F100 */ -static constexpr uint8_t Rotation1TimeToSpriteMap_0[] = { +static constexpr uint8_t kTwistAnimationStart[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -66,7 +66,7 @@ static constexpr uint8_t Rotation1TimeToSpriteMap_0[] = { }; /** rct2: 0x0099F422 */ -static constexpr uint8_t Rotation1TimeToSpriteMap_1[] = { +static constexpr uint8_t kTwistAnimationLoop[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, @@ -110,7 +110,7 @@ static constexpr uint8_t Rotation1TimeToSpriteMap_1[] = { }; /** rct2: 0x0099F6AB */ -static constexpr uint8_t Rotation1TimeToSpriteMap_2[] = { +static constexpr uint8_t kTwistAnimationEnd[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, @@ -163,14 +163,14 @@ static constexpr uint8_t Rotation1TimeToSpriteMap_2[] = { }; /** rct2: 0x0099F0F4 */ -const uint8_t * Rotation1TimeToSpriteMaps[] = { - Rotation1TimeToSpriteMap_0, - Rotation1TimeToSpriteMap_1, - Rotation1TimeToSpriteMap_2, +const uint8_t* kTwistTimeToSpriteMaps[] = { + kTwistAnimationStart, + kTwistAnimationLoop, + kTwistAnimationEnd, }; /** rct2: 0x009A2434 */ -static constexpr uint8_t Rotation2TimeToSpriteMap_0[] = { +static constexpr uint8_t kEnterpriseAnimationStart[] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, @@ -212,7 +212,7 @@ static constexpr uint8_t Rotation2TimeToSpriteMap_0[] = { }; /** rct2: 0x009A26A6 */ -static constexpr uint8_t Rotation2TimeToSpriteMap_1[] = { +static constexpr uint8_t kEnterpriseAnimationLoop[] = { 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, @@ -223,7 +223,7 @@ static constexpr uint8_t Rotation2TimeToSpriteMap_1[] = { }; /** rct2: 0x009A270E */ -static constexpr uint8_t Rotation2TimeToSpriteMap_2[] = { +static constexpr uint8_t kEnterpriseAnimationEnd[] = { 43, 43, 44, 44, 45, 45, 43, 43, 44, 44, 45, 45, 43, 43, 44, 44, 45, 45, 40, 40, 41, 41, 42, 42, 40, 40, 41, 41, 42, 42, 40, 40, 41, 41, 42, 42, 37, 37, 38, 38, 39, 39, 37, 37, 38, 38, 39, 39, 37, 37, 38, @@ -256,14 +256,14 @@ static constexpr uint8_t Rotation2TimeToSpriteMap_2[] = { }; /** rct2: 0x009A2428 */ -const uint8_t * Rotation2TimeToSpriteMaps[] = { - Rotation2TimeToSpriteMap_0, - Rotation2TimeToSpriteMap_1, - Rotation2TimeToSpriteMap_2, +const uint8_t* kEnterpriseTimeToSpriteMaps[] = { + kEnterpriseAnimationStart, + kEnterpriseAnimationLoop, + kEnterpriseAnimationEnd, }; /** rct2: 0x0099EB28 */ -static constexpr uint8_t Rotation3TimeToSpriteMap_0[] = { +static constexpr uint8_t kMerryGoRoundAnimationStart[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -300,7 +300,7 @@ static constexpr uint8_t Rotation3TimeToSpriteMap_0[] = { }; /** rct2: 0x0099ED49 */ -static constexpr uint8_t Rotation3TimeToSpriteMap_1[] = { +static constexpr uint8_t kMerryGoRoundAnimationLoop[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, @@ -328,7 +328,7 @@ static constexpr uint8_t Rotation3TimeToSpriteMap_1[] = { }; /** rct2: 0x0099EED1 */ -static constexpr uint8_t Rotation3TimeToSpriteMap_2[] = { +static constexpr uint8_t kMerryGoRoundAnimationEnd[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, @@ -365,14 +365,14 @@ static constexpr uint8_t Rotation3TimeToSpriteMap_2[] = { }; /** rct2: 0x0099EB1C */ -const uint8_t * Rotation3TimeToSpriteMaps[] = { - Rotation3TimeToSpriteMap_0, - Rotation3TimeToSpriteMap_1, - Rotation3TimeToSpriteMap_2, +const uint8_t* kMerryGoRoundTimeToSpriteMaps[] = { + kMerryGoRoundAnimationStart, + kMerryGoRoundAnimationLoop, + kMerryGoRoundAnimationEnd, }; /** rct2: 0x009A12EC */ -static constexpr TopSpinTimeToSpriteMap TopSpinTimeToSpriteMap_0[] = { +static constexpr TopSpinTimeToSpriteMap kTopSpinAnimationBeginners[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 2, 0 }, { 2, 0 }, { 2, 0 }, { 2, 0 }, @@ -458,7 +458,7 @@ static constexpr TopSpinTimeToSpriteMap TopSpinTimeToSpriteMap_0[] = { }; /** rct2: 0x009A1751 */ -static constexpr TopSpinTimeToSpriteMap TopSpinTimeToSpriteMap_1[] = { +static constexpr TopSpinTimeToSpriteMap kTopSpinAnimationIntense[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 2, 0 }, { 2, 0 }, { 2, 0 }, { 2, 0 }, @@ -563,7 +563,7 @@ static constexpr TopSpinTimeToSpriteMap TopSpinTimeToSpriteMap_1[] = { }; /** rct2: 0x009A1CC6 */ -static constexpr TopSpinTimeToSpriteMap TopSpinTimeToSpriteMap_2[] = { +static constexpr TopSpinTimeToSpriteMap kTopSpinAnimationBerserk[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 2, 0 }, { 2, 0 }, { 2, 0 }, { 2, 0 }, @@ -703,10 +703,10 @@ static constexpr TopSpinTimeToSpriteMap TopSpinTimeToSpriteMap_2[] = { }; /** rct2: 0x009A12E0 */ -const TopSpinTimeToSpriteMap * TopSpinTimeToSpriteMaps[] = { - TopSpinTimeToSpriteMap_0, - TopSpinTimeToSpriteMap_1, - TopSpinTimeToSpriteMap_2, +const TopSpinTimeToSpriteMap* kTopSpinTimeToSpriteMaps[] = { + kTopSpinAnimationBeginners, + kTopSpinAnimationIntense, + kTopSpinAnimationBerserk, }; /** rct2: 0x009A0434 */ @@ -794,132 +794,4 @@ const uint8_t MotionSimulatorTimeToSpriteMap[] = { }; const int32_t MotionSimulatorTimeToSpriteMapCount = static_cast(std::size(MotionSimulatorTimeToSpriteMap)); - -/** rct2: 0x009A2930 -The distance between subposition points in a movement direction (but not distance). -*/ -const int32_t SubpositionTranslationDistances[] = { - // For a base length of 8716 (0x220C) on the horizontal and 6554 (0x199A) on the vertical, - // use the Pythagoras theorem and round up. - 0, // no movement - 8716, // X translation - 8716, // Y translation - 12327, // XY translation - 6554, // Z translation - 10905, // XZ translation - 10905, // YZ translation - 13961, // XYZ translation - // For the reverser car, multiply the horizontal distance by 2.5 and the vertical distance by 4.072. - 0, // no movement - 21790, // X translation - 21790, // Y translation - 30817, // Z translation - 16385, // XY translation - 27262, // XZ translation - 27262, // YZ translation - 34902, // XYZ translation -}; - -/** rct2: 0x009A2970 */ -const int32_t AccelerationFromPitch[] = { - 0, // Flat - // The geometric angle of slopes 12.5 and 25 are actually 11.1 and 22.2 respectively. - -124548, // 1 Slope Up 12.5 - -243318, // 2 Slope Up 25 - -416016, // 3 Slope Up 42.5 - -546342, // 4 Slope Up 60 - 124548, // 5 Slope Down 12.5 - 243318, // 6 Slope Down 25 - 416016, // 7 Slope Down 42.5 - 546342, // 8 Slope Down 60 - -617604, // 9 Slope Up 75 - -642000, // 10 Slope Up 90 - -620172, // 11 Slope Up 105 - -555972, // 12 Slope Up 120 - -453894, // 13 Slope Up 135 - -321000, // 14 Slope Up 150 - -166278, // 15 Slope Up 165 - 0, // 16 Fully Inverted - 617604, // 17 Slope Down 75 - 642000, // 18 Slope Down 90 - 620172, // 19 Slope Down 105 - 555972, // 20 Slope Down 120 - 453894, // 21 Slope Down 135 - 321000, // 22 Slope Down 150 - 166278, // 23 Slope Down 165 - -321000, // 24 Corkscrew Right Up 0 - -555972, // 25 Corkscrew Right Up 1 - -642000, // 26 Corkscrew Right Up 2 - -555972, // 27 Corkscrew Right Up 3 - -321000, // 28 Corkscrew Right Up 4 - 321000, // 29 Corkscrew Right Down 4 - 555972, // 30 Corkscrew Right Down 3 - 642000, // 31 Corkscrew Right Down 2 - 555972, // 32 Corkscrew Right Down 1 - 321000, // 33 Corkscrew Right Down 0 - -321000, // 34 Corkscrew Left Up 0 - -555972, // 35 Corkscrew Left Up 1 - -642000, // 36 Corkscrew Left Up 2 - -555972, // 37 Corkscrew Left Up 3 - -321000, // 38 Corkscrew Left Up 4 - 321000, // 39 Corkscrew Left Down 4 - 555972, // 40 Corkscrew Left Down 2 - 642000, // 41 Corkscrew Left Down 1 - 555972, // 42 Corkscrew Left Down 1 - 321000, // 43 Corkscrew Left Down 0 - -33384, // 44 Half Helix Up Large - -55854, // 45 Half Helix Up Small - 33384, // 46 Half Helix Down Large - 55854, // 47 Half Helix Down Small - -66768, // 48 Quarter Helix Up - 66768, // 49 Quarter Helix Down - // currently only diagonal elements use slopes angles 8, 16, 50. Diagonal gentle-to-steep transition uses - // diagonal sprites of slopes 25 and 42. - -90522, // 50 Slope Up 8 - -179760, // 51 Slope Down 16 - -484068, // 52 Slope Up 50 - 90522, // 53 Slope Down 8 - 179760, // 54 Slope Down 16 - 484068, // 55 Slope Down 50 - 243318, // 56 Inverting Loop Down 25 - 416016, // 57 Inverting Loop Down 42.5 - 546342, // 58 Inverting Loop Down 60 - -110424, // 59 Slope Up Spiral Lift Hill -}; - -/** rct2: 0x009A3684 */ -const int32_t SpriteDirectionToSoundDirection[] = { - -0x4000, // 0 - -0x3000, // 1 - -0x2000, // 2 - -0x1000, // 3 - 0, // 4 - 0x1000, // 5 - 0x2000, // 6 - 0x3000, // 7 - 0x4000, // 8 - 0x4800, // 9 - 0x4800, // 10 - 0x4800, // 11 - 0x4800, // 12 - 0x4800, // 13 - 0x4800, // 14 - 0x4800, // 15 - 0x4000, // 16 - 0x3000, // 17 - 0x2000, // 18 - 0x1000, // 19 - 0, // 20 - -0x1000, // 21 - -0x2000, // 22 - -0x3000, // 23 - -0x4000, // 24 - -0x4800, // 25 - -0x4800, // 26 - -0x4800, // 27 - -0x4800, // 28 - -0x4800, // 29 - -0x4800, // 30 - -0x4800, // 31 -}; // clang-format on diff --git a/src/openrct2/ride/VehicleData.h b/src/openrct2/ride/VehicleData.h index 5a7c47c80a..5885c01efa 100644 --- a/src/openrct2/ride/VehicleData.h +++ b/src/openrct2/ride/VehicleData.h @@ -11,9 +11,9 @@ #include -extern const uint8_t* Rotation1TimeToSpriteMaps[]; -extern const uint8_t* Rotation2TimeToSpriteMaps[]; -extern const uint8_t* Rotation3TimeToSpriteMaps[]; +extern const uint8_t* kTwistTimeToSpriteMaps[]; +extern const uint8_t* kEnterpriseTimeToSpriteMaps[]; +extern const uint8_t* kMerryGoRoundTimeToSpriteMaps[]; struct TopSpinTimeToSpriteMap { @@ -21,12 +21,7 @@ struct TopSpinTimeToSpriteMap uint8_t bank_rotation; }; -extern const TopSpinTimeToSpriteMap* TopSpinTimeToSpriteMaps[]; +extern const TopSpinTimeToSpriteMap* kTopSpinTimeToSpriteMaps[]; extern const uint8_t MotionSimulatorTimeToSpriteMap[]; extern const int32_t MotionSimulatorTimeToSpriteMapCount; - -extern const int32_t SubpositionTranslationDistances[]; -extern const int32_t AccelerationFromPitch[]; - -extern const int32_t SpriteDirectionToSoundDirection[]; diff --git a/src/openrct2/ride/VehicleGeometry.cpp b/src/openrct2/ride/VehicleGeometry.cpp new file mode 100644 index 0000000000..d834bb1e84 --- /dev/null +++ b/src/openrct2/ride/VehicleGeometry.cpp @@ -0,0 +1,298 @@ +/***************************************************************************** + * Copyright (c) 2014-2025 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 "VehicleGeometry.h" + +#include + +namespace OpenRCT2::RideVehicle::Geometry +{ + + // clang-format off + /** rct2: 0x009A2930 */ + constexpr auto kSubpositionTranslationDistances = std::to_array({ + // For a base length of 8716 (0x220C) on the horizontal and 6554 (0x199A) on the vertical, + // use the Pythagoras theorem and round up. + 0, // no movement + 8716, // X translation + 8716, // Y translation + 12327, // XY translation + 6554, // Z translation + 10905, // XZ translation + 10905, // YZ translation + 13961, // XYZ translation + // For the reverser car, multiply the horizontal distance by 2.5 and the vertical distance by 4.072. + 0, // no movement + 21790, // X translation + 21790, // Y translation + 30817, // Z translation + 16385, // XY translation + 27262, // XZ translation + 27262, // YZ translation + 34902, // XYZ translation + }); + // clang-format on + static_assert(std::size(kSubpositionTranslationDistances) == 16); + + /** rct2: 0x009A36C4 */ + const auto kFreeroamVehicleMovementData = std::to_array({ + { -1, 0, 8716 }, { -1, 0, 8716 }, { -1, 0, 8716 }, { -1, 1, 12327 }, { -1, 1, 12327 }, { -1, 1, 12327 }, + { 0, 1, 8716 }, { -1, 1, 12327 }, { 0, 1, 8716 }, { 0, 1, 8716 }, { 0, 1, 8716 }, { 1, 1, 12327 }, + { 1, 1, 12327 }, { 1, 1, 12327 }, { 1, 0, 8716 }, { 1, 1, 12327 }, { 1, 0, 8716 }, { 1, 0, 8716 }, + { 1, 0, 8716 }, { 1, -1, 12327 }, { 1, -1, 12327 }, { 1, -1, 12327 }, { 0, -1, 8716 }, { 1, -1, 12327 }, + { 0, -1, 8716 }, { 0, -1, 8716 }, { 0, -1, 8716 }, { -1, -1, 12327 }, { -1, -1, 12327 }, { -1, -1, 12327 }, + { -1, 0, 8716 }, { -1, -1, 12327 }, + }); + static_assert(std::size(kFreeroamVehicleMovementData) == 32); + + /** rct2: 0x009A2970 */ + constexpr auto kAccelerationFromPitch = std::to_array({ + 0, // Flat + -124548, // 1 Slope Up 12.5 + -243318, // 2 Slope Up 25 + -416016, // 3 Slope Up 42.5 + -546342, // 4 Slope Up 60 + 124548, // 5 Slope Down 12.5 + 243318, // 6 Slope Down 25 + 416016, // 7 Slope Down 42.5 + 546342, // 8 Slope Down 60 + -617604, // 9 Slope Up 75 + -642000, // 10 Slope Up 90 + -620172, // 11 Slope Up 105 + -555972, // 12 Slope Up 120 + -453894, // 13 Slope Up 135 + -321000, // 14 Slope Up 150 + -166278, // 15 Slope Up 165 + 0, // 16 Fully Inverted + 617604, // 17 Slope Down 75 + 642000, // 18 Slope Down 90 + 620172, // 19 Slope Down 105 + 555972, // 20 Slope Down 120 + 453894, // 21 Slope Down 135 + 321000, // 22 Slope Down 150 + 166278, // 23 Slope Down 165 + -321000, // 24 Corkscrew Right Up 0 + -555972, // 25 Corkscrew Right Up 1 + -642000, // 26 Corkscrew Right Up 2 + -555972, // 27 Corkscrew Right Up 3 + -321000, // 28 Corkscrew Right Up 4 + 321000, // 29 Corkscrew Right Down 4 + 555972, // 30 Corkscrew Right Down 3 + 642000, // 31 Corkscrew Right Down 2 + 555972, // 32 Corkscrew Right Down 1 + 321000, // 33 Corkscrew Right Down 0 + -321000, // 34 Corkscrew Left Up 0 + -555972, // 35 Corkscrew Left Up 1 + -642000, // 36 Corkscrew Left Up 2 + -555972, // 37 Corkscrew Left Up 3 + -321000, // 38 Corkscrew Left Up 4 + 321000, // 39 Corkscrew Left Down 4 + 555972, // 40 Corkscrew Left Down 2 + 642000, // 41 Corkscrew Left Down 1 + 555972, // 42 Corkscrew Left Down 1 + 321000, // 43 Corkscrew Left Down 0 + -33384, // 44 Half Helix Up Large + -55854, // 45 Half Helix Up Small + 33384, // 46 Half Helix Down Large + 55854, // 47 Half Helix Down Small + -66768, // 48 Quarter Helix Up + 66768, // 49 Quarter Helix Down + -90522, // 50 Slope Up 8 + -179760, // 51 Slope Down 16 + -484068, // 52 Slope Up 50 + 90522, // 53 Slope Down 8 + 179760, // 54 Slope Down 16 + 484068, // 55 Slope Down 50 + 243318, // 56 Inverting Loop Down 25 + 416016, // 57 Inverting Loop Down 42.5 + 546342, // 58 Inverting Loop Down 60 + -110424, // 59 Slope Up Spiral Lift Hill + 110424, // 60 Slope Down Spiral Lift Hill + }); + static_assert(std::size(kAccelerationFromPitch) == EnumValue(VehiclePitch::pitchCount)); + + /** rct2: 0x009A37E4 + * rct2: 0x009A38D4 + */ + constexpr auto kPitchToDirectionVectorInt32 = std::to_array({ + { 2147483647, 0 }, // flat + { 2106585154, 417115092 }, // up12 + { 1985590284, 817995863 }, // up25 + { 1636362342, 1390684831 }, // up42 + { 1127484953, 1827693544 }, // up60 + { 2106585154, -417115092 }, // down12 + { 1985590284, -817995863 }, // down25 + { 1636362342, -1390684831 }, // down42 + { 1127484953, -1827693544 }, // down60 + { 58579923, 2066040965 }, // up75 + { 0, 2147483647 }, // up90 + { -555809667, 2074309916 }, // up115 + { -1073741824, 1859775393 }, // up120 + { -1518500249, 1518500249 }, // up135 + { -1859775391, 1073741824 }, // up150 + { -2074309916, 555809666 }, // up165 + { -2147483647, 0 }, // inverted + { 58579923, -2066040965 }, // down75 + { 0, -2147483647 }, // down90 + { -555809667, -2074309916 }, // down115 + { -1073741824, -1859775393 }, // down120 + { -1518500249, -1518500249 }, // down135 + { -1859775391, -1073741824 }, // down150 + { -2074309916, -555809666 }, // down165 + { 1859775393, 1073741824 }, // corkscrewUpRight0 + { 1073741824, 1859775393 }, // corkscrewUpRight1 + { 0, 2147483647 }, // corkscrewUpRight2 + { -1073741824, 1859775393 }, // corkscrewUpRight3 + { -1859775393, 1073741824 }, // corkscrewUpRight4 + { 1859775393, -1073741824 }, // corkscrewDownLeft0 + { 1073741824, -1859775393 }, // corkscrewDownLeft1 + { 0, -2147483647 }, // corkscrewDownLeft2 + { -1073741824, -1859775393 }, // corkscrewDownLeft3 + { -1859775393, -1073741824 }, // corkscrewDownLeft4 + { 1859775393, 1073741824 }, // corkscrewUpLeft0 + { 1073741824, 1859775393 }, // corkscrewUpLeft1 + { 0, 2147483647 }, // corkscrewUpLeft2 + { -1073741824, 1859775393 }, // corkscrewUpLeft3 + { -1859775393, 1073741824 }, // corkscrewUpLeft4 + { 1859775393, -1073741824 }, // corkscrewDownRight0 + { 1073741824, -1859775393 }, // corkscrewDownRight1 + { 0, -2147483647 }, // corkscrewDownRight2 + { -1073741824, -1859775393 }, // corkscrewDownRight3 + { -1859775393, -1073741824 }, // corkscrewDownRight4 + { 2144540595, 112390610 }, // upHalfHelixLarge + { 2139311823, 187165532 }, // upHalfHelixSmall + { 2144540595, -112390610 }, // downHalfHelixLarge + { 2139311823, -187165532 }, // downHalfHelixSmall + { 2135719507, 224473165 }, // upQuarterHelix + { 2135719507, -224473165 }, // downQuarterHelix + { 2125953864, 303325208 }, // up8 + { 2061796213, 600568389 }, // up16 + { 1411702590, 1618265062 }, // up50 + { 2125953864, -303325208 }, // down8 + { 2061796213, -600568389 }, // down16 + { 1411702590, -1618265062 }, // down50 + { 1985590284, -817995863 }, // uninvertingDown25 + { 1636362342, -1390684831 }, // uninvertingDown42 + { 1127484953, -1827693544 }, // uninvertingDown60 + { 2115506168, 369214930 }, // curvedLifthillUp + { 2115506168, -369214930 }, // curvedLiftHillDown + }); + static_assert(std::size(kPitchToDirectionVectorInt32) == EnumValue(VehiclePitch::pitchCount)); + + /** rct2: 0x009A39C4 */ + const auto kRollHorizontalComponent = std::to_array({ + 2147483647, 2096579710, 1946281152, 2096579710, 1946281152, 1380375879, 555809667, + -372906620, -1231746017, -1859775391, 1380375879, 555809667, -372906620, -1231746017, + -1859775391, 0, 2096579710, 1946281152, 2096579710, 1946281152, + }); + static_assert(std::size(kRollHorizontalComponent) == EnumValue(VehicleRoll::rollCount)); + + /** rct2: 0x009A3684 */ + const auto kSpriteDirectionToSoundDirection = std::to_array({ + -0x4000, // 0 + -0x3000, // 1 + -0x2000, // 2 + -0x1000, // 3 + 0, // 4 + 0x1000, // 5 + 0x2000, // 6 + 0x3000, // 7 + 0x4000, // 8 + 0x4800, // 9 + 0x4800, // 10 + 0x4800, // 11 + 0x4800, // 12 + 0x4800, // 13 + 0x4800, // 14 + 0x4800, // 15 + 0x4000, // 16 + 0x3000, // 17 + 0x2000, // 18 + 0x1000, // 19 + 0, // 20 + -0x1000, // 21 + -0x2000, // 22 + -0x3000, // 23 + -0x4000, // 24 + -0x4800, // 25 + -0x4800, // 26 + -0x4800, // 27 + -0x4800, // 28 + -0x4800, // 29 + -0x4800, // 30 + -0x4800, // 31 + }); + + /** rct2: 0x009A3AC4, 0x009A3AC6 */ + const auto kCrashDirectionComponents = std::to_array({ + { -256, 0 }, + { -236, 98 }, + { -181, 181 }, + { -98, 236 }, + { 0, 256 }, + { 98, 236 }, + { 181, 181 }, + { 236, 98 }, + { 256, 0 }, + { 236, -98 }, + { 181, -181 }, + { 98, -236 }, + { 0, -256 }, + { -98, -236 }, + { -181, -181 }, + { -236, -98 }, + }); + static_assert(std::size(kCrashDirectionComponents) == 16); + + Unk9A36C4Struct getFreeroamVehicleMovementData(uint8_t orientation) + { + return kFreeroamVehicleMovementData[orientation]; + } + + int32_t getRollHorizontalComponent(VehicleRoll roll) + { + return kRollHorizontalComponent[EnumValue(roll)]; + } + + int32_t getSoundDirectionFromOrientation(uint8_t orientation) + { + return kSpriteDirectionToSoundDirection[orientation]; + } + + CoordsXY getCrashDirectionComponents(uint8_t orientation) + { + return kCrashDirectionComponents[orientation / 2]; + } + + int32_t getTranslationDistance(CoordsXYZ distance, bool useReverserDistance) + { + uint8_t index = ((distance.x != 0) << 0) | ((distance.y != 0) << 1) | ((distance.z != 0) << 2) + | ((useReverserDistance) << 3); + return kSubpositionTranslationDistances[index]; + } + + int32_t getAccelerationFromPitch(VehiclePitch pitch) + { + if (pitch >= VehiclePitch::pitchCount) + { + return 0; + } + return kAccelerationFromPitch[EnumValue(pitch)]; + } + + CoordsXY getPitchVector32(VehiclePitch pitch) + { + if (pitch >= VehiclePitch::pitchCount) + { + pitch = VehiclePitch::flat; + } + return kPitchToDirectionVectorInt32[EnumValue(pitch)]; + } + +} // namespace OpenRCT2::RideVehicle::Geometry diff --git a/src/openrct2/ride/VehicleGeometry.h b/src/openrct2/ride/VehicleGeometry.h new file mode 100644 index 0000000000..4d2e64958c --- /dev/null +++ b/src/openrct2/ride/VehicleGeometry.h @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2014-2025 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/EnumUtils.hpp" +#include "../world/Location.hpp" +#include "Angles.h" + +#include + +namespace OpenRCT2::RideVehicle::Geometry +{ + struct Unk9A36C4Struct + { + int16_t x; + int16_t y; + uint32_t distance; + }; + + Unk9A36C4Struct getFreeroamVehicleMovementData(uint8_t orientation); + + int32_t getRollHorizontalComponent(VehicleRoll roll); + + int32_t getSoundDirectionFromOrientation(uint8_t orientation); + + CoordsXY getCrashDirectionComponents(uint8_t orientation); + + /** The distance between subposition points in a movement vector. + * Squashes vector components to 0 or !0, so vector length is ignored. + */ + int32_t getTranslationDistance(CoordsXYZ distance, bool useReverserDistance); + + int32_t getAccelerationFromPitch(VehiclePitch pitch); + + CoordsXY getPitchVector32(VehiclePitch pitch); + +} // namespace OpenRCT2::RideVehicle::Geometry diff --git a/src/openrct2/ride/rtd/coaster/AirPoweredVerticalCoaster.h b/src/openrct2/ride/rtd/coaster/AirPoweredVerticalCoaster.h index f2bd725c52..10193e0eda 100644 --- a/src/openrct2/ride/rtd/coaster/AirPoweredVerticalCoaster.h +++ b/src/openrct2/ride/rtd/coaster/AirPoweredVerticalCoaster.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor AirPoweredVerticalCoasterRTD = .BuildCosts = { 100.00_GBP, 0.00_GBP, 45, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock2, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 70, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_WHITE, COLOUR_BRIGHT_RED, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/AlpineCoaster.h b/src/openrct2/ride/rtd/coaster/AlpineCoaster.h index 325e472337..d4d7bba435 100644 --- a/src/openrct2/ride/rtd/coaster/AlpineCoaster.h +++ b/src/openrct2/ride/rtd/coaster/AlpineCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor AlpineCoasterRTD = .BuildCosts = { 22.50_GBP, 2.50_GBP, 50}, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 65, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_GREY, COLOUR_GREY, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/BobsleighCoaster.h b/src/openrct2/ride/rtd/coaster/BobsleighCoaster.h index 0c13d8d357..8362f2071d 100644 --- a/src/openrct2/ride/rtd/coaster/BobsleighCoaster.h +++ b/src/openrct2/ride/rtd/coaster/BobsleighCoaster.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor BobsleighCoasterRTD = .BuildCosts = { 40.00_GBP, 2.50_GBP, 45, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 75, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_WHITE, COLOUR_BRIGHT_RED, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/ClassicMiniRollerCoaster.h b/src/openrct2/ride/rtd/coaster/ClassicMiniRollerCoaster.h index feb70bdc42..74ba628a2c 100644 --- a/src/openrct2/ride/rtd/coaster/ClassicMiniRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/ClassicMiniRollerCoaster.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor ClassicMiniRollerCoasterRTD = .BuildCosts = { 22.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 60, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_YELLOW, COLOUR_YELLOW, COLOUR_SATURATED_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/ClassicStandUpRollerCoaster.h b/src/openrct2/ride/rtd/coaster/ClassicStandUpRollerCoaster.h index 4c64595d3e..9596ad05ec 100644 --- a/src/openrct2/ride/rtd/coaster/ClassicStandUpRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/ClassicStandUpRollerCoaster.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor ClassicStandUpRollerCoasterRTD = .BuildCosts = { 50.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 90, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/ClassicWoodenRollerCoaster.h b/src/openrct2/ride/rtd/coaster/ClassicWoodenRollerCoaster.h index 2ac60aa5fe..1c36c3d6be 100644 --- a/src/openrct2/ride/rtd/coaster/ClassicWoodenRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/ClassicWoodenRollerCoaster.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor ClassicWoodenRollerCoasterRTD = .BuildCosts = {37.50_GBP, 3.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWildWest, - .PhotoItem = ShopItem::Photo3, + .PhotoItem = ShopItem::photo3, .BonusValue = 105, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_SATURATED_BROWN, COLOUR_SATURATED_BROWN, COLOUR_SATURATED_BROWN}, diff --git a/src/openrct2/ride/rtd/coaster/ClassicWoodenTwisterRollerCoaster.h b/src/openrct2/ride/rtd/coaster/ClassicWoodenTwisterRollerCoaster.h index f0288c7402..3f220a06c6 100644 --- a/src/openrct2/ride/rtd/coaster/ClassicWoodenTwisterRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/ClassicWoodenTwisterRollerCoaster.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor ClassicWoodenTwisterRollerCoasterRTD = .BuildCosts = {37.50_GBP, 3.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWildWest, - .PhotoItem = ShopItem::Photo3, + .PhotoItem = ShopItem::photo3, .BonusValue = 105, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BLACK, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/CompactInvertedCoaster.h b/src/openrct2/ride/rtd/coaster/CompactInvertedCoaster.h index b95ec0f80b..9feb2a3a17 100644 --- a/src/openrct2/ride/rtd/coaster/CompactInvertedCoaster.h +++ b/src/openrct2/ride/rtd/coaster/CompactInvertedCoaster.h @@ -30,7 +30,7 @@ constexpr RideTypeDescriptor CompactInvertedCoasterRTD = .InvertedTrackPaintFunctions = {}, .Flags = kRtdFlagsHasThreeColours | kRtdFlagsCommonCoaster | kRtdFlagsCommonCoasterNonAlt | EnumsToFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation, RtdFlag::checkGForces, - RtdFlag::allowMultipleCircuits, RtdFlag::isSuspended), + RtdFlag::allowMultipleCircuits, RtdFlag::isSuspended, RtdFlag::reverseInclineLaunchAffectsReliability), .RideModes = EnumsToFlags(RideMode::continuousCircuit, RideMode::continuousCircuitBlockSectioned, RideMode::reverseInclineLaunchedShuttle), .DefaultMode = RideMode::continuousCircuit, .OperatingSettings = { 7, 27 }, @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor CompactInvertedCoasterRTD = .BuildCosts = { 50.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 80, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_YELLOW, COLOUR_BRIGHT_YELLOW, COLOUR_BRIGHT_RED }, diff --git a/src/openrct2/ride/rtd/coaster/CorkscrewRollerCoaster.h b/src/openrct2/ride/rtd/coaster/CorkscrewRollerCoaster.h index 91436f9fda..56180b6783 100644 --- a/src/openrct2/ride/rtd/coaster/CorkscrewRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/CorkscrewRollerCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor CorkscrewRollerCoasterRTD = .BuildCosts = { 52.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BORDEAUX_RED, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/FlyingRollerCoaster.h b/src/openrct2/ride/rtd/coaster/FlyingRollerCoaster.h index 2a0646fa2b..e87e58e0eb 100644 --- a/src/openrct2/ride/rtd/coaster/FlyingRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/FlyingRollerCoaster.h @@ -53,7 +53,7 @@ constexpr RideTypeDescriptor FlyingRollerCoasterRTD = .BuildCosts = { 62.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_OLIVE_GREEN, COLOUR_OLIVE_GREEN, COLOUR_TEAL }, @@ -128,7 +128,7 @@ constexpr RideTypeDescriptor FlyingRollerCoasterAltRTD = .BuildCosts = { 62.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_OLIVE_GREEN, COLOUR_OLIVE_GREEN, COLOUR_TEAL }, diff --git a/src/openrct2/ride/rtd/coaster/GigaCoaster.h b/src/openrct2/ride/rtd/coaster/GigaCoaster.h index cc2aa4d3ec..b33e454aac 100644 --- a/src/openrct2/ride/rtd/coaster/GigaCoaster.h +++ b/src/openrct2/ride/rtd/coaster/GigaCoaster.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor GigaCoasterRTD = .BuildCosts = { 60.00_GBP, 2.50_GBP, 55, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock3, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 120, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/HeartlineTwisterCoaster.h b/src/openrct2/ride/rtd/coaster/HeartlineTwisterCoaster.h index 5a27b99d2b..3401adc442 100644 --- a/src/openrct2/ride/rtd/coaster/HeartlineTwisterCoaster.h +++ b/src/openrct2/ride/rtd/coaster/HeartlineTwisterCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor HeartlineTwisterCoasterRTD = .BuildCosts = { 72.50_GBP, 3.50_GBP, 30, }, .DefaultPrices = { 15, 20 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 70, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_WHITE, COLOUR_LIGHT_BLUE, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/HybridCoaster.h b/src/openrct2/ride/rtd/coaster/HybridCoaster.h index 1080ef2825..a4a6045f5d 100644 --- a/src/openrct2/ride/rtd/coaster/HybridCoaster.h +++ b/src/openrct2/ride/rtd/coaster/HybridCoaster.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor HybridCoasterRTD = .BuildCosts = { 65.00_GBP, 3.50_GBP, 55}, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock2, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 120, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_ORANGE, COLOUR_LIGHT_ORANGE, COLOUR_DARK_BROWN }, // Medusa diff --git a/src/openrct2/ride/rtd/coaster/HyperTwister.h b/src/openrct2/ride/rtd/coaster/HyperTwister.h index 95f6eb040a..62bb10249b 100644 --- a/src/openrct2/ride/rtd/coaster/HyperTwister.h +++ b/src/openrct2/ride/rtd/coaster/HyperTwister.h @@ -49,7 +49,7 @@ constexpr RideTypeDescriptor HyperTwisterRTD = .BuildCosts = { 60.00_GBP, 2.50_GBP, 55, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 120, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_YELLOW, COLOUR_YELLOW, COLOUR_BORDEAUX_RED }, diff --git a/src/openrct2/ride/rtd/coaster/Hypercoaster.h b/src/openrct2/ride/rtd/coaster/Hypercoaster.h index 22accb8a5b..e48a545af3 100644 --- a/src/openrct2/ride/rtd/coaster/Hypercoaster.h +++ b/src/openrct2/ride/rtd/coaster/Hypercoaster.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor HypercoasterRTD = .BuildCosts = { 52.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BORDEAUX_RED, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/InvertedHairpinCoaster.h b/src/openrct2/ride/rtd/coaster/InvertedHairpinCoaster.h index 37f79f03c1..3017104be9 100644 --- a/src/openrct2/ride/rtd/coaster/InvertedHairpinCoaster.h +++ b/src/openrct2/ride/rtd/coaster/InvertedHairpinCoaster.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor InvertedHairpinCoasterRTD = .BuildCosts = { 33.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock2, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_YELLOW, COLOUR_BRIGHT_YELLOW, COLOUR_BRIGHT_RED }, diff --git a/src/openrct2/ride/rtd/coaster/InvertedImpulseCoaster.h b/src/openrct2/ride/rtd/coaster/InvertedImpulseCoaster.h index a7eff1cb16..fe86bb95a6 100644 --- a/src/openrct2/ride/rtd/coaster/InvertedImpulseCoaster.h +++ b/src/openrct2/ride/rtd/coaster/InvertedImpulseCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor InvertedImpulseCoasterRTD = .BuildCosts = { 62.50_GBP, 2.50_GBP, 25, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 75, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/coaster/InvertedRollerCoaster.h b/src/openrct2/ride/rtd/coaster/InvertedRollerCoaster.h index c81d48a286..a3eef9b7ab 100644 --- a/src/openrct2/ride/rtd/coaster/InvertedRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/InvertedRollerCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor InvertedRollerCoasterRTD = .BuildCosts = { 65.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BORDEAUX_RED, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/JuniorRollerCoaster.h b/src/openrct2/ride/rtd/coaster/JuniorRollerCoaster.h index 5fbef682ff..78ccf41052 100644 --- a/src/openrct2/ride/rtd/coaster/JuniorRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/JuniorRollerCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor JuniorRollerCoasterRTD = .BuildCosts = { 22.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 60, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_YELLOW, COLOUR_YELLOW, COLOUR_SATURATED_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/LIMLaunchedRollerCoaster.h b/src/openrct2/ride/rtd/coaster/LIMLaunchedRollerCoaster.h index 9e8fdc41b6..615478a07c 100644 --- a/src/openrct2/ride/rtd/coaster/LIMLaunchedRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/LIMLaunchedRollerCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor LIMLaunchedRollerCoasterRTD = .BuildCosts = { 47.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_GREEN, COLOUR_BRIGHT_GREEN, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/LSMLaunchedRollerCoaster.h b/src/openrct2/ride/rtd/coaster/LSMLaunchedRollerCoaster.h index e755dc72b2..db2c78e04a 100644 --- a/src/openrct2/ride/rtd/coaster/LSMLaunchedRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/LSMLaunchedRollerCoaster.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor LSMLaunchedRollerCoasterRTD = .BuildCosts = { 57.00_GBP, 2.50_GBP, 55, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectModern, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 120, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_BLUE, COLOUR_LIGHT_BLUE, COLOUR_BLACK}, // Taiga diff --git a/src/openrct2/ride/rtd/coaster/LayDownRollerCoaster.h b/src/openrct2/ride/rtd/coaster/LayDownRollerCoaster.h index b63acb9402..5be964e847 100644 --- a/src/openrct2/ride/rtd/coaster/LayDownRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/LayDownRollerCoaster.h @@ -56,7 +56,7 @@ constexpr RideTypeDescriptor LayDownRollerCoasterRTD = .BuildCosts = { 53.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_YELLOW }, @@ -127,7 +127,7 @@ constexpr RideTypeDescriptor LayDownRollerCoasterAltRTD = .BuildCosts = { 53.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_YELLOW }, diff --git a/src/openrct2/ride/rtd/coaster/LoopingRollerCoaster.h b/src/openrct2/ride/rtd/coaster/LoopingRollerCoaster.h index fb417955b8..7d172b53a8 100644 --- a/src/openrct2/ride/rtd/coaster/LoopingRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/LoopingRollerCoaster.h @@ -30,7 +30,7 @@ constexpr RideTypeDescriptor LoopingRollerCoasterRTD = .InvertedTrackPaintFunctions = {}, .Flags = kRtdFlagsHasThreeColours | kRtdFlagsCommonCoaster | kRtdFlagsCommonCoasterNonAlt | EnumsToFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation, RtdFlag::checkGForces, - RtdFlag::allowMultipleCircuits, RtdFlag::allowReversedTrains), + RtdFlag::allowMultipleCircuits, RtdFlag::allowReversedTrains, RtdFlag::poweredLaunchAffectsReliability), .RideModes = EnumsToFlags(RideMode::continuousCircuit, RideMode::continuousCircuitBlockSectioned, RideMode::reverseInclineLaunchedShuttle, RideMode::poweredLaunchPasstrough, RideMode::poweredLaunch), .DefaultMode = RideMode::continuousCircuit, .OperatingSettings = { 10, 27 }, @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor LoopingRollerCoasterRTD = .BuildCosts = { 45.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 95, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_BROWN, COLOUR_LIGHT_BROWN, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/MineRide.h b/src/openrct2/ride/rtd/coaster/MineRide.h index c4ff7c9024..7e3988683a 100644 --- a/src/openrct2/ride/rtd/coaster/MineRide.h +++ b/src/openrct2/ride/rtd/coaster/MineRide.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor MineRideRTD = .BuildCosts = { 42.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWildWest, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 70, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_BROWN, COLOUR_DARK_BROWN, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/MineTrainCoaster.h b/src/openrct2/ride/rtd/coaster/MineTrainCoaster.h index a5440cdb2e..d46ca37653 100644 --- a/src/openrct2/ride/rtd/coaster/MineTrainCoaster.h +++ b/src/openrct2/ride/rtd/coaster/MineTrainCoaster.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor MineTrainCoasterRTD = .BuildCosts = { 41.00_GBP, 3.00_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWildWest, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 85, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_BROWN, COLOUR_GREY, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/MiniRollerCoaster.h b/src/openrct2/ride/rtd/coaster/MiniRollerCoaster.h index 6b5af8fc79..432b8e5165 100644 --- a/src/openrct2/ride/rtd/coaster/MiniRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/MiniRollerCoaster.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor MiniRollerCoasterRTD = .BuildCosts = { 32.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 60, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_GREY, COLOUR_GREY, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/MiniSuspendedCoaster.h b/src/openrct2/ride/rtd/coaster/MiniSuspendedCoaster.h index caae9bed77..3049551613 100644 --- a/src/openrct2/ride/rtd/coaster/MiniSuspendedCoaster.h +++ b/src/openrct2/ride/rtd/coaster/MiniSuspendedCoaster.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor MiniSuspendedCoasterRTD = .BuildCosts = { 30.00_GBP, 2.50_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWildWest, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 50, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BLACK, COLOUR_BLACK, COLOUR_SATURATED_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/MultiDimensionRollerCoaster.h b/src/openrct2/ride/rtd/coaster/MultiDimensionRollerCoaster.h index 2e43731e8c..e8925af0bb 100644 --- a/src/openrct2/ride/rtd/coaster/MultiDimensionRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/MultiDimensionRollerCoaster.h @@ -53,7 +53,7 @@ constexpr RideTypeDescriptor MultiDimensionRollerCoasterRTD = .BuildCosts = { 90.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock3, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_PINK, COLOUR_YELLOW, COLOUR_YELLOW }, // X @@ -127,7 +127,7 @@ constexpr RideTypeDescriptor MultiDimensionRollerCoasterAltRTD = .BuildCosts = { 90.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock3, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 100, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_PINK, COLOUR_YELLOW, COLOUR_YELLOW }, diff --git a/src/openrct2/ride/rtd/coaster/ReverseFreefallCoaster.h b/src/openrct2/ride/rtd/coaster/ReverseFreefallCoaster.h index 3e845cb9e4..29423a6ac2 100644 --- a/src/openrct2/ride/rtd/coaster/ReverseFreefallCoaster.h +++ b/src/openrct2/ride/rtd/coaster/ReverseFreefallCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor ReverseFreefallCoasterRTD = .BuildCosts = { 100.00_GBP, 0.00_GBP, 45, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 70, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_GREEN, COLOUR_YELLOW, COLOUR_DARK_GREEN }, diff --git a/src/openrct2/ride/rtd/coaster/ReverserRollerCoaster.h b/src/openrct2/ride/rtd/coaster/ReverserRollerCoaster.h index 9392d5632b..c524256228 100644 --- a/src/openrct2/ride/rtd/coaster/ReverserRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/ReverserRollerCoaster.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor ReverserRollerCoasterRTD = .BuildCosts = { 27.50_GBP, 3.00_GBP, 37, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo3, + .PhotoItem = ShopItem::photo3, .BonusValue = 65, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_BROWN, COLOUR_LIGHT_BROWN, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/SideFrictionRollerCoaster.h b/src/openrct2/ride/rtd/coaster/SideFrictionRollerCoaster.h index c8d9a32f0d..c5cb42a850 100644 --- a/src/openrct2/ride/rtd/coaster/SideFrictionRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/SideFrictionRollerCoaster.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor SideFrictionRollerCoasterRTD = .BuildCosts = { 27.50_GBP, 3.00_GBP, 37, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo3, + .PhotoItem = ShopItem::photo3, .BonusValue = 65, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_WHITE, COLOUR_DARK_BROWN, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/SingleRailRollerCoaster.h b/src/openrct2/ride/rtd/coaster/SingleRailRollerCoaster.h index 8692250707..c1e44b1726 100644 --- a/src/openrct2/ride/rtd/coaster/SingleRailRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/SingleRailRollerCoaster.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor SingleRailRollerCoasterRTD = .BuildCosts = { 37.50_GBP, 2.50_GBP, 50}, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 80, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_ORANGE, COLOUR_LIGHT_ORANGE, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/SpinningWildMouse.h b/src/openrct2/ride/rtd/coaster/SpinningWildMouse.h index d841aeb3c3..4c8b5d8bb4 100644 --- a/src/openrct2/ride/rtd/coaster/SpinningWildMouse.h +++ b/src/openrct2/ride/rtd/coaster/SpinningWildMouse.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor SpinningWildMouseRTD = .BuildCosts = { 27.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_BLUE, COLOUR_LIGHT_BLUE, COLOUR_YELLOW }, diff --git a/src/openrct2/ride/rtd/coaster/SpiralRollerCoaster.h b/src/openrct2/ride/rtd/coaster/SpiralRollerCoaster.h index 7dbe837a4a..1f5e6cddab 100644 --- a/src/openrct2/ride/rtd/coaster/SpiralRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/SpiralRollerCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor SpiralRollerCoasterRTD = .BuildCosts = { 35.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock3, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 85, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BORDEAUX_RED, COLOUR_DARK_GREEN }, diff --git a/src/openrct2/ride/rtd/coaster/StandUpRollerCoaster.h b/src/openrct2/ride/rtd/coaster/StandUpRollerCoaster.h index f107f92df6..070137164f 100644 --- a/src/openrct2/ride/rtd/coaster/StandUpRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/StandUpRollerCoaster.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor StandUpRollerCoasterRTD = .BuildCosts = { 50.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 90, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/SteelWildMouse.h b/src/openrct2/ride/rtd/coaster/SteelWildMouse.h index 0583dfa1ab..2b9af8ebac 100644 --- a/src/openrct2/ride/rtd/coaster/SteelWildMouse.h +++ b/src/openrct2/ride/rtd/coaster/SteelWildMouse.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor SteelWildMouseRTD = .BuildCosts = { 27.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_BLUE, COLOUR_LIGHT_BLUE, COLOUR_YELLOW }, diff --git a/src/openrct2/ride/rtd/coaster/Steeplechase.h b/src/openrct2/ride/rtd/coaster/Steeplechase.h index 0b75784036..a5d4afdfe0 100644 --- a/src/openrct2/ride/rtd/coaster/Steeplechase.h +++ b/src/openrct2/ride/rtd/coaster/Steeplechase.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor SteeplechaseRTD = .BuildCosts = { 28.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 60, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_BLUE, COLOUR_LIGHT_BLUE, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/SuspendedSwingingCoaster.h b/src/openrct2/ride/rtd/coaster/SuspendedSwingingCoaster.h index 0ab562b09d..6fa9852e47 100644 --- a/src/openrct2/ride/rtd/coaster/SuspendedSwingingCoaster.h +++ b/src/openrct2/ride/rtd/coaster/SuspendedSwingingCoaster.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor SuspendedSwingingCoasterRTD = .BuildCosts = { 47.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo2, + .PhotoItem = ShopItem::photo2, .BonusValue = 90, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_OLIVE_GREEN, COLOUR_OLIVE_GREEN, COLOUR_LIGHT_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/TwisterRollerCoaster.h b/src/openrct2/ride/rtd/coaster/TwisterRollerCoaster.h index 2c4bc21784..daf11b1d3e 100644 --- a/src/openrct2/ride/rtd/coaster/TwisterRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/TwisterRollerCoaster.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor TwisterRollerCoasterRTD = .BuildCosts = { 60.00_GBP, 2.50_GBP, 55, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 120, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_YELLOW, COLOUR_YELLOW, COLOUR_BORDEAUX_RED }, diff --git a/src/openrct2/ride/rtd/coaster/VerticalDropCoaster.h b/src/openrct2/ride/rtd/coaster/VerticalDropCoaster.h index 34bfaedbf2..204db0f746 100644 --- a/src/openrct2/ride/rtd/coaster/VerticalDropCoaster.h +++ b/src/openrct2/ride/rtd/coaster/VerticalDropCoaster.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor VerticalDropCoasterRTD = .BuildCosts = { 60.00_GBP, 2.50_GBP, 42, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 95, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BLACK, COLOUR_GREY, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/VirginiaReel.h b/src/openrct2/ride/rtd/coaster/VirginiaReel.h index 6dd525fba3..327a8d5445 100644 --- a/src/openrct2/ride/rtd/coaster/VirginiaReel.h +++ b/src/openrct2/ride/rtd/coaster/VirginiaReel.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor VirginiaReelRTD = .BuildCosts = { 26.50_GBP, 3.00_GBP, 25, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo3, + .PhotoItem = ShopItem::photo3, .BonusValue = 50, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_SATURATED_BROWN, COLOUR_GREY, COLOUR_SATURATED_BROWN }, diff --git a/src/openrct2/ride/rtd/coaster/WaterCoaster.h b/src/openrct2/ride/rtd/coaster/WaterCoaster.h index 81020ec5bc..298f55db22 100644 --- a/src/openrct2/ride/rtd/coaster/WaterCoaster.h +++ b/src/openrct2/ride/rtd/coaster/WaterCoaster.h @@ -60,7 +60,7 @@ constexpr RideTypeDescriptor WaterCoasterRTD = .BuildCosts = { 27.50_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWater, - .PhotoItem = ShopItem::Photo4, + .PhotoItem = ShopItem::photo4, .BonusValue = 60, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_GREEN, COLOUR_DARK_GREEN, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/coaster/WoodenRollerCoaster.h b/src/openrct2/ride/rtd/coaster/WoodenRollerCoaster.h index fe4f3ff563..1de1d7074c 100644 --- a/src/openrct2/ride/rtd/coaster/WoodenRollerCoaster.h +++ b/src/openrct2/ride/rtd/coaster/WoodenRollerCoaster.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor WoodenRollerCoasterRTD = .BuildCosts = { 37.50_GBP, 3.50_GBP, 50, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWildWest, - .PhotoItem = ShopItem::Photo3, + .PhotoItem = ShopItem::photo3, .BonusValue = 105, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BLACK, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/coaster/WoodenWildMouse.h b/src/openrct2/ride/rtd/coaster/WoodenWildMouse.h index 663d600a7f..9e32e89dde 100644 --- a/src/openrct2/ride/rtd/coaster/WoodenWildMouse.h +++ b/src/openrct2/ride/rtd/coaster/WoodenWildMouse.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor WoodenWildMouseRTD = .BuildCosts = { 25.00_GBP, 3.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWildWest, - .PhotoItem = ShopItem::Photo3, + .PhotoItem = ShopItem::photo3, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_WHITE }, diff --git a/src/openrct2/ride/rtd/gentle/CarRide.h b/src/openrct2/ride/rtd/gentle/CarRide.h index 4489baaa50..f8ea14a464 100644 --- a/src/openrct2/ride/rtd/gentle/CarRide.h +++ b/src/openrct2/ride/rtd/gentle/CarRide.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor CarRideRTD = .BuildCosts = { 12.50_GBP, 2.50_GBP, 30, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 50, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_SATURATED_BROWN, COLOUR_SATURATED_BROWN, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/gentle/Circus.h b/src/openrct2/ride/rtd/gentle/Circus.h index 6f21b9b416..af9371e32c 100644 --- a/src/openrct2/ride/rtd/gentle/Circus.h +++ b/src/openrct2/ride/rtd/gentle/Circus.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor CircusRTD = .BuildCosts = { 62.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = {}, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 39, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/gentle/CrookedHouse.h b/src/openrct2/ride/rtd/gentle/CrookedHouse.h index 489c5a9fda..e43e085827 100644 --- a/src/openrct2/ride/rtd/gentle/CrookedHouse.h +++ b/src/openrct2/ride/rtd/gentle/CrookedHouse.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor CrookedHouseRTD = .BuildCosts = { 32.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 22, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BLACK, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/gentle/Dodgems.h b/src/openrct2/ride/rtd/gentle/Dodgems.h index b5f97990c3..f17f36cf66 100644 --- a/src/openrct2/ride/rtd/gentle/Dodgems.h +++ b/src/openrct2/ride/rtd/gentle/Dodgems.h @@ -32,7 +32,7 @@ constexpr RideTypeDescriptor DodgemsRTD = RtdFlag::cannotHaveGaps, RtdFlag::noTestMode, RtdFlag::noWallsAroundTrack, RtdFlag::isFlatRide, RtdFlag::hasVehicleColours, RtdFlag::hasMusicByDefault, RtdFlag::allowMusic, RtdFlag::hasEntranceAndExit, - RtdFlag::slightlyInterestingToLookAt), + RtdFlag::slightlyInterestingToLookAt, RtdFlag::hasRoofOverWholeRide), .RideModes = EnumsToFlags(RideMode::dodgems), .DefaultMode = RideMode::dodgems, .OperatingSettings = { 20, 180 }, @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor DodgemsRTD = .BuildCosts = { 27.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectDodgems, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 35, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_SATURATED_BROWN, COLOUR_SATURATED_BROWN }, diff --git a/src/openrct2/ride/rtd/gentle/FerrisWheel.h b/src/openrct2/ride/rtd/gentle/FerrisWheel.h index 4613d694df..6ca6c9d1f9 100644 --- a/src/openrct2/ride/rtd/gentle/FerrisWheel.h +++ b/src/openrct2/ride/rtd/gentle/FerrisWheel.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor FerrisWheelRTD = .BuildCosts = { 112.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BLACK, COLOUR_BLACK, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/gentle/FlyingSaucers.h b/src/openrct2/ride/rtd/gentle/FlyingSaucers.h index 028cf13d30..7908cd658d 100644 --- a/src/openrct2/ride/rtd/gentle/FlyingSaucers.h +++ b/src/openrct2/ride/rtd/gentle/FlyingSaucers.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor FlyingSaucersRTD = .BuildCosts = { 35.00_GBP, 2.00_GBP, 1, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 35, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_PURPLE, COLOUR_GREY, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/gentle/GhostTrain.h b/src/openrct2/ride/rtd/gentle/GhostTrain.h index ed32455b44..e5c3abc8a9 100644 --- a/src/openrct2/ride/rtd/gentle/GhostTrain.h +++ b/src/openrct2/ride/rtd/gentle/GhostTrain.h @@ -49,7 +49,7 @@ constexpr RideTypeDescriptor GhostTrainRTD = .BuildCosts = { 13.00_GBP, 2.50_GBP, 30, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectHorror, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 50, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_GREEN, COLOUR_BORDEAUX_RED, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/gentle/HauntedHouse.h b/src/openrct2/ride/rtd/gentle/HauntedHouse.h index 36739bdc0e..760b339780 100644 --- a/src/openrct2/ride/rtd/gentle/HauntedHouse.h +++ b/src/openrct2/ride/rtd/gentle/HauntedHouse.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor HauntedHouseRTD = .BuildCosts = { 42.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectHorror, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 22, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/gentle/Maze.h b/src/openrct2/ride/rtd/gentle/Maze.h index 47c01b07b6..4ce8056d23 100644 --- a/src/openrct2/ride/rtd/gentle/Maze.h +++ b/src/openrct2/ride/rtd/gentle/Maze.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor MazeRTD = .BuildCosts = { 27.50_GBP, 1.00_GBP, 8, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 40, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_GREY, COLOUR_GREY, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/gentle/MerryGoRound.h b/src/openrct2/ride/rtd/gentle/MerryGoRound.h index 9a381f5f94..48fbdd592a 100644 --- a/src/openrct2/ride/rtd/gentle/MerryGoRound.h +++ b/src/openrct2/ride/rtd/gentle/MerryGoRound.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor MerryGoRoundRTD = .BuildCosts = { 57.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectFairground, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/gentle/MiniGolf.h b/src/openrct2/ride/rtd/gentle/MiniGolf.h index 45d12536d9..4afc86b725 100644 --- a/src/openrct2/ride/rtd/gentle/MiniGolf.h +++ b/src/openrct2/ride/rtd/gentle/MiniGolf.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor MiniGolfRTD = .BuildCosts = { 25.00_GBP, 3.50_GBP, 20, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 23, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_SATURATED_GREEN, COLOUR_DARK_BROWN, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/gentle/MiniHelicopters.h b/src/openrct2/ride/rtd/gentle/MiniHelicopters.h index 587678a760..b70f41ec2f 100644 --- a/src/openrct2/ride/rtd/gentle/MiniHelicopters.h +++ b/src/openrct2/ride/rtd/gentle/MiniHelicopters.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor MiniHelicoptersRTD = .BuildCosts = { 12.50_GBP, 2.50_GBP, 30, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_PURPLE, COLOUR_YELLOW, COLOUR_DARK_PURPLE }, diff --git a/src/openrct2/ride/rtd/gentle/MonorailCycles.h b/src/openrct2/ride/rtd/gentle/MonorailCycles.h index cc9aa7c239..7f41696957 100644 --- a/src/openrct2/ride/rtd/gentle/MonorailCycles.h +++ b/src/openrct2/ride/rtd/gentle/MonorailCycles.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor MonorailCyclesRTD = .BuildCosts = { 10.00_GBP, 2.50_GBP, 30, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_BROWN, COLOUR_GREY, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/gentle/MonsterTrucks.h b/src/openrct2/ride/rtd/gentle/MonsterTrucks.h index 627fc05a7d..95b6f94dc6 100644 --- a/src/openrct2/ride/rtd/gentle/MonsterTrucks.h +++ b/src/openrct2/ride/rtd/gentle/MonsterTrucks.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor MonsterTrucksRTD = .BuildCosts = { 12.50_GBP, 2.50_GBP, 30, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 50, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_SATURATED_BROWN, COLOUR_SATURATED_BROWN, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/gentle/ObservationTower.h b/src/openrct2/ride/rtd/gentle/ObservationTower.h index 55f3fedf9a..e7fc6e1587 100644 --- a/src/openrct2/ride/rtd/gentle/ObservationTower.h +++ b/src/openrct2/ride/rtd/gentle/ObservationTower.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor ObservationTowerRTD = .BuildCosts = { 18.50_GBP, 0.00_GBP, 4, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_BLACK, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/gentle/SpaceRings.h b/src/openrct2/ride/rtd/gentle/SpaceRings.h index ca0e7f6fda..68f2506cd1 100644 --- a/src/openrct2/ride/rtd/gentle/SpaceRings.h +++ b/src/openrct2/ride/rtd/gentle/SpaceRings.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor SpaceRingsRTD = .BuildCosts = { 36.00_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 5, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 30, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, @@ -61,6 +61,7 @@ constexpr RideTypeDescriptor SpaceRingsRTD = { RatingsModifierType::BonusScenery, 0, 25098, 0, 0 }, }, }, + .specialType = RtdSpecialType::spaceRings, }; } // namespace OpenRCT2 // clang-format on diff --git a/src/openrct2/ride/rtd/gentle/SpiralSlide.h b/src/openrct2/ride/rtd/gentle/SpiralSlide.h index 4200bcd793..5340d229a7 100644 --- a/src/openrct2/ride/rtd/gentle/SpiralSlide.h +++ b/src/openrct2/ride/rtd/gentle/SpiralSlide.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor SpiralSlideRTD = .BuildCosts = { 82.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 40, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_YELLOW, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/shops/CashMachine.h b/src/openrct2/ride/rtd/shops/CashMachine.h index 658079c6b9..16ef56ca7f 100644 --- a/src/openrct2/ride/rtd/shops/CashMachine.h +++ b/src/openrct2/ride/rtd/shops/CashMachine.h @@ -42,7 +42,7 @@ constexpr RideTypeDescriptor CashMachineRTD = .BuildCosts = { 200.00_GBP, 0.00_GBP, 1, }, .DefaultPrices = { 0, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 5, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/shops/DrinkStall.h b/src/openrct2/ride/rtd/shops/DrinkStall.h index ffea6a132d..d59796e0aa 100644 --- a/src/openrct2/ride/rtd/shops/DrinkStall.h +++ b/src/openrct2/ride/rtd/shops/DrinkStall.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor DrinkStallRTD = .BuildCosts = { 250.00_GBP, 0.00_GBP, 1, }, .DefaultPrices = { 0, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 15, .ColourPresets = kDefaultStallColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/shops/FirstAid.h b/src/openrct2/ride/rtd/shops/FirstAid.h index add59e2a72..2f9bef0027 100644 --- a/src/openrct2/ride/rtd/shops/FirstAid.h +++ b/src/openrct2/ride/rtd/shops/FirstAid.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor FirstAidRTD = .BuildCosts = { 250.00_GBP, 0.00_GBP, 1, }, .DefaultPrices = { 0, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 5, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/shops/FoodStall.h b/src/openrct2/ride/rtd/shops/FoodStall.h index 2c8105c517..09bb7ea951 100644 --- a/src/openrct2/ride/rtd/shops/FoodStall.h +++ b/src/openrct2/ride/rtd/shops/FoodStall.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor FoodStallRTD = .BuildCosts = { 300.00_GBP, 0.00_GBP, 1, }, .DefaultPrices = { 0, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 15, .ColourPresets = kDefaultStallColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/shops/InformationKiosk.h b/src/openrct2/ride/rtd/shops/InformationKiosk.h index b1662cbaa6..e044294562 100644 --- a/src/openrct2/ride/rtd/shops/InformationKiosk.h +++ b/src/openrct2/ride/rtd/shops/InformationKiosk.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor InformationKioskRTD = .BuildCosts = { 250.00_GBP, 0.00_GBP, 1, }, .DefaultPrices = { 0, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 15, .ColourPresets = kDefaultStallColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/shops/Shop.h b/src/openrct2/ride/rtd/shops/Shop.h index 55d33e575a..835cf9a314 100644 --- a/src/openrct2/ride/rtd/shops/Shop.h +++ b/src/openrct2/ride/rtd/shops/Shop.h @@ -43,7 +43,7 @@ constexpr RideTypeDescriptor ShopRTD = .BuildCosts = { 200.00_GBP, 0.00_GBP, 1, }, .DefaultPrices = { 0, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 15, .ColourPresets = kDefaultStallColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/shops/Toilets.h b/src/openrct2/ride/rtd/shops/Toilets.h index e6927767a8..90c7f4370c 100644 --- a/src/openrct2/ride/rtd/shops/Toilets.h +++ b/src/openrct2/ride/rtd/shops/Toilets.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor ToiletsRTD = .BuildCosts = { 225.00_GBP, 0.00_GBP, 1, }, .DefaultPrices = { 0, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 5, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/thrill/3DCinema.h b/src/openrct2/ride/rtd/thrill/3DCinema.h index 66f2cd8a02..9c0d1b1301 100644 --- a/src/openrct2/ride/rtd/thrill/3DCinema.h +++ b/src/openrct2/ride/rtd/thrill/3DCinema.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor CinemaRTD = .BuildCosts = { 70.00_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 20, 0 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/thrill/Enterprise.h b/src/openrct2/ride/rtd/thrill/Enterprise.h index abbfad15d5..6d6d269bb1 100644 --- a/src/openrct2/ride/rtd/thrill/Enterprise.h +++ b/src/openrct2/ride/rtd/thrill/Enterprise.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor EnterpriseRTD = .BuildCosts = { 50.00_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 20, 0 }, .DefaultMusic = kMusicObjectRock2, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, @@ -72,6 +72,7 @@ constexpr RideTypeDescriptor EnterpriseRTD = .UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault, .SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default, .GetGuestWaypointLocation = GetGuestWaypointLocationEnterprise, + .specialType = RtdSpecialType::enterprise, }; } // namespace OpenRCT2 // clang-format on diff --git a/src/openrct2/ride/rtd/thrill/GoKarts.h b/src/openrct2/ride/rtd/thrill/GoKarts.h index 270c5c6f02..22dd8e49c5 100644 --- a/src/openrct2/ride/rtd/thrill/GoKarts.h +++ b/src/openrct2/ride/rtd/thrill/GoKarts.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor GoKartsRTD = .BuildCosts = { 31.00_GBP, 2.00_GBP, 20, }, .DefaultPrices = { 20, 0 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BORDEAUX_RED, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/thrill/LaunchedFreefall.h b/src/openrct2/ride/rtd/thrill/LaunchedFreefall.h index ba54005283..6f39b68faf 100644 --- a/src/openrct2/ride/rtd/thrill/LaunchedFreefall.h +++ b/src/openrct2/ride/rtd/thrill/LaunchedFreefall.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor LaunchedFreefallRTD = .BuildCosts = { 25.00_GBP, 0.00_GBP, 4, }, .DefaultPrices = { 20, 0 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 65, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_WHITE, COLOUR_BRIGHT_RED, COLOUR_LIGHT_PURPLE }, diff --git a/src/openrct2/ride/rtd/thrill/MagicCarpet.h b/src/openrct2/ride/rtd/thrill/MagicCarpet.h index 4b16eb4dc4..e7e72326e1 100644 --- a/src/openrct2/ride/rtd/thrill/MagicCarpet.h +++ b/src/openrct2/ride/rtd/thrill/MagicCarpet.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor MagicCarpetRTD = .BuildCosts = { 99.00_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectEgyptian, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 35, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_PURPLE, COLOUR_WHITE, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/thrill/MotionSimulator.h b/src/openrct2/ride/rtd/thrill/MotionSimulator.h index 7656c3c731..a38c942257 100644 --- a/src/openrct2/ride/rtd/thrill/MotionSimulator.h +++ b/src/openrct2/ride/rtd/thrill/MotionSimulator.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor MotionSimulatorRTD = .BuildCosts = { 110.00_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 20, 0 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, @@ -75,6 +75,7 @@ constexpr RideTypeDescriptor MotionSimulatorRTD = .UpdateMeasurementsSpecialElements = RideUpdateMeasurementsSpecialElements_Default, .MusicTrackOffsetLength = RideAudio::RideMusicGetTrackOffsetLength_Default, .UpdateRideApproachVehicleWaypoints = UpdateRideApproachVehicleWaypointsMotionSimulator, + .specialType = RtdSpecialType::motionSimulator, }; } // namespace OpenRCT2 // clang-format on diff --git a/src/openrct2/ride/rtd/thrill/RotoDrop.h b/src/openrct2/ride/rtd/thrill/RotoDrop.h index 8cd04eb40a..86ec8e70a7 100644 --- a/src/openrct2/ride/rtd/thrill/RotoDrop.h +++ b/src/openrct2/ride/rtd/thrill/RotoDrop.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor RotoDropRTD = .BuildCosts = { 22.50_GBP, 0.00_GBP, 4, }, .DefaultPrices = { 20, 0 }, .DefaultMusic = kMusicObjectRock1, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_YELLOW, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/thrill/SwingingInverterShip.h b/src/openrct2/ride/rtd/thrill/SwingingInverterShip.h index 86ed3408b6..359d8db36b 100644 --- a/src/openrct2/ride/rtd/thrill/SwingingInverterShip.h +++ b/src/openrct2/ride/rtd/thrill/SwingingInverterShip.h @@ -46,7 +46,7 @@ constexpr RideTypeDescriptor SwingingInverterShipRTD = .BuildCosts = { 106.00_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 35, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_YELLOW, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/thrill/SwingingShip.h b/src/openrct2/ride/rtd/thrill/SwingingShip.h index b40aeef214..fde428342e 100644 --- a/src/openrct2/ride/rtd/thrill/SwingingShip.h +++ b/src/openrct2/ride/rtd/thrill/SwingingShip.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor SwingingShipRTD = .BuildCosts = { 77.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 15, 0 }, .DefaultMusic = kMusicObjectPirate, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 35, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_BROWN, COLOUR_DARK_BROWN, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/thrill/TopSpin.h b/src/openrct2/ride/rtd/thrill/TopSpin.h index 3565cc8ff1..ded2100ddc 100644 --- a/src/openrct2/ride/rtd/thrill/TopSpin.h +++ b/src/openrct2/ride/rtd/thrill/TopSpin.h @@ -45,7 +45,7 @@ constexpr RideTypeDescriptor TopSpinRTD = .BuildCosts = { 72.50_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 20, 0 }, .DefaultMusic = kMusicObjectTechno, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_YELLOW, COLOUR_YELLOW }, diff --git a/src/openrct2/ride/rtd/thrill/Twist.h b/src/openrct2/ride/rtd/thrill/Twist.h index b75cce3e68..98dfe85892 100644 --- a/src/openrct2/ride/rtd/thrill/Twist.h +++ b/src/openrct2/ride/rtd/thrill/Twist.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor TwistRTD = .BuildCosts = { 45.00_GBP, 1.00_GBP, 1, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 40, .ColourPresets = kDefaultFlatRideColourPreset, .ColourPreview = { 0, 0 }, diff --git a/src/openrct2/ride/rtd/transport/Chairlift.h b/src/openrct2/ride/rtd/transport/Chairlift.h index 4085d4cdb5..e91f83ed1a 100644 --- a/src/openrct2/ride/rtd/transport/Chairlift.h +++ b/src/openrct2/ride/rtd/transport/Chairlift.h @@ -33,7 +33,7 @@ constexpr RideTypeDescriptor ChairliftRTD = RtdFlag::hasLoadOptions, RtdFlag::hasVehicleColours, RtdFlag::hasTrack, RtdFlag::supportsMultipleColourSchemes, RtdFlag::allowMusic, RtdFlag::hasEntranceAndExit, RtdFlag::allowMoreVehiclesThanStationFits, RtdFlag::isTransportRide, RtdFlag::showInTrackDesigner, - RtdFlag::slightlyInterestingToLookAt, RtdFlag::isSuspended), + RtdFlag::slightlyInterestingToLookAt, RtdFlag::isSuspended, RtdFlag::runningSpeedAffectsReliability), .RideModes = EnumsToFlags(RideMode::stationToStation), .DefaultMode = RideMode::stationToStation, .OperatingSettings = { 1, 4 }, @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor ChairliftRTD = .BuildCosts = { 32.50_GBP, 0.50_GBP, 30, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BORDEAUX_RED, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/transport/Lift.h b/src/openrct2/ride/rtd/transport/Lift.h index 67c9ec7d09..c1d1f2a4a1 100644 --- a/src/openrct2/ride/rtd/transport/Lift.h +++ b/src/openrct2/ride/rtd/transport/Lift.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor LiftRTD = .BuildCosts = { 19.50_GBP, 0.00_GBP, 4, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 45, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BORDEAUX_RED, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/transport/MiniatureRailway.h b/src/openrct2/ride/rtd/transport/MiniatureRailway.h index 217d0b3719..13d40550b9 100644 --- a/src/openrct2/ride/rtd/transport/MiniatureRailway.h +++ b/src/openrct2/ride/rtd/transport/MiniatureRailway.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor MiniatureRailwayRTD = .BuildCosts = { 17.50_GBP, 3.00_GBP, 50, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 50, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_LIGHT_BLUE, COLOUR_WHITE, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/transport/Monorail.h b/src/openrct2/ride/rtd/transport/Monorail.h index b7ea7b22b9..674b31499f 100644 --- a/src/openrct2/ride/rtd/transport/Monorail.h +++ b/src/openrct2/ride/rtd/transport/Monorail.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor MonorailRTD = .BuildCosts = { 21.00_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 60, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_GREY, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN }, diff --git a/src/openrct2/ride/rtd/transport/SuspendedMonorail.h b/src/openrct2/ride/rtd/transport/SuspendedMonorail.h index 91b35e3664..ed5dfd3c69 100644 --- a/src/openrct2/ride/rtd/transport/SuspendedMonorail.h +++ b/src/openrct2/ride/rtd/transport/SuspendedMonorail.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor SuspendedMonorailRTD = .BuildCosts = { 32.50_GBP, 2.50_GBP, 50, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectSummer, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 60, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BORDEAUX_RED, COLOUR_BLACK, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/water/BoatHire.h b/src/openrct2/ride/rtd/water/BoatHire.h index efbf98fd35..b48d8f53a6 100644 --- a/src/openrct2/ride/rtd/water/BoatHire.h +++ b/src/openrct2/ride/rtd/water/BoatHire.h @@ -44,7 +44,7 @@ constexpr RideTypeDescriptor BoatHireRTD = .BuildCosts = { 27.50_GBP, 0.00_GBP, 5, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectWater, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 40, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_MOSS_GREEN, COLOUR_MOSS_GREEN, COLOUR_WHITE }, @@ -76,6 +76,7 @@ constexpr RideTypeDescriptor BoatHireRTD = }, .UpdateRotating = UpdateRotatingDefault, .LightFXAddLightsMagicVehicle = Drawing::LightFx::AddLightsMagicVehicle_BoatHire, + .specialType = RtdSpecialType::boatHire, }; } // namespace OpenRCT2 // clang-format on diff --git a/src/openrct2/ride/rtd/water/DinghySlide.h b/src/openrct2/ride/rtd/water/DinghySlide.h index 0ec9c0fecc..d7d79ba84a 100644 --- a/src/openrct2/ride/rtd/water/DinghySlide.h +++ b/src/openrct2/ride/rtd/water/DinghySlide.h @@ -61,7 +61,7 @@ constexpr RideTypeDescriptor DinghySlideRTD = .BuildCosts = { 20.00_GBP, 2.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWater, - .PhotoItem = ShopItem::Photo4, + .PhotoItem = ShopItem::photo4, .BonusValue = 55, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_GREEN, COLOUR_SATURATED_BROWN, COLOUR_DARK_GREEN }, diff --git a/src/openrct2/ride/rtd/water/LogFlume.h b/src/openrct2/ride/rtd/water/LogFlume.h index 69395d0941..5ee6e039aa 100644 --- a/src/openrct2/ride/rtd/water/LogFlume.h +++ b/src/openrct2/ride/rtd/water/LogFlume.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor LogFlumeRTD = .BuildCosts = { 22.50_GBP, 2.50_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWater, - .PhotoItem = ShopItem::Photo4, + .PhotoItem = ShopItem::photo4, .BonusValue = 65, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_BROWN, COLOUR_DARK_BROWN, COLOUR_GREY }, diff --git a/src/openrct2/ride/rtd/water/RiverRafts.h b/src/openrct2/ride/rtd/water/RiverRafts.h index 0d4c9e12f2..3a60b70723 100644 --- a/src/openrct2/ride/rtd/water/RiverRafts.h +++ b/src/openrct2/ride/rtd/water/RiverRafts.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor RiverRaftsRTD = .BuildCosts = { 20.00_GBP, 2.50_GBP, 30, }, .DefaultPrices = { 10, 20 }, .DefaultMusic = kMusicObjectGentle, - .PhotoItem = ShopItem::Photo4, + .PhotoItem = ShopItem::photo4, .BonusValue = 65, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_BLACK, COLOUR_BLACK, COLOUR_SATURATED_BROWN }, diff --git a/src/openrct2/ride/rtd/water/RiverRapids.h b/src/openrct2/ride/rtd/water/RiverRapids.h index 3a92ec1f54..85eca6af24 100644 --- a/src/openrct2/ride/rtd/water/RiverRapids.h +++ b/src/openrct2/ride/rtd/water/RiverRapids.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor RiverRapidsRTD = .BuildCosts = { 31.00_GBP, 3.00_GBP, 40, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWater, - .PhotoItem = ShopItem::Photo4, + .PhotoItem = ShopItem::photo4, .BonusValue = 70, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_WHITE, COLOUR_BLACK, COLOUR_DARK_BROWN }, diff --git a/src/openrct2/ride/rtd/water/SplashBoats.h b/src/openrct2/ride/rtd/water/SplashBoats.h index 14f3b5a459..f85b348cb1 100644 --- a/src/openrct2/ride/rtd/water/SplashBoats.h +++ b/src/openrct2/ride/rtd/water/SplashBoats.h @@ -48,7 +48,7 @@ constexpr RideTypeDescriptor SplashBoatsRTD = .BuildCosts = { 28.50_GBP, 2.50_GBP, 30, }, .DefaultPrices = { 20, 20 }, .DefaultMusic = kMusicObjectWater, - .PhotoItem = ShopItem::Photo4, + .PhotoItem = ShopItem::photo4, .BonusValue = 65, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_DARK_BROWN, COLOUR_DARK_BROWN, COLOUR_BLACK }, diff --git a/src/openrct2/ride/rtd/water/SubmarineRide.h b/src/openrct2/ride/rtd/water/SubmarineRide.h index 70987097da..34de462498 100644 --- a/src/openrct2/ride/rtd/water/SubmarineRide.h +++ b/src/openrct2/ride/rtd/water/SubmarineRide.h @@ -47,7 +47,7 @@ constexpr RideTypeDescriptor SubmarineRideRTD = .BuildCosts = { 35.00_GBP, 2.50_GBP, 5, }, .DefaultPrices = { 10, 0 }, .DefaultMusic = kMusicObjectWater, - .PhotoItem = ShopItem::Photo, + .PhotoItem = ShopItem::photo, .BonusValue = 40, .ColourPresets = TRACK_COLOUR_PRESETS( { COLOUR_GREY, COLOUR_GREY, COLOUR_BLACK }, diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index e3f89cb3be..a57b29e898 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -235,7 +235,7 @@ static void ScenarioCheckEntranceFeeTooHigh() auto y = entrance.y + 16; uint32_t packed_xy = (y << 16) | x; - if (Config::Get().notifications.ParkWarnings) + if (Config::Get().notifications.parkWarnings) { News::AddItemToQueue(News::ItemType::blank, STR_ENTRANCE_FEE_TOO_HI, packed_xy, {}); } @@ -254,7 +254,7 @@ void ScenarioAutosaveCheck() bool shouldSave = false; using namespace std::chrono_literals; - switch (Config::Get().general.AutosaveFrequency) + switch (Config::Get().general.autosaveFrequency) { case AUTOSAVE_EVERY_MINUTE: shouldSave = timeSinceSave >= std::chrono::milliseconds(1min).count(); @@ -352,7 +352,7 @@ static void ScenarioUpdateDayNightCycle() float currentDayNightCycle = gDayNightCycle; gDayNightCycle = 0; - if (gLegacyScene == LegacyScene::playing && Config::Get().general.DayNightCycle) + if (gLegacyScene == LegacyScene::playing && Config::Get().general.dayNightCycle) { float monthFraction = GetDate().GetMonthTicks() / static_cast(kTicksPerMonth); if (monthFraction < (1 / 8.0f)) @@ -614,7 +614,7 @@ bool AllowEarlyCompletion() case Network::Mode::none: case Network::Mode::server: default: - return Config::Get().general.AllowEarlyCompletion; + return Config::Get().general.allowEarlyCompletion; } } diff --git a/src/openrct2/scenario/ScenarioObjective.cpp b/src/openrct2/scenario/ScenarioObjective.cpp index 9b8427e194..a624ed36ad 100644 --- a/src/openrct2/scenario/ScenarioObjective.cpp +++ b/src/openrct2/scenario/ScenarioObjective.cpp @@ -106,28 +106,28 @@ namespace OpenRCT2::Scenario gameState.scenarioParkRatingWarningDays++; if (gameState.scenarioParkRatingWarningDays == 1) { - if (Config::Get().notifications.ParkRatingWarnings) + if (Config::Get().notifications.parkRatingWarnings) { News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_4_WEEKS_REMAINING, 0, {}); } } else if (gameState.scenarioParkRatingWarningDays == 8) { - if (Config::Get().notifications.ParkRatingWarnings) + if (Config::Get().notifications.parkRatingWarnings) { News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_3_WEEKS_REMAINING, 0, {}); } } else if (gameState.scenarioParkRatingWarningDays == 15) { - if (Config::Get().notifications.ParkRatingWarnings) + if (Config::Get().notifications.parkRatingWarnings) { News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_2_WEEKS_REMAINING, 0, {}); } } else if (gameState.scenarioParkRatingWarningDays == 22) { - if (Config::Get().notifications.ParkRatingWarnings) + if (Config::Get().notifications.parkRatingWarnings) { News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_1_WEEK_REMAINING, 0, {}); } diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 94c7ba5aa5..52719352f2 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -621,7 +621,7 @@ private: // Check if legacy highscore is better if (scBasic.CompanyValue > highscore->company_value) { - std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::EnglishUK); + std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::englishUK); highscore->name = name; highscore->company_value = scBasic.CompanyValue; highscore->timestamp = kDatetime64Min; @@ -633,7 +633,7 @@ private: { ScenarioHighscoreEntry* highscore = InsertHighscore(); highscore->fileName = scBasic.Path; - std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::EnglishUK); + std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::englishUK); highscore->name = name; highscore->company_value = scBasic.CompanyValue; highscore->timestamp = kDatetime64Min; diff --git a/src/openrct2/scenes/intro/IntroScene.cpp b/src/openrct2/scenes/intro/IntroScene.cpp index 92eeec0a0a..852ccd8151 100644 --- a/src/openrct2/scenes/intro/IntroScene.cpp +++ b/src/openrct2/scenes/intro/IntroScene.cpp @@ -11,15 +11,18 @@ #include "../../Context.h" #include "../../Input.h" +#include "../../OpenRCT2.h" #include "../../SpriteIds.h" #include "../../audio/Audio.h" #include "../../audio/AudioChannel.h" #include "../../audio/AudioMixer.h" #include "../../drawing/Drawing.h" +#include "../../drawing/Rectangle.h" #include using OpenRCT2::Audio::SoundId; +using namespace OpenRCT2::Drawing; namespace OpenRCT2 { @@ -27,8 +30,8 @@ namespace OpenRCT2 static constexpr PaletteIndex kBackgroundColourLogo = PaletteIndex::pi245; static constexpr PaletteIndex kBorderColourPublisher = PaletteIndex::pi129; - constexpr int32_t PALETTE_G1_IDX_DEVELOPER = 23217; - constexpr int32_t PALETTE_G1_IDX_LOGO = 23224; + static constexpr ImageIndex kPaletteChrisSawyerLogo = 23217; + static constexpr ImageIndex kPaletteRCT2Logo = 23224; static IntroState _introState; @@ -67,11 +70,6 @@ namespace OpenRCT2 switch (_introState) { - case IntroState::Disclaimer1: - case IntroState::Disclaimer2: - // Originally used for the disclaimer text - _introState = IntroState::PublisherBegin; - [[fallthrough]]; case IntroState::PublisherBegin: LoadPalette(); @@ -174,9 +172,12 @@ namespace OpenRCT2 _soundChannel = nullptr; } - // Move to next part - _introState = IntroState::Finish; - _introStateCounter = 0; + if (gOpenRCT2Headless) + { + // Move to next part + _introState = IntroState::Finish; + _introStateCounter = 0; + } break; case IntroState::Finish: { @@ -195,9 +196,6 @@ namespace OpenRCT2 switch (_introState) { - case IntroState::Disclaimer1: - case IntroState::Disclaimer2: - break; case IntroState::PublisherBegin: GfxClear(rt, kBackgroundColourDark); break; @@ -205,7 +203,7 @@ namespace OpenRCT2 GfxClear(rt, kBackgroundColourDark); // Draw a white rectangle for the logo background (gives a bit of white margin) - GfxFillRect( + Rectangle::fill( rt, { { (screenWidth / 2) - 320 + 50, _introStateCounter + 50 }, { (screenWidth / 2) - 320 + 50 + 540, _introStateCounter + 50 + 425 } }, @@ -220,7 +218,7 @@ namespace OpenRCT2 break; case IntroState::DeveloperBegin: GfxClear(rt, kBackgroundColourDark); - GfxTransposePalette(PALETTE_G1_IDX_DEVELOPER, 255); + GfxTransposePalette(kPaletteChrisSawyerLogo, 255); break; case IntroState::DeveloperScroll: GfxClear(rt, kBackgroundColourDark); @@ -232,11 +230,11 @@ namespace OpenRCT2 case IntroState::LogoFadeIn: if (_introStateCounter <= 0xFF00) { - GfxTransposePalette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF); + GfxTransposePalette(kPaletteRCT2Logo, (_introStateCounter >> 8) & 0xFF); } else { - GfxTransposePalette(PALETTE_G1_IDX_LOGO, 255); + GfxTransposePalette(kPaletteRCT2Logo, 255); } ScreenIntroDrawLogo(rt); break; @@ -246,16 +244,20 @@ namespace OpenRCT2 case IntroState::LogoFadeOut: if (_introStateCounter >= 0) { - GfxTransposePalette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF); + GfxTransposePalette(kPaletteRCT2Logo, (_introStateCounter >> 8) & 0xFF); } else { - GfxTransposePalette(PALETTE_G1_IDX_LOGO, 0); + GfxTransposePalette(kPaletteRCT2Logo, 0); } ScreenIntroDrawLogo(rt); break; case IntroState::Clear: GfxClear(rt, kBackgroundColourDark); + + // Move to next part. Has to be done here to ensure the screen is cleared. + _introState = IntroState::Finish; + _introStateCounter = 0; break; default: break; @@ -264,7 +266,7 @@ namespace OpenRCT2 static void ScreenIntroProcessMouseInput() { - if (ContextGetCursorState()->any == CURSOR_PRESSED) + if (ContextGetCursorState()->any & CURSOR_DOWN) { ScreenIntroSkipPart(); } @@ -293,9 +295,6 @@ namespace OpenRCT2 { case IntroState::None: break; - case IntroState::Disclaimer2: - _introState = IntroState::PublisherBegin; - break; default: _introState = IntroState::Clear; break; diff --git a/src/openrct2/scenes/intro/IntroScene.h b/src/openrct2/scenes/intro/IntroScene.h index 43b3d98c4a..73fcffe0aa 100644 --- a/src/openrct2/scenes/intro/IntroScene.h +++ b/src/openrct2/scenes/intro/IntroScene.h @@ -27,8 +27,6 @@ namespace OpenRCT2 LogoFadeIn, LogoWait, LogoFadeOut, - Disclaimer1, - Disclaimer2, Clear = 254, Finish = 255, }; diff --git a/src/openrct2/scenes/title/TitleScene.cpp b/src/openrct2/scenes/title/TitleScene.cpp index faf1a4a4e6..9ab24763d2 100644 --- a/src/openrct2/scenes/title/TitleScene.cpp +++ b/src/openrct2/scenes/title/TitleScene.cpp @@ -180,7 +180,7 @@ void TitleScene::ChangePresetSequence(size_t preset) } const utf8* configId = TitleSequenceManager::GetConfigID(preset); - Config::Get().interface.CurrentTitleSequencePreset = configId; + Config::Get().interface.currentTitleSequencePreset = configId; if (!_previewingSequence) _currentSequence = preset; @@ -209,7 +209,7 @@ void TitleScene::TitleInitialise() { _sequencePlayer = GetContext().GetUiContext().GetTitleSequencePlayer(); } - if (Config::Get().interface.RandomTitleSequence) + if (Config::Get().interface.randomTitleSequence) { const size_t total = TitleSequenceManager::GetCount(); if (total > 0) @@ -305,7 +305,7 @@ bool TitleScene::TryLoadSequence(bool loadPreview) { // Forcefully change the preset to a preset that works. const utf8* configId = TitleSequenceManager::GetConfigID(targetSequence); - Config::Get().interface.CurrentTitleSequencePreset = configId; + Config::Get().interface.currentTitleSequencePreset = configId; } _currentSequence = targetSequence; GfxInvalidateScreen(); @@ -361,7 +361,7 @@ void TitleSequenceChangePreset(size_t preset) size_t TitleGetConfigSequence() { - return TitleSequenceManager::GetIndexForConfigID(Config::Get().interface.CurrentTitleSequencePreset.c_str()); + return TitleSequenceManager::GetIndexForConfigID(Config::Get().interface.currentTitleSequencePreset.c_str()); } size_t TitleGetCurrentSequence() diff --git a/src/openrct2/scripting/IconNames.hpp b/src/openrct2/scripting/IconNames.hpp index ede22c6b15..84bdd33195 100644 --- a/src/openrct2/scripting/IconNames.hpp +++ b/src/openrct2/scripting/IconNames.hpp @@ -169,6 +169,10 @@ namespace OpenRCT2::Scripting { "selection_edge_se", SPR_G2_SELECTION_EDGE_SE }, { "palette_invisible", SPR_G2_ICON_PALETTE_INVISIBLE }, { "palette_invisible_pressed", SPR_G2_ICON_PALETTE_INVISIBLE_PRESSED }, + { "palette_large", SPR_G2_ICON_PALETTE_LARGE }, + { "palette_pressed_large", SPR_G2_ICON_PALETTE_PRESSED_LARGE }, + { "palette_invisible_large", SPR_G2_ICON_PALETTE_INVISIBLE_LARGE }, + { "palette_invisible_pressed_large", SPR_G2_ICON_PALETTE_INVISIBLE_PRESSED_LARGE }, { "monitor_start", SPR_G2_MONITOR_TAB_START }, { "monitor_end", SPR_G2_MONITOR_TAB_END }, }; diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 1db154a36c..80a013c9d3 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -588,7 +588,7 @@ void ScriptEngine::RefreshPlugins() } // Turn on hot reload if not already enabled - if (!_hotReloadingInitialised && Config::Get().plugin.EnableHotReloading && Network::GetMode() == Network::Mode::none) + if (!_hotReloadingInitialised && Config::Get().plugin.enableHotReloading && Network::GetMode() == Network::Mode::none) { SetupHotReloading(); } diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index d54fd7aa0a..3efdeacca2 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -56,37 +56,37 @@ namespace OpenRCT2::Scripting { switch (entity->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: return "car"; - case EntityType::Guest: + case EntityType::guest: if (targetApiVersion <= kApiVersionPeepDeprecation) return "peep"; return "guest"; - case EntityType::Staff: + case EntityType::staff: if (targetApiVersion <= kApiVersionPeepDeprecation) return "peep"; return "staff"; - case EntityType::SteamParticle: + case EntityType::steamParticle: return "steam_particle"; - case EntityType::MoneyEffect: + case EntityType::moneyEffect: return "money_effect"; - case EntityType::CrashedVehicleParticle: + case EntityType::crashedVehicleParticle: return "crashed_vehicle_particle"; - case EntityType::ExplosionCloud: + case EntityType::explosionCloud: return "explosion_cloud"; - case EntityType::CrashSplash: + case EntityType::crashSplash: return "crash_splash"; - case EntityType::ExplosionFlare: + case EntityType::explosionFlare: return "explosion_flare"; - case EntityType::Balloon: + case EntityType::balloon: return "balloon"; - case EntityType::Duck: + case EntityType::duck: return "duck"; - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: return "jumping_fountain"; - case EntityType::Litter: + case EntityType::litter: return "litter"; - case EntityType::Null: + case EntityType::null: return "unknown"; default: break; @@ -152,16 +152,16 @@ namespace OpenRCT2::Scripting entity->Invalidate(); switch (entity->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: duk_error(ctx, DUK_ERR_ERROR, "Removing a vehicle is currently unsupported."); break; - case EntityType::Guest: - case EntityType::Staff: + case EntityType::guest: + case EntityType::staff: { auto peep = entity->As(); // We can't remove a single peep from a ride at the moment as this can cause complications with the // vehicle car having an unsupported peep capacity. - if (peep == nullptr || peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide) + if (peep == nullptr || peep->State == PeepState::onRide || peep->State == PeepState::enteringRide) { duk_error(ctx, DUK_ERR_ERROR, "Removing a peep that is on a ride is currently unsupported."); } @@ -171,19 +171,19 @@ namespace OpenRCT2::Scripting } break; } - case EntityType::SteamParticle: - case EntityType::MoneyEffect: - case EntityType::CrashedVehicleParticle: - case EntityType::ExplosionCloud: - case EntityType::CrashSplash: - case EntityType::ExplosionFlare: - case EntityType::JumpingFountain: - case EntityType::Balloon: - case EntityType::Duck: - case EntityType::Litter: + case EntityType::steamParticle: + case EntityType::moneyEffect: + case EntityType::crashedVehicleParticle: + case EntityType::explosionCloud: + case EntityType::crashSplash: + case EntityType::explosionFlare: + case EntityType::jumpingFountain: + case EntityType::balloon: + case EntityType::duck: + case EntityType::litter: getGameState().entities.EntityRemove(entity); break; - case EntityType::Null: + case EntityType::null: break; default: break; diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index 3ae2e1d4b4..8c921f98c3 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -575,7 +575,7 @@ namespace OpenRCT2::Scripting auto obj = OpenRCT2::Scripting::DukObject(ctx); obj.Set("type", itemEnumPair.first); - if (shopItem == ShopItem::Voucher) + if (shopItem == ShopItem::voucher) { // Voucher obj.Set("voucherType", VoucherTypeMap[peep->VoucherType]); @@ -595,16 +595,16 @@ namespace OpenRCT2::Scripting // GuestPhoto switch (shopItem) { - case ShopItem::Photo: + case ShopItem::photo: obj.Set("rideId", peep->Photo1RideRef.ToUnderlying()); break; - case ShopItem::Photo2: + case ShopItem::photo2: obj.Set("rideId", peep->Photo2RideRef.ToUnderlying()); break; - case ShopItem::Photo3: + case ShopItem::photo3: obj.Set("rideId", peep->Photo3RideRef.ToUnderlying()); break; - case ShopItem::Photo4: + case ShopItem::photo4: obj.Set("rideId", peep->Photo4RideRef.ToUnderlying()); break; default: @@ -643,7 +643,7 @@ namespace OpenRCT2::Scripting return false; } - if (*shopItem == ShopItem::Voucher) + if (*shopItem == ShopItem::voucher) { if (item["voucherType"].type() == DukValue::Type::STRING) { @@ -686,25 +686,25 @@ namespace OpenRCT2::Scripting { switch (*shopItem) { - case ShopItem::Photo: + case ShopItem::photo: if (item["rideId"].as_uint() != peep->Photo1RideRef.ToUnderlying()) { return false; } break; - case ShopItem::Photo2: + case ShopItem::photo2: if (item["rideId"].as_uint() != peep->Photo2RideRef.ToUnderlying()) { return false; } break; - case ShopItem::Photo3: + case ShopItem::photo3: if (item["rideId"].as_uint() != peep->Photo3RideRef.ToUnderlying()) { return false; } break; - case ShopItem::Photo4: + case ShopItem::photo4: if (item["rideId"].as_uint() != peep->Photo4RideRef.ToUnderlying()) { return false; @@ -742,7 +742,7 @@ namespace OpenRCT2::Scripting duk_error(ctx, DUK_ERR_ERROR, "Invalid 'type'."); } - if (*shopItem == ShopItem::Voucher) + if (*shopItem == ShopItem::voucher) { // Voucher if (item["voucherType"].type() != DukValue::Type::STRING) @@ -801,16 +801,16 @@ namespace OpenRCT2::Scripting switch (*shopItem) { - case ShopItem::Photo: + case ShopItem::photo: peep->Photo1RideRef = RideId::FromUnderlying(item["rideId"].as_uint()); break; - case ShopItem::Photo2: + case ShopItem::photo2: peep->Photo2RideRef = RideId::FromUnderlying(item["rideId"].as_uint()); break; - case ShopItem::Photo3: + case ShopItem::photo3: peep->Photo3RideRef = RideId::FromUnderlying(item["rideId"].as_uint()); break; - case ShopItem::Photo4: + case ShopItem::photo4: peep->Photo4RideRef = RideId::FromUnderlying(item["rideId"].as_uint()); break; default: @@ -848,7 +848,7 @@ namespace OpenRCT2::Scripting std::vector ScGuest::availableAnimations_get() const { std::vector availableAnimations{}; - for (auto& animation : getAnimationsByPeepType(AnimationPeepType::Guest)) + for (auto& animation : getAnimationsByPeepType(AnimationPeepType::guest)) { availableAnimations.push_back(std::string(animation.first)); } @@ -859,7 +859,7 @@ namespace OpenRCT2::Scripting { std::vector spriteIds{}; - auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::Guest); + auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::guest); auto animationType = availableGuestAnimations.TryGet(groupKey); if (animationType == std::nullopt) { @@ -873,10 +873,10 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, *animationType); - for (auto frameOffset : animationGroup.frame_offsets) + for (auto frameOffset : animationGroup.frameOffsets) { - auto imageId = animationGroup.base_image; - if (animationType != PeepAnimationType::Hanging) + auto imageId = animationGroup.baseImage; + if (animationType != PeepAnimationType::hanging) imageId += rotation + frameOffset * 4; else imageId += frameOffset; @@ -895,13 +895,13 @@ namespace OpenRCT2::Scripting return nullptr; } - auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::Guest); + auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::guest); std::string_view action = availableGuestAnimations[peep->AnimationType]; // Special consideration for sitting peeps // TODO: something funky going on in the state machine - if (peep->AnimationType == PeepAnimationType::Walking && peep->State == PeepState::Sitting) - action = availableGuestAnimations[PeepAnimationType::SittingIdle]; + if (peep->AnimationType == PeepAnimationType::walking && peep->State == PeepState::sitting) + action = availableGuestAnimations[PeepAnimationType::sittingIdle]; return std::string(action); } @@ -910,7 +910,7 @@ namespace OpenRCT2::Scripting { ThrowIfGameStateNotMutable(); - auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::Guest); + auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::guest); auto newType = availableGuestAnimations.TryGet(groupKey); if (newType == std::nullopt) { @@ -930,7 +930,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->Invalidate(); peep->UpdateSpriteBoundingBox(); peep->Invalidate(); @@ -960,7 +960,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - auto length = animationGroup.frame_offsets.size(); + auto length = animationGroup.frameOffsets.size(); offset %= length; if (peep->IsActionWalking()) @@ -968,7 +968,7 @@ namespace OpenRCT2::Scripting else peep->AnimationFrameNum = offset; - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->UpdateSpriteBoundingBox(); } @@ -984,7 +984,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - return static_cast(animationGroup.frame_offsets.size()); + return static_cast(animationGroup.frameOffsets.size()); } ScThought::ScThought(PeepThought backing) diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.hpp b/src/openrct2/scripting/bindings/entity/ScGuest.hpp index ceb5dc78fc..1bcb1ff130 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.hpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.hpp @@ -21,60 +21,60 @@ namespace OpenRCT2::Scripting { static const DukEnumMap ShopItemMap( { - { "beef_noodles", ShopItem::BeefNoodles }, - { "burger", ShopItem::Burger }, - { "candyfloss", ShopItem::Candyfloss }, - { "chicken", ShopItem::Chicken }, - { "chips", ShopItem::Chips }, - { "chocolate", ShopItem::Chocolate }, - { "cookie", ShopItem::Cookie }, - { "doughnut", ShopItem::Doughnut }, - { "hot_dog", ShopItem::HotDog }, - { "fried_rice_noodles", ShopItem::FriedRiceNoodles }, - { "funnel_cake", ShopItem::FunnelCake }, - { "ice_cream", ShopItem::IceCream }, - { "meatball_soup", ShopItem::MeatballSoup }, - { "pizza", ShopItem::Pizza }, - { "popcorn", ShopItem::Popcorn }, - { "pretzel", ShopItem::Pretzel }, - { "roast_sausage", ShopItem::RoastSausage }, - { "sub_sandwich", ShopItem::SubSandwich }, - { "tentacle", ShopItem::Tentacle }, - { "toffee_apple", ShopItem::ToffeeApple }, - { "wonton_soup", ShopItem::WontonSoup }, - { "coffee", ShopItem::Coffee }, - { "drink", ShopItem::Drink }, - { "fruit_juice", ShopItem::FruitJuice }, - { "iced_tea", ShopItem::IcedTea }, - { "lemonade", ShopItem::Lemonade }, - { "soybean_milk", ShopItem::SoybeanMilk }, - { "sujeonggwa", ShopItem::Sujeonggwa }, - { "balloon", ShopItem::Balloon }, - { "hat", ShopItem::Hat }, - { "map", ShopItem::Map }, - { "sunglasses", ShopItem::Sunglasses }, - { "toy", ShopItem::Toy }, - { "tshirt", ShopItem::TShirt }, - { "umbrella", ShopItem::Umbrella }, - { "photo1", ShopItem::Photo }, - { "photo2", ShopItem::Photo2 }, - { "photo3", ShopItem::Photo3 }, - { "photo4", ShopItem::Photo4 }, - { "voucher", ShopItem::Voucher }, - { "empty_bottle", ShopItem::EmptyBottle }, - { "empty_bowl_blue", ShopItem::EmptyBowlBlue }, - { "empty_bowl_red", ShopItem::EmptyBowlRed }, - { "empty_box", ShopItem::EmptyBox }, - { "empty_burger_box", ShopItem::EmptyBurgerBox }, - { "empty_can", ShopItem::EmptyCan }, - { "empty_cup", ShopItem::EmptyCup }, - { "empty_drink_carton", ShopItem::EmptyDrinkCarton }, - { "empty_juice_cup", ShopItem::EmptyJuiceCup }, - { "rubbish", ShopItem::Rubbish }, + { "beef_noodles", ShopItem::beefNoodles }, + { "burger", ShopItem::burger }, + { "candyfloss", ShopItem::candyfloss }, + { "chicken", ShopItem::chicken }, + { "chips", ShopItem::chips }, + { "chocolate", ShopItem::chocolate }, + { "cookie", ShopItem::cookie }, + { "doughnut", ShopItem::doughnut }, + { "hot_dog", ShopItem::hotDog }, + { "fried_rice_noodles", ShopItem::friedRiceNoodles }, + { "funnel_cake", ShopItem::funnelCake }, + { "ice_cream", ShopItem::iceCream }, + { "meatball_soup", ShopItem::meatballSoup }, + { "pizza", ShopItem::pizza }, + { "popcorn", ShopItem::popcorn }, + { "pretzel", ShopItem::pretzel }, + { "roast_sausage", ShopItem::roastSausage }, + { "sub_sandwich", ShopItem::subSandwich }, + { "tentacle", ShopItem::tentacle }, + { "toffee_apple", ShopItem::toffeeApple }, + { "wonton_soup", ShopItem::wontonSoup }, + { "coffee", ShopItem::coffee }, + { "drink", ShopItem::drink }, + { "fruit_juice", ShopItem::fruitJuice }, + { "iced_tea", ShopItem::icedTea }, + { "lemonade", ShopItem::lemonade }, + { "soybean_milk", ShopItem::soybeanMilk }, + { "sujeonggwa", ShopItem::sujeonggwa }, + { "balloon", ShopItem::balloon }, + { "hat", ShopItem::hat }, + { "map", ShopItem::map }, + { "sunglasses", ShopItem::sunglasses }, + { "toy", ShopItem::toy }, + { "tshirt", ShopItem::tShirt }, + { "umbrella", ShopItem::umbrella }, + { "photo1", ShopItem::photo }, + { "photo2", ShopItem::photo2 }, + { "photo3", ShopItem::photo3 }, + { "photo4", ShopItem::photo4 }, + { "voucher", ShopItem::voucher }, + { "empty_bottle", ShopItem::emptyBottle }, + { "empty_bowl_blue", ShopItem::emptyBowlBlue }, + { "empty_bowl_red", ShopItem::emptyBowlRed }, + { "empty_box", ShopItem::emptyBox }, + { "empty_burger_box", ShopItem::emptyBurgerBox }, + { "empty_can", ShopItem::emptyCan }, + { "empty_cup", ShopItem::emptyCup }, + { "empty_drink_carton", ShopItem::emptyDrinkCarton }, + { "empty_juice_cup", ShopItem::emptyJuiceCup }, + { "rubbish", ShopItem::rubbish }, }); - // Since the ShopItem enum is missing values and includes ShopItem::Admission (something a + // Since the ShopItem enum is missing values and includes ShopItem::admission (something a // guest cannot carry), 6 is subtracted from the value. - static_assert((EnumValue(ShopItem::Count) - 6) == 50, "ShopItem::Count changed, update scripting binding!"); + static_assert((EnumValue(ShopItem::count) - 6) == 50, "ShopItem::count changed, update scripting binding!"); static const DukEnumMap VoucherTypeMap( { diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp index 5fa023aa1b..ad012b8cf9 100644 --- a/src/openrct2/scripting/bindings/entity/ScLitter.cpp +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -17,18 +17,18 @@ namespace OpenRCT2::Scripting { static const DukEnumMap LitterTypeMap( { - { "vomit", Litter::Type::Vomit }, - { "vomit_alt", Litter::Type::VomitAlt }, - { "empty_can", Litter::Type::EmptyCan }, - { "rubbish", Litter::Type::Rubbish }, - { "burger_box", Litter::Type::BurgerBox }, - { "empty_cup", Litter::Type::EmptyCup }, - { "empty_box", Litter::Type::EmptyBox }, - { "empty_bottle", Litter::Type::EmptyBottle }, - { "empty_bowl_red", Litter::Type::EmptyBowlRed }, - { "empty_drink_carton", Litter::Type::EmptyDrinkCarton }, - { "empty_juice_cup", Litter::Type::EmptyJuiceCup }, - { "empty_bowl_blue", Litter::Type::EmptyBowlBlue }, + { "vomit", Litter::Type::vomit }, + { "vomit_alt", Litter::Type::vomitAlt }, + { "empty_can", Litter::Type::emptyCan }, + { "rubbish", Litter::Type::rubbish }, + { "burger_box", Litter::Type::burgerBox }, + { "empty_cup", Litter::Type::emptyCup }, + { "empty_box", Litter::Type::emptyBox }, + { "empty_bottle", Litter::Type::emptyBottle }, + { "empty_bowl_red", Litter::Type::emptyBowlRed }, + { "empty_drink_carton", Litter::Type::emptyDrinkCarton }, + { "empty_juice_cup", Litter::Type::emptyJuiceCup }, + { "empty_bowl_blue", Litter::Type::emptyBowlBlue }, }); ScLitter::ScLitter(EntityId Id) diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.cpp b/src/openrct2/scripting/bindings/entity/ScStaff.cpp index a600ceb792..11eed011ff 100644 --- a/src/openrct2/scripting/bindings/entity/ScStaff.cpp +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -54,15 +54,15 @@ namespace OpenRCT2::Scripting { switch (peep->AssignedStaffType) { - case StaffType::Handyman: + case StaffType::handyman: return "handyman"; - case StaffType::Mechanic: + case StaffType::mechanic: return "mechanic"; - case StaffType::Security: + case StaffType::security: return "security"; - case StaffType::Entertainer: + case StaffType::entertainer: return "entertainer"; - case StaffType::Count: + case StaffType::count: break; } } @@ -75,34 +75,34 @@ namespace OpenRCT2::Scripting auto peep = GetStaff(); if (peep != nullptr) { - if (value == "handyman" && peep->AssignedStaffType != StaffType::Handyman) + if (value == "handyman" && peep->AssignedStaffType != StaffType::handyman) { - peep->AssignedStaffType = StaffType::Handyman; - peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Handyman); - peep->AnimationGroup = PeepAnimationGroup::Normal; + peep->AssignedStaffType = StaffType::handyman; + peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::handyman); + peep->AnimationGroup = PeepAnimationGroup::normal; } else if (value == "mechanic" && !peep->IsMechanic()) { - peep->AssignedStaffType = StaffType::Mechanic; - peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Mechanic); - peep->AnimationGroup = PeepAnimationGroup::Normal; + peep->AssignedStaffType = StaffType::mechanic; + peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::mechanic); + peep->AnimationGroup = PeepAnimationGroup::normal; } - else if (value == "security" && peep->AssignedStaffType != StaffType::Security) + else if (value == "security" && peep->AssignedStaffType != StaffType::security) { - peep->AssignedStaffType = StaffType::Security; - peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Security); - peep->AnimationGroup = PeepAnimationGroup::Normal; + peep->AssignedStaffType = StaffType::security; + peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::security); + peep->AnimationGroup = PeepAnimationGroup::normal; } else if (value == "entertainer" && !peep->isEntertainer()) { - peep->AssignedStaffType = StaffType::Entertainer; - peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Entertainer); - peep->AnimationGroup = PeepAnimationGroup::Normal; + peep->AssignedStaffType = StaffType::entertainer; + peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::entertainer); + peep->AnimationGroup = PeepAnimationGroup::normal; } // Reset state to walking to prevent invalid actions from carrying over - peep->Action = PeepActionType::Walking; - peep->AnimationType = peep->NextAnimationType = PeepAnimationType::Walking; + peep->Action = PeepActionType::walking; + peep->AnimationType = peep->NextAnimationType = PeepAnimationType::walking; peep->Invalidate(); } } @@ -203,7 +203,7 @@ namespace OpenRCT2::Scripting } else if (value.type() == DukValue::Type::NUMBER) { - auto target = RCT12PeepAnimationGroup(value.as_uint() + EnumValue(RCT12PeepAnimationGroup::EntertainerPanda)); + auto target = RCT12PeepAnimationGroup(value.as_uint() + EnumValue(RCT12PeepAnimationGroup::entertainerPanda)); costume = std::find_if( costumes.begin(), costumes.end(), [target](auto& candidate) { return candidate.legacyPosition == target; }); } @@ -242,18 +242,18 @@ namespace OpenRCT2::Scripting AnimationPeepType animPeepType{}; switch (staffType) { - case StaffType::Handyman: - animPeepType = AnimationPeepType::Handyman; + case StaffType::handyman: + animPeepType = AnimationPeepType::handyman; break; - case StaffType::Mechanic: - animPeepType = AnimationPeepType::Mechanic; + case StaffType::mechanic: + animPeepType = AnimationPeepType::mechanic; break; - case StaffType::Security: - animPeepType = AnimationPeepType::Security; + case StaffType::security: + animPeepType = AnimationPeepType::security; break; - case StaffType::Entertainer: + case StaffType::entertainer: default: - animPeepType = AnimationPeepType::Entertainer; + animPeepType = AnimationPeepType::entertainer; } return getAnimationsByPeepType(animPeepType); } @@ -295,10 +295,10 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, *animationType); - for (auto frameOffset : animationGroup.frame_offsets) + for (auto frameOffset : animationGroup.frameOffsets) { - auto imageId = animationGroup.base_image; - if (animationType != PeepAnimationType::Hanging) + auto imageId = animationGroup.baseImage; + if (animationType != PeepAnimationType::hanging) imageId += rotation + frameOffset * 4; else imageId += frameOffset; @@ -346,7 +346,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->Invalidate(); peep->UpdateSpriteBoundingBox(); peep->Invalidate(); @@ -376,7 +376,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - auto length = animationGroup.frame_offsets.size(); + auto length = animationGroup.frameOffsets.size(); offset %= length; if (peep->IsActionWalking()) @@ -384,7 +384,7 @@ namespace OpenRCT2::Scripting else peep->AnimationFrameNum = offset; - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->Invalidate(); peep->UpdateSpriteBoundingBox(); peep->Invalidate(); @@ -402,7 +402,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - return static_cast(animationGroup.frame_offsets.size()); + return static_cast(animationGroup.frameOffsets.size()); } ScHandyman::ScHandyman(EntityId Id) @@ -429,7 +429,7 @@ namespace OpenRCT2::Scripting auto& scriptEngine = GetContext()->GetScriptEngine(); auto* ctx = scriptEngine.GetContext(); auto peep = GetHandyman(); - if (peep != nullptr && peep->AssignedStaffType == StaffType::Handyman) + if (peep != nullptr && peep->AssignedStaffType == StaffType::handyman) { duk_push_uint(ctx, peep->StaffLawnsMown); } @@ -445,7 +445,7 @@ namespace OpenRCT2::Scripting auto& scriptEngine = GetContext()->GetScriptEngine(); auto* ctx = scriptEngine.GetContext(); auto peep = GetHandyman(); - if (peep != nullptr && peep->AssignedStaffType == StaffType::Handyman) + if (peep != nullptr && peep->AssignedStaffType == StaffType::handyman) { duk_push_uint(ctx, peep->StaffGardensWatered); } @@ -461,7 +461,7 @@ namespace OpenRCT2::Scripting auto& scriptEngine = GetContext()->GetScriptEngine(); auto* ctx = scriptEngine.GetContext(); auto peep = GetHandyman(); - if (peep != nullptr && peep->AssignedStaffType == StaffType::Handyman) + if (peep != nullptr && peep->AssignedStaffType == StaffType::handyman) { duk_push_uint(ctx, peep->StaffLitterSwept); } @@ -477,7 +477,7 @@ namespace OpenRCT2::Scripting auto& scriptEngine = GetContext()->GetScriptEngine(); auto* ctx = scriptEngine.GetContext(); auto peep = GetHandyman(); - if (peep != nullptr && peep->AssignedStaffType == StaffType::Handyman) + if (peep != nullptr && peep->AssignedStaffType == StaffType::handyman) { duk_push_uint(ctx, peep->StaffBinsEmptied); } @@ -558,7 +558,7 @@ namespace OpenRCT2::Scripting auto& scriptEngine = GetContext()->GetScriptEngine(); auto* ctx = scriptEngine.GetContext(); auto peep = GetSecurity(); - if (peep != nullptr && peep->AssignedStaffType == StaffType::Security) + if (peep != nullptr && peep->AssignedStaffType == StaffType::security) { duk_push_uint(ctx, peep->StaffVandalsStopped); } @@ -606,9 +606,9 @@ namespace OpenRCT2::Scripting else { auto mapRange = FromDuk(coordsOrRange); - for (int32_t y = mapRange.GetTop(); y <= mapRange.GetBottom(); y += kCoordsXYStep) + for (int32_t y = mapRange.GetY1(); y <= mapRange.GetY2(); y += kCoordsXYStep) { - for (int32_t x = mapRange.GetLeft(); x <= mapRange.GetRight(); x += kCoordsXYStep) + for (int32_t x = mapRange.GetX1(); x <= mapRange.GetX2(); x += kCoordsXYStep) { CoordsXY coord(x, y); staff->SetPatrolArea(coord, value); diff --git a/src/openrct2/scripting/bindings/game/ScConfiguration.hpp b/src/openrct2/scripting/bindings/game/ScConfiguration.hpp index 9997bb4aed..40b163333b 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", Config::Get().general.Language); - obj.Set("general.showFps", Config::Get().general.ShowFPS); + obj.Set("general.language", Config::Get().general.language); + obj.Set("general.showFps", Config::Get().general.showFPS); } result = obj.Take(); } @@ -205,7 +205,7 @@ namespace OpenRCT2::Scripting } if (key == "general.showFps") { - duk_push_boolean(ctx, Config::Get().general.ShowFPS); + duk_push_boolean(ctx, Config::Get().general.showFPS); return DukValue::take_from_stack(ctx); } } @@ -246,7 +246,7 @@ namespace OpenRCT2::Scripting { if (key == "general.showFps") { - Config::Get().general.ShowFPS = value.as_bool(); + Config::Get().general.showFPS = value.as_bool(); } else { diff --git a/src/openrct2/scripting/bindings/network/ScSocket.hpp b/src/openrct2/scripting/bindings/network/ScSocket.hpp index fb1f625de0..e28f5e41cb 100644 --- a/src/openrct2/scripting/bindings/network/ScSocket.hpp +++ b/src/openrct2/scripting/bindings/network/ScSocket.hpp @@ -89,16 +89,16 @@ namespace OpenRCT2::Scripting constexpr char delimiter = ','; size_t start_pos = 0; size_t end_pos = 0; - while ((end_pos = Config::Get().plugin.AllowedHosts.find(delimiter, start_pos)) != std::string::npos) + while ((end_pos = Config::Get().plugin.allowedHosts.find(delimiter, start_pos)) != std::string::npos) { - if (host == Config::Get().plugin.AllowedHosts.substr(start_pos, end_pos - start_pos)) + if (host == Config::Get().plugin.allowedHosts.substr(start_pos, end_pos - start_pos)) { return true; } start_pos = end_pos + 1; } return host - == Config::Get().plugin.AllowedHosts.substr(start_pos, Config::Get().plugin.AllowedHosts.length() - start_pos); + == Config::Get().plugin.allowedHosts.substr(start_pos, Config::Get().plugin.allowedHosts.length() - start_pos); } public: diff --git a/src/openrct2/scripting/bindings/object/ScObject.hpp b/src/openrct2/scripting/bindings/object/ScObject.hpp index 10053f72d7..c350cfb55b 100644 --- a/src/openrct2/scripting/bindings/object/ScObject.hpp +++ b/src/openrct2/scripting/bindings/object/ScObject.hpp @@ -250,7 +250,7 @@ namespace OpenRCT2::Scripting auto entry = GetEntry(); if (entry != nullptr) { - return entry->sprite_width; + return entry->spriteWidth; } return 0; } @@ -260,7 +260,7 @@ namespace OpenRCT2::Scripting auto entry = GetEntry(); if (entry != nullptr) { - return entry->sprite_height_negative; + return entry->spriteHeightNegative; } return 0; } @@ -270,7 +270,7 @@ namespace OpenRCT2::Scripting auto entry = GetEntry(); if (entry != nullptr) { - return entry->sprite_height_positive; + return entry->spriteHeightPositive; } return 0; } diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index 286ccc1015..bf9bef1b64 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -97,7 +97,7 @@ namespace OpenRCT2::Scripting { auto spriteId = EntityId::FromUnderlying(id); auto sprite = getGameState().entities.GetEntity(spriteId); - if (sprite != nullptr && sprite->Type != EntityType::Null) + if (sprite != nullptr && sprite->Type != EntityType::null) { return GetEntityAsDukValue(sprite); } @@ -190,13 +190,13 @@ namespace OpenRCT2::Scripting { switch (staff->AssignedStaffType) { - case StaffType::Handyman: + case StaffType::handyman: result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->Id))); break; - case StaffType::Mechanic: + case StaffType::mechanic: result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->Id))); break; - case StaffType::Security: + case StaffType::security: result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->Id))); break; default: @@ -286,13 +286,13 @@ namespace OpenRCT2::Scripting { switch (staff->AssignedStaffType) { - case StaffType::Handyman: + case StaffType::handyman: result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->Id))); break; - case StaffType::Mechanic: + case StaffType::mechanic: result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->Id))); break; - case StaffType::Security: + case StaffType::security: result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->Id))); break; default: @@ -456,20 +456,20 @@ namespace OpenRCT2::Scripting auto spriteId = sprite->Id; switch (sprite->Type) { - case EntityType::Vehicle: + case EntityType::vehicle: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::Staff: + case EntityType::staff: { auto staff = getGameState().entities.GetEntity(spriteId); if (staff != nullptr) { switch (staff->AssignedStaffType) { - case StaffType::Handyman: + case StaffType::handyman: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case StaffType::Mechanic: + case StaffType::mechanic: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case StaffType::Security: + case StaffType::security: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); default: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); @@ -480,15 +480,15 @@ namespace OpenRCT2::Scripting return GetObjectAsDukValue(_context, std::make_shared(spriteId)); } } - case EntityType::Guest: + case EntityType::guest: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::Litter: + case EntityType::litter: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::Balloon: + case EntityType::balloon: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::MoneyEffect: + case EntityType::moneyEffect: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::CrashedVehicleParticle: + case EntityType::crashedVehicleParticle: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); default: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); diff --git a/src/openrct2/scripting/bindings/world/ScResearch.cpp b/src/openrct2/scripting/bindings/world/ScResearch.cpp index b6f718b5b7..971240fbe9 100644 --- a/src/openrct2/scripting/bindings/world/ScResearch.cpp +++ b/src/openrct2/scripting/bindings/world/ScResearch.cpp @@ -35,19 +35,19 @@ namespace OpenRCT2::Scripting static const DukEnumMap ResearchCategoryMap( { - { "transport", ResearchCategory::Transport }, - { "gentle", ResearchCategory::Gentle }, - { "rollercoaster", ResearchCategory::Rollercoaster }, - { "thrill", ResearchCategory::Thrill }, - { "water", ResearchCategory::Water }, - { "shop", ResearchCategory::Shop }, - { "scenery", ResearchCategory::SceneryGroup }, + { "transport", ResearchCategory::transport }, + { "gentle", ResearchCategory::gentle }, + { "rollercoaster", ResearchCategory::rollercoaster }, + { "thrill", ResearchCategory::thrill }, + { "water", ResearchCategory::water }, + { "shop", ResearchCategory::shop }, + { "scenery", ResearchCategory::sceneryGroup }, }); static const DukEnumMap ResearchEntryTypeMap( { - { "ride", Research::EntryType::Ride }, - { "scenery", Research::EntryType::Scenery }, + { "ride", Research::EntryType::ride }, + { "scenery", Research::EntryType::scenery }, }); template<> @@ -56,7 +56,7 @@ namespace OpenRCT2::Scripting DukObject obj(ctx); obj.Set("category", ResearchCategoryMap[value.category]); obj.Set("type", ResearchEntryTypeMap[value.type]); - if (value.type == Research::EntryType::Ride) + if (value.type == Research::EntryType::ride) { obj.Set("rideType", value.baseRideType); } @@ -75,7 +75,7 @@ namespace OpenRCT2::Scripting return it->second; } } - return Research::EntryType::Scenery; + return Research::EntryType::scenery; } template<> @@ -112,7 +112,7 @@ namespace OpenRCT2::Scripting std::vector ScResearch::priorities_get() const { std::vector result; - for (auto i = EnumValue(ResearchCategory::Transport); i <= EnumValue(ResearchCategory::SceneryGroup); i++) + for (auto i = EnumValue(ResearchCategory::transport); i <= EnumValue(ResearchCategory::sceneryGroup); i++) { auto category = static_cast(i); if (getGameState().researchPriorities & EnumToFlag(category)) @@ -271,7 +271,7 @@ namespace OpenRCT2::Scripting { auto researchItem = FromDuk(item); researchItem.flags = 0; - if (researchItem.type == Research::EntryType::Ride) + if (researchItem.type == Research::EntryType::ride) { auto rideEntry = GetRideEntryByIndex(researchItem.entryIndex); if (rideEntry != nullptr) @@ -286,7 +286,7 @@ namespace OpenRCT2::Scripting if (sceneryGroup != nullptr) { researchItem.baseRideType = 0; - researchItem.category = ResearchCategory::SceneryGroup; + researchItem.category = ResearchCategory::sceneryGroup; result.push_back(researchItem); } } diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index 71b48dfbb7..11ed1c07cd 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -445,9 +445,9 @@ static void ClimateUpdateLightning() { if (_lightningTimer == 0) return; - if (Config::Get().general.DisableLightningEffect) + if (Config::Get().general.disableLightningEffect) return; - if (!Config::Get().general.RenderWeatherEffects && !Config::Get().general.RenderWeatherGloom) + if (!Config::Get().general.renderWeatherEffects && !Config::Get().general.renderWeatherGloom) return; _lightningTimer--; diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 396d8f985f..bafe549d3f 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -107,8 +107,10 @@ static bool MapLoc68BABCShouldContinue( const auto [slopeNorthZ, slopeEastZ, slopeSouthZ, slopeWestZ] = GetSlopeCornerHeights(pos.baseZ, slope); const TrackElement* const trackElement = tileElement->AsTrack(); - const auto& ted = OpenRCT2::TrackMetaData::GetTrackElementDescriptor(trackElement->GetTrackType()); - const auto& trackClearances = ted.sequences[trackElement->GetSequenceIndex()].clearance; + const TrackElemType trackElemType = trackElement->GetTrackType(); + const auto& ted = OpenRCT2::TrackMetaData::GetTrackElementDescriptor(trackElemType); + const uint8_t sequenceIndex = trackElemType == TrackElemType::Maze ? 0 : trackElement->GetSequenceIndex(); + const auto& trackClearances = ted.sequences[sequenceIndex].clearance; const auto trackQuarters = trackClearances.quarterTile.Rotate(trackElement->GetDirection()); const auto trackQuarterHeights = trackQuarters.GetQuarterHeights(trackElement->GetBaseZ()); const uint8_t trackOccupiedQuarters = trackQuarters.GetBaseQuarterOccupied(); diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 34b51d2e9d..43f754812d 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -102,23 +102,13 @@ static constexpr uint8_t connected_path_count[] = { }; /** rct2: 0x0098D8B4 */ -static constexpr uint8_t kDefaultPathSlope[] = { - 0, - SLOPE_IS_IRREGULAR_FLAG, - SLOPE_IS_IRREGULAR_FLAG, - FOOTPATH_PROPERTIES_FLAG_IS_SLOPED | 2, - SLOPE_IS_IRREGULAR_FLAG, - SLOPE_IS_IRREGULAR_FLAG, - FOOTPATH_PROPERTIES_FLAG_IS_SLOPED | 3, - RAISE_FOOTPATH_FLAG, - SLOPE_IS_IRREGULAR_FLAG, - FOOTPATH_PROPERTIES_FLAG_IS_SLOPED | 1, - SLOPE_IS_IRREGULAR_FLAG, - RAISE_FOOTPATH_FLAG, - FOOTPATH_PROPERTIES_FLAG_IS_SLOPED | 0, - RAISE_FOOTPATH_FLAG, - RAISE_FOOTPATH_FLAG, - SLOPE_IS_IRREGULAR_FLAG, +static constexpr FootpathSlope kDefaultPathSlope[] = { + { FootpathSlopeType::flat }, { FootpathSlopeType::irregular }, { FootpathSlopeType::irregular }, + { FootpathSlopeType::sloped, 2 }, { FootpathSlopeType::irregular }, { FootpathSlopeType::irregular }, + { FootpathSlopeType::sloped, 3 }, { FootpathSlopeType::raise }, { FootpathSlopeType::irregular }, + { FootpathSlopeType::sloped, 1 }, { FootpathSlopeType::irregular }, { FootpathSlopeType::raise }, + { FootpathSlopeType::sloped, 0 }, { FootpathSlopeType::raise }, { FootpathSlopeType::raise }, + { FootpathSlopeType::irregular }, }; static bool entrance_has_direction(const EntranceElement& entranceElement, int32_t direction) @@ -172,13 +162,13 @@ void FootpathInterruptPeeps(const CoordsXYZ& footpathPos) auto quad = EntityTileList(footpathPos); for (auto peep : quad) { - if (peep->State == PeepState::Sitting || peep->State == PeepState::Watching) + if (peep->State == PeepState::sitting || peep->State == PeepState::watching) { auto location = peep->GetLocation(); if (location.z == footpathPos.z) { auto destination = location.ToTileCentre(); - peep->SetState(PeepState::Walking); + peep->SetState(PeepState::walking); peep->SetDestination(destination, 5); peep->UpdateCurrentAnimationType(); } @@ -1923,10 +1913,10 @@ FootpathPlacementResult FootpathGetOnTerrainPlacement(const TileCoordsXY& locati FootpathPlacementResult FootpathGetOnTerrainPlacement(const SurfaceElement& surfaceElement) { int32_t baseZ = surfaceElement.GetBaseZ(); - uint8_t slope = kDefaultPathSlope[surfaceElement.GetSlope() & kTileSlopeRaisedCornersMask]; - if (slope & RAISE_FOOTPATH_FLAG) + auto slope = kDefaultPathSlope[surfaceElement.GetSlope() & kTileSlopeRaisedCornersMask]; + if (slope.type == FootpathSlopeType::raise) { - slope &= ~RAISE_FOOTPATH_FLAG; + slope.type = FootpathSlopeType::flat; baseZ += kPathHeightStep; } diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 9140d65399..9690d468f8 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -76,10 +76,36 @@ struct FootpathSelection } }; +enum class FootpathSlopeType : uint8_t +{ + flat, + sloped, + /** + * Land has one corner down, raise the Z coordinate and place a flat piece. + */ + raise, + /** + * Terrain has a shape that allows for two different path slopes, and as such it cannot autoplace a piece + * without further context of the surrounding paths. + */ + irregular, +}; + +struct FootpathSlope +{ + FootpathSlopeType type{}; + Direction direction{}; + + constexpr bool operator==(const FootpathSlope& rhs) const + { + return type == rhs.type && direction == rhs.direction; + } +}; + struct FootpathPlacementResult { int32_t baseZ{}; - uint8_t slope{}; + FootpathSlope slope{}; bool isValid() { diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 1c36ea0e05..1b12e2581f 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -848,19 +848,19 @@ struct RectRange : public CoordsRange * Represents a rectangular range of the map using regular coordinates (32 per tile). */ -struct MapRange : public RectRange +struct MapRange : public CoordsRange { - using RectRange::RectRange; + using CoordsRange::CoordsRange; constexpr MapRange Normalise() const { // Don't use std::min/max, as they require , one of C++'s heaviest // in this very common header. auto result = MapRange( - GetLeft() < GetRight() ? GetLeft() : GetRight(), // min - GetTop() < GetBottom() ? GetTop() : GetBottom(), // min - GetLeft() > GetRight() ? GetLeft() : GetRight(), // max - GetTop() > GetBottom() ? GetTop() : GetBottom() // max + GetX1() < GetX2() ? GetX1() : GetX2(), // min + GetY1() < GetY2() ? GetY1() : GetY2(), // min + GetX1() > GetX2() ? GetX1() : GetX2(), // max + GetY1() > GetY2() ? GetY1() : GetY2() // max ); return result; } diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 5bee0dd662..9048a28186 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -944,13 +944,13 @@ int32_t TileElementGetCornerHeight(const SurfaceElement* surfaceElement, int32_t uint8_t MapGetLowestLandHeight(const MapRange& range) { auto mapSizeMax = GetMapSizeMaxXY(); - MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), - std::min(range.GetRight(), mapSizeMax.x), std::min(range.GetBottom(), mapSizeMax.y) }; + MapRange validRange = { std::max(range.GetX1(), 32), std::max(range.GetY1(), 32), std::min(range.GetX2(), mapSizeMax.x), + std::min(range.GetY2(), mapSizeMax.y) }; uint8_t minHeight = 0xFF; - for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += kCoordsXYStep) + for (int32_t yi = validRange.GetY1(); yi <= validRange.GetY2(); yi += kCoordsXYStep) { - for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += kCoordsXYStep) + for (int32_t xi = validRange.GetX1(); xi <= validRange.GetX2(); xi += kCoordsXYStep) { auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); @@ -974,13 +974,13 @@ uint8_t MapGetLowestLandHeight(const MapRange& range) uint8_t MapGetHighestLandHeight(const MapRange& range) { auto mapSizeMax = GetMapSizeMaxXY(); - MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), - std::min(range.GetRight(), mapSizeMax.x), std::min(range.GetBottom(), mapSizeMax.y) }; + MapRange validRange = { std::max(range.GetX1(), 32), std::max(range.GetY1(), 32), std::min(range.GetX2(), mapSizeMax.x), + std::min(range.GetY2(), mapSizeMax.y) }; uint8_t maxHeight = 0; - for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += kCoordsXYStep) + for (int32_t yi = validRange.GetY1(); yi <= validRange.GetY2(); yi += kCoordsXYStep) { - for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += kCoordsXYStep) + for (int32_t xi = validRange.GetX1(); xi <= validRange.GetX2(); xi += kCoordsXYStep) { auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); if (surfaceElement != nullptr) @@ -1074,10 +1074,10 @@ void MapGetBoundingBox(const MapRange& _range, int32_t* left, int32_t* top, int3 { uint32_t rotation = GetCurrentRotation(); const std::array corners{ - CoordsXY{ _range.GetLeft(), _range.GetTop() }, - CoordsXY{ _range.GetRight(), _range.GetTop() }, - CoordsXY{ _range.GetRight(), _range.GetBottom() }, - CoordsXY{ _range.GetLeft(), _range.GetBottom() }, + CoordsXY{ _range.GetX1(), _range.GetY1() }, + CoordsXY{ _range.GetX2(), _range.GetY1() }, + CoordsXY{ _range.GetX2(), _range.GetY2() }, + CoordsXY{ _range.GetX1(), _range.GetY2() }, }; *left = std::numeric_limits::max(); @@ -2187,10 +2187,10 @@ void FixLandOwnershipTilesWithOwnership(std::vector tiles, uint8_t MapRange ClampRangeWithinMap(const MapRange& range) { auto mapSizeMax = GetMapSizeMaxXY(); - auto aX = std::max(kCoordsXYStep, range.GetLeft()); - auto bX = std::min(mapSizeMax.x, range.GetRight()); - auto aY = std::max(kCoordsXYStep, range.GetTop()); - auto bY = std::min(mapSizeMax.y, range.GetBottom()); + auto aX = std::max(kCoordsXYStep, range.GetX1()); + auto bX = std::min(mapSizeMax.x, range.GetX2()); + auto aY = std::max(kCoordsXYStep, range.GetY1()); + auto bY = std::min(mapSizeMax.y, range.GetY2()); MapRange validRange = MapRange{ aX, aY, bX, bY }; return validRange; } @@ -2262,7 +2262,7 @@ void ShiftMap(const TileCoordsXY& amount) // Entities auto& entityTweener = EntityTweener::Get(); - for (auto i = 0; i < EnumValue(EntityType::Count); i++) + for (auto i = 0; i < EnumValue(EntityType::count); i++) { auto entityType = static_cast(i); auto& list = getGameState().entities.GetEntityList(entityType); @@ -2279,8 +2279,8 @@ void ShiftMap(const TileCoordsXY& amount) switch (entityType) { - case EntityType::Guest: - case EntityType::Staff: + case EntityType::guest: + case EntityType::staff: { auto peep = entity->As(); if (peep != nullptr) @@ -2294,7 +2294,7 @@ void ShiftMap(const TileCoordsXY& amount) } break; } - case EntityType::Vehicle: + case EntityType::vehicle: { auto vehicle = entity->As(); if (vehicle != nullptr) @@ -2304,7 +2304,7 @@ void ShiftMap(const TileCoordsXY& amount) } break; } - case EntityType::Duck: + case EntityType::duck: { auto duck = entity->As(); if (duck != nullptr) @@ -2314,7 +2314,7 @@ void ShiftMap(const TileCoordsXY& amount) } break; } - case EntityType::JumpingFountain: + case EntityType::jumpingFountain: { auto fountain = entity->As(); if (fountain != nullptr) @@ -2327,7 +2327,7 @@ void ShiftMap(const TileCoordsXY& amount) default: break; } - if (entityType == EntityType::Staff) + if (entityType == EntityType::staff) { auto staff = entity->As(); if (staff != nullptr) diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 82a05c515b..8784c1f143 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -176,9 +176,9 @@ static std::optional UpdateSmallSceneryAnimation( auto quad = EntityTileList(CoordsXY{ loc.x, loc.y } - CoordsDirectionDelta[direction]); for (auto peep : quad) { - if (peep->State != PeepState::Walking || peep->z != baseZ || peep->Action < PeepActionType::Idle) + if (peep->State != PeepState::walking || peep->z != baseZ || !peep->IsActionInterruptableSafely()) continue; - peep->Action = PeepActionType::CheckTime; + peep->Action = PeepActionType::checkTime; peep->AnimationFrameNum = 0; peep->AnimationImageIdOffset = 0; peep->UpdateCurrentAnimationType(); diff --git a/src/openrct2/world/MapSelection.cpp b/src/openrct2/world/MapSelection.cpp index a03bb94093..fa0138906f 100644 --- a/src/openrct2/world/MapSelection.cpp +++ b/src/openrct2/world/MapSelection.cpp @@ -57,3 +57,20 @@ void MapInvalidateSelectionRect() OpenRCT2::ViewportsInvalidate({ { left, top }, { right, bottom } }); } + +MapRange getMapSelectRange() +{ + return MapRange(gMapSelectPositionA, gMapSelectPositionB); +} + +void setMapSelectRange(const MapRange& range) +{ + const auto normalised = range.Normalise(); + gMapSelectPositionA = normalised.Point1; + gMapSelectPositionB = normalised.Point2; +} + +void setMapSelectRange(const CoordsXY coords) +{ + setMapSelectRange({ coords, coords }); +} diff --git a/src/openrct2/world/MapSelection.h b/src/openrct2/world/MapSelection.h index 2c2018a9f9..8899b8c76c 100644 --- a/src/openrct2/world/MapSelection.h +++ b/src/openrct2/world/MapSelection.h @@ -65,3 +65,6 @@ extern std::vector gMapSelectionTiles; void MapInvalidateMapSelectionTiles(); void MapInvalidateSelectionRect(); +MapRange getMapSelectRange(); +void setMapSelectRange(const MapRange& range); +void setMapSelectRange(const CoordsXY coords); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 2f6b6f82d6..c08c608924 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -299,8 +299,8 @@ namespace OpenRCT2::Park ParkEntranceReset(); gameState.researchPriorities = EnumsToFlags( - ResearchCategory::Transport, ResearchCategory::Gentle, ResearchCategory::Rollercoaster, ResearchCategory::Thrill, - ResearchCategory::Water, ResearchCategory::Shop, ResearchCategory::SceneryGroup); + ResearchCategory::transport, ResearchCategory::gentle, ResearchCategory::rollercoaster, ResearchCategory::thrill, + ResearchCategory::water, ResearchCategory::shop, ResearchCategory::sceneryGroup); gameState.researchFundingLevel = RESEARCH_FUNDING_NORMAL; gameState.scenarioOptions.guestInitialCash = 50.00_GBP; @@ -557,7 +557,7 @@ namespace OpenRCT2::Park peep->SetDestination(destination, 5); peep->PeepDirection = direction; peep->Var37 = 0; - peep->State = PeepState::EnteringPark; + peep->State = PeepState::enteringPark; } } return peep; diff --git a/src/openrct2/world/tile_element/PathElement.h b/src/openrct2/world/tile_element/PathElement.h index 356b9579d7..236b6295b8 100644 --- a/src/openrct2/world/tile_element/PathElement.h +++ b/src/openrct2/world/tile_element/PathElement.h @@ -32,15 +32,6 @@ namespace OpenRCT2 FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK = (1 << 6) | (1 << 7), }; - // Masks and flags for values stored in TileElement.properties.path.type - enum - { - FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK = (1 << 0) | (1 << 1), - FOOTPATH_PROPERTIES_FLAG_IS_SLOPED = (1 << 2), - FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER = (1 << 3), - FOOTPATH_PROPERTIES_TYPE_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7), - }; - // Masks and flags for values stored in TileElement.properties.path.edges enum { diff --git a/test/tests/FormattingTests.cpp b/test/tests/FormattingTests.cpp index f73cc5c591..107b2a25b7 100644 --- a/test/tests/FormattingTests.cpp +++ b/test/tests/FormattingTests.cpp @@ -140,7 +140,7 @@ TEST_F(FormattingTests, comma_large) TEST_F(FormattingTests, currency) { - Config::Get().general.CurrencyFormat = CurrencyType::Pounds; + Config::Get().general.currencyFormat = CurrencyType::pounds; ASSERT_EQ(u8"-£251", FormatString("{CURRENCY}", -2510)); ASSERT_EQ(u8"£1", FormatString("{CURRENCY}", 4)); ASSERT_EQ(u8"£1", FormatString("{CURRENCY}", 5)); @@ -151,7 +151,7 @@ TEST_F(FormattingTests, currency) TEST_F(FormattingTests, currency2dp) { - Config::Get().general.CurrencyFormat = CurrencyType::Pounds; + Config::Get().general.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)); @@ -162,7 +162,7 @@ TEST_F(FormattingTests, currency2dp) TEST_F(FormattingTests, currency_yen) { - Config::Get().general.CurrencyFormat = CurrencyType::Yen; + Config::Get().general.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)); @@ -173,7 +173,7 @@ TEST_F(FormattingTests, currency_yen) TEST_F(FormattingTests, currency2dp_yen) { - Config::Get().general.CurrencyFormat = CurrencyType::Yen; + Config::Get().general.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)); @@ -184,14 +184,14 @@ TEST_F(FormattingTests, currency2dp_yen) TEST_F(FormattingTests, currency_pts) { - Config::Get().general.CurrencyFormat = CurrencyType::Peseta; + Config::Get().general.currencyFormat = CurrencyType::peseta; ASSERT_EQ("-251Pts", FormatString("{CURRENCY}", -2510)); ASSERT_EQ("112Pts", FormatString("{CURRENCY}", 1111)); } TEST_F(FormattingTests, currency2dp_pts) { - Config::Get().general.CurrencyFormat = CurrencyType::Peseta; + Config::Get().general.currencyFormat = CurrencyType::peseta; ASSERT_EQ("-251.00Pts", FormatString("{CURRENCY2DP}", -2510)); ASSERT_EQ("0.40Pts", FormatString("{CURRENCY2DP}", 4)); ASSERT_EQ("111.10Pts", FormatString("{CURRENCY2DP}", 1111)); @@ -211,42 +211,42 @@ TEST_F(FormattingTests, escaped_braces) TEST_F(FormattingTests, velocity_mph) { - Config::Get().general.MeasurementFormat = MeasurementFormat::Imperial; + Config::Get().general.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) { - Config::Get().general.MeasurementFormat = MeasurementFormat::Metric; + Config::Get().general.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) { - Config::Get().general.MeasurementFormat = MeasurementFormat::SI; + Config::Get().general.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) { - Config::Get().general.MeasurementFormat = MeasurementFormat::Imperial; + Config::Get().general.measurementFormat = MeasurementFormat::Imperial; auto actual = FormatString("Height: {LENGTH}", 1024); ASSERT_EQ("Height: 3,360 ft", actual); } TEST_F(FormattingTests, length_metric) { - Config::Get().general.MeasurementFormat = MeasurementFormat::Metric; + Config::Get().general.measurementFormat = MeasurementFormat::Metric; auto actual = FormatString("Height: {LENGTH}", 1024); ASSERT_EQ("Height: 1,024 m", actual); } TEST_F(FormattingTests, length_si) { - Config::Get().general.MeasurementFormat = MeasurementFormat::SI; + Config::Get().general.measurementFormat = MeasurementFormat::SI; auto actual = FormatString("Height: {LENGTH}", 2048); ASSERT_EQ("Height: 2,048 m", actual); } @@ -346,7 +346,7 @@ TEST_F(FormattingTests, format_number_basic) { FormatBuffer ss; // test basic integral conversion - FormatArgument(ss, FormatToken::UInt16, 123); + FormatArgument(ss, FormatToken::uint16, 123); ASSERT_STREQ("123", ss.data()); } @@ -354,7 +354,7 @@ TEST_F(FormattingTests, format_number_basic_int32) { FormatBuffer ss; // test that case fallthrough works - FormatArgument(ss, FormatToken::Int32, 123); + FormatArgument(ss, FormatToken::int32, 123); ASSERT_STREQ("123", ss.data()); } @@ -362,7 +362,7 @@ TEST_F(FormattingTests, format_number_negative) { FormatBuffer ss; // test negative conversion - FormatArgument(ss, FormatToken::Int32, -123); + FormatArgument(ss, FormatToken::int32, -123); ASSERT_STREQ("-123", ss.data()); } @@ -371,7 +371,7 @@ TEST_F(FormattingTests, format_number_comma16_basic) FormatBuffer ss; // test separator formatter // test base case separator formatter - FormatArgument(ss, FormatToken::Comma16, 123); + FormatArgument(ss, FormatToken::comma16, 123); ASSERT_STREQ("123", ss.data()); } @@ -380,7 +380,7 @@ TEST_F(FormattingTests, format_number_comma16_negative) FormatBuffer ss; // test separator formatter // test base case separator formatter - FormatArgument(ss, FormatToken::Comma16, -123); + FormatArgument(ss, FormatToken::comma16, -123); ASSERT_STREQ("-123", ss.data()); } @@ -388,7 +388,7 @@ TEST_F(FormattingTests, format_number_comma16_large) { FormatBuffer ss; // test larger value for separator formatter - FormatArgument(ss, FormatToken::Comma16, 123456789); + FormatArgument(ss, FormatToken::comma16, 123456789); ASSERT_STREQ("123,456,789", ss.data()); } @@ -396,7 +396,7 @@ TEST_F(FormattingTests, format_number_comma16_large_negative) { FormatBuffer ss; // test larger value for separator formatter with negative - FormatArgument(ss, FormatToken::Comma16, -123456789); + FormatArgument(ss, FormatToken::comma16, -123456789); ASSERT_STREQ("-123,456,789", ss.data()); } @@ -404,7 +404,7 @@ TEST_F(FormattingTests, format_number_comma16_uneven) { FormatBuffer ss; // test non-multiple of 3 - FormatArgument(ss, FormatToken::Comma16, 12345678); + FormatArgument(ss, FormatToken::comma16, 12345678); ASSERT_STREQ("12,345,678", ss.data()); } @@ -412,7 +412,7 @@ TEST_F(FormattingTests, format_number_comma16_uneven_negative) { FormatBuffer ss; // test non-multiple of 3 with negative - FormatArgument(ss, FormatToken::Comma16, -12345678); + FormatArgument(ss, FormatToken::comma16, -12345678); ASSERT_STREQ("-12,345,678", ss.data()); } @@ -420,7 +420,7 @@ TEST_F(FormattingTests, format_number_comma16_zero) { FormatBuffer ss; // test zero - FormatArgument(ss, FormatToken::Comma16, 0); + FormatArgument(ss, FormatToken::comma16, 0); ASSERT_STREQ("0", ss.data()); } @@ -428,7 +428,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_zero) { FormatBuffer ss; // zero case - FormatArgument(ss, FormatToken::Comma1dp16, 0); + FormatArgument(ss, FormatToken::comma1dp16, 0); ASSERT_STREQ("0.0", ss.data()); } @@ -436,7 +436,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_leading_zero) { FormatBuffer ss; // test leading zero - FormatArgument(ss, FormatToken::Comma1dp16, 5); + FormatArgument(ss, FormatToken::comma1dp16, 5); ASSERT_STREQ("0.5", ss.data()); } @@ -444,7 +444,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_leading_zero_negative) { FormatBuffer ss; // test leading zero with negative value - FormatArgument(ss, FormatToken::Comma1dp16, -5); + FormatArgument(ss, FormatToken::comma1dp16, -5); ASSERT_STREQ("-0.5", ss.data()); } @@ -452,7 +452,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_small_value) { FormatBuffer ss; // test small value - FormatArgument(ss, FormatToken::Comma1dp16, 75); + FormatArgument(ss, FormatToken::comma1dp16, 75); ASSERT_STREQ("7.5", ss.data()); } @@ -460,7 +460,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_small_value_negative) { FormatBuffer ss; // test small value with negative - FormatArgument(ss, FormatToken::Comma1dp16, -75); + FormatArgument(ss, FormatToken::comma1dp16, -75); ASSERT_STREQ("-7.5", ss.data()); } @@ -468,7 +468,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_trailing_zeros) { FormatBuffer ss; // test value with trailing zero, no commas - FormatArgument(ss, FormatToken::Comma1dp16, 1000); + FormatArgument(ss, FormatToken::comma1dp16, 1000); ASSERT_STREQ("100.0", ss.data()); } @@ -476,7 +476,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_trailing_zeros_negative) { FormatBuffer ss; // test value with trailing zero, no commas - FormatArgument(ss, FormatToken::Comma1dp16, -1000); + FormatArgument(ss, FormatToken::comma1dp16, -1000); ASSERT_STREQ("-100.0", ss.data()); } @@ -484,7 +484,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_large_trailing_zeros) { FormatBuffer ss; // test value with commas and trailing zeros - FormatArgument(ss, FormatToken::Comma1dp16, 10000000); + FormatArgument(ss, FormatToken::comma1dp16, 10000000); ASSERT_STREQ("1,000,000.0", ss.data()); } @@ -492,7 +492,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_large_trailing_zeros_negative) { FormatBuffer ss; // test value with commas and trailing zeros - FormatArgument(ss, FormatToken::Comma1dp16, -10000000); + FormatArgument(ss, FormatToken::comma1dp16, -10000000); ASSERT_STREQ("-1,000,000.0", ss.data()); } @@ -500,7 +500,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_large_value) { FormatBuffer ss; // test large value - FormatArgument(ss, FormatToken::Comma1dp16, 123456789); + FormatArgument(ss, FormatToken::comma1dp16, 123456789); ASSERT_STREQ("12,345,678.9", ss.data()); } @@ -508,7 +508,7 @@ TEST_F(FormattingTests, format_number_comma1dp16_large_value_negative) { FormatBuffer ss; // test large value - FormatArgument(ss, FormatToken::Comma1dp16, -123456789); + FormatArgument(ss, FormatToken::comma1dp16, -123456789); ASSERT_STREQ("-12,345,678.9", ss.data()); } @@ -516,7 +516,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_zero) { FormatBuffer ss; // zero case - FormatArgument(ss, FormatToken::Comma2dp32, 0); + FormatArgument(ss, FormatToken::comma2dp32, 0); ASSERT_STREQ("0.00", ss.data()); } @@ -524,7 +524,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_less_sig_figs) { FormatBuffer ss; // test leading zero - FormatArgument(ss, FormatToken::Comma2dp32, 5); + FormatArgument(ss, FormatToken::comma2dp32, 5); ASSERT_STREQ("0.05", ss.data()); } @@ -532,7 +532,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_less_sig_figs_negative) { FormatBuffer ss; // test leading zero - FormatArgument(ss, FormatToken::Comma2dp32, -5); + FormatArgument(ss, FormatToken::comma2dp32, -5); ASSERT_STREQ("-0.05", ss.data()); } @@ -540,7 +540,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_leading_zero) { FormatBuffer ss; // test small value - FormatArgument(ss, FormatToken::Comma2dp32, 75); + FormatArgument(ss, FormatToken::comma2dp32, 75); ASSERT_STREQ("0.75", ss.data()); } @@ -548,7 +548,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_leading_zero_negative) { FormatBuffer ss; // test small value - FormatArgument(ss, FormatToken::Comma2dp32, -75); + FormatArgument(ss, FormatToken::comma2dp32, -75); ASSERT_STREQ("-0.75", ss.data()); } @@ -556,7 +556,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_trailing_zeros) { FormatBuffer ss; // test value with trailing zero, no commas - FormatArgument(ss, FormatToken::Comma2dp32, 1000); + FormatArgument(ss, FormatToken::comma2dp32, 1000); ASSERT_STREQ("10.00", ss.data()); } @@ -564,7 +564,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_trailing_zeros_negative) { FormatBuffer ss; // test value with trailing zero, no commas - FormatArgument(ss, FormatToken::Comma2dp32, -1000); + FormatArgument(ss, FormatToken::comma2dp32, -1000); ASSERT_STREQ("-10.00", ss.data()); } @@ -572,7 +572,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_large_trailing_zeros) { FormatBuffer ss; // test value with commas and trailing zeros - FormatArgument(ss, FormatToken::Comma2dp32, 10000000); + FormatArgument(ss, FormatToken::comma2dp32, 10000000); ASSERT_STREQ("100,000.00", ss.data()); } @@ -580,7 +580,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_large_trailing_zeros_negative) { FormatBuffer ss; // test value with commas and trailing zeros - FormatArgument(ss, FormatToken::Comma2dp32, -10000000); + FormatArgument(ss, FormatToken::comma2dp32, -10000000); ASSERT_STREQ("-100,000.00", ss.data()); } @@ -588,7 +588,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_large_value) { FormatBuffer ss; // test large value - FormatArgument(ss, FormatToken::Comma2dp32, 123456789); + FormatArgument(ss, FormatToken::comma2dp32, 123456789); ASSERT_STREQ("1,234,567.89", ss.data()); } @@ -596,7 +596,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_large_value_negative) { FormatBuffer ss; // test large value - FormatArgument(ss, FormatToken::Comma2dp32, -123456789); + FormatArgument(ss, FormatToken::comma2dp32, -123456789); ASSERT_STREQ("-1,234,567.89", ss.data()); // extra note: @@ -605,7 +605,7 @@ TEST_F(FormattingTests, format_number_comma2dp32_large_value_negative) // specialization for which that would ever be the case is never // declared. As such the following line won't be able to find // the necessary symbol to link with. - // FormatArgument(ss, FormatToken::Comma1dp16, 12.372); + // FormatArgument(ss, FormatToken::comma1dp16, 12.372); } TEST_F(FormattingTests, buffer_storage_swap) diff --git a/test/tests/LocalisationTest.cpp b/test/tests/LocalisationTest.cpp index 0e842a972e..5e0fa06de5 100644 --- a/test/tests/LocalisationTest.cpp +++ b/test/tests/LocalisationTest.cpp @@ -27,7 +27,7 @@ TEST_F(Localisation, RCT2_to_UTF8_UK) { auto input = "The quick brown fox"; auto expected = u8"The quick brown fox"; - auto actual = RCT2StringToUTF8(input, RCT2LanguageId::EnglishUK); + auto actual = RCT2StringToUTF8(input, RCT2LanguageId::englishUK); ASSERT_EQ(expected, actual); } @@ -35,7 +35,7 @@ TEST_F(Localisation, RCT2_to_UTF8_JP) { auto input = StringFromHex("ff8374ff8340ff8358ff8367ff8375ff8389ff8345ff8393ff8374ff8348ff8362ff834eff8358"); auto expected = u8"ファストブラウンフォックス"; - auto actual = RCT2StringToUTF8(input, RCT2LanguageId::Japanese); + auto actual = RCT2StringToUTF8(input, RCT2LanguageId::japanese); ASSERT_EQ(expected, actual); } @@ -43,7 +43,7 @@ TEST_F(Localisation, RCT2_to_UTF8_ZH_TW) { auto input = StringFromHex("ffa7d6ffb374ffaabaffb4c4ffa6e2ffaab0ffaf57"); auto expected = u8"快速的棕色狐狸"; - auto actual = RCT2StringToUTF8(input, RCT2LanguageId::ChineseTraditional); + auto actual = RCT2StringToUTF8(input, RCT2LanguageId::chineseTraditional); ASSERT_EQ(expected, actual); } @@ -51,7 +51,7 @@ TEST_F(Localisation, RCT2_to_UTF8_PL) { auto input = StringFromHex("47F372736b6120446ff76b692054e6637a6f7779"); auto expected = u8"Górska Dołki Tęczowy"; - auto actual = RCT2StringToUTF8(input, RCT2LanguageId::EnglishUK); + auto actual = RCT2StringToUTF8(input, RCT2LanguageId::englishUK); ASSERT_EQ(expected, actual); } @@ -60,6 +60,6 @@ TEST_F(Localisation, RCT2_to_UTF8_ZH_TW_PREMATURE_END) // This string can be found in BATFL.DAT, the last double byte character is missing its second byte. auto input = StringFromHex("ffa470ffabacffa8aeffbdf8ffa662ffc54bffb944ffa457ffaeb6ffb0caffb76effc2"); auto expected = u8"小型車輛在鐵道上振動搖"; - auto actual = RCT2StringToUTF8(input, RCT2LanguageId::ChineseTraditional); + auto actual = RCT2StringToUTF8(input, RCT2LanguageId::chineseTraditional); ASSERT_EQ(expected, actual); } diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 9b801b6831..46db582abb 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -125,7 +125,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) richGuest->CashInPocket = 3000; // Wait for rich guest to get in queue - bool matched = updateUntil(1000, [&]() { return richGuest->State == PeepState::Queuing; }); + bool matched = updateUntil(1000, [&]() { return richGuest->State == PeepState::queuing; }); ASSERT_TRUE(matched); // Insert poor guest @@ -133,7 +133,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) poorGuest->CashInPocket = 5; // Wait for poor guest to get in queue - matched = updateUntil(1000, [&]() { return poorGuest->State == PeepState::Queuing; }); + matched = updateUntil(1000, [&]() { return poorGuest->State == PeepState::queuing; }); ASSERT_TRUE(matched); // Raise the price of the ride to a value poor guest can't pay @@ -143,8 +143,8 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) // since it doesn't have enough money to pay for it bool enteredTheRide = false; matched = updateUntil(10000, [&]() { - enteredTheRide |= poorGuest->State == PeepState::OnRide; - return poorGuest->State == PeepState::Walking || enteredTheRide; + enteredTheRide |= poorGuest->State == PeepState::onRide; + return poorGuest->State == PeepState::walking || enteredTheRide; }); ASSERT_TRUE(matched); @@ -187,7 +187,7 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests) } // Wait until one of them is riding - auto guestIsOnRide = [](auto* g) { return g->State == PeepState::OnRide; }; + auto guestIsOnRide = [](auto* g) { return g->State == PeepState::onRide; }; bool matched = updateUntil(10000, [&]() { return std::any_of(guests.begin(), guests.end(), guestIsOnRide); }); ASSERT_TRUE(matched);