From 62fcbb07ca12d4574329d855fd06a61dbd9c5a83 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 22 Dec 2019 22:14:02 +0100 Subject: [PATCH] Rename methods to GetBaseZ/GetClearanceZ --- .../interface/ViewportInteraction.cpp | 14 ++++---- src/openrct2-ui/windows/Banner.cpp | 4 +-- src/openrct2-ui/windows/Footpath.cpp | 2 +- src/openrct2-ui/windows/Map.cpp | 6 ++-- src/openrct2-ui/windows/Ride.cpp | 6 ++-- src/openrct2-ui/windows/RideConstruction.cpp | 6 ++-- src/openrct2-ui/windows/Sign.cpp | 8 ++--- src/openrct2-ui/windows/TileInspector.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 18 +++++----- src/openrct2-ui/windows/TrackDesignPlace.cpp | 2 +- src/openrct2/actions/BannerPlaceAction.hpp | 2 +- src/openrct2/actions/ClearAction.hpp | 8 ++--- src/openrct2/actions/FootpathRemoveAction.hpp | 2 +- src/openrct2/actions/LandBuyRightsAction.hpp | 2 +- src/openrct2/actions/LandSetRightsAction.hpp | 6 ++-- .../actions/LargeSceneryPlaceAction.hpp | 2 +- src/openrct2/actions/MazeSetTrackAction.hpp | 3 +- .../actions/ParkEntranceRemoveAction.hpp | 2 +- .../actions/PlaceParkEntranceAction.hpp | 2 +- src/openrct2/actions/RideDemolishAction.hpp | 2 +- src/openrct2/actions/SetCheatAction.hpp | 4 +-- src/openrct2/actions/SignSetStyleAction.hpp | 2 +- .../actions/SmallSceneryPlaceAction.hpp | 4 +-- src/openrct2/actions/TrackPlaceAction.hpp | 9 +++-- src/openrct2/actions/TrackRemoveAction.hpp | 4 +-- src/openrct2/actions/WallPlaceAction.hpp | 6 ++-- src/openrct2/actions/WallRemoveAction.hpp | 2 +- src/openrct2/audio/Audio.cpp | 2 +- .../paint/tile_element/Paint.Entrance.cpp | 2 +- .../paint/tile_element/Paint.LargeScenery.cpp | 2 +- .../paint/tile_element/Paint.Path.cpp | 4 +-- .../paint/tile_element/Paint.TileElement.cpp | 2 +- src/openrct2/peep/Guest.cpp | 6 ++-- src/openrct2/peep/Peep.cpp | 6 ++-- src/openrct2/peep/Staff.cpp | 6 ++-- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/ride/Ride.cpp | 36 +++++++++---------- src/openrct2/ride/RideRatings.cpp | 4 +-- src/openrct2/ride/Station.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 10 +++--- src/openrct2/ride/TrackDesignSave.cpp | 12 +++---- src/openrct2/ride/Vehicle.cpp | 15 ++++---- src/openrct2/ride/gentle/ObservationTower.cpp | 2 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 2 +- src/openrct2/ride/thrill/RotoDrop.cpp | 2 +- src/openrct2/world/Banner.cpp | 2 +- src/openrct2/world/Entrance.cpp | 4 +-- src/openrct2/world/Footpath.cpp | 10 +++--- src/openrct2/world/Fountain.cpp | 2 +- src/openrct2/world/Map.cpp | 17 +++++---- src/openrct2/world/MapAnimation.cpp | 8 ++--- src/openrct2/world/Park.cpp | 2 +- src/openrct2/world/Scenery.cpp | 4 +-- src/openrct2/world/SmallScenery.cpp | 4 +-- src/openrct2/world/Sprite.cpp | 2 +- src/openrct2/world/Surface.cpp | 2 +- src/openrct2/world/TileElement.cpp | 4 +-- src/openrct2/world/TileElement.h | 4 +-- src/openrct2/world/TileInspector.cpp | 4 +-- src/openrct2/world/Wall.cpp | 4 +-- test/testpaint/Compat.cpp | 4 +-- 61 files changed, 160 insertions(+), 164 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 35ad26cc1d..e6233cee0d 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -505,7 +505,7 @@ int32_t viewport_interaction_right_click(ScreenCoordsXY screenCoords) static void viewport_interaction_remove_scenery(TileElement* tileElement, CoordsXY mapCoords) { auto removeSceneryAction = SmallSceneryRemoveAction( - { mapCoords.x, mapCoords.y, tileElement->GetBaseHeight() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(), + { mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(), tileElement->AsSmallScenery()->GetEntryIndex()); GameActions::Execute(&removeSceneryAction); @@ -520,7 +520,7 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, Coord rct_window* w; TileElement* tileElement2; - auto z = tileElement->GetBaseHeight(); + auto z = tileElement->GetBaseZ(); w = window_find_by_class(WC_FOOTPATH); if (w != nullptr) @@ -531,7 +531,7 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, Coord return; do { - if (tileElement2->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement2->GetBaseHeight() == z) + if (tileElement2->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement2->GetBaseZ() == z) { footpath_remove({ mapCoords, z }, GAME_COMMAND_FLAG_APPLY); break; @@ -545,7 +545,7 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, Coord */ static void viewport_interaction_remove_footpath_item(TileElement* tileElement, CoordsXY mapCoords) { - auto footpathSceneryRemoveAction = FootpathSceneryRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseHeight() }); + auto footpathSceneryRemoveAction = FootpathSceneryRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }); GameActions::Execute(&footpathSceneryRemoveAction); } @@ -565,7 +565,7 @@ void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsX mapCoords -= CoordsDirectionDelta[rotation]; break; } - auto parkEntranceRemoveAction = ParkEntranceRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseHeight() }); + auto parkEntranceRemoveAction = ParkEntranceRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }); GameActions::Execute(&parkEntranceRemoveAction); } @@ -582,7 +582,7 @@ static void viewport_interaction_remove_park_wall(TileElement* tileElement, Coor } else { - CoordsXYZD wallLocation = { mapCoords.x, mapCoords.y, tileElement->GetBaseHeight(), tileElement->GetDirection() }; + CoordsXYZD wallLocation = { mapCoords.x, mapCoords.y, tileElement->GetBaseZ(), tileElement->GetDirection() }; auto wallRemoveAction = WallRemoveAction(wallLocation); GameActions::Execute(&wallRemoveAction); } @@ -604,7 +604,7 @@ static void viewport_interaction_remove_large_scenery(TileElement* tileElement, else { auto removeSceneryAction = LargeSceneryRemoveAction( - { mapCoords.x, mapCoords.y, tileElement->GetBaseHeight(), tileElement->GetDirection() }, + { mapCoords.x, mapCoords.y, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex()); GameActions::Execute(&removeSceneryAction); } diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index e3523174d6..5853755897 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -149,7 +149,7 @@ rct_window* window_banner_open(rct_windownumber number) tile_element++; } - int32_t view_z = tile_element->GetBaseHeight(); + int32_t view_z = tile_element->GetBaseZ(); w->frame_no = view_z; view_x += 16; @@ -196,7 +196,7 @@ static void window_banner_mouseup(rct_window* w, rct_widgetindex widgetIndex) case WIDX_BANNER_DEMOLISH: { auto bannerRemoveAction = BannerRemoveAction( - { x, y, tile_element->GetBaseHeight(), tile_element->AsBanner()->GetPosition() }); + { x, y, tile_element->GetBaseZ(), tile_element->AsBanner()->GetPosition() }); GameActions::Execute(&bannerRemoveAction); break; } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index fb022e040e..c83ad51272 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1046,7 +1046,7 @@ static void footpath_remove_tile_element(TileElement* tileElement) } } - gFootpathConstructFromPosition.z = tileElement->GetBaseHeight(); + gFootpathConstructFromPosition.z = tileElement->GetBaseZ(); // Remove path footpath_remove(gFootpathConstructFromPosition, GAME_COMMAND_FLAG_APPLY); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index cad3b1a37c..40bda3d30d 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1207,7 +1207,7 @@ static CoordsXYZD place_park_entrance_get_map_position(ScreenCoordsXY screenCoor parkEntranceMapPosition.z = surfaceElement->GetWaterHeight() * 8; if (parkEntranceMapPosition.z == 0) { - parkEntranceMapPosition.z = surfaceElement->GetBaseHeight(); + parkEntranceMapPosition.z = surfaceElement->GetBaseZ(); if ((surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != 0) { parkEntranceMapPosition.z += 16; @@ -1281,7 +1281,7 @@ static void window_map_set_peep_spawn_tool_update(ScreenCoordsXY screenCoords) if ((mapX & 0xFFFF) == 0x8000) return; - mapZ = tileElement->GetBaseHeight(); + mapZ = tileElement->GetBaseZ(); if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE) { if ((tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != 0) @@ -1338,7 +1338,7 @@ static void window_map_set_peep_spawn_tool_down(ScreenCoordsXY screenCoords) if (mapX == LOCATION_NULL) return; - mapZ = tileElement->GetBaseHeight(); + mapZ = tileElement->GetBaseZ(); auto gameAction = PlacePeepSpawnAction({ mapX, mapY, mapZ, static_cast(direction) }); auto result = GameActions::Execute(&gameAction); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e3668817b6..3dfe7fff69 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1495,8 +1495,8 @@ static void window_ride_update_overall_view(Ride* ride) int32_t x = it.x * 32; int32_t y = it.y * 32; - int32_t z1 = it.element->GetBaseHeight(); - int32_t z2 = it.element->GetClearanceHeight(); + int32_t z1 = it.element->GetBaseZ(); + int32_t z2 = it.element->GetClearanceZ(); minx = std::min(minx, x); miny = std::min(miny, y); @@ -4411,7 +4411,7 @@ static void window_ride_set_track_colour_scheme(rct_window* w, int32_t x, int32_ if (tileElement->AsTrack()->GetColourScheme() == newColourScheme) return; - z = tileElement->GetBaseHeight(); + z = tileElement->GetBaseZ(); direction = tileElement->GetDirection(); auto gameAction = RideSetColourSchemeAction( CoordsXYZD{ x, y, z, static_cast(direction) }, tileElement->AsTrack()->GetTrackType(), newColourScheme); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index f3fab84d56..67c0ce1448 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1943,7 +1943,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) const rct_preview_track* trackBlock = get_track_def_from_ride_index( _currentRideIndex, tileElement->AsTrack()->GetTrackType()); - z = (tileElement->GetBaseHeight()) - trackBlock->z; + z = (tileElement->GetBaseZ()) - trackBlock->z; gGotoStartPlacementMode = true; } @@ -2122,7 +2122,7 @@ static std::optional ride_get_place_position_from_screen_position(Scre get_map_coordinates_from_pos(screenCoords, 0xFCCA, mapCoords, &interactionType, &tileElement, &viewport); if (interactionType != 0) { - _trackPlaceCtrlZ = tileElement->GetBaseHeight(); + _trackPlaceCtrlZ = tileElement->GetBaseZ(); _trackPlaceCtrlState = true; } } @@ -2183,7 +2183,7 @@ static std::optional ride_get_place_position_from_screen_position(Scre auto surfaceElement = map_get_surface_element_at(mapCoords); if (surfaceElement == nullptr) return std::nullopt; - auto mapZ = floor2(surfaceElement->GetBaseHeight(), 16); + auto mapZ = floor2(surfaceElement->GetBaseZ(), 16); mapZ += _trackPlaceShiftZ; mapZ = std::max(mapZ, 16); _trackPlaceZ = mapZ; diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 495eb33d6a..2a8b62b13e 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -179,7 +179,7 @@ rct_window* window_sign_open(rct_windownumber number) tile_element++; } - int32_t view_z = tile_element->GetBaseHeight(); + int32_t view_z = tile_element->GetBaseZ(); w->frame_no = view_z; w->list_information_type = tile_element->AsLargeScenery()->GetPrimaryColour(); @@ -236,7 +236,7 @@ static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex) } auto sceneryRemoveAction = LargeSceneryRemoveAction( - { x, y, tile_element->GetBaseHeight(), tile_element->GetDirection() }, + { x, y, tile_element->GetBaseZ(), tile_element->GetDirection() }, tile_element->AsLargeScenery()->GetSequenceIndex()); GameActions::Execute(&sceneryRemoveAction); break; @@ -426,7 +426,7 @@ rct_window* window_sign_small_open(rct_windownumber number) tile_element++; } - int32_t view_z = tile_element->GetBaseHeight(); + int32_t view_z = tile_element->GetBaseZ(); w->frame_no = view_z; w->list_information_type = tile_element->AsWall()->GetPrimaryColour(); @@ -481,7 +481,7 @@ static void window_sign_small_mouseup(rct_window* w, rct_widgetindex widgetIndex } tile_element++; } - CoordsXYZD wallLocation = { x, y, tile_element->GetBaseHeight(), tile_element->GetDirection() }; + CoordsXYZD wallLocation = { x, y, tile_element->GetBaseZ(), tile_element->GetDirection() }; auto wallRemoveAction = WallRemoveAction(wallLocation); GameActions::Execute(&wallRemoveAction); break; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 22a7b6ae7d..672f6a95d3 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1976,7 +1976,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { // TODO: Make this work with Left/Right park entrance parts int16_t parkEntranceIndex = park_entrance_get_index( - windowTileInspectorToolMap.x, windowTileInspectorToolMap.y, tileElement->GetBaseHeight()); + windowTileInspectorToolMap.x, windowTileInspectorToolMap.y, tileElement->GetBaseZ()); gfx_draw_string_left( dpi, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, &parkEntranceIndex, COLOUR_WHITE, x, y + 11); } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 8ef0574351..3fb8e35618 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1042,7 +1042,7 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg uint8_t quadrant = tile_element->AsSmallScenery()->GetSceneryQuadrant(); auto repaintScenery = SmallScenerySetColourAction( - { gridCoords.x, gridCoords.y, tile_element->GetBaseHeight() }, quadrant, + { gridCoords.x, gridCoords.y, tile_element->GetBaseZ() }, quadrant, tile_element->AsSmallScenery()->GetEntryIndex(), gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour); GameActions::Execute(&repaintScenery); @@ -1057,7 +1057,7 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg return; auto repaintScenery = WallSetColourAction( - { gridCoords.x, gridCoords.y, tile_element->GetBaseHeight(), tile_element->GetDirection() }, + { gridCoords.x, gridCoords.y, tile_element->GetBaseZ(), tile_element->GetDirection() }, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); GameActions::Execute(&repaintScenery); @@ -1072,7 +1072,7 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg return; auto repaintScenery = LargeScenerySetColourAction( - { gridCoords.x, gridCoords.y, tile_element->GetBaseHeight(), tile_element->GetDirection() }, + { gridCoords.x, gridCoords.y, tile_element->GetBaseZ(), tile_element->GetDirection() }, tile_element->AsLargeScenery()->GetSequenceIndex(), gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour); GameActions::Execute(&repaintScenery); @@ -1087,7 +1087,7 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg if (scenery_entry->banner.flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) { auto repaintScenery = BannerSetColourAction( - { gridCoords.x, gridCoords.y, tile_element->GetBaseHeight(), tile_element->AsBanner()->GetPosition() }, + { gridCoords.x, gridCoords.y, tile_element->GetBaseZ(), tile_element->AsBanner()->GetPosition() }, gWindowSceneryPrimaryColour); GameActions::Execute(&repaintScenery); @@ -1284,7 +1284,7 @@ static void sub_6E1F34( if (interaction_type != VIEWPORT_INTERACTION_ITEM_NONE) { gSceneryCtrlPressed = true; - gSceneryCtrlPressZ = tile_element->GetBaseHeight(); + gSceneryCtrlPressZ = tile_element->GetBaseZ(); } } } @@ -1368,7 +1368,7 @@ static void sub_6E1F34( return; } - int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0; + int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; z += gSceneryShiftPressZOffset; z = std::clamp(z, 16, maxPossibleHeight); @@ -1457,7 +1457,7 @@ static void sub_6E1F34( return; } - int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0; + int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; z += gSceneryShiftPressZOffset; z = std::clamp(z, 16, maxPossibleHeight); @@ -1569,7 +1569,7 @@ static void sub_6E1F34( return; } - int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0; + int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; z += gSceneryShiftPressZOffset; z = std::clamp(z, 16, maxPossibleHeight); @@ -1637,7 +1637,7 @@ static void sub_6E1F34( return; } - int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0; + int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; z += gSceneryShiftPressZOffset; z = std::clamp(z, 16, maxPossibleHeight); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index c434d7410e..2dcf7ea94c 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -478,7 +478,7 @@ static int32_t window_track_place_get_base_z(int32_t x, int32_t y) auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); if (surfaceElement == nullptr) return 0; - z = surfaceElement->GetBaseHeight(); + z = surfaceElement->GetBaseZ(); // Increase Z above slope if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) diff --git a/src/openrct2/actions/BannerPlaceAction.hpp b/src/openrct2/actions/BannerPlaceAction.hpp index 9dbd060bfd..a8c32c0511 100644 --- a/src/openrct2/actions/BannerPlaceAction.hpp +++ b/src/openrct2/actions/BannerPlaceAction.hpp @@ -158,7 +158,7 @@ public: bannerElement->SetGhost(true); } map_invalidate_tile_full(_loc.x, _loc.y); - map_animation_create(MAP_ANIMATION_TYPE_BANNER, CoordsXYZ{ _loc, bannerElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_BANNER, CoordsXYZ{ _loc, bannerElement->GetBaseZ() }); rct_scenery_entry* bannerEntry = get_banner_entry(_bannerType); if (bannerEntry == nullptr) diff --git a/src/openrct2/actions/ClearAction.hpp b/src/openrct2/actions/ClearAction.hpp index 2d2574f709..c1f1e16bea 100644 --- a/src/openrct2/actions/ClearAction.hpp +++ b/src/openrct2/actions/ClearAction.hpp @@ -154,7 +154,7 @@ private: case TILE_ELEMENT_TYPE_PATH: if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_FOOTPATH) { - auto footpathRemoveAction = FootpathRemoveAction({ tilePos, tileElement->GetBaseHeight() }); + auto footpathRemoveAction = FootpathRemoveAction({ tilePos, tileElement->GetBaseZ() }); footpathRemoveAction.SetFlags(GetFlags()); auto res = executing ? GameActions::ExecuteNested(&footpathRemoveAction) @@ -171,7 +171,7 @@ private: if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_SMALL) { auto removeSceneryAction = SmallSceneryRemoveAction( - { tilePos, tileElement->GetBaseHeight() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(), + { tilePos, tileElement->GetBaseZ() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(), tileElement->AsSmallScenery()->GetEntryIndex()); removeSceneryAction.SetFlags(GetFlags()); @@ -188,7 +188,7 @@ private: case TILE_ELEMENT_TYPE_WALL: if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_SMALL) { - CoordsXYZD wallLocation = { tilePos, tileElement->GetBaseHeight(), tileElement->GetDirection() }; + CoordsXYZD wallLocation = { tilePos, tileElement->GetBaseZ(), tileElement->GetDirection() }; auto wallRemoveAction = WallRemoveAction(wallLocation); wallRemoveAction.SetFlags(GetFlags()); @@ -206,7 +206,7 @@ private: if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_LARGE) { auto removeSceneryAction = LargeSceneryRemoveAction( - { tilePos, tileElement->GetBaseHeight(), tileElement->GetDirection() }, + { tilePos, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex()); removeSceneryAction.SetFlags(GetFlags() | GAME_COMMAND_FLAG_PATH_SCENERY); diff --git a/src/openrct2/actions/FootpathRemoveAction.hpp b/src/openrct2/actions/FootpathRemoveAction.hpp index acfb340327..ca648931ec 100644 --- a/src/openrct2/actions/FootpathRemoveAction.hpp +++ b/src/openrct2/actions/FootpathRemoveAction.hpp @@ -157,7 +157,7 @@ private: continue; auto bannerRemoveAction = BannerRemoveAction( - { x, y, tileElement->GetBaseHeight(), tileElement->AsBanner()->GetPosition() }); + { x, y, tileElement->GetBaseZ(), tileElement->AsBanner()->GetPosition() }); bool isGhost = tileElement->IsGhost(); auto bannerFlags = GetFlags() | (isGhost ? static_cast(GAME_COMMAND_FLAG_GHOST) : 0); bannerRemoveAction.SetFlags(bannerFlags); diff --git a/src/openrct2/actions/LandBuyRightsAction.hpp b/src/openrct2/actions/LandBuyRightsAction.hpp index fb34344c4c..931b4d6959 100644 --- a/src/openrct2/actions/LandBuyRightsAction.hpp +++ b/src/openrct2/actions/LandBuyRightsAction.hpp @@ -169,7 +169,7 @@ private: if (isExecuting) { surfaceElement->SetOwnership(surfaceElement->GetOwnership() | OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); - uint16_t baseHeight = surfaceElement->GetBaseHeight(); + uint16_t baseHeight = surfaceElement->GetBaseZ(); map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16); } res->Cost = gConstructionRightsPrice; diff --git a/src/openrct2/actions/LandSetRightsAction.hpp b/src/openrct2/actions/LandSetRightsAction.hpp index 5bbba42e38..b8e4b02be5 100644 --- a/src/openrct2/actions/LandSetRightsAction.hpp +++ b/src/openrct2/actions/LandSetRightsAction.hpp @@ -152,7 +152,7 @@ private: if (isExecuting) { surfaceElement->SetOwnership(surfaceElement->GetOwnership() & ~OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); - uint16_t baseHeight = surfaceElement->GetBaseHeight(); + uint16_t baseHeight = surfaceElement->GetBaseZ(); map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16); } return res; @@ -160,7 +160,7 @@ private: if (isExecuting) { surfaceElement->SetOwnership(surfaceElement->GetOwnership() | OWNERSHIP_AVAILABLE); - uint16_t baseHeight = surfaceElement->GetBaseHeight(); + uint16_t baseHeight = surfaceElement->GetBaseZ(); map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16); } return res; @@ -168,7 +168,7 @@ private: if (isExecuting) { surfaceElement->SetOwnership(surfaceElement->GetOwnership() | OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE); - uint16_t baseHeight = surfaceElement->GetBaseHeight(); + uint16_t baseHeight = surfaceElement->GetBaseZ(); map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16); } return res; diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.hpp b/src/openrct2/actions/LargeSceneryPlaceAction.hpp index 25df3f5263..38b6c62d3d 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.hpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.hpp @@ -364,7 +364,7 @@ private: if (surfaceElement == nullptr) continue; - int32_t height = surfaceElement->GetBaseHeight(); + int32_t height = surfaceElement->GetBaseZ(); int32_t slope = surfaceElement->GetSlope(); if (slope & 0xF) diff --git a/src/openrct2/actions/MazeSetTrackAction.hpp b/src/openrct2/actions/MazeSetTrackAction.hpp index 9a7b622768..115c4a55f6 100644 --- a/src/openrct2/actions/MazeSetTrackAction.hpp +++ b/src/openrct2/actions/MazeSetTrackAction.hpp @@ -334,8 +334,7 @@ public: break; } - map_invalidate_tile( - floor2(_loc.x, 32), floor2(_loc.y, 32), tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile(floor2(_loc.x, 32), floor2(_loc.y, 32), tileElement->GetBaseZ(), tileElement->GetClearanceZ()); if ((tileElement->AsTrack()->GetMazeEntry() & 0x8888) == 0x8888) { diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.hpp b/src/openrct2/actions/ParkEntranceRemoveAction.hpp index b7a1ba0f07..67ebf63ca0 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.hpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.hpp @@ -101,7 +101,7 @@ private: return; } - map_invalidate_tile(loc.x, loc.y, entranceElement->GetBaseHeight(), entranceElement->GetClearanceHeight()); + map_invalidate_tile(loc.x, loc.y, entranceElement->GetBaseZ(), entranceElement->GetClearanceZ()); entranceElement->Remove(); update_park_fences({ loc.x, loc.y }); } diff --git a/src/openrct2/actions/PlaceParkEntranceAction.hpp b/src/openrct2/actions/PlaceParkEntranceAction.hpp index 27d0286470..d50e4c508a 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.hpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.hpp @@ -180,7 +180,7 @@ public: update_park_fences({ entranceLoc.x, entranceLoc.y - 32 }); update_park_fences({ entranceLoc.x, entranceLoc.y + 32 }); - map_invalidate_tile(entranceLoc.x, entranceLoc.y, newElement->GetBaseHeight(), newElement->GetClearanceHeight()); + map_invalidate_tile(entranceLoc.x, entranceLoc.y, newElement->GetBaseZ(), newElement->GetClearanceZ()); if (index == 0) { diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index bee6a9218b..57fdbbe85d 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -304,7 +304,7 @@ private: continue; int32_t x = it.x * 32, y = it.y * 32; - int32_t z = it.element->GetBaseHeight(); + int32_t z = it.element->GetBaseZ(); uint8_t rotation = it.element->GetDirection(); uint8_t type = it.element->AsTrack()->GetTrackType(); diff --git a/src/openrct2/actions/SetCheatAction.hpp b/src/openrct2/actions/SetCheatAction.hpp index daca75ced1..a3cacaa06e 100644 --- a/src/openrct2/actions/SetCheatAction.hpp +++ b/src/openrct2/actions/SetCheatAction.hpp @@ -752,7 +752,7 @@ private: { surfaceElement->SetOwnership(destOwnership); update_park_fences_around_tile(coords); - uint16_t baseHeight = surfaceElement->GetBaseHeight(); + uint16_t baseHeight = surfaceElement->GetBaseZ(); map_invalidate_tile(coords.x, coords.y, baseHeight, baseHeight + 16); } } @@ -770,7 +770,7 @@ private: { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); update_park_fences_around_tile({ x, y }); - uint16_t baseHeight = surfaceElement->GetBaseHeight(); + uint16_t baseHeight = surfaceElement->GetBaseZ(); map_invalidate_tile(x, y, baseHeight, baseHeight + 16); } } diff --git a/src/openrct2/actions/SignSetStyleAction.hpp b/src/openrct2/actions/SignSetStyleAction.hpp index 20e1709692..bc903f201e 100644 --- a/src/openrct2/actions/SignSetStyleAction.hpp +++ b/src/openrct2/actions/SignSetStyleAction.hpp @@ -111,7 +111,7 @@ public: wallElement->SetPrimaryColour(_mainColour); wallElement->SetSecondaryColour(_textColour); - map_invalidate_tile(coords.x, coords.y, wallElement->GetBaseHeight(), wallElement->GetClearanceHeight()); + map_invalidate_tile(coords.x, coords.y, wallElement->GetBaseZ(), wallElement->GetClearanceZ()); } auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.hpp b/src/openrct2/actions/SmallSceneryPlaceAction.hpp index 2115f77dd7..c296780b38 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.hpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.hpp @@ -227,7 +227,7 @@ public: { if (surfaceElement != nullptr) { - if (surfaceElement->GetWaterHeight() || (surfaceElement->GetBaseHeight()) != targetHeight) + if (surfaceElement->GetWaterHeight() || (surfaceElement->GetBaseZ()) != targetHeight) { return std::make_unique(GA_ERROR::DISALLOWED, STR_LEVEL_LAND_REQUIRED); } @@ -456,7 +456,7 @@ public: map_invalidate_tile_full(_loc.x, _loc.y); if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ANIMATED)) { - map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, CoordsXYZ{ _loc, sceneryElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, CoordsXYZ{ _loc, sceneryElement->GetBaseZ() }); } return res; diff --git a/src/openrct2/actions/TrackPlaceAction.hpp b/src/openrct2/actions/TrackPlaceAction.hpp index c4c0bce48c..d73aac040d 100644 --- a/src/openrct2/actions/TrackPlaceAction.hpp +++ b/src/openrct2/actions/TrackPlaceAction.hpp @@ -597,17 +597,16 @@ public: switch (_trackType) { case TRACK_ELEM_WATERFALL: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_WATERFALL, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_TRACK_WATERFALL, CoordsXYZ{ mapLoc, tileElement->GetBaseZ() }); break; case TRACK_ELEM_RAPIDS: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_RAPIDS, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_TRACK_RAPIDS, CoordsXYZ{ mapLoc, tileElement->GetBaseZ() }); break; case TRACK_ELEM_WHIRLPOOL: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, CoordsXYZ{ mapLoc, tileElement->GetBaseZ() }); break; case TRACK_ELEM_SPINNING_TUNNEL: - map_animation_create( - MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, tileElement->GetBaseZ() }); break; } if (track_element_has_speed_setting(_trackType)) diff --git a/src/openrct2/actions/TrackRemoveAction.hpp b/src/openrct2/actions/TrackRemoveAction.hpp index 7f6457fb4d..611cb67936 100644 --- a/src/openrct2/actions/TrackRemoveAction.hpp +++ b/src/openrct2/actions/TrackRemoveAction.hpp @@ -78,7 +78,7 @@ public: if (tileElement == nullptr) break; - if (tileElement->GetBaseHeight() != _origin.z) + if (tileElement->GetBaseZ() != _origin.z) continue; if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) @@ -274,7 +274,7 @@ public: if (tileElement == nullptr) break; - if (tileElement->GetBaseHeight() != _origin.z) + if (tileElement->GetBaseZ() != _origin.z) continue; if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) diff --git a/src/openrct2/actions/WallPlaceAction.hpp b/src/openrct2/actions/WallPlaceAction.hpp index b1468072f0..c2ef6d51a9 100644 --- a/src/openrct2/actions/WallPlaceAction.hpp +++ b/src/openrct2/actions/WallPlaceAction.hpp @@ -148,7 +148,7 @@ public: log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); return std::make_unique(GA_ERROR::INVALID_PARAMETERS); } - targetHeight = surfaceElement->GetBaseHeight(); + targetHeight = surfaceElement->GetBaseZ(); uint8_t slope = surfaceElement->GetSlope(); edgeSlope = EdgeSlopes[slope][_edge & 3]; @@ -322,7 +322,7 @@ public: log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); return std::make_unique(GA_ERROR::INVALID_PARAMETERS); } - targetHeight = surfaceElement->GetBaseHeight(); + targetHeight = surfaceElement->GetBaseZ(); uint8_t slope = surfaceElement->GetSlope(); edgeSlope = EdgeSlopes[slope][_edge & 3]; @@ -431,7 +431,7 @@ public: } res->tileElement = tileElement; - map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->GetBaseHeight(), wallElement->GetBaseHeight() + 72); + map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72); res->Cost = wallEntry->wall.price; return res; diff --git a/src/openrct2/actions/WallRemoveAction.hpp b/src/openrct2/actions/WallRemoveAction.hpp index 117800d59b..6f7dcf1936 100644 --- a/src/openrct2/actions/WallRemoveAction.hpp +++ b/src/openrct2/actions/WallRemoveAction.hpp @@ -87,7 +87,7 @@ public: res->Position.z = tile_element_height(res->Position); tile_element_remove_banner_entry(wallElement); - map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->GetBaseHeight(), (wallElement->GetBaseHeight()) + 72); + map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->GetBaseZ(), (wallElement->GetBaseZ()) + 72); tile_element_remove(wallElement); return res; diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 39560f5998..7faedd1df8 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -207,7 +207,7 @@ static AudioParams audio_get_params_from_location(SoundId soundId, const CoordsX params.pan = 0; auto element = map_get_surface_element_at(location); - if (element && (element->GetBaseHeight()) - 5 > location.z) + if (element && (element->GetBaseZ()) - 5 > location.z) { volumeDown = 10; } diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index e6a2b541b1..d9d0d28186 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -347,7 +347,7 @@ void entrance_paint(paint_session* session, uint8_t direction, int32_t height, c { if (entrance_get_directions(tile_element) & 0xF) { - int32_t z = tile_element->GetBaseHeight() + 3; + int32_t z = tile_element->GetBaseZ() + 3; uint32_t image_id = 0x20101689 + get_height_marker_offset() + (z / 16); image_id -= gMapBaseZ; diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index e8fea4b1cd..61dfa46c0d 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -52,7 +52,7 @@ static void large_scenery_paint_supports( wooden_b_supports_paint_setup(session, (direction & 1), ax, supportHeight, supportImageColourFlags, nullptr); - int32_t clearanceHeight = ceil2(tileElement->GetClearanceHeight() + 15, 16); + int32_t clearanceHeight = ceil2(tileElement->GetClearanceZ() + 15, 16); if (tile->flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE) { diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index c01871cc1b..0005f1f6fa 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -912,7 +912,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile if (staff_is_patrol_area_set(200 + staffType, x, y)) { uint32_t imageId = 2618; - int32_t height2 = tile_element->GetBaseHeight(); + int32_t height2 = tile_element->GetBaseZ(); if (tile_element->AsPath()->IsSloped()) { imageId = 2619 + ((tile_element->AsPath()->GetSlopeDirection() + session->CurrentRotation) & 3); @@ -925,7 +925,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile if (session->ViewFlags & VIEWPORT_FLAG_PATH_HEIGHTS) { - uint16_t height2 = 3 + tile_element->GetBaseHeight(); + uint16_t height2 = 3 + tile_element->GetBaseZ(); if (tile_element->AsPath()->IsSloped()) { height2 += 8; diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 3c0cca8584..815924c7c7 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -251,7 +251,7 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) continue; Direction direction = tile_element->GetDirectionWithOffset(rotation); - int32_t height = tile_element->GetBaseHeight(); + int32_t height = tile_element->GetBaseZ(); // If we are on a new height level, look through elements on the // same height and store any types might be relevant to others diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index d58963d90c..b7b856d909 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -5048,7 +5048,7 @@ void Guest::UpdateRideLeaveExit() int16_t height = map_height_from_slope( targetLoc, tileElement->AsPath()->GetSlopeDirection(), tileElement->AsPath()->IsSloped()); - height += tileElement->GetBaseHeight(); + height += tileElement->GetBaseZ(); int16_t z_diff = z - height; if (z_diff > 0 || z_diff < -16) @@ -6003,7 +6003,7 @@ void Guest::UpdateUsingBin() additionStatus |= space_left_in_bin << selected_bin; tileElement->AsPath()->SetAdditionStatus(additionStatus); - map_invalidate_tile_zoom0(next_x, next_y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile_zoom0(next_x, next_y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); StateReset(); break; } @@ -6320,7 +6320,7 @@ static void peep_update_walking_break_scenery(Peep* peep) tileElement->AsPath()->SetIsBroken(true); - map_invalidate_tile_zoom1(peep->next_x, peep->next_y, (tileElement->GetBaseHeight()) + 32, tileElement->GetBaseHeight()); + map_invalidate_tile_zoom1(peep->next_x, peep->next_y, (tileElement->GetBaseZ()) + 32, tileElement->GetBaseZ()); peep->angriness = 16; } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 55dfb08286..970a589e39 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -773,7 +773,7 @@ bool Peep::Place(TileCoordsXYZ location, bool apply) // Set the coordinate of destination to be exactly // in the middle of a tile. - CoordsXYZ destination = { location.x * 32 + 16, location.y * 32 + 16, tileElement->GetBaseHeight() + 16 }; + CoordsXYZ destination = { location.x * 32 + 16, location.y * 32 + 16, tileElement->GetBaseZ() + 16 }; if (!map_is_location_owned(destination)) { @@ -912,7 +912,7 @@ void Peep::UpdateFalling() { int32_t height = map_height_from_slope( { x, y }, tile_element->AsPath()->GetSlopeDirection(), tile_element->AsPath()->IsSloped()) - + tile_element->GetBaseHeight(); + + tile_element->GetBaseZ(); if (height < z - 1 || height > z + 4) continue; @@ -2795,7 +2795,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen vandalism_present = true; } - int16_t z = tile_element->GetBaseHeight(); + int16_t z = tile_element->GetBaseZ(); if (map_is_location_owned({ x, y, z })) { if (peep->outside_of_park == 1) diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 12dd0ed274..98c97ff583 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1212,7 +1212,7 @@ void Staff::UpdateMowing() if (surfaceElement != nullptr && surfaceElement->CanGrassGrow()) { surfaceElement->SetGrassLength(GRASS_LENGTH_MOWED); - map_invalidate_tile_zoom0(next_x, next_y, surfaceElement->GetBaseHeight(), surfaceElement->GetBaseHeight() + 16); + map_invalidate_tile_zoom0(next_x, next_y, surfaceElement->GetBaseZ(), surfaceElement->GetBaseZ() + 16); } staff_lawns_mown++; window_invalidate_flags |= PEEP_INVALIDATE_STAFF_STATS; @@ -1274,7 +1274,7 @@ void Staff::UpdateWatering() continue; tile_element->AsSmallScenery()->SetAge(0); - map_invalidate_tile_zoom0(actionX, actionY, tile_element->GetBaseHeight(), tile_element->GetClearanceHeight()); + map_invalidate_tile_zoom0(actionX, actionY, tile_element->GetBaseZ(), tile_element->GetClearanceZ()); staff_gardens_watered++; window_invalidate_flags |= PEEP_INVALIDATE_STAFF_STATS; } while (!(tile_element++)->IsLastForTile()); @@ -1358,7 +1358,7 @@ void Staff::UpdateEmptyingBin() uint8_t additionStatus = tile_element->AsPath()->GetAdditionStatus() | ((3 << var_37) << var_37); tile_element->AsPath()->SetAdditionStatus(additionStatus); - map_invalidate_tile_zoom0(next_x, next_y, tile_element->GetBaseHeight(), tile_element->GetClearanceHeight()); + map_invalidate_tile_zoom0(next_x, next_y, tile_element->GetBaseZ(), tile_element->GetClearanceZ()); staff_bins_emptied++; window_invalidate_flags |= PEEP_INVALIDATE_STAFF_STATS; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index ff4e299254..d3f9f3564d 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2862,7 +2862,7 @@ private: CoordsXYZD entrance; entrance.x = it.x * 32; entrance.y = it.y * 32; - entrance.z = element->GetBaseHeight(); + entrance.z = element->GetBaseZ(); entrance.direction = element->GetDirection(); gParkEntrances.push_back(entrance); } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 256d3fb1ba..852d89ac40 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -539,12 +539,12 @@ bool track_block_get_next_from_zero( if (nextRotation != direction_start) continue; - int16_t nextZ = nextTrackCoordinate->z_begin - nextTrackBlock->z + tileElement->GetBaseHeight(); + int16_t nextZ = nextTrackCoordinate->z_begin - nextTrackBlock->z + tileElement->GetBaseZ(); if (nextZ != z_start) continue; if (z != nullptr) - *z = tileElement->GetBaseHeight(); + *z = tileElement->GetBaseZ(); if (direction != nullptr) *direction = nextRotation; output->x = x; @@ -590,7 +590,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 int32_t x = input->x; int32_t y = input->y; - int32_t OriginZ = inputElement->GetBaseHeight(); + int32_t OriginZ = inputElement->GetBaseZ(); uint8_t rotation = inputElement->GetDirection(); @@ -666,7 +666,7 @@ bool track_block_get_previous_from_zero( if (nextRotation != directionStart) continue; - int16_t nextZ = nextTrackCoordinate->z_end - nextTrackBlock->z + tileElement->GetBaseHeight(); + int16_t nextZ = nextTrackCoordinate->z_end - nextTrackBlock->z + tileElement->GetBaseZ(); if (nextZ != z) continue; @@ -684,7 +684,7 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->begin_x = coords.x; outTrackBeginEnd->begin_y = coords.y; - outTrackBeginEnd->begin_z = tileElement->GetBaseHeight(); + outTrackBeginEnd->begin_z = tileElement->GetBaseZ(); auto nextTrackBlock2 = get_track_def_from_ride(ride, trackElement->GetTrackType()); if (nextTrackBlock2 == nullptr) @@ -733,7 +733,7 @@ bool track_block_get_previous(int32_t x, int32_t y, TileElement* tileElement, tr if (trackCoordinate == nullptr) return false; - int32_t z = trackElement->GetBaseHeight(); + int32_t z = trackElement->GetBaseZ(); uint8_t rotation = trackElement->GetDirection(); CoordsXY coords = { x, y }; @@ -991,7 +991,7 @@ void ride_construct(Ride* ride) rct_window* w = window_get_main(); if (w != nullptr && ride_modify(&trackElement)) - window_scroll_to_location(w, trackElement.x, trackElement.y, trackElement.element->GetBaseHeight()); + window_scroll_to_location(w, trackElement.x, trackElement.y, trackElement.element->GetBaseZ()); } else { @@ -1622,7 +1622,7 @@ void ride_select_next_section() if (!scenery_tool_is_active()) { // Set next element's height. - virtual_floor_set_height(tileElement->GetBaseHeight()); + virtual_floor_set_height(tileElement->GetBaseZ()); } } else @@ -1696,7 +1696,7 @@ void ride_select_previous_section() if (!scenery_tool_is_active()) { // Set previous element's height. - virtual_floor_set_height(trackBeginEnd.begin_element->GetBaseHeight()); + virtual_floor_set_height(trackBeginEnd.begin_element->GetBaseZ()); } window_ride_construction_update_active_elements(); } @@ -1816,7 +1816,7 @@ static bool ride_modify_maze(const CoordsXYE& tileElement) _rideConstructionState = RIDE_CONSTRUCTION_STATE_MAZE_BUILD; _currentTrackBegin.x = tileElement.x; _currentTrackBegin.y = tileElement.y; - _currentTrackBegin.z = trackElement->GetBaseHeight(); + _currentTrackBegin.z = trackElement->GetBaseZ(); _currentTrackSelectionFlags = 0; _rideConstructionArrowPulseTime = 0; @@ -1886,7 +1886,7 @@ bool ride_modify(CoordsXYE* input) int32_t x = tileElement.x; int32_t y = tileElement.y; - int32_t z = tileElement.element->GetBaseHeight(); + int32_t z = tileElement.element->GetBaseZ(); int32_t direction = tileElement.element->GetDirection(); int32_t type = tileElement.element->AsTrack()->GetTrackType(); @@ -2245,7 +2245,7 @@ void Ride::UpdateSpiralSlide() x += ride_spiral_slide_main_tile_offset[rotation][current_rotation].x; y += ride_spiral_slide_main_tile_offset[rotation][current_rotation].y; - map_invalidate_tile_zoom0(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile_zoom0(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); } } @@ -4471,7 +4471,7 @@ static rct_vehicle* vehicle_create_car( int32_t direction = tileElement->GetDirection(); x += word_9A3AB4[direction].x; y += word_9A3AB4[direction].y; - z = tileElement->GetBaseHeight(); + z = tileElement->GetBaseZ(); vehicle->track_x = x; vehicle->track_y = y; vehicle->track_z = z; @@ -4565,10 +4565,10 @@ static rct_vehicle* vehicle_create_car( x += word_9A2A60[direction].x; y += word_9A2A60[direction].y; - vehicle->track_z = tileElement->GetBaseHeight(); + vehicle->track_z = tileElement->GetBaseZ(); vehicle->current_station = tileElement->AsTrack()->GetStationIndex(); - z = tileElement->GetBaseHeight(); + z = tileElement->GetBaseZ(); z += RideData5[ride->type].z_offset; sprite_move(x, y, z, (rct_sprite*)vehicle); @@ -5013,7 +5013,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) } if (isApplying) { - z = tileElement->GetBaseHeight(); + z = tileElement->GetBaseZ(); int32_t direction = tileElement->GetDirection(); trackType = tileElement->AsTrack()->GetTrackType(); x = it.current.x; @@ -5166,7 +5166,7 @@ static void ride_scroll_to_track_error(CoordsXYE* trackElement) rct_window* w = window_get_main(); if (w != nullptr) { - window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->GetBaseHeight()); + window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->GetBaseZ()); ride_modify(trackElement); } } @@ -5550,7 +5550,7 @@ int32_t ride_get_refund_price(const Ride* ride) { auto trackRemoveAction = TrackRemoveAction( trackElement.element->AsTrack()->GetTrackType(), trackElement.element->AsTrack()->GetSequenceIndex(), - { trackElement.x, trackElement.y, trackElement.element->GetBaseHeight(), direction }); + { trackElement.x, trackElement.y, trackElement.element->GetBaseZ(), direction }); trackRemoveAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); auto res = GameActions::Query(&trackRemoveAction); diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 2d5911a9d3..4abcca2de8 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -250,7 +250,7 @@ static void ride_ratings_update_state_2() x = nextTrackElement.x; y = nextTrackElement.y; - z = nextTrackElement.element->GetBaseHeight(); + z = nextTrackElement.element->GetBaseZ(); tileElement = nextTrackElement.element; if (x == gRideRatingsCalcData.proximity_start_x && y == gRideRatingsCalcData.proximity_start_y && z == gRideRatingsCalcData.proximity_start_z) @@ -571,7 +571,7 @@ static void ride_ratings_score_close_proximity(TileElement* inputTileElement) { case TILE_ELEMENT_TYPE_SURFACE: gRideRatingsCalcData.proximity_base_height = tileElement->base_height; - if (tileElement->GetBaseHeight() == gRideRatingsCalcData.proximity_z) + if (tileElement->GetBaseZ() == gRideRatingsCalcData.proximity_z) { proximity_score_increment(PROXIMITY_SURFACE_TOUCH); } diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 7cbab1605a..9f6a072be7 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -329,7 +329,7 @@ static void ride_invalidate_station_start(Ride* ride, int32_t stationIndex, bool tileElement->AsTrack()->SetHasGreenLight(greenLight); // Invalidate map tile - map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile_zoom1(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); } TileElement* ride_get_station_start_track_element(Ride* ride, int32_t stationIndex) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index cd1b3064e7..59919e3011 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -181,7 +181,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) ride_get_start_of_track(&trackElement); - int32_t z = trackElement.element->GetBaseHeight(); + int32_t z = trackElement.element->GetBaseZ(); uint8_t trackType = trackElement.element->AsTrack()->GetTrackType(); uint8_t direction = trackElement.element->GetDirection(); _saveDirection = direction; @@ -237,7 +237,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) break; } - z = trackElement.element->GetBaseHeight(); + z = trackElement.element->GetBaseZ(); direction = trackElement.element->GetDirection(); trackType = trackElement.element->AsTrack()->GetTrackType(); @@ -350,7 +350,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride) return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; } - gTrackPreviewOrigin = { startLoc.x, startLoc.y, startLoc.element->GetBaseHeight() }; + gTrackPreviewOrigin = { startLoc.x, startLoc.y, startLoc.element->GetBaseZ() }; // x is defined here as we can start the search // on tile start_x, start_y but then the next row @@ -1432,7 +1432,7 @@ static int32_t track_design_place_maze(TrackDesign* td6, int16_t x, int16_t y, i auto surfaceElement = map_get_surface_element_at(mapCoord); if (surfaceElement == nullptr) continue; - int16_t map_height = surfaceElement->GetBaseHeight(); + int16_t map_height = surfaceElement->GetBaseZ(); if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) { map_height += 16; @@ -1602,7 +1602,7 @@ static bool track_design_place_ride(TrackDesign* td6, int16_t x, int16_t y, int1 return false; } - int32_t height = surfaceElement->GetBaseHeight(); + int32_t height = surfaceElement->GetBaseZ(); if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) { height += 16; diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index f08922eb1f..6e41a4b361 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -218,7 +218,7 @@ static void track_design_save_add_scenery(CoordsXY loc, SmallSceneryElement* sce track_design_save_push_tile_element(loc, reinterpret_cast(sceneryElement)); track_design_save_push_tile_element_desc( - entry, { loc.x, loc.y, sceneryElement->GetBaseHeight() }, flags, primaryColour, secondaryColour); + entry, { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags, primaryColour, secondaryColour); } static void track_design_save_add_large_scenery(CoordsXY loc, LargeSceneryElement* tileElement) @@ -278,7 +278,7 @@ static void track_design_save_add_wall(CoordsXY loc, WallElement* wallElement) track_design_save_push_tile_element(loc, reinterpret_cast(wallElement)); track_design_save_push_tile_element_desc( - entry, { loc.x, loc.y, wallElement->GetBaseHeight() }, flags, primaryColour, secondaryColour); + entry, { loc.x, loc.y, wallElement->GetBaseZ() }, flags, primaryColour, secondaryColour); } static void track_design_save_add_footpath(CoordsXY loc, PathElement* pathElement) @@ -295,7 +295,7 @@ static void track_design_save_add_footpath(CoordsXY loc, PathElement* pathElemen flags |= 1 << 7; track_design_save_push_tile_element(loc, reinterpret_cast(pathElement)); - track_design_save_push_tile_element_desc(entry, { loc.x, loc.y, pathElement->GetBaseHeight() }, flags, 0, 0); + track_design_save_push_tile_element_desc(entry, { loc.x, loc.y, pathElement->GetBaseZ() }, flags, 0, 0); } /** @@ -392,7 +392,7 @@ static void track_design_save_remove_scenery(CoordsXY loc, SmallSceneryElement* flags |= sceneryElement->GetSceneryQuadrant() << 2; track_design_save_pop_tile_element(loc, reinterpret_cast(sceneryElement)); - track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, sceneryElement->GetBaseHeight() }, flags); + track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags); } static void track_design_save_remove_large_scenery(CoordsXY loc, LargeSceneryElement* tileElement) @@ -445,7 +445,7 @@ static void track_design_save_remove_wall(CoordsXY loc, WallElement* wallElement flags |= wallElement->GetTertiaryColour() << 2; track_design_save_pop_tile_element(loc, reinterpret_cast(wallElement)); - track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, wallElement->GetBaseHeight() }, flags); + track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, wallElement->GetBaseZ() }, flags); } static void track_design_save_remove_footpath(CoordsXY loc, PathElement* pathElement) @@ -462,7 +462,7 @@ static void track_design_save_remove_footpath(CoordsXY loc, PathElement* pathEle flags |= (1 << 7); track_design_save_pop_tile_element(loc, reinterpret_cast(pathElement)); - track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, pathElement->GetBaseHeight() }, flags); + track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, pathElement->GetBaseZ() }, flags); } /** diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index ac8fa43603..41e87de277 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -982,7 +982,7 @@ static void vehicle_update_sound_params(rct_vehicle* vehicle) auto surfaceElement = map_get_surface_element_at(CoordsXY{ vehicle->x, vehicle->y }); // vehicle underground - if (surfaceElement != nullptr && surfaceElement->GetBaseHeight() > vehicle->z) + if (surfaceElement != nullptr && surfaceElement->GetBaseZ() > vehicle->z) { soundParam->volume = 0x30; } @@ -1832,7 +1832,7 @@ static void vehicle_update_measurements(rct_vehicle* vehicle) auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); // If vehicle above ground. - if (surfaceElement != nullptr && surfaceElement->GetBaseHeight() <= z) + if (surfaceElement != nullptr && surfaceElement->GetBaseZ() <= z) { // Set tile_element to first element. Since elements aren't always ordered by base height, // we must start at the first element and iterate through each tile element. @@ -1844,7 +1844,7 @@ static void vehicle_update_measurements(rct_vehicle* vehicle) do { // If the tile_element is lower than the vehicle, continue (don't set flag) - if (tile_element->GetBaseHeight() <= z) + if (tile_element->GetBaseZ() <= z) continue; if (tile_element->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY) @@ -5151,10 +5151,10 @@ static TileElement* vehicle_check_collision(int16_t x, int16_t y, int16_t z) do { - if (z < tileElement->GetBaseHeight()) + if (z < tileElement->GetBaseZ()) continue; - if (z >= tileElement->GetClearanceHeight()) + if (z >= tileElement->GetClearanceZ()) continue; if (tileElement->GetOccupiedQuadrants() & quadrant) @@ -7199,7 +7199,7 @@ static void vehicle_update_spinning_car(rct_vehicle* vehicle) static void steam_particle_create(int16_t x, int16_t y, int16_t z) { auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); - if (surfaceElement != nullptr && z > surfaceElement->GetBaseHeight()) + if (surfaceElement != nullptr && z > surfaceElement->GetBaseZ()) { rct_steam_particle* steam = &create_sprite(SPRITE_IDENTIFIER_MISC)->steam_particle; if (steam == nullptr) @@ -7488,8 +7488,7 @@ static void vehicle_trigger_on_ride_photo(rct_vehicle* vehicle, TileElement* til { tileElement->AsTrack()->SetPhotoTimeout(); - map_animation_create( - MAP_ANIMATION_TYPE_TRACK_ONRIDEPHOTO, { vehicle->track_x, vehicle->track_y, tileElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_TRACK_ONRIDEPHOTO, { vehicle->track_x, vehicle->track_y, tileElement->GetBaseZ() }); } /** diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index d681a49509..a4d0dfae9b 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -168,7 +168,7 @@ static void paint_observation_tower_section( sub_98197C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); const TileElement* nextTileElement = tileElement + 1; - if (tileElement->IsLastForTile() || tileElement->GetClearanceHeight() != nextTileElement->GetBaseHeight()) + if (tileElement->IsLastForTile() || tileElement->GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = SPR_OBSERVATION_TOWER_SEGMENT_TOP | session->TrackColours[SCHEME_TRACK]; sub_98199C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 7ed8f2e21f..631f223538 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -176,7 +176,7 @@ static void paint_launched_freefall_tower_section( sub_98197C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); const TileElement* nextTileElement = tileElement + 1; - if (tileElement->IsLastForTile() || tileElement->GetClearanceHeight() != nextTileElement->GetBaseHeight()) + if (tileElement->IsLastForTile() || tileElement->GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT_TOP | session->TrackColours[SCHEME_TRACK]; sub_98199C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index a79f2ea32a..38de6cfb78 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -190,7 +190,7 @@ static void paint_roto_drop_tower_section( sub_98197C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); const TileElement* nextTileElement = tileElement + 1; - if (tileElement->IsLastForTile() || tileElement->GetClearanceHeight() != nextTileElement->GetBaseHeight()) + if (tileElement->IsLastForTile() || tileElement->GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = SPR_ROTO_DROP_TOWER_SEGMENT_TOP | session->TrackColours[SCHEME_TRACK]; sub_98199C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 2adbc6b9be..dec93a722a 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -93,7 +93,7 @@ static uint8_t banner_get_ride_index_at(int32_t x, int32_t y, int32_t z) if (ride == nullptr || ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP)) continue; - if ((tileElement->GetClearanceHeight()) + 32 <= z) + if ((tileElement->GetClearanceZ()) + 32 <= z) continue; resultRideIndex = rideIndex; diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index e1dc6867fd..f28d26291f 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -157,7 +157,7 @@ void maze_entrance_hedge_replacement(int32_t x, int32_t y, TileElement* tileElem // Add the bottom outer wall tileElement->AsTrack()->MazeEntryAdd(1 << ((mazeSection + 12) & 0x0F)); - map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); return; } while (!(tileElement++)->IsLastForTile()); } @@ -201,7 +201,7 @@ void maze_entrance_hedge_removal(int32_t x, int32_t y, TileElement* tileElement) // Remove the bottom hedge section tileElement->AsTrack()->MazeEntrySubtract(1 << ((mazeSection + 15) & 0x0F)); - map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); return; } while (!(tileElement++)->IsLastForTile()); } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 59d5146bc8..bfc1e3d9d1 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -275,7 +275,7 @@ void footpath_get_coordinates_from_pos( if (interactionType == VIEWPORT_INTERACTION_ITEM_FOOTPATH) { - z = myTileElement->GetBaseHeight(); + z = myTileElement->GetBaseZ(); if (myTileElement->AsPath()->IsSloped()) { z += 8; @@ -913,7 +913,7 @@ static void loc_6A6D7E( } if (!(flags & (GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED))) { - footpath_interrupt_peeps(x, y, tileElement->GetBaseHeight()); + footpath_interrupt_peeps(x, y, tileElement->GetBaseZ()); } map_invalidate_element(x, y, tileElement); } @@ -1158,7 +1158,7 @@ void footpath_chain_ride_queue( lastPathElement->AsPath()->SetHasQueueBanner(true); lastPathElement->AsPath()->SetQueueBannerDirection(lastPathDirection); // set the ride sign direction - map_animation_create(MAP_ANIMATION_TYPE_QUEUE_BANNER, { lastPathX, lastPathY, lastPathElement->GetBaseHeight() }); + map_animation_create(MAP_ANIMATION_TYPE_QUEUE_BANNER, { lastPathX, lastPathY, lastPathElement->GetBaseZ() }); } } } @@ -1926,7 +1926,7 @@ static void footpath_remove_edges_towards_here( tileElement->AsPath()->SetCorners(tileElement->AsPath()->GetCorners() & ~(1 << cd)); cd = ((cd + 1) & 3); tileElement->AsPath()->SetCorners(tileElement->AsPath()->GetCorners() & ~(1 << cd)); - map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); if (isQueue) footpath_disconnect_queue_from_path(x, y, tileElement, -1); @@ -1950,7 +1950,7 @@ static void footpath_remove_edges_towards_here( cd = ((direction + 1) & 3); tileElement->AsPath()->SetCorners(tileElement->AsPath()->GetCorners() & ~(1 << cd)); - map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); break; } while (!(tileElement++)->IsLastForTile()); } diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index cb7a90730c..1da21deaaf 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -70,7 +70,7 @@ const uint8_t _fountainPatternFlags[] = { void JumpingFountain::StartAnimation(const int32_t newType, const CoordsXY newLoc, const TileElement* tileElement) { int32_t randomIndex; - auto newZ = tileElement->GetBaseHeight(); + auto newZ = tileElement->GetBaseZ(); // Change pattern approximately every 51 seconds uint32_t pattern = (gCurrentTicks >> 11) & 7; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index f7757bd390..a30854402c 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -416,7 +416,7 @@ int16_t tile_element_height(const CoordsXY& loc) return 16; } - uint16_t height = surfaceElement->GetBaseHeight(); + uint16_t height = surfaceElement->GetBaseZ(); uint32_t slope = surfaceElement->GetSlope(); uint8_t extra_height = (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) >> 4; // 0x10 is the 5th bit - sets slope to double height @@ -1672,13 +1672,13 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) seqLoc -= CoordsDirectionDelta[rotation]; break; } - auto parkEntranceRemoveAction = ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->GetBaseHeight() }); + auto parkEntranceRemoveAction = ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->GetBaseZ() }); GameActions::Execute(&parkEntranceRemoveAction); break; } case TILE_ELEMENT_TYPE_WALL: { - CoordsXYZD wallLocation = { loc.x, loc.y, element->GetBaseHeight(), element->GetDirection() }; + CoordsXYZD wallLocation = { loc.x, loc.y, element->GetBaseZ(), element->GetDirection() }; auto wallRemoveAction = WallRemoveAction(wallLocation); GameActions::Execute(&wallRemoveAction); } @@ -1686,15 +1686,14 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) case TILE_ELEMENT_TYPE_LARGE_SCENERY: { auto removeSceneryAction = LargeSceneryRemoveAction( - { loc.x, loc.y, element->GetBaseHeight(), element->GetDirection() }, - element->AsLargeScenery()->GetSequenceIndex()); + { loc.x, loc.y, element->GetBaseZ(), element->GetDirection() }, element->AsLargeScenery()->GetSequenceIndex()); GameActions::Execute(&removeSceneryAction); } break; case TILE_ELEMENT_TYPE_BANNER: { auto bannerRemoveAction = BannerRemoveAction( - { loc.x, loc.y, element->GetBaseHeight(), element->AsBanner()->GetPosition() }); + { loc.x, loc.y, element->GetBaseZ(), element->AsBanner()->GetPosition() }); GameActions::Execute(&bannerRemoveAction); break; } @@ -1737,7 +1736,7 @@ int32_t map_get_highest_z(const CoordsXY& loc) if (surfaceElement == nullptr) return -1; - z = surfaceElement->GetBaseHeight(); + z = surfaceElement->GetBaseZ(); // Raise z so that is above highest point of land and water on tile if ((surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != TILE_ELEMENT_SLOPE_FLAT) @@ -1934,7 +1933,7 @@ bool sign_set_colour( tileElement->SetPrimaryColour(mainColour); tileElement->SetSecondaryColour(textColour); - map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); } } @@ -2017,7 +2016,7 @@ void map_invalidate_tile_full(int32_t x, int32_t y) void map_invalidate_element(int32_t x, int32_t y, TileElement* tileElement) { - map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); } void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs) diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 1120e04456..6f1945ed99 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -185,7 +185,7 @@ static bool map_animation_invalidate_small_scenery(CoordsXYZ loc) SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_1 | SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_4 | SMALL_SCENERY_FLAG_SWAMP_GOO | SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) { - map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceHeight()); + map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceZ()); return false; } @@ -221,7 +221,7 @@ static bool map_animation_invalidate_small_scenery(CoordsXYZ loc) break; } } - map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceHeight()); + map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceZ()); return false; } @@ -338,7 +338,7 @@ static bool map_animation_invalidate_track_onridephoto(CoordsXYZ loc) if (tileElement->AsTrack()->GetTrackType() == TRACK_ELEM_ON_RIDE_PHOTO) { - map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceHeight()); + map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceZ()); if (game_is_paused()) { return false; @@ -634,7 +634,7 @@ void AutoCreateMapAnimations() while (tile_element_iterator_next(&it)) { auto el = it.element; - auto loc = CoordsXYZ{ it.x * 32, it.y * 32, el->GetBaseHeight() }; + auto loc = CoordsXYZ{ it.x * 32, it.y * 32, el->GetBaseZ() }; switch (el->GetType()) { case TILE_ELEMENT_TYPE_BANNER: diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 38a5147a05..855171e30a 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -166,7 +166,7 @@ void update_park_fences(const CoordsXY coords) if (surfaceElement->GetParkFences() != newFences) { - int32_t z0 = surfaceElement->GetBaseHeight(); + int32_t z0 = surfaceElement->GetBaseZ(); int32_t z1 = z0 + 16; map_invalidate_tile(coords.x, coords.y, z0, z1); surfaceElement->SetParkFences(newFences); diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 45a9d4cbfe..92a60f8731 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -154,7 +154,7 @@ void scenery_update_age(int32_t x, int32_t y, TileElement* tileElement) case TILE_ELEMENT_TYPE_LARGE_SCENERY: case TILE_ELEMENT_TYPE_ENTRANCE: case TILE_ELEMENT_TYPE_PATH: - map_invalidate_tile_zoom1(x, y, tileElementAbove->GetBaseHeight(), tileElementAbove->GetClearanceHeight()); + map_invalidate_tile_zoom1(x, y, tileElementAbove->GetBaseZ(), tileElementAbove->GetClearanceZ()); tileElement->AsSmallScenery()->IncreaseAge(x, y); return; case TILE_ELEMENT_TYPE_SMALL_SCENERY: @@ -170,7 +170,7 @@ void scenery_update_age(int32_t x, int32_t y, TileElement* tileElement) // Reset age / water plant tileElement->AsSmallScenery()->SetAge(0); - map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight()); + map_invalidate_tile_zoom1(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ()); } /** diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index 319bd2c800..68fa90c9ba 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -50,7 +50,7 @@ static int32_t map_place_clear_func( if (!(flags & GAME_COMMAND_FLAG_APPLY)) return 0; - map_invalidate_tile(x, y, (*tile_element)->GetBaseHeight(), (*tile_element)->GetClearanceHeight()); + map_invalidate_tile(x, y, (*tile_element)->GetBaseZ(), (*tile_element)->GetClearanceZ()); tile_element_remove(*tile_element); @@ -128,7 +128,7 @@ void SmallSceneryElement::IncreaseAge(int32_t x, int32_t y) if (scenery_small_entry_has_flag(entry, SMALL_SCENERY_FLAG_CAN_WITHER)) { - map_invalidate_tile_zoom1(x, y, GetBaseHeight(), GetClearanceHeight()); + map_invalidate_tile_zoom1(x, y, GetBaseZ(), GetClearanceZ()); } } } diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 7bc385cdea..8bdc22e1dc 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -727,7 +727,7 @@ static bool litter_can_be_at(int32_t x, int32_t y, int32_t z) if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) continue; - int32_t pathZ = tileElement->GetBaseHeight(); + int32_t pathZ = tileElement->GetBaseZ(); if (pathZ < z || pathZ >= z + 32) continue; diff --git a/src/openrct2/world/Surface.cpp b/src/openrct2/world/Surface.cpp index 39ae27c1cd..4fd14ceb19 100644 --- a/src/openrct2/world/Surface.cpp +++ b/src/openrct2/world/Surface.cpp @@ -92,7 +92,7 @@ void SurfaceElement::SetGrassLengthAndInvalidate(uint8_t length, CoordsXY coords return; } - int32_t z = GetBaseHeight(); + int32_t z = GetBaseZ(); map_invalidate_tile(coords.x, coords.y, z, z + 16); } diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 8a4dc1f25b..cdb749a2c6 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -225,12 +225,12 @@ void TileElementBase::SetOccupiedQuadrants(uint8_t quadrants) flags |= (quadrants & TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK); } -int32_t TileElementBase::GetBaseHeight() const +int32_t TileElementBase::GetBaseZ() const { return base_height * 8; } -int32_t TileElementBase::GetClearanceHeight() const +int32_t TileElementBase::GetClearanceZ() const { return clearance_height * 8; } diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 8adf55368a..917608a35d 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -78,8 +78,8 @@ struct TileElementBase void Remove(); uint8_t GetOccupiedQuadrants() const; void SetOccupiedQuadrants(uint8_t quadrants); - int32_t GetBaseHeight() const; - int32_t GetClearanceHeight() const; + int32_t GetBaseZ() const; + int32_t GetClearanceZ() const; }; /** diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 38236f72ec..6722d41011 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -756,7 +756,7 @@ GameActionResult::Ptr tile_inspector_track_base_height_offset( uint8_t type = trackElement->AsTrack()->GetTrackType(); int16_t originX = loc.x; int16_t originY = loc.y; - int16_t originZ = trackElement->GetBaseHeight(); + int16_t originZ = trackElement->GetBaseZ(); uint8_t rotation = trackElement->GetDirection(); auto rideIndex = trackElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); @@ -863,7 +863,7 @@ GameActionResult::Ptr tile_inspector_track_set_chain( uint8_t type = trackElement->AsTrack()->GetTrackType(); int16_t originX = loc.x; int16_t originY = loc.y; - int16_t originZ = trackElement->GetBaseHeight(); + int16_t originZ = trackElement->GetBaseZ(); uint8_t rotation = trackElement->GetDirection(); auto rideIndex = trackElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index 99ff3e2f0f..ec41223f25 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -53,7 +53,7 @@ repeat: continue; tile_element_remove_banner_entry(tileElement); - map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetBaseHeight() + 72); + map_invalidate_tile_zoom1(x, y, tileElement->GetBaseZ(), tileElement->GetBaseZ() + 72); tile_element_remove(tileElement); goto repeat; } while (!(tileElement++)->IsLastForTile()); @@ -91,7 +91,7 @@ void wall_remove_intersecting_walls(int32_t x, int32_t y, int32_t z0, int32_t z1 continue; tile_element_remove_banner_entry(tileElement); - map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetBaseHeight() + 72); + map_invalidate_tile_zoom1(x, y, tileElement->GetBaseZ(), tileElement->GetBaseZ() + 72); tile_element_remove(tileElement); tileElement--; } while (!(tileElement++)->IsLastForTile()); diff --git a/test/testpaint/Compat.cpp b/test/testpaint/Compat.cpp index bc19fa4305..656f989d9c 100644 --- a/test/testpaint/Compat.cpp +++ b/test/testpaint/Compat.cpp @@ -464,12 +464,12 @@ void TileElementBase::SetOccupiedQuadrants(uint8_t quadrants) flags |= (quadrants & TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK); } -int32_t TileElementBase::GetBaseHeight() const +int32_t TileElementBase::GetBaseZ() const { return base_height * 8; } -int32_t TileElementBase::GetClearanceHeight() const +int32_t TileElementBase::GetClearanceZ() const { return clearance_height * 8; }