Create getter for GetBaseHeight()/GetClearanceHeight()

This commit is contained in:
Gymnasiast 2019-12-21 16:50:28 +01:00
parent b330d3816f
commit 7d11858dbe
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
58 changed files with 164 additions and 143 deletions

View File

@ -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->base_height * 8 }, tileElement->AsSmallScenery()->GetSceneryQuadrant(),
{ mapCoords.x, mapCoords.y, tileElement->GetBaseHeight() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(),
tileElement->AsSmallScenery()->GetEntryIndex());
GameActions::Execute(&removeSceneryAction);
@ -517,11 +517,10 @@ static void viewport_interaction_remove_scenery(TileElement* tileElement, Coords
*/
static void viewport_interaction_remove_footpath(TileElement* tileElement, CoordsXY mapCoords)
{
int32_t z;
rct_window* w;
TileElement* tileElement2;
z = tileElement->base_height;
auto z = tileElement->GetBaseHeight();
w = window_find_by_class(WC_FOOTPATH);
if (w != nullptr)
@ -532,9 +531,9 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, Coord
return;
do
{
if (tileElement2->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement2->base_height == z)
if (tileElement2->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement2->GetBaseHeight() == z)
{
footpath_remove({ mapCoords, z * 8 }, GAME_COMMAND_FLAG_APPLY);
footpath_remove({ mapCoords, z }, GAME_COMMAND_FLAG_APPLY);
break;
}
} while (!(tileElement2++)->IsLastForTile());
@ -546,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->base_height * 8 });
auto footpathSceneryRemoveAction = FootpathSceneryRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseHeight() });
GameActions::Execute(&footpathSceneryRemoveAction);
}
@ -566,7 +565,7 @@ void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsX
mapCoords -= CoordsDirectionDelta[rotation];
break;
}
auto parkEntranceRemoveAction = ParkEntranceRemoveAction({ mapCoords.x, mapCoords.y, tileElement->base_height * 8 });
auto parkEntranceRemoveAction = ParkEntranceRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseHeight() });
GameActions::Execute(&parkEntranceRemoveAction);
}
@ -583,7 +582,7 @@ static void viewport_interaction_remove_park_wall(TileElement* tileElement, Coor
}
else
{
CoordsXYZD wallLocation = { mapCoords.x, mapCoords.y, tileElement->base_height * 8, tileElement->GetDirection() };
CoordsXYZD wallLocation = { mapCoords.x, mapCoords.y, tileElement->GetBaseHeight(), tileElement->GetDirection() };
auto wallRemoveAction = WallRemoveAction(wallLocation);
GameActions::Execute(&wallRemoveAction);
}
@ -605,7 +604,7 @@ static void viewport_interaction_remove_large_scenery(TileElement* tileElement,
else
{
auto removeSceneryAction = LargeSceneryRemoveAction(
{ mapCoords.x, mapCoords.y, tileElement->base_height * 8, tileElement->GetDirection() },
{ mapCoords.x, mapCoords.y, tileElement->GetBaseHeight(), tileElement->GetDirection() },
tileElement->AsLargeScenery()->GetSequenceIndex());
GameActions::Execute(&removeSceneryAction);
}

View File

@ -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->base_height * 8, tile_element->AsBanner()->GetPosition() });
{ x, y, tile_element->GetBaseHeight(), tile_element->AsBanner()->GetPosition() });
GameActions::Execute(&bannerRemoveAction);
break;
}

View File

@ -1046,7 +1046,7 @@ static void footpath_remove_tile_element(TileElement* tileElement)
}
}
gFootpathConstructFromPosition.z = tileElement->base_height * 8;
gFootpathConstructFromPosition.z = tileElement->GetBaseHeight();
// Remove path
footpath_remove(gFootpathConstructFromPosition, GAME_COMMAND_FLAG_APPLY);

View File

@ -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->base_height * 8;
parkEntranceMapPosition.z = surfaceElement->GetBaseHeight();
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->base_height * 8;
mapZ = tileElement->GetBaseHeight();
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->base_height * 8;
mapZ = tileElement->GetBaseHeight();
auto gameAction = PlacePeepSpawnAction({ mapX, mapY, mapZ, static_cast<Direction>(direction) });
auto result = GameActions::Execute(&gameAction);

