diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index a99d980c2e..c524ab3eef 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -291,7 +291,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor info.SpriteType = ViewportInteractionItem::None; return info; } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { info.SpriteType = ViewportInteractionItem::None; return info; @@ -310,7 +310,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor auto ft = Formatter(); ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() == TileElementTypeN::Entrance) { rct_string_id stringId; if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) @@ -368,7 +368,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor const auto& rtd = ride->GetRideTypeDescriptor(); ft.Add(GetRideComponentName(rtd.NameConvention.station).capitalised); - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() == TileElementTypeN::Entrance) stationIndex = tileElement->AsEntrance()->GetStationIndex(); else stationIndex = tileElement->AsTrack()->GetStationIndex(); @@ -485,7 +485,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) break; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) break; ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); @@ -622,7 +622,7 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co return; do { - if (tileElement2->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement2->GetBaseZ() == z) + if (tileElement2->GetTypeN() == TileElementTypeN::Path && tileElement2->GetBaseZ() == z) { footpath_remove({ mapCoords, z }, GAME_COMMAND_FLAG_APPLY); break; diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 57e997455f..38cbdc368b 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -935,7 +935,7 @@ static void WindowFootpathSetSelectionStartBridgeAtPoint(const ScreenCoordsXY& s int32_t z = tileElement->GetBaseZ(); - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (tileElement->GetTypeN() == TileElementTypeN::Surface) { uint8_t slope = tileElement->AsSurface()->GetSlope(); if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) @@ -1036,7 +1036,7 @@ static void WindowFootpathStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) return; } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (tileElement->GetTypeN() == TileElementTypeN::Surface) { // If we start the path on a slope, the arrow is slightly raised, so we // expect the path to be slightly raised as well. @@ -1056,7 +1056,7 @@ static void WindowFootpathStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) else { z = tileElement->GetBaseZ(); - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { if (tileElement->AsPath()->IsSloped()) { @@ -1201,7 +1201,7 @@ static TileElement* FootpathGetTileElementToRemove() { if (tileElement == nullptr) break; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { if (tileElement->GetBaseZ() == z) { diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index de16f59073..a6a193eb86 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1296,7 +1296,7 @@ static void WindowMapSetPeepSpawnToolUpdate(const ScreenCoordsXY& screenCoords) return; mapZ = tileElement->GetBaseZ(); - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (tileElement->GetTypeN() == TileElementTypeN::Surface) { if ((tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != 0) mapZ += 16; @@ -1440,13 +1440,13 @@ static uint16_t MapWindowGetPixelColourPeep(const CoordsXY& c) break; } - int32_t tileElementType = tileElement->GetType() >> 2; - if (tileElementType >= maxSupportedTileElementType) + auto tileElementType = tileElement->GetTypeN(); + if (EnumValue(tileElementType) >= maxSupportedTileElementType) { - tileElementType = TILE_ELEMENT_TYPE_SURFACE >> 2; + tileElementType = TileElementTypeN::Surface; } - colour &= ElementTypeMaskColour[tileElementType]; - colour |= ElementTypeAddColour[tileElementType]; + colour &= ElementTypeMaskColour[EnumValue(tileElementType)]; + colour |= ElementTypeAddColour[EnumValue(tileElementType)]; } return colour; diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e3cbd17548..c4c7e12e11 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1175,7 +1175,7 @@ static void WindowRideUpdateOverallView(Ride* ride) while (tile_element_iterator_next(&it)) { - if (it.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (it.element->GetTypeN() != TileElementTypeN::Track) continue; if (it.element->AsTrack()->GetRideIndex() != ride->id) @@ -4237,7 +4237,7 @@ static void WindowRideSetTrackColourScheme(rct_window* w, const ScreenCoordsXY& if (info.SpriteType != ViewportInteractionItem::Ride) return; - if (info.Element->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (info.Element->GetTypeN() != TileElementTypeN::Track) return; if (info.Element->AsTrack()->GetRideIndex() != w->rideId) return; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index b16e125d66..e1236a8729 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1193,7 +1193,7 @@ static void WindowTileInspectorDropdown(rct_window* w, rct_widgetindex widgetInd if (w->tileInspectorPage == TileInspectorPage::Wall) { - openrct2_assert(tileElement->GetType() == TILE_ELEMENT_TYPE_WALL, "Element is not a wall"); + openrct2_assert(tileElement->GetTypeN() == TileElementTypeN::Wall, "Element is not a wall"); if (widgetIndex == WIDX_WALL_DROPDOWN_SLOPE_BUTTON) { diff --git a/src/openrct2/ParkFile.cpp b/src/openrct2/ParkFile.cpp index 3de1d100d8..c6bab1a08a 100644 --- a/src/openrct2/ParkFile.cpp +++ b/src/openrct2/ParkFile.cpp @@ -902,7 +902,7 @@ namespace OpenRCT2 tile_element_iterator_begin(&it); while (tile_element_iterator_next(&it)) { - if (it.element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (it.element->GetTypeN() == TileElementTypeN::Path) { auto* pathElement = it.element->AsPath(); if (pathElement->HasLegacyPathEntry()) @@ -947,7 +947,7 @@ namespace OpenRCT2 continue; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; auto* trackElement = tileElement->AsTrack(); diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index dcf251f578..1807a87a54 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -219,7 +219,7 @@ void ClearAction::ResetClearLargeSceneryFlag() { if (tileElement == nullptr) break; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() == TileElementTypeN::LargeScenery) { tileElement->AsLargeScenery()->SetIsAccounted(false); } diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index aa64dbdfe3..ff50a47c4d 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -133,7 +133,7 @@ TileElement* FootpathRemoveAction::GetFootpathElement() const { while (!(tileElement++)->IsLastForTile()) { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH && !tileElement->IsGhost()) + if (tileElement->GetTypeN() != TileElementTypeN::Path && !tileElement->IsGhost()) { continue; } @@ -165,10 +165,10 @@ GameActions::Result FootpathRemoveAction::RemoveBannersAtElement(const CoordsXY& auto result = GameActions::Result(); while (!(tileElement++)->IsLastForTile()) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) return result; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_BANNER) + if (tileElement->GetTypeN() != TileElementTypeN::Banner) continue; auto bannerRemoveAction = BannerRemoveAction({ loc, tileElement->GetBaseZ(), tileElement->AsBanner()->GetPosition() }); diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 695e113996..dad62fcfec 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -258,7 +258,7 @@ void LandSetHeightAction::SmallSceneryRemoval() const { if (tileElement == nullptr) break; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::SmallScenery) continue; if (_height > tileElement->clearance_height) continue; @@ -325,12 +325,12 @@ TileElement* LandSetHeightAction::CheckUnremovableObstructions(TileElement* surf { for (auto* tileElement : TileElementsView(_coords)) { - int32_t elementType = tileElement->GetType(); + const auto elementType = tileElement->GetTypeN(); // Wall's and Small Scenery are removed and therefore do not need checked - if (elementType == TILE_ELEMENT_TYPE_WALL) + if (elementType == TileElementTypeN::Wall) continue; - if (elementType == TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (elementType == TileElementTypeN::SmallScenery) continue; if (tileElement->IsGhost()) continue; @@ -382,10 +382,10 @@ int32_t LandSetHeightAction::map_set_land_height_clear_func( TileElement** tile_element, [[maybe_unused]] const CoordsXY& coords, [[maybe_unused]] uint8_t flags, [[maybe_unused]] money32* price) { - if ((*tile_element)->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if ((*tile_element)->GetTypeN() == TileElementTypeN::Surface) return 0; - if ((*tile_element)->GetType() == TILE_ELEMENT_TYPE_SMALL_SCENERY) + if ((*tile_element)->GetTypeN() == TileElementTypeN::SmallScenery) return 0; return 1; diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 13516ee6d3..a17dd43c24 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -383,7 +383,7 @@ void SetCheatAction::WaterPlants() const tile_element_iterator_begin(&it); do { - if (it.element->GetType() == TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (it.element->GetTypeN() == TileElementTypeN::SmallScenery) { it.element->AsSmallScenery()->SetAge(0); } @@ -399,7 +399,7 @@ void SetCheatAction::FixVandalism() const tile_element_iterator_begin(&it); do { - if (it.element->GetType() != TILE_ELEMENT_TYPE_PATH) + if (it.element->GetTypeN() != TileElementTypeN::Path) continue; if (!(it.element)->AsPath()->HasAddition()) @@ -422,7 +422,7 @@ void SetCheatAction::RemoveLitter() const tile_element_iterator_begin(&it); do { - if (it.element->GetType() != TILE_ELEMENT_TYPE_PATH) + if (it.element->GetTypeN() != TileElementTypeN::Path) continue; auto* path = it.element->AsPath(); diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 40d4626a4a..1b1a9b16de 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -54,7 +54,7 @@ GameActions::Result SignSetStyleAction::Query() const log_warning("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } - if (tileElement->GetType() != TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::LargeScenery) { log_warning("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index ce5df8d2fd..290d4e482c 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -78,7 +78,7 @@ GameActions::Result TrackRemoveAction::Query() const if (tileElement->GetBaseZ() != _origin.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if ((tileElement->GetDirection()) != _origin.direction) @@ -176,7 +176,7 @@ GameActions::Result TrackRemoveAction::Query() const if (tileElement->GetBaseZ() != mapLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetDirection() != _origin.direction) @@ -272,7 +272,7 @@ GameActions::Result TrackRemoveAction::Execute() const if (tileElement->GetBaseZ() != _origin.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if ((tileElement->GetDirection()) != _origin.direction) @@ -352,7 +352,7 @@ GameActions::Result TrackRemoveAction::Execute() const if (tileElement->GetBaseZ() != mapLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetDirection() != _origin.direction) diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index 8dc2c6f63d..bf7c815157 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -254,7 +254,7 @@ bool JumpingFountain::IsJumpingFountain(const JumpingFountainType newType, const return false; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (tileElement->GetBaseZ() != newLoc.z) continue; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index b80c4ab27e..f90124b32f 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -4858,13 +4858,13 @@ void Guest::UpdateRideMazePathfinding() if (stationBaseZ != tileElement->GetBaseZ()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Track) { mazeType = maze_type::hedge; break; } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE + if (tileElement->GetTypeN() == TileElementTypeN::Entrance && tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) { mazeType = maze_type::entrance_or_exit; @@ -5354,7 +5354,7 @@ void Guest::UpdateWalking() for (;; tileElement++) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { if (NextLoc.z == tileElement->GetBaseZ()) break; @@ -6262,7 +6262,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT if (tileElement->IsGhost()) continue; } - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; if (tileElement->GetDirection() != edge) continue; @@ -6301,7 +6301,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT if (tileElement->IsGhost()) continue; } - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; if (direction_reverse(tileElement->GetDirection()) != edge) continue; @@ -6334,7 +6334,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT if (peep->NextLoc.z + (6 * COORDS_Z_STEP) < tileElement->GetBaseZ()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Track) { if (peep_should_watch_ride(tileElement)) { @@ -6342,7 +6342,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT } } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() == TileElementTypeN::LargeScenery) { const auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); if (sceneryEntry == nullptr || !(sceneryEntry->flags & LARGE_SCENERY_FLAG_PHOTOGENIC)) @@ -6377,12 +6377,12 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT continue; if (peep->NextLoc.z + (6 * COORDS_Z_STEP) < tileElement->GetBaseZ()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (tileElement->GetTypeN() == TileElementTypeN::Surface) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() == TileElementTypeN::Wall) { auto wallEntry = tileElement->AsWall()->GetEntry(); if (wallEntry == nullptr || (wallEntry->flags2 & WALL_SCENERY_2_IS_OPAQUE)) @@ -6420,7 +6420,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT if (tileElement->IsGhost()) continue; } - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; if (direction_reverse(tileElement->GetDirection()) != edge) continue; @@ -6451,7 +6451,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT if (peep->NextLoc.z + (8 * COORDS_Z_STEP) < tileElement->GetBaseZ()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Track) { if (peep_should_watch_ride(tileElement)) { @@ -6459,7 +6459,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT } } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() == TileElementTypeN::LargeScenery) { auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); if (!(sceneryEntry == nullptr || sceneryEntry->flags & LARGE_SCENERY_FLAG_PHOTOGENIC)) @@ -6494,12 +6494,12 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT continue; if (peep->NextLoc.z + (8 * COORDS_Z_STEP) < tileElement->GetBaseZ()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (tileElement->GetTypeN() == TileElementTypeN::Surface) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() == TileElementTypeN::Wall) { auto wallEntry = tileElement->AsWall()->GetEntry(); if (wallEntry == nullptr || (wallEntry->flags2 & WALL_SCENERY_2_IS_OPAQUE)) @@ -6536,7 +6536,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT if (tileElement->IsGhost()) continue; } - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; if (direction_reverse(tileElement->GetDirection()) != edge) continue; @@ -6567,7 +6567,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT if (peep->NextLoc.z + (10 * COORDS_Z_STEP) < tileElement->GetBaseZ()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Track) { if (peep_should_watch_ride(tileElement)) { @@ -6575,7 +6575,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideT } } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() == TileElementTypeN::LargeScenery) { const auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); if (sceneryEntry == nullptr || !(sceneryEntry->flags & LARGE_SCENERY_FLAG_PHOTOGENIC)) diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index e45f82e319..b9b281e3fa 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -27,7 +27,7 @@ static bool isLocationLitterable(const CoordsXYZ& mapPos) return false; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; int32_t pathZ = tileElement->GetBaseZ(); diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index d7d3a4f619..b61b22015e 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -279,17 +279,17 @@ bool Peep::CheckForPath() TileElement* tile_element = map_get_first_element_at(NextLoc); - uint8_t map_type = TILE_ELEMENT_TYPE_PATH; + auto mapType = TileElementTypeN::Path; if (GetNextIsSurface()) { - map_type = TILE_ELEMENT_TYPE_SURFACE; + mapType = TileElementTypeN::Surface; } do { if (tile_element == nullptr) break; - if (tile_element->GetType() == map_type) + if (tile_element->GetTypeN() == mapType) { if (NextLoc.z == tile_element->GetBaseZ()) { @@ -724,7 +724,7 @@ void Peep::UpdateFalling() do { // If a path check if we are on it - if (tile_element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tile_element->GetTypeN() == TileElementTypeN::Path) { int32_t height = map_height_from_slope( { x, y }, tile_element->AsPath()->GetSlopeDirection(), tile_element->AsPath()->IsSloped()) @@ -737,7 +737,7 @@ void Peep::UpdateFalling() saved_map = tile_element; break; } // If a surface get the height and see if we are on it - else if (tile_element->GetType() == TILE_ELEMENT_TYPE_SURFACE) + else if (tile_element->GetTypeN() == TileElementTypeN::Surface) { // If the surface is water check to see if we could be drowning if (tile_element->AsSurface()->GetWaterHeight() > 0) @@ -794,7 +794,7 @@ void Peep::UpdateFalling() NextLoc = { CoordsXY{ x, y }.ToTileStart(), saved_map->GetBaseZ() }; - if (saved_map->GetType() != TILE_ELEMENT_TYPE_PATH) + if (saved_map->GetTypeN() != TileElementTypeN::Path) { SetNextFlags(0, false, true); } @@ -1808,7 +1808,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin { if (nextTileElement == nullptr) break; - if (nextTileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (nextTileElement->GetTypeN() != TileElementTypeN::Path) continue; if (nextTileElement->AsPath()->IsQueue()) @@ -2352,14 +2352,14 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) if (tileElement->IsGhost()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { peep_interact_with_path(this, { newLoc, tileElement }); tile_result = tileElement; return; } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Track) { if (peep_interact_with_shop(this, { newLoc, tileElement })) { @@ -2367,7 +2367,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) return; } } - else if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + else if (tileElement->GetTypeN() == TileElementTypeN::Entrance) { if (peep_interact_with_entrance(this, { newLoc, tileElement }, pathing_result)) { diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index e8b8902b48..b4472bcefb 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -223,7 +223,7 @@ bool Staff::CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) cons bool widefound = false; do { - if (test_element->GetType() != TILE_ELEMENT_TYPE_PATH) + if (test_element->GetTypeN() != TileElementTypeN::Path) { continue; } @@ -434,7 +434,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const { if (tileElement->base_height != nextZ) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE || tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Entrance || tileElement->GetTypeN() == TileElementTypeN::Track) { return INVALID_DIRECTION; } @@ -450,7 +450,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const { if (tileElement->base_height != nextZ) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE || tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Entrance || tileElement->GetTypeN() == TileElementTypeN::Track) { return INVALID_DIRECTION; } @@ -1203,7 +1203,7 @@ void Staff::UpdateWatering() do { - if (tile_element->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tile_element->GetTypeN() != TileElementTypeN::SmallScenery) continue; if (abs(NextLoc.z - tile_element->GetBaseZ()) > 4 * COORDS_Z_STEP) @@ -1270,7 +1270,7 @@ void Staff::UpdateEmptyingBin() for (;; tile_element++) { - if (tile_element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tile_element->GetTypeN() == TileElementTypeN::Path) { if (NextLoc.z == tile_element->GetBaseZ()) break; @@ -1584,7 +1584,7 @@ bool Staff::UpdatePatrollingFindWatering() do { - if (tile_element->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tile_element->GetTypeN() != TileElementTypeN::SmallScenery) { continue; } @@ -1647,7 +1647,7 @@ bool Staff::UpdatePatrollingFindBin() for (;; tileElement++) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH && (tileElement->GetBaseZ() == NextLoc.z)) + if (tileElement->GetTypeN() == TileElementTypeN::Path && (tileElement->GetBaseZ() == NextLoc.z)) break; if (tileElement->IsLastForTile()) diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 8681079db3..6c6f139f45 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1254,7 +1254,7 @@ static int32_t cc_remove_park_fences(InteractiveConsole& console, [[maybe_unused tile_element_iterator_begin(&it); do { - if (it.element->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (it.element->GetTypeN() == TileElementTypeN::Surface) { // Remove all park fence flags it.element->AsSurface()->SetParkFences(0); diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index ae73f422f6..bee58621ab 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -247,9 +247,9 @@ static void virtual_floor_get_tile_properties( // * Ghost objects, which are displayed as lit squares for (auto* tileElement : TileElementsView(loc)) { - int32_t elementType = tileElement->GetType(); + const auto elementType = tileElement->GetTypeN(); - if (elementType == TILE_ELEMENT_TYPE_SURFACE) + if (elementType == TileElementTypeN::Surface) { if (height < tileElement->GetClearanceZ()) { @@ -272,7 +272,7 @@ static void virtual_floor_get_tile_properties( continue; } - if (elementType == TILE_ELEMENT_TYPE_WALL || elementType == TILE_ELEMENT_TYPE_BANNER) + if (elementType == TileElementTypeN::Wall || elementType == TileElementTypeN::Banner) { int32_t direction = tileElement->GetDirection(); *outOccupiedEdges |= 1 << direction; diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 10648863c6..538e13fa69 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -194,7 +194,7 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) element--; - if (element->GetType() == TILE_ELEMENT_TYPE_SURFACE && (element->AsSurface()->GetWaterHeight() > 0)) + if (element->GetTypeN() == TileElementTypeN::Surface && (element->AsSurface()->GetWaterHeight() > 0)) { max_height = element->AsSurface()->GetWaterHeight(); } @@ -304,7 +304,7 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) return; } - if ((tile_element - 1)->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if ((tile_element - 1)->GetTypeN() == TileElementTypeN::Surface) { return; } diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 47751d1f25..682fa2d0e2 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -80,10 +80,10 @@ static TileElement* get_banner_on_path(TileElement* path_element) do { // Path on top, so no banners - if (bannerElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (bannerElement->GetTypeN() == TileElementTypeN::Path) return nullptr; // Found a banner - if (bannerElement->GetType() == TILE_ELEMENT_TYPE_BANNER) + if (bannerElement->GetTypeN() == TileElementTypeN::Banner) return bannerElement; // Last element so there can't be any other banners if (bannerElement->IsLastForTile()) @@ -284,7 +284,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, PathElement break; if (nextTileElement->IsGhost()) continue; - if (nextTileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (nextTileElement->GetTypeN() != TileElementTypeN::Path) continue; if (!IsValidPathZAndDirection(nextTileElement, loc.z, chosenDirection)) continue; @@ -1303,7 +1303,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) break; if (dest_tile_element->base_height != loc.z) continue; - if (dest_tile_element->GetType() != TILE_ELEMENT_TYPE_PATH) + if (dest_tile_element->GetTypeN() != TileElementTypeN::Path) continue; found = true; if (first_tile_element == nullptr) @@ -1808,7 +1808,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) bool found = false; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (loc.z != tileElement->base_height) @@ -1830,7 +1830,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) while (true) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { lastPathElement = tileElement; // Update the current queue end @@ -1855,7 +1855,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) if (tileElement == firstPathElement) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (baseZ == tileElement->base_height) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 1879f1e908..0906c30625 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2407,7 +2407,7 @@ namespace RCT1 { TileElement* element = it.element; - if (element->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (element->GetTypeN() != TileElementTypeN::Entrance) continue; if (element->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) continue; @@ -2561,7 +2561,7 @@ namespace RCT1 continue; do { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Track) { // Lift hill tops are the only pieces present in RCT1 that can count as a block brake. if (!tileElement->AsTrack()->HasChain()) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index e3753ff69a..281642ee5f 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -409,7 +409,7 @@ bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output) tile_element_iterator_begin(&it); do { - if (it.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (it.element->GetTypeN() != TileElementTypeN::Track) continue; if (it.element->AsTrack()->GetRideIndex() != ride->id) continue; @@ -719,7 +719,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra int32_t ride_find_track_gap(const Ride* ride, CoordsXYE* input, CoordsXYE* output) { if (ride == nullptr || input == nullptr || input->element == nullptr - || input->element->GetType() != TILE_ELEMENT_TYPE_TRACK) + || input->element->GetTypeN() != TileElementTypeN::Track) return 0; if (ride->type == RIDE_TYPE_MAZE) @@ -2260,7 +2260,7 @@ static void ride_shop_connected(Ride* ride) { if (tileElement == nullptr) break; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK && tileElement->AsTrack()->GetRideIndex() == ride->id) + if (tileElement->GetTypeN() == TileElementTypeN::Track && tileElement->AsTrack()->GetRideIndex() == ride->id) { trackElement = tileElement->AsTrack(); break; @@ -2446,11 +2446,11 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) void ride_set_map_tooltip(TileElement* tileElement) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() == TileElementTypeN::Entrance) { ride_entrance_set_map_tooltip(tileElement); } - else if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + else if (tileElement->GetTypeN() == TileElementTypeN::Track) { if (tileElement->AsTrack()->IsStation()) { @@ -2461,7 +2461,7 @@ void ride_set_map_tooltip(TileElement* tileElement) ride_track_set_map_tooltip(tileElement); } } - else if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + else if (tileElement->GetTypeN() == TileElementTypeN::Path) { ride_queue_banner_set_map_tooltip(tileElement); } @@ -2616,7 +2616,7 @@ void Ride::ChainQueues() const { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->GetBaseZ() != mapLocation.z) continue; @@ -2961,7 +2961,7 @@ static void ride_set_maze_entrance_exit_points(Ride* ride) { if (tileElement == nullptr) break; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE && tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_EXIT) @@ -3595,7 +3595,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) return success; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetBaseZ() != location.z) continue; @@ -3829,7 +3829,7 @@ TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const return nullptr; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; auto* trackElement = tileElement->AsTrack(); @@ -4559,7 +4559,7 @@ bool ride_has_any_track_elements(const Ride* ride) tile_element_iterator_begin(&it); while (tile_element_iterator_next(&it)) { - if (it.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (it.element->GetTypeN() != TileElementTypeN::Track) continue; if (it.element->AsTrack()->GetRideIndex() != ride->id) continue; @@ -4934,7 +4934,7 @@ static int32_t ride_get_track_length(Ride* ride) continue; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; trackType = tileElement->AsTrack()->GetTrackType(); @@ -5323,7 +5323,7 @@ TileElement* get_station_platform(const CoordsXYRangedZ& coords) { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; /* Check if tileElement is a station platform. */ if (!tileElement->AsTrack()->IsStation()) @@ -5604,7 +5604,7 @@ void determine_ride_entrance_and_exit_locations() { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) { continue; } @@ -5775,7 +5775,7 @@ void Ride::UpdateRideTypeForAllPieces() do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; auto* trackElement = tileElement->AsTrack(); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index af6015e6f7..5a8db73a5f 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1008,7 +1008,7 @@ bool ride_modify(CoordsXYE* input) } // Check if element is a station entrance or exit - if (tileElement.element->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement.element->GetTypeN() == TileElementTypeN::Entrance) return ride_modify_entrance_or_exit(tileElement); ride_create_or_find_construction_window(rideIndex); @@ -1025,7 +1025,7 @@ bool ride_modify(CoordsXYE* input) tileElement = endOfTrackElement; } - if (tileElement.element == nullptr || tileElement.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement.element == nullptr || tileElement.element->GetTypeN() != TileElementTypeN::Track) return false; auto tileCoords = CoordsXYZ{ tileElement, tileElement.element->GetBaseZ() }; @@ -1209,7 +1209,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC auto info = get_map_coordinates_from_pos(screenCoords, EnumsToFlags(ViewportInteractionItem::Ride)); if (info.SpriteType != ViewportInteractionItem::None) { - if (info.Element->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (info.Element->GetTypeN() == TileElementTypeN::Track) { const auto* trackElement = info.Element->AsTrack(); if (trackElement->GetRideIndex() == gRideEntranceExitPlaceRideIndex) @@ -1288,7 +1288,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC continue; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetBaseZ() != stationBaseZ) continue; @@ -1363,7 +1363,7 @@ void Ride::ValidateStations() { if (tileElement->GetBaseZ() != location.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetRideIndex() != id) continue; @@ -1418,7 +1418,7 @@ void Ride::ValidateStations() { if (blockLocation.z != tileElement->GetBaseZ()) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); @@ -1489,7 +1489,7 @@ void Ride::ValidateStations() continue; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->base_height != locationCoords.z) continue; @@ -1511,7 +1511,7 @@ void Ride::ValidateStations() continue; do { - if (trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (trackElement->GetTypeN() != TileElementTypeN::Track) continue; if (trackElement->AsTrack()->GetRideIndex() != id) continue; diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 5a84f61dd9..ea9a6d3f86 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -218,7 +218,7 @@ static void ride_ratings_update_state_2(RideRatingUpdateState& state) { if (tileElement->IsGhost()) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetBaseZ() != loc.z) continue; @@ -325,7 +325,7 @@ static void ride_ratings_update_state_5(RideRatingUpdateState& state) { if (tileElement->IsGhost()) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetBaseZ() != loc.z) continue; @@ -1469,8 +1469,8 @@ static int32_t ride_ratings_get_scenery_score(Ride* ride) if (tileElement->IsGhost()) continue; - int32_t type = tileElement->GetType(); - if (type == TILE_ELEMENT_TYPE_SMALL_SCENERY || type == TILE_ELEMENT_TYPE_LARGE_SCENERY) + const auto type = tileElement->GetTypeN(); + if (type == TileElementTypeN::SmallScenery || type == TileElementTypeN::LargeScenery) numSceneryItems++; } while (!(tileElement++)->IsLastForTile()); } diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index dd18e22caf..efc02be01b 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -339,7 +339,7 @@ TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex return nullptr; do { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK && stationStart.z == tileElement->GetBaseZ()) + if (tileElement->GetTypeN() == TileElementTypeN::Track && stationStart.z == tileElement->GetBaseZ()) return tileElement; } while (!(tileElement++)->IsLastForTile()); @@ -357,7 +357,7 @@ TileElement* ride_get_station_exit_element(const CoordsXYZ& elementPos) { if (tileElement == nullptr) break; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE && elementPos.z == tileElement->GetBaseZ()) + if (tileElement->GetTypeN() == TileElementTypeN::Entrance && elementPos.z == tileElement->GetBaseZ()) return tileElement; } while (!(tileElement++)->IsLastForTile()); diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 33406d53bb..72f8209143 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -79,7 +79,7 @@ static TileElement* find_station_element(const CoordsXYZD& loc, ride_id_t rideIn { if (loc.z != tileElement->GetBaseZ()) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetDirection() != loc.direction) continue; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 849dc28507..51cfcaa3de 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -274,7 +274,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const R do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->GetBaseZ() == z) break; @@ -352,7 +352,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ri { if (tileElement == nullptr) break; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetRideIndex() != ride.id) continue; @@ -386,7 +386,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ri { if (tileElement == nullptr) return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE) continue; @@ -415,7 +415,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ri return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_EXIT) continue; @@ -459,7 +459,7 @@ CoordsXYE TrackDesign::MazeGetFirstElement(const Ride& ride) if (tile.element == nullptr) break; - if (tile.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tile.element->GetTypeN() != TileElementTypeN::Track) continue; if (tile.element->AsTrack()->GetRideIndex() == ride.id) { @@ -1726,7 +1726,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi do { - if (tile_element->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tile_element->GetTypeN() != TileElementTypeN::Track) { continue; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index e4dec6ce15..7670bf9bcc 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1729,19 +1729,19 @@ void Vehicle::UpdateMeasurements() if (tileElement->GetBaseZ() <= z) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() == TileElementTypeN::LargeScenery) { coverFound = true; break; } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { coverFound = true; break; } - if (tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::SmallScenery) continue; auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); @@ -3001,7 +3001,7 @@ bool Vehicle::CurrentTowerElementIsTop() while (!tileElement->IsLastForTile()) { tileElement++; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK + if (tileElement->GetTypeN() == TileElementTypeN::Track && tileElement->AsTrack()->GetTrackType() == TrackElemType::TowerSection) { return false; @@ -4583,7 +4583,7 @@ static bool vehicle_boat_is_location_accessible(const CoordsXYZ& location) if (tileElement->IsGhost()) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (tileElement->GetTypeN() == TileElementTypeN::Surface) { int32_t waterZ = tileElement->AsSurface()->GetWaterHeight(); if (location.z != waterZ) @@ -6671,7 +6671,7 @@ static void block_brakes_open_previous_section(Ride& ride, const CoordsXYZ& vehi slowLocation.y = slowTrackBeginEnd.end_y; slowTileElement = *(slowTrackBeginEnd.begin_element); if (slowLocation == location && slowTileElement.GetBaseZ() == tileElement->GetBaseZ() - && slowTileElement.GetType() == tileElement->GetType() + && slowTileElement.GetTypeN() == tileElement->GetTypeN() && slowTileElement.GetDirection() == tileElement->GetDirection()) { return; diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 6053e40dc9..4d23ac3094 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -122,7 +122,7 @@ static const TrackElement* chairlift_paint_util_map_get_track_element_at_from_ri do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetRideIndex() != ride->id) continue; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 8bab0b8521..455eeb37f5 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -564,7 +564,7 @@ static bool scenario_prepare_rides_for_save() tile_element_iterator_begin(&it); do { - if (it.element->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (it.element->GetTypeN() == TileElementTypeN::Track) { markTrackAsIndestructible = false; diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 5ffdf0f44a..1cdd6952f5 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -1257,7 +1257,7 @@ namespace OpenRCT2::Scripting DukValue ScTileElement::surfaceObject_get() const { auto ctx = GetContext()->GetScriptEngine().GetContext(); - if (_element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (_element->GetTypeN() == TileElementTypeN::Path) { auto el = _element->AsPath(); auto index = el->GetSurfaceEntryIndex(); @@ -1280,7 +1280,7 @@ namespace OpenRCT2::Scripting void ScTileElement::surfaceObject_set(const DukValue& value) { ThrowIfGameStateNotMutable(); - if (_element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (_element->GetTypeN() == TileElementTypeN::Path) { auto el = _element->AsPath(); el->SetSurfaceEntryIndex(FromDuk(value)); @@ -1291,7 +1291,7 @@ namespace OpenRCT2::Scripting DukValue ScTileElement::railingsObject_get() const { auto ctx = GetContext()->GetScriptEngine().GetContext(); - if (_element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (_element->GetTypeN() == TileElementTypeN::Path) { auto el = _element->AsPath(); auto index = el->GetRailingsEntryIndex(); @@ -1314,7 +1314,7 @@ namespace OpenRCT2::Scripting void ScTileElement::railingsObject_set(const DukValue& value) { ThrowIfGameStateNotMutable(); - if (_element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (_element->GetTypeN() == TileElementTypeN::Path) { auto el = _element->AsPath(); el->SetRailingsEntryIndex(FromDuk(value)); diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index ce9993d6b4..98b5c77457 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -94,7 +94,7 @@ static ride_id_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords) return resultRideIndex; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 170a859899..9553e8ebfa 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -21,7 +21,7 @@ static int32_t map_place_clear_func( TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price, bool is_scenery) { - if ((*tile_element)->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if ((*tile_element)->GetTypeN() != TileElementTypeN::SmallScenery) return 1; if (is_scenery && !(flags & GAME_COMMAND_FLAG_PATH_SCENERY)) @@ -84,14 +84,14 @@ static bool MapLoc68BABCShouldContinue( // Crossing mode 1: building track over path auto tileElement = *tileElementPtr; - if (crossingMode == 1 && canBuildCrossing && tileElement->GetType() == TILE_ELEMENT_TYPE_PATH + if (crossingMode == 1 && canBuildCrossing && tileElement->GetTypeN() == TileElementTypeN::Path && tileElement->GetBaseZ() == pos.baseZ && !tileElement->AsPath()->IsQueue() && !tileElement->AsPath()->IsSloped()) { return true; } // Crossing mode 2: building path over track else if ( - crossingMode == 2 && canBuildCrossing && tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK + crossingMode == 2 && canBuildCrossing && tileElement->GetTypeN() == TileElementTypeN::Track && tileElement->GetBaseZ() == pos.baseZ && tileElement->AsTrack()->GetTrackType() == TrackElemType::Flat) { auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); @@ -146,7 +146,7 @@ GameActions::Result MapCanConstructWithClearAt( do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_SURFACE) + if (tileElement->GetTypeN() != TileElementTypeN::Surface) { if (pos.baseZ < tileElement->GetClearanceZ() && pos.clearanceZ > tileElement->GetBaseZ() && !(tileElement->IsGhost())) @@ -195,7 +195,7 @@ GameActions::Result MapCanConstructWithClearAt( } // Only allow building crossings directly on a flat surface tile. - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE + if (tileElement->GetTypeN() == TileElementTypeN::Surface && (tileElement->AsSurface()->GetSlope()) == TILE_ELEMENT_SLOPE_FLAT && tileElement->GetBaseZ() == pos.baseZ) { canBuildCrossing = true; diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index dc8e794780..391c82b697 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -143,7 +143,7 @@ void maze_entrance_hedge_replacement(const CoordsXYE& entrance) return; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetRideIndex() != rideIndex) continue; @@ -180,7 +180,7 @@ void maze_entrance_hedge_removal(const CoordsXYE& entrance) return; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetRideIndex() != rideIndex) continue; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index d29cac54c9..f4286cd2d3 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -121,7 +121,7 @@ TileElement* map_get_footpath_element(const CoordsXYZ& coords) { if (tileElement == nullptr) break; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement->GetBaseZ() == coords.z) + if (tileElement->GetTypeN() == TileElementTypeN::Path && tileElement->GetBaseZ() == coords.z) return tileElement; } while (!(tileElement++)->IsLastForTile()); @@ -363,7 +363,7 @@ CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, i *tileElement = info.Element; if (info.SpriteType == ViewportInteractionItem::Ride && viewport->flags & (VIEWPORT_FLAG_UNDERGROUND_INSIDE | VIEWPORT_FLAG_HIDE_BASE | VIEWPORT_FLAG_HIDE_VERTICAL) - && (*tileElement)->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + && (*tileElement)->GetTypeN() == TileElementTypeN::Entrance) { int32_t directions = (*tileElement)->AsEntrance()->GetDirections(); if (directions & 0x0F) @@ -380,7 +380,7 @@ CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, i info = get_map_coordinates_from_pos_window( window, screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath, ViewportInteractionItem::Ride)); - if (info.SpriteType == ViewportInteractionItem::Ride && (*tileElement)->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + if (info.SpriteType == ViewportInteractionItem::Ride && (*tileElement)->GetTypeN() == TileElementTypeN::Entrance) { int32_t directions = (*tileElement)->AsEntrance()->GetDirections(); if (directions & 0x0F) @@ -458,7 +458,7 @@ bool fence_in_the_way(const CoordsXYRangedZ& fencePos, int32_t direction) return false; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; if (tileElement->IsGhost()) continue; @@ -486,7 +486,7 @@ static PathElement* footpath_connect_corners_get_neighbour(const CoordsXYZ& foot return nullptr; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; auto pathElement = tileElement->AsPath(); if (pathElement->IsQueue()) @@ -662,7 +662,7 @@ static TileElement* footpath_get_element(const CoordsXYRangedZ& footpathPos, int return nullptr; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (footpathPos.clearanceZ == tileElement->GetBaseZ()) @@ -773,7 +773,7 @@ static bool footpath_disconnect_queue_from_path(const CoordsXY& footpathPos, Til static void loc_6A6FD2(const CoordsXYZ& initialTileElementPos, int32_t direction, TileElement* initialTileElement, bool query) { - if ((initialTileElement)->GetType() == TILE_ELEMENT_TYPE_PATH) + if ((initialTileElement)->GetTypeN() == TileElementTypeN::Path) { if (!query) { @@ -804,7 +804,7 @@ static void loc_6A6F1F( } else { - if ((initialTileElement)->GetType() == TILE_ELEMENT_TYPE_PATH && initialTileElement->AsPath()->IsQueue()) + if ((initialTileElement)->GetTypeN() == TileElementTypeN::Path && initialTileElement->AsPath()->IsQueue()) { if (footpath_disconnect_queue_from_path(targetPos, tileElement, 0)) { @@ -958,7 +958,7 @@ static void loc_6A6C85( { tileElementPos, tileElementPos.element->GetBaseZ(), tileElementPos.element->GetClearanceZ() }, direction)) return; - if (tileElementPos.element->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElementPos.element->GetTypeN() == TileElementTypeN::Entrance) { if (!entrance_has_direction( *(tileElementPos.element->AsEntrance()), direction - tileElementPos.element->GetDirection())) @@ -967,7 +967,7 @@ static void loc_6A6C85( } } - if (tileElementPos.element->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElementPos.element->GetTypeN() == TileElementTypeN::Track) { auto ride = get_ride(tileElementPos.element->AsTrack()->GetRideIndex()); if (ride == nullptr) @@ -995,7 +995,7 @@ static void loc_6A6C85( } auto pos = CoordsXYZ{ tileElementPos, tileElementPos.element->GetBaseZ() }; - if (tileElementPos.element->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElementPos.element->GetTypeN() == TileElementTypeN::Path) { if (tileElementPos.element->AsPath()->IsSloped()) { @@ -1034,7 +1034,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen neighbour_list_sort(&neighbourList); - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement->AsPath()->IsQueue()) + if (tileElement->GetTypeN() == TileElementTypeN::Path && tileElement->AsPath()->IsQueue()) { ride_id_t rideIndex = RIDE_ID_NULL; uint8_t entranceIndex = 255; @@ -1068,7 +1068,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen loc_6A6C85({ footpathPos, tileElement }, neighbour.direction, flags, false, nullptr); } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { footpath_connect_corners(footpathPos, tileElement->AsPath()); } @@ -1093,7 +1093,7 @@ void footpath_chain_ride_queue( lastQueuePathElement = nullptr; for (;;) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { lastPathElement = tileElement; lastPath = curQueuePos; @@ -1116,7 +1116,7 @@ void footpath_chain_ride_queue( { if (lastQueuePathElement == tileElement) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (tileElement->GetBaseZ() == baseZ) { @@ -1244,7 +1244,7 @@ void footpath_update_queue_chains() { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE) continue; @@ -1374,7 +1374,7 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i // Encapsulate the tile skipping logic to make do-while more readable auto SkipTileElement = [](int32_t ste_flags, TileElement* ste_tileElement, int32_t& ste_slopeDirection, int32_t ste_direction, const CoordsXYZ& ste_targetPos) { - if (ste_tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (ste_tileElement->GetTypeN() != TileElementTypeN::Path) return true; if (ste_tileElement->AsPath()->IsSloped() @@ -1439,9 +1439,9 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i // Loop over all elements and cull appropriate edges do { - if (tileElement[elementIndex].GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement[elementIndex].GetTypeN() == TileElementTypeN::Path) break; - if (tileElement[elementIndex].GetType() != TILE_ELEMENT_TYPE_BANNER) + if (tileElement[elementIndex].GetTypeN() != TileElementTypeN::Banner) { continue; } @@ -1798,7 +1798,7 @@ static void footpath_clear_wide(const CoordsXY& footpathPos) return; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; tileElement->AsPath()->SetWide(false); } while (!(tileElement++)->IsLastForTile()); @@ -1817,7 +1817,7 @@ static TileElement* footpath_can_be_wide(const CoordsXYZ& footpathPos) return nullptr; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (footpathPos.z != tileElement->GetBaseZ()) continue; @@ -1864,7 +1864,7 @@ void footpath_update_path_wide_flags(const CoordsXY& footpathPos) return; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (tileElement->AsPath()->IsQueue()) @@ -2043,31 +2043,30 @@ bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position) */ void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElement* tileElement) { - int32_t elementType = tileElement->GetType(); - switch (elementType) + const auto elementType = tileElement->GetTypeN(); + if (elementType == TileElementTypeN::Path) { - case TILE_ELEMENT_TYPE_PATH: - if (tileElement->AsPath()->IsQueue()) + if (tileElement->AsPath()->IsQueue()) + { + footpath_queue_chain_push(tileElement->AsPath()->GetRideIndex()); + for (int32_t direction = 0; direction < 4; direction++) { - footpath_queue_chain_push(tileElement->AsPath()->GetRideIndex()); - for (int32_t direction = 0; direction < 4; direction++) + if (tileElement->AsPath()->GetEdges() & (1 << direction)) { - if (tileElement->AsPath()->GetEdges() & (1 << direction)) - { - footpath_chain_ride_queue(RIDE_ID_NULL, 0, footpathPos, tileElement, direction); - } + footpath_chain_ride_queue(RIDE_ID_NULL, 0, footpathPos, tileElement, direction); } - tileElement->AsPath()->SetRideIndex(RIDE_ID_NULL); } - break; - case TILE_ELEMENT_TYPE_ENTRANCE: - if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) - { - footpath_queue_chain_push(tileElement->AsEntrance()->GetRideIndex()); - footpath_chain_ride_queue( - RIDE_ID_NULL, 0, footpathPos, tileElement, direction_reverse(tileElement->GetDirection())); - } - break; + tileElement->AsPath()->SetRideIndex(RIDE_ID_NULL); + } + } + else if (elementType == TileElementTypeN::Entrance) + { + if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) + { + footpath_queue_chain_push(tileElement->AsEntrance()->GetRideIndex()); + footpath_chain_ride_queue( + RIDE_ID_NULL, 0, footpathPos, tileElement, direction_reverse(tileElement->GetDirection())); + } } } @@ -2102,7 +2101,7 @@ static void footpath_remove_edges_towards_here( return; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (tileElement->GetBaseZ() != targetFootPathPos.z) continue; @@ -2133,7 +2132,7 @@ static void footpath_remove_edges_towards(const CoordsXYRangedZ& footPathPos, in return; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (footPathPos.clearanceZ == tileElement->GetBaseZ()) @@ -2248,7 +2247,7 @@ static void footpath_fix_corners_around(const TileCoordsXY& footpathPos, TileEle }; // Sloped paths don't create filled corners, so no need to remove any - if (pathElement->GetType() == TILE_ELEMENT_TYPE_PATH && pathElement->AsPath()->IsSloped()) + if (pathElement->GetTypeN() == TileElementTypeN::Path && pathElement->AsPath()->IsSloped()) return; for (int32_t xOffset = -1; xOffset <= 1; xOffset++) @@ -2265,7 +2264,7 @@ static void footpath_fix_corners_around(const TileCoordsXY& footpathPos, TileEle continue; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (tileElement->AsPath()->IsSloped()) continue; @@ -2288,7 +2287,7 @@ static void footpath_fix_corners_around(const TileCoordsXY& footpathPos, TileEle */ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElement) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() == TileElementTypeN::Track) { auto rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); @@ -2305,7 +2304,7 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem for (uint8_t direction = 0; direction < 4; direction++) { int32_t z1 = tileElement->base_height; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) { if (tileElement->AsPath()->IsSloped()) { @@ -2324,7 +2323,7 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem // to. if (!tile_element_wants_path_connection_towards({ TileCoordsXY{ footpathPos }, z1, direction }, tileElement)) { - bool isQueue = tileElement->GetType() == TILE_ELEMENT_TYPE_PATH ? tileElement->AsPath()->IsQueue() : false; + bool isQueue = tileElement->GetTypeN() == TileElementTypeN::Path ? tileElement->AsPath()->IsQueue() : false; int32_t z0 = z1 - 2; footpath_remove_edges_towards( { footpathPos + CoordsDirectionDelta[direction], z0 * COORDS_Z_STEP, z1 * COORDS_Z_STEP }, direction, isQueue); @@ -2343,7 +2342,7 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem footpath_fix_corners_around(tileFootpathPos, tileElement); } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() == TileElementTypeN::Path) tileElement->AsPath()->SetEdgesAndCorners(0); } diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index ebef76090b..5286656cd1 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -700,7 +700,7 @@ bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection) do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; uint8_t slopeDirection = tileElement->AsPath()->GetSlopeDirection(); @@ -1649,7 +1649,7 @@ LargeSceneryElement* map_get_large_scenery_segment(const CoordsXYZD& sceneryPos, auto sceneryTilePos = TileCoordsXYZ{ sceneryPos }; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::LargeScenery) continue; if (tileElement->base_height != sceneryTilePos.z) continue; @@ -1671,7 +1671,7 @@ EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoord { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->base_height != entranceTileCoords.z) @@ -1697,7 +1697,7 @@ EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoord { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->base_height != entranceTileCoords.z) @@ -1723,7 +1723,7 @@ EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->base_height != exitTileCoords.z) @@ -1749,7 +1749,7 @@ SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCo { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::SmallScenery) continue; if (tileElement->AsSmallScenery()->GetSceneryQuadrant() != quadrant) continue; @@ -1965,10 +1965,10 @@ bool map_surface_is_blocked(const CoordsXY& mapCoords) if (base_z < tileElement->base_height) continue; - if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH || tileElement->GetType() == TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() == TileElementTypeN::Path || tileElement->GetTypeN() == TileElementTypeN::Wall) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::SmallScenery) return true; auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); @@ -2007,7 +2007,7 @@ TrackElement* map_get_track_element_at(const CoordsXYZ& trackPos) return nullptr; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->GetBaseZ() != trackPos.z) continue; @@ -2032,7 +2032,7 @@ TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_t auto trackTilePos = TileCoordsXYZ{ trackPos }; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->base_height != trackTilePos.z) continue; @@ -2059,7 +2059,7 @@ TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, tra { if (tileElement == nullptr) break; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->base_height != trackTilePos.z) continue; @@ -2136,7 +2136,7 @@ TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPo auto trackTilePos = TileCoordsXYZ{ trackPos }; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->base_height != trackTilePos.z) continue; @@ -2165,7 +2165,7 @@ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_ auto trackTilePos = TileCoordsXYZ{ trackPos }; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->base_height != trackTilePos.z) continue; @@ -2193,7 +2193,7 @@ TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& auto trackTilePos = TileCoordsXYZ{ trackPos }; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->base_height != trackTilePos.z) continue; @@ -2216,7 +2216,7 @@ WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords) { do { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_WALL && coords.baseZ < tileElement->GetClearanceZ() + if (tileElement->GetTypeN() == TileElementTypeN::Wall && coords.baseZ < tileElement->GetClearanceZ() && coords.clearanceZ > tileElement->GetBaseZ()) { return tileElement->AsWall(); @@ -2235,7 +2235,7 @@ WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords) return nullptr; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; if (tileElement->base_height != tileWallCoords.z) continue; diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 0d43fc0e26..44adecf76c 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -98,7 +98,7 @@ static bool map_animation_invalidate_ride_entrance(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE) continue; @@ -135,7 +135,7 @@ static bool map_animation_invalidate_queue_banner(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (!(tileElement->AsPath()->IsQueue())) continue; @@ -168,7 +168,7 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::SmallScenery) continue; if (tileElement->IsGhost()) continue; @@ -233,7 +233,7 @@ static bool map_animation_invalidate_park_entrance(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) continue; @@ -263,7 +263,7 @@ static bool map_animation_invalidate_track_waterfall(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Waterfall) @@ -292,7 +292,7 @@ static bool map_animation_invalidate_track_rapids(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Rapids) @@ -321,7 +321,7 @@ static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetTrackType() == TrackElemType::OnRidePhoto) @@ -360,7 +360,7 @@ static bool map_animation_invalidate_track_whirlpool(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Whirlpool) @@ -389,7 +389,7 @@ static bool map_animation_invalidate_track_spinningtunnel(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (tileElement->GetTypeN() != TileElementTypeN::Track) continue; if (tileElement->AsTrack()->GetTrackType() == TrackElemType::SpinningTunnel) @@ -427,7 +427,7 @@ static bool map_animation_invalidate_banner(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_BANNER) + if (tileElement->GetTypeN() != TileElementTypeN::Banner) continue; map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 }); return false; @@ -453,7 +453,7 @@ static bool map_animation_invalidate_large_scenery(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::LargeScenery) continue; auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); @@ -487,7 +487,7 @@ static bool map_animation_invalidate_wall_door(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; auto* wallEntry = tileElement->AsWall()->GetEntry(); @@ -548,7 +548,7 @@ static bool map_animation_invalidate_wall(const CoordsXYZ& loc) { if (tileElement->base_height != tileLoc.z) continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; auto* wallEntry = tileElement->AsWall()->GetEntry(); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 1993573ed1..636dbc655f 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -121,7 +121,7 @@ void update_park_fences(const CoordsXY& coords) // If an entrance element do not place flags around surface do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() != TileElementTypeN::Entrance) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) @@ -342,7 +342,7 @@ int32_t Park::CalculateParkSize() const tile_element_iterator_begin(&it); do { - if (it.element->GetType() == TILE_ELEMENT_TYPE_SURFACE) + if (it.element->GetTypeN() == TileElementTypeN::Surface) { if (it.element->AsSurface()->GetOwnership() & (OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED | OWNERSHIP_OWNED)) { diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 03ba51ebea..051bf21ba2 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -81,11 +81,11 @@ void scenery_update_tile(const CoordsXY& sceneryPos) continue; } - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement->GetTypeN() == TileElementTypeN::SmallScenery) { tileElement->AsSmallScenery()->UpdateAge(sceneryPos); } - else if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) + else if (tileElement->GetTypeN() == TileElementTypeN::Path) { if (tileElement->AsPath()->HasAddition() && !tileElement->AsPath()->AdditionIsGhost()) { @@ -192,7 +192,7 @@ void scenery_remove_ghost_tool_placement() if (tileElement == nullptr) break; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (tileElement->GetTypeN() != TileElementTypeN::Path) continue; if (tileElement->GetBaseZ() != gSceneryGhostPosition.z) diff --git a/src/openrct2/world/Surface.cpp b/src/openrct2/world/Surface.cpp index b9c5773ca5..8b39f86b42 100644 --- a/src/openrct2/world/Surface.cpp +++ b/src/openrct2/world/Surface.cpp @@ -173,7 +173,7 @@ void SurfaceElement::UpdateGrassLength(const CoordsXY& coords) else { tileElementAbove++; - if (tileElementAbove->GetType() == TILE_ELEMENT_TYPE_WALL) + if (tileElementAbove->GetTypeN() == TileElementTypeN::Wall) continue; // Grass should not be affected by ghost elements. if (tileElementAbove->IsGhost()) diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 68eac33494..8599c899aa 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -25,7 +25,7 @@ bool tile_element_is_underground(TileElement* tileElement) tileElement++; if ((tileElement - 1)->IsLastForTile()) return false; - } while (tileElement->GetType() != TILE_ELEMENT_TYPE_SURFACE); + } while (tileElement->GetTypeN() != TileElementTypeN::Surface); return true; } diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 1caebdf832..924ed2b9df 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -111,7 +111,7 @@ namespace OpenRCT2::TileInspector { do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_LARGE_SCENERY) + if (tileElement->GetTypeN() != TileElementTypeN::LargeScenery) continue; if (tileElement->GetDirection() != direction) @@ -466,7 +466,7 @@ namespace OpenRCT2::TileInspector if (isExecuting) { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + if (tileElement->GetTypeN() == TileElementTypeN::Entrance) { uint8_t entranceType = tileElement->AsEntrance()->GetEntranceType(); if (entranceType != ENTRANCE_TYPE_PARK_ENTRANCE) @@ -611,7 +611,7 @@ namespace OpenRCT2::TileInspector { TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); - if (pathElement == nullptr || pathElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (pathElement == nullptr || pathElement->GetTypeN() != TileElementTypeN::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -633,7 +633,7 @@ namespace OpenRCT2::TileInspector { TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); - if (pathElement == nullptr || pathElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (pathElement == nullptr || pathElement->GetTypeN() != TileElementTypeN::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -655,7 +655,7 @@ namespace OpenRCT2::TileInspector { TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); - if (pathElement == nullptr || pathElement->GetType() != TILE_ELEMENT_TYPE_PATH) + if (pathElement == nullptr || pathElement->GetTypeN() != TileElementTypeN::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -678,7 +678,7 @@ namespace OpenRCT2::TileInspector { TileElement* const entranceElement = map_get_nth_element_at(loc, elementIndex); - if (entranceElement == nullptr || entranceElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + if (entranceElement == nullptr || entranceElement->GetTypeN() != TileElementTypeN::Entrance) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); auto ride = get_ride(entranceElement->AsEntrance()->GetRideIndex()); @@ -718,7 +718,7 @@ namespace OpenRCT2::TileInspector { TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); - if (wallElement == nullptr || wallElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (wallElement == nullptr || wallElement->GetTypeN() != TileElementTypeN::Wall) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -742,7 +742,7 @@ namespace OpenRCT2::TileInspector { TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); - if (wallElement == nullptr || wallElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (wallElement == nullptr || wallElement->GetTypeN() != TileElementTypeN::Wall) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -770,7 +770,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); - if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (trackElement == nullptr || trackElement->GetTypeN() != TileElementTypeN::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -843,7 +843,7 @@ namespace OpenRCT2::TileInspector { TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); - if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (trackElement == nullptr || trackElement->GetTypeN() != TileElementTypeN::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -925,7 +925,7 @@ namespace OpenRCT2::TileInspector { TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); - if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (trackElement == nullptr || trackElement->GetTypeN() != TileElementTypeN::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -948,7 +948,7 @@ namespace OpenRCT2::TileInspector { TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); - if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + if (trackElement == nullptr || trackElement->GetTypeN() != TileElementTypeN::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -971,7 +971,7 @@ namespace OpenRCT2::TileInspector { TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); - if (tileElement == nullptr || tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement == nullptr || tileElement->GetTypeN() != TileElementTypeN::SmallScenery) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -998,7 +998,7 @@ namespace OpenRCT2::TileInspector { TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); - if (tileElement == nullptr || tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + if (tileElement == nullptr || tileElement->GetTypeN() != TileElementTypeN::SmallScenery) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) @@ -1022,7 +1022,7 @@ namespace OpenRCT2::TileInspector { TileElement* const bannerElement = map_get_nth_element_at(loc, elementIndex); - if (bannerElement == nullptr || bannerElement->GetType() != TILE_ELEMENT_TYPE_BANNER) + if (bannerElement == nullptr || bannerElement->GetTypeN() != TileElementTypeN::Banner) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index 89bc53b0b0..8d56e3afce 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -65,7 +65,7 @@ void wall_remove_intersecting_walls(const CoordsXYRangedZ& wallPos, Direction di return; do { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) + if (tileElement->GetTypeN() != TileElementTypeN::Wall) continue; if (tileElement->GetClearanceZ() <= wallPos.baseZ || tileElement->GetBaseZ() >= wallPos.clearanceZ)