View File

@ -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->base_height * 8;
int32_t z2 = it.element->clearance_height * 8;
int32_t z1 = it.element->GetBaseHeight();
int32_t z2 = it.element->GetClearanceHeight();
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->base_height * 8;
z = tileElement->GetBaseHeight();
direction = tileElement->GetDirection();
auto gameAction = RideSetColourSchemeAction(
CoordsXYZD{ x, y, z, static_cast<Direction>(direction) }, tileElement->AsTrack()->GetTrackType(), newColourScheme);

View File

@ -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->base_height * 8) - trackBlock->z;
z = (tileElement->GetBaseHeight()) - trackBlock->z;
gGotoStartPlacementMode = true;
}
@ -2122,7 +2122,7 @@ static std::optional<CoordsXY> ride_get_place_position_from_screen_position(Scre
get_map_coordinates_from_pos(screenCoords, 0xFCCA, mapCoords, &interactionType, &tileElement, &viewport);
if (interactionType != 0)
{
_trackPlaceCtrlZ = tileElement->base_height * 8;
_trackPlaceCtrlZ = tileElement->GetBaseHeight();
_trackPlaceCtrlState = true;
}
}
@ -2183,7 +2183,7 @@ static std::optional<CoordsXY> 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->base_height * 8, 16);
auto mapZ = floor2(surfaceElement->GetBaseHeight(), 16);
mapZ += _trackPlaceShiftZ;
mapZ = std::max<int16_t>(mapZ, 16);
_trackPlaceZ = mapZ;

View File

@ -236,7 +236,7 @@ static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex)
}
auto sceneryRemoveAction = LargeSceneryRemoveAction(
{ x, y, tile_element->base_height * 8, tile_element->GetDirection() },
{ x, y, tile_element->GetBaseHeight(), tile_element->GetDirection() },
tile_element->AsLargeScenery()->GetSequenceIndex());
GameActions::Execute(&sceneryRemoveAction);
break;
@ -481,7 +481,7 @@ static void window_sign_small_mouseup(rct_window* w, rct_widgetindex widgetIndex
}
tile_element++;
}
CoordsXYZD wallLocation = { x, y, tile_element->base_height * 8, tile_element->GetDirection() };
CoordsXYZD wallLocation = { x, y, tile_element->GetBaseHeight(), tile_element->GetDirection() };
auto wallRemoveAction = WallRemoveAction(wallLocation);
GameActions::Execute(&wallRemoveAction);
break;

View File

@ -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->base_height * 8);
windowTileInspectorToolMap.x, windowTileInspectorToolMap.y, tileElement->GetBaseHeight());
gfx_draw_string_left(
dpi, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, &parkEntranceIndex, COLOUR_WHITE, x, y + 11);
}

View File

@ -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->base_height * 8 }, quadrant,
{ gridCoords.x, gridCoords.y, tile_element->GetBaseHeight() }, 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->base_height * 8, tile_element->GetDirection() },
{ gridCoords.x, gridCoords.y, tile_element->GetBaseHeight(), 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->base_height * 8, tile_element->GetDirection() },
{ gridCoords.x, gridCoords.y, tile_element->GetBaseHeight(), 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->base_height * 8, tile_element->AsBanner()->GetPosition() },
{ gridCoords.x, gridCoords.y, tile_element->GetBaseHeight(), 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->base_height * 8;
gSceneryCtrlPressZ = tile_element->GetBaseHeight();
}
}
}
@ -1368,7 +1368,7 @@ static void sub_6E1F34(
return;
}
int16_t z = (surfaceElement->base_height * 8) & 0xFFF0;
int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0;
z += gSceneryShiftPressZOffset;
z = std::clamp<int16_t>(z, 16, maxPossibleHeight);
@ -1457,7 +1457,7 @@ static void sub_6E1F34(
return;
}
int16_t z = (surfaceElement->base_height * 8) & 0xFFF0;
int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0;
z += gSceneryShiftPressZOffset;
z = std::clamp<int16_t>(z, 16, maxPossibleHeight);
@ -1569,7 +1569,7 @@ static void sub_6E1F34(
return;
}
int16_t z = (surfaceElement->base_height * 8) & 0xFFF0;
int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0;
z += gSceneryShiftPressZOffset;
z = std::clamp<int16_t>(z, 16, maxPossibleHeight);
@ -1637,7 +1637,7 @@ static void sub_6E1F34(
return;
}
int16_t z = (surfaceElement->base_height * 8) & 0xFFF0;
int16_t z = (surfaceElement->GetBaseHeight()) & 0xFFF0;
z += gSceneryShiftPressZOffset;
z = std::clamp<int16_t>(z, 16, maxPossibleHeight);

View File

@ -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->base_height * 8;
z = surfaceElement->GetBaseHeight();
// Increase Z above slope
if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)

View File

@ -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->base_height * 8 });
map_animation_create(MAP_ANIMATION_TYPE_BANNER, CoordsXYZ{ _loc, bannerElement->GetBaseHeight() });
rct_scenery_entry* bannerEntry = get_banner_entry(_bannerType);
if (bannerEntry == nullptr)

View File

@ -154,7 +154,7 @@ private:
case TILE_ELEMENT_TYPE_PATH:
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_FOOTPATH)
{
auto footpathRemoveAction = FootpathRemoveAction({ tilePos, tileElement->base_height * 8 });
auto footpathRemoveAction = FootpathRemoveAction({ tilePos, tileElement->GetBaseHeight() });
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->base_height * 8 }, tileElement->AsSmallScenery()->GetSceneryQuadrant(),
{ tilePos, tileElement->GetBaseHeight() }, 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->base_height * 8, tileElement->GetDirection() };
CoordsXYZD wallLocation = { tilePos, tileElement->GetBaseHeight(), 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->base_height * 8, tileElement->GetDirection() },
{ tilePos, tileElement->GetBaseHeight(), tileElement->GetDirection() },
tileElement->AsLargeScenery()->GetSequenceIndex());
removeSceneryAction.SetFlags(GetFlags() | GAME_COMMAND_FLAG_PATH_SCENERY);

View File

@ -157,7 +157,7 @@ private:
continue;
auto bannerRemoveAction = BannerRemoveAction(
{ x, y, tileElement->base_height * 8, tileElement->AsBanner()->GetPosition() });
{ x, y, tileElement->GetBaseHeight(), tileElement->AsBanner()->GetPosition() });
bool isGhost = tileElement->IsGhost();
auto bannerFlags = GetFlags() | (isGhost ? static_cast<uint32_t>(GAME_COMMAND_FLAG_GHOST) : 0);
bannerRemoveAction.SetFlags(bannerFlags);

View File

@ -169,7 +169,7 @@ private:
if (isExecuting)
{
surfaceElement->SetOwnership(surfaceElement->GetOwnership() | OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED);
uint16_t baseHeight = surfaceElement->base_height * 8;
uint16_t baseHeight = surfaceElement->GetBaseHeight();
map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16);
}
res->Cost = gConstructionRightsPrice;

View File

@ -152,7 +152,7 @@ private:
if (isExecuting)
{
surfaceElement->SetOwnership(surfaceElement->GetOwnership() & ~OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED);
uint16_t baseHeight = surfaceElement->base_height * 8;
uint16_t baseHeight = surfaceElement->GetBaseHeight();
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->base_height * 8;
uint16_t baseHeight = surfaceElement->GetBaseHeight();
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->base_height * 8;
uint16_t baseHeight = surfaceElement->GetBaseHeight();
map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16);
}
return res;

View File

@ -364,7 +364,7 @@ private:
if (surfaceElement == nullptr)
continue;
int32_t height = surfaceElement->base_height * 8;
int32_t height = surfaceElement->GetBaseHeight();
int32_t slope = surfaceElement->GetSlope();
if (slope & 0xF)

View File

@ -335,7 +335,7 @@ public:
}
map_invalidate_tile(
floor2(_loc.x, 32), floor2(_loc.y, 32), tileElement->base_height * 8, tileElement->clearance_height * 8);
floor2(_loc.x, 32), floor2(_loc.y, 32), tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
if ((tileElement->AsTrack()->GetMazeEntry() & 0x8888) == 0x8888)
{

View File

@ -101,7 +101,7 @@ private:
return;
}
map_invalidate_tile(loc.x, loc.y, entranceElement->base_height * 8, entranceElement->clearance_height * 8);
map_invalidate_tile(loc.x, loc.y, entranceElement->GetBaseHeight(), entranceElement->GetClearanceHeight());
entranceElement->Remove();
update_park_fences({ loc.x, loc.y });
}

View File

@ -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->base_height * 8, newElement->clearance_height * 8);
map_invalidate_tile(entranceLoc.x, entranceLoc.y, newElement->GetBaseHeight(), newElement->GetClearanceHeight());
if (index == 0)
{

View File

@ -304,7 +304,7 @@ private:
continue;
int32_t x = it.x * 32, y = it.y * 32;
int32_t z = it.element->base_height * 8;
int32_t z = it.element->GetBaseHeight();
uint8_t rotation = it.element->GetDirection();
uint8_t type = it.element->AsTrack()->GetTrackType();

View File

@ -752,7 +752,7 @@ private:
{
surfaceElement->SetOwnership(destOwnership);
update_park_fences_around_tile(coords);
uint16_t baseHeight = surfaceElement->base_height * 8;
uint16_t baseHeight = surfaceElement->GetBaseHeight();
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->base_height * 8;
uint16_t baseHeight = surfaceElement->GetBaseHeight();
map_invalidate_tile(x, y, baseHeight, baseHeight + 16);
}
}

View File

@ -111,7 +111,7 @@ public:
wallElement->SetPrimaryColour(_mainColour);
wallElement->SetSecondaryColour(_textColour);
map_invalidate_tile(coords.x, coords.y, wallElement->base_height * 8, wallElement->clearance_height * 8);
map_invalidate_tile(coords.x, coords.y, wallElement->GetBaseHeight(), wallElement->GetClearanceHeight());
}
auto intent = Intent(INTENT_ACTION_UPDATE_BANNER);

View File

@ -227,7 +227,7 @@ public:
{
if (surfaceElement != nullptr)
{
if (surfaceElement->GetWaterHeight() || (surfaceElement->base_height * 8) != targetHeight)
if (surfaceElement->GetWaterHeight() || (surfaceElement->GetBaseHeight()) != targetHeight)
{
return std::make_unique<SmallSceneryPlaceActionResult>(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->base_height * 8 });
map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, CoordsXYZ{ _loc, sceneryElement->GetBaseHeight() });
}
return res;

View File

@ -597,17 +597,17 @@ public:
switch (_trackType)
{
case TRACK_ELEM_WATERFALL:
map_animation_create(MAP_ANIMATION_TYPE_TRACK_WATERFALL, CoordsXYZ{ mapLoc, tileElement->base_height * 8 });
map_animation_create(MAP_ANIMATION_TYPE_TRACK_WATERFALL, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() });
break;
case TRACK_ELEM_RAPIDS:
map_animation_create(MAP_ANIMATION_TYPE_TRACK_RAPIDS, CoordsXYZ{ mapLoc, tileElement->base_height * 8 });
map_animation_create(MAP_ANIMATION_TYPE_TRACK_RAPIDS, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() });
break;
case TRACK_ELEM_WHIRLPOOL:
map_animation_create(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, CoordsXYZ{ mapLoc, tileElement->base_height * 8 });
map_animation_create(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() });
break;
case TRACK_ELEM_SPINNING_TUNNEL:
map_animation_create(
MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, tileElement->base_height * 8 });
MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, tileElement->GetBaseHeight() });
break;
}
if (track_element_has_speed_setting(_trackType))

View File

@ -78,7 +78,7 @@ public:
if (tileElement == nullptr)
break;
if (tileElement->base_height * 8 != _origin.z)
if (tileElement->GetBaseHeight() != _origin.z)
continue;
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
@ -274,7 +274,7 @@ public:
if (tileElement == nullptr)
break;
if (tileElement->base_height * 8 != _origin.z)
if (tileElement->GetBaseHeight() != _origin.z)
continue;
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)

View File

@ -148,7 +148,7 @@ public:
log_error("Surface element not found at %d, %d.", _loc.x, _loc.y);
return std::make_unique<WallPlaceActionResult>(GA_ERROR::INVALID_PARAMETERS);
}
targetHeight = surfaceElement->base_height * 8;
targetHeight = surfaceElement->GetBaseHeight();
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<WallPlaceActionResult>(GA_ERROR::INVALID_PARAMETERS);
}
targetHeight = surfaceElement->base_height * 8;
targetHeight = surfaceElement->GetBaseHeight();
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->base_height * 8, wallElement->base_height * 8 + 72);
map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->GetBaseHeight(), wallElement->GetBaseHeight() + 72);
res->Cost = wallEntry->wall.price;
return res;

View File

@ -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->base_height * 8, (wallElement->base_height * 8) + 72);
map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->GetBaseHeight(), (wallElement->GetBaseHeight()) + 72);
tile_element_remove(wallElement);
return res;

View File

@ -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->base_height * 8) - 5 > location.z)
if (element && (element->GetBaseHeight()) - 5 > location.z)
{
volumeDown = 10;
}

View File

@ -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->base_height * 8 + 3;
int32_t z = tile_element->GetBaseHeight() + 3;
uint32_t image_id = 0x20101689 + get_height_marker_offset() + (z / 16);
image_id -= gMapBaseZ;

View File

@ -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->clearance_height * 8 + 15, 16);
int32_t clearanceHeight = ceil2(tileElement->GetClearanceHeight() + 15, 16);
if (tile->flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE)
{

View File

@ -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->base_height * 8;
int32_t height2 = tile_element->GetBaseHeight();
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->base_height * 8;
uint16_t height2 = 3 + tile_element->GetBaseHeight();
if (tile_element->AsPath()->IsSloped())
{
height2 += 8;

View File

@ -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->base_height * 8;
int32_t height = tile_element->GetBaseHeight();
// If we are on a new height level, look through elements on the
// same height and store any types might be relevant to others

View File

@ -5048,7 +5048,7 @@ void Guest::UpdateRideLeaveExit()
int16_t height = map_height_from_slope(
targetLoc, tileElement->AsPath()->GetSlopeDirection(), tileElement->AsPath()->IsSloped());
height += tileElement->base_height * 8;
height += tileElement->GetBaseHeight();
int16_t z_diff = z - height;
if (z_diff > 0 || z_diff < -16)

View File

@ -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->base_height * 8 + 16 };
CoordsXYZ destination = { location.x * 32 + 16, location.y * 32 + 16, tileElement->GetBaseHeight() + 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->base_height * 8;
+ tile_element->GetBaseHeight();
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->base_height * 8;
int16_t z = tile_element->GetBaseHeight();
if (map_is_location_owned({ x, y, z }))
{
if (peep->outside_of_park == 1)

View File

@ -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->base_height * 8, surfaceElement->base_height * 8 + 16);
map_invalidate_tile_zoom0(next_x, next_y, surfaceElement->GetBaseHeight(), surfaceElement->GetBaseHeight() + 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->base_height * 8, tile_element->clearance_height * 8);
map_invalidate_tile_zoom0(actionX, actionY, tile_element->GetBaseHeight(), tile_element->GetClearanceHeight());
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->base_height * 8, tile_element->clearance_height * 8);
map_invalidate_tile_zoom0(next_x, next_y, tile_element->GetBaseHeight(), tile_element->GetClearanceHeight());
staff_bins_emptied++;
window_invalidate_flags |= PEEP_INVALIDATE_STAFF_STATS;

View File

@ -2862,7 +2862,7 @@ private:
CoordsXYZD entrance;
entrance.x = it.x * 32;
entrance.y = it.y * 32;
entrance.z = element->base_height * 8;
entrance.z = element->GetBaseHeight();
entrance.direction = element->GetDirection();
gParkEntrances.push_back(entrance);
}

View File

@ -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->base_height * 8;
int16_t nextZ = nextTrackCoordinate->z_begin - nextTrackBlock->z + tileElement->GetBaseHeight();
if (nextZ != z_start)
continue;
if (z != nullptr)
*z = tileElement->base_height * 8;
*z = tileElement->GetBaseHeight();
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->base_height * 8;
int32_t OriginZ = inputElement->GetBaseHeight();
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->base_height * 8;
int16_t nextZ = nextTrackCoordinate->z_end - nextTrackBlock->z + tileElement->GetBaseHeight();
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->base_height * 8;
outTrackBeginEnd->begin_z = tileElement->GetBaseHeight();
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->base_height * 8;
int32_t z = trackElement->GetBaseHeight();
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->base_height * 8);
window_scroll_to_location(w, trackElement.x, trackElement.y, trackElement.element->GetBaseHeight());
}
else
{
@ -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->base_height * 8;
_currentTrackBegin.z = trackElement->GetBaseHeight();
_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->base_height * 8;
int32_t z = tileElement.element->GetBaseHeight();
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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile_zoom0(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
}
}
@ -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->base_height * 8;
z = tileElement->GetBaseHeight();
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->base_height * 8;
vehicle->track_z = tileElement->GetBaseHeight();
vehicle->current_station = tileElement->AsTrack()->GetStationIndex();
z = tileElement->base_height * 8;
z = tileElement->GetBaseHeight();
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->base_height * 8;
z = tileElement->GetBaseHeight();
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->base_height * 8);
window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->GetBaseHeight());
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->base_height * 8, direction });
{ trackElement.x, trackElement.y, trackElement.element->GetBaseHeight(), direction });
trackRemoveAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
auto res = GameActions::Query(&trackRemoveAction);

View File

@ -250,7 +250,7 @@ static void ride_ratings_update_state_2()
x = nextTrackElement.x;
y = nextTrackElement.y;
z = nextTrackElement.element->base_height * 8;
z = nextTrackElement.element->GetBaseHeight();
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->base_height * 8 == gRideRatingsCalcData.proximity_z)
if (tileElement->GetBaseHeight() == gRideRatingsCalcData.proximity_z)
{
proximity_score_increment(PROXIMITY_SURFACE_TOUCH);
}

View File

@ -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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
}
TileElement* ride_get_station_start_track_element(Ride* ride, int32_t stationIndex)

View File

@ -181,7 +181,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride)
ride_get_start_of_track(&trackElement);
int32_t z = trackElement.element->base_height * 8;
int32_t z = trackElement.element->GetBaseHeight();
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->base_height * 8;
z = trackElement.element->GetBaseHeight();
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->base_height * 8 };
gTrackPreviewOrigin = { startLoc.x, startLoc.y, startLoc.element->GetBaseHeight() };
// 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->base_height * 8;
int16_t map_height = surfaceElement->GetBaseHeight();
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->base_height * 8;
int32_t height = surfaceElement->GetBaseHeight();
if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
{
height += 16;

View File

@ -218,7 +218,7 @@ static void track_design_save_add_scenery(CoordsXY loc, SmallSceneryElement* sce
track_design_save_push_tile_element(loc, reinterpret_cast<TileElement*>(sceneryElement));
track_design_save_push_tile_element_desc(
entry, { loc.x, loc.y, sceneryElement->base_height * 8 }, flags, primaryColour, secondaryColour);
entry, { loc.x, loc.y, sceneryElement->GetBaseHeight() }, 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<TileElement*>(wallElement));
track_design_save_push_tile_element_desc(
entry, { loc.x, loc.y, wallElement->base_height * 8 }, flags, primaryColour, secondaryColour);
entry, { loc.x, loc.y, wallElement->GetBaseHeight() }, 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<TileElement*>(pathElement));
track_design_save_push_tile_element_desc(entry, { loc.x, loc.y, pathElement->base_height * 8 }, flags, 0, 0);
track_design_save_push_tile_element_desc(entry, { loc.x, loc.y, pathElement->GetBaseHeight() }, 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<TileElement*>(sceneryElement));
track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, sceneryElement->base_height * 8 }, flags);
track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, sceneryElement->GetBaseHeight() }, 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<TileElement*>(wallElement));
track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, wallElement->base_height * 8 }, flags);
track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, wallElement->GetBaseHeight() }, 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<TileElement*>(pathElement));
track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, pathElement->base_height * 8 }, flags);
track_design_save_pop_tile_element_desc(entry, { loc.x, loc.y, pathElement->GetBaseHeight() }, flags);
}
/**

View File

@ -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->base_height * 8 > vehicle->z)
if (surfaceElement != nullptr && surfaceElement->GetBaseHeight() > 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->base_height * 8 <= z)
if (surfaceElement != nullptr && surfaceElement->GetBaseHeight() <= 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->base_height * 8 <= z)
if (tile_element->GetBaseHeight() <= z)
continue;
if (tile_element->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY)
@ -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->base_height * 8)
if (surfaceElement != nullptr && z > surfaceElement->GetBaseHeight())
{
rct_steam_particle* steam = &create_sprite(SPRITE_IDENTIFIER_MISC)->steam_particle;
if (steam == nullptr)
@ -7489,7 +7489,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->base_height * 8 });
MAP_ANIMATION_TYPE_TRACK_ONRIDEPHOTO, { vehicle->track_x, vehicle->track_y, tileElement->GetBaseHeight() });
}
/**

View File

@ -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->clearance_height * 8) + 32 <= z)
if ((tileElement->GetClearanceHeight()) + 32 <= z)
continue;
resultRideIndex = rideIndex;

View File

@ -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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
return;
} while (!(tileElement++)->IsLastForTile());
}

View File

@ -275,7 +275,7 @@ void footpath_get_coordinates_from_pos(
if (interactionType == VIEWPORT_INTERACTION_ITEM_FOOTPATH)
{
z = myTileElement->base_height * 8;
z = myTileElement->GetBaseHeight();
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->base_height * 8);
footpath_interrupt_peeps(x, y, tileElement->GetBaseHeight());
}
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->base_height * 8 });
map_animation_create(MAP_ANIMATION_TYPE_QUEUE_BANNER, { lastPathX, lastPathY, lastPathElement->GetBaseHeight() });
}
}
}
@ -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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
break;
} while (!(tileElement++)->IsLastForTile());
}

View File

@ -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->base_height * 8;
auto newZ = tileElement->GetBaseHeight();
// Change pattern approximately every 51 seconds
uint32_t pattern = (gCurrentTicks >> 11) & 7;

View File

@ -1672,13 +1672,13 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
seqLoc -= CoordsDirectionDelta[rotation];
break;
}
auto parkEntranceRemoveAction = ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->base_height * 8 });
auto parkEntranceRemoveAction = ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->GetBaseHeight() });
GameActions::Execute(&parkEntranceRemoveAction);
break;
}
case TILE_ELEMENT_TYPE_WALL:
{
CoordsXYZD wallLocation = { loc.x, loc.y, element->base_height * 8, element->GetDirection() };
CoordsXYZD wallLocation = { loc.x, loc.y, element->GetBaseHeight(), element->GetDirection() };
auto wallRemoveAction = WallRemoveAction(wallLocation);
GameActions::Execute(&wallRemoveAction);
}
@ -1686,7 +1686,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
{
auto removeSceneryAction = LargeSceneryRemoveAction(
{ loc.x, loc.y, element->base_height * 8, element->GetDirection() },
{ loc.x, loc.y, element->GetBaseHeight(), element->GetDirection() },
element->AsLargeScenery()->GetSequenceIndex());
GameActions::Execute(&removeSceneryAction);
}
@ -1694,7 +1694,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
case TILE_ELEMENT_TYPE_BANNER:
{
auto bannerRemoveAction = BannerRemoveAction(
{ loc.x, loc.y, element->base_height * 8, element->AsBanner()->GetPosition() });
{ loc.x, loc.y, element->GetBaseHeight(), element->AsBanner()->GetPosition() });
GameActions::Execute(&bannerRemoveAction);
break;
}
@ -1737,7 +1737,7 @@ int32_t map_get_highest_z(const CoordsXY& loc)
if (surfaceElement == nullptr)
return -1;
z = surfaceElement->base_height * 8;
z = surfaceElement->GetBaseHeight();
// 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 +1934,7 @@ bool sign_set_colour(
tileElement->SetPrimaryColour(mainColour);
tileElement->SetSecondaryColour(textColour);
map_invalidate_tile(x, y, tileElement->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
}
}
@ -2017,7 +2017,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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
}
void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs)

View File

@ -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->clearance_height * 8);
map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceHeight());
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->clearance_height * 8);
map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceHeight());
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->clearance_height * 8);
map_invalidate_tile_zoom1(loc.x, loc.y, loc.z, tileElement->GetClearanceHeight());
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->base_height * 8 };
auto loc = CoordsXYZ{ it.x * 32, it.y * 32, el->GetBaseHeight() };
switch (el->GetType())
{
case TILE_ELEMENT_TYPE_BANNER:

View File

@ -166,7 +166,7 @@ void update_park_fences(const CoordsXY coords)
if (surfaceElement->GetParkFences() != newFences)
{
int32_t z0 = surfaceElement->base_height * 8;
int32_t z0 = surfaceElement->GetBaseHeight();
int32_t z1 = z0 + 16;
map_invalidate_tile(coords.x, coords.y, z0, z1);
surfaceElement->SetParkFences(newFences);

View File

@ -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->base_height * 8, tileElementAbove->clearance_height * 8);
map_invalidate_tile_zoom1(x, y, tileElementAbove->GetBaseHeight(), tileElementAbove->GetClearanceHeight());
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->base_height * 8, tileElement->clearance_height * 8);
map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetClearanceHeight());
}
/**

View File

@ -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)->base_height * 8, (*tile_element)->clearance_height * 8);
map_invalidate_tile(x, y, (*tile_element)->GetBaseHeight(), (*tile_element)->GetClearanceHeight());
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, base_height * 8, clearance_height * 8);
map_invalidate_tile_zoom1(x, y, GetBaseHeight(), GetClearanceHeight());
}
}
}

View File

@ -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->base_height * 8;
int32_t pathZ = tileElement->GetBaseHeight();
if (pathZ < z || pathZ >= z + 32)
continue;

View File

@ -92,7 +92,7 @@ void SurfaceElement::SetGrassLengthAndInvalidate(uint8_t length, CoordsXY coords
return;
}
int32_t z = base_height * 8;
int32_t z = GetBaseHeight();
map_invalidate_tile(coords.x, coords.y, z, z + 16);
}

View File

@ -224,3 +224,13 @@ void TileElementBase::SetOccupiedQuadrants(uint8_t quadrants)
flags &= ~TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK;
flags |= (quadrants & TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK);
}
int32_t TileElementBase::GetBaseHeight() const
{
return base_height * 8;
}
int32_t TileElementBase::GetClearanceHeight() const
{
return clearance_height * 8;
}

View File

@ -78,6 +78,8 @@ struct TileElementBase
void Remove();
uint8_t GetOccupiedQuadrants() const;
void SetOccupiedQuadrants(uint8_t quadrants);
int32_t GetBaseHeight() const;
int32_t GetClearanceHeight() const;
};
/**

View File

@ -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->base_height * 8;
int16_t originZ = trackElement->GetBaseHeight();
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->base_height * 8;
int16_t originZ = trackElement->GetBaseHeight();
uint8_t rotation = trackElement->GetDirection();
auto rideIndex = trackElement->AsTrack()->GetRideIndex();
auto ride = get_ride(rideIndex);

View File

@ -53,7 +53,7 @@ repeat:
continue;
tile_element_remove_banner_entry(tileElement);
map_invalidate_tile_zoom1(x, y, tileElement->base_height * 8, tileElement->base_height * 8 + 72);
map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetBaseHeight() + 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->base_height * 8, tileElement->base_height * 8 + 72);
map_invalidate_tile_zoom1(x, y, tileElement->GetBaseHeight(), tileElement->GetBaseHeight() + 72);
tile_element_remove(tileElement);
tileElement--;
} while (!(tileElement++)->IsLastForTile());

View File

@ -463,3 +463,13 @@ void TileElementBase::SetOccupiedQuadrants(uint8_t quadrants)
flags &= ~TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK;
flags |= (quadrants & TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK);
}
int32_t TileElementBase::GetBaseHeight() const
{
return base_height * 8;
}
int32_t TileElementBase::GetClearanceHeight() const
{
return clearance_height * 8;
}