forked from rosebudai/OpenRCT2-Web
Merge pull request #10414 from Gymnasiast/refactor/getter-base-height
Create getters for GetBaseHeight()/GetClearanceHeight()
This commit is contained in:
61 files changed
+181
-164
No files matched your search
@@ -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->GetBaseZ() }, 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->GetBaseZ();
|
||||
|
||||
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->GetBaseZ() == 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->GetBaseZ() });
|
||||
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->GetBaseZ() });
|
||||
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->GetBaseZ(), 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->GetBaseZ(), tileElement->GetDirection() },
|
||||
tileElement->AsLargeScenery()->GetSequenceIndex());
|
||||
GameActions::Execute(&removeSceneryAction);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ rct_window* window_banner_open(rct_windownumber number)
|
||||
tile_element++;
|
||||
}
|
||||
|
||||
int32_t view_z = tile_element->base_height << 3;
|
||||
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->base_height * 8, tile_element->AsBanner()->GetPosition() });
|
||||
{ x, y, tile_element->GetBaseZ(), tile_element->AsBanner()->GetPosition() });
|
||||
GameActions::Execute(&bannerRemoveAction);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1046,7 +1046,7 @@ static void footpath_remove_tile_element(TileElement* tileElement)
|
||||
}
|
||||
}
|
||||
|
||||
gFootpathConstructFromPosition.z = tileElement->base_height * 8;
|
||||
gFootpathConstructFromPosition.z = tileElement->GetBaseZ();
|
||||
// Remove path
|
||||
footpath_remove(gFootpathConstructFromPosition, GAME_COMMAND_FLAG_APPLY);
|
||||
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
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->base_height * 8;
|
||||
mapZ = tileElement->GetBaseZ();
|
||||
|
||||
auto gameAction = PlacePeepSpawnAction({ mapX, mapY, mapZ, static_cast<Direction>(direction) });
|
||||
auto result = GameActions::Execute(&gameAction);
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
z = tileElement->GetBaseZ();
|
||||
direction = tileElement->GetDirection();
|
||||
auto gameAction = RideSetColourSchemeAction(
|
||||
CoordsXYZD{ x, y, z, static_cast<Direction>(direction) }, tileElement->AsTrack()->GetTrackType(), newColourScheme);
|
||||
|
||||
@@ -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->GetBaseZ()) - 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->GetBaseZ();
|
||||
_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->GetBaseZ(), 16);
|
||||
mapZ += _trackPlaceShiftZ;
|
||||
mapZ = std::max<int16_t>(mapZ, 16);
|
||||
_trackPlaceZ = mapZ;
|
||||
@@ -2432,8 +2432,8 @@ static void sub_6CBCE2(
|
||||
CoordsXY offsets = { trackBlock->x, trackBlock->y };
|
||||
CoordsXY coords = originCoords + offsets.Rotate(trackDirection);
|
||||
|
||||
int32_t baseZ = (originZ + trackBlock->z) >> 3;
|
||||
int32_t clearanceZ = ((trackBlock->var_07 + RideData5[ride->type].clearance_height) >> 3) + baseZ + 4;
|
||||
int32_t baseZ = originZ + trackBlock->z;
|
||||
int32_t clearanceZ = trackBlock->var_07 + RideData5[ride->type].clearance_height + baseZ + (4 * 8);
|
||||
|
||||
auto centreTileCoords = TileCoordsXY{ coords };
|
||||
auto eastTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_EAST];
|
||||
@@ -2459,8 +2459,8 @@ static void sub_6CBCE2(
|
||||
_tempTrackTileElement.AsTrack()->SetHasChain((liftHillAndInvertedState & CONSTRUCTION_LIFT_HILL_SELECTED) != 0);
|
||||
_tempTrackTileElement.SetOccupiedQuadrants(quarterTile.GetBaseQuarterOccupied());
|
||||
_tempTrackTileElement.SetLastForTile(true);
|
||||
_tempTrackTileElement.base_height = baseZ;
|
||||
_tempTrackTileElement.clearance_height = clearanceZ;
|
||||
_tempTrackTileElement.base_height = baseZ / 8;
|
||||
_tempTrackTileElement.clearance_height = clearanceZ / 8;
|
||||
_tempTrackTileElement.AsTrack()->SetTrackType(trackType);
|
||||
_tempTrackTileElement.AsTrack()->SetSequenceIndex(trackBlock->index);
|
||||
_tempTrackTileElement.AsTrack()->SetHasCableLift(false);
|
||||
|
||||
@@ -179,7 +179,7 @@ rct_window* window_sign_open(rct_windownumber number)
|
||||
tile_element++;
|
||||
}
|
||||
|
||||
int32_t view_z = tile_element->base_height << 3;
|
||||
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->base_height * 8, 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->base_height << 3;
|
||||
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->base_height * 8, tile_element->GetDirection() };
|
||||
CoordsXYZD wallLocation = { x, y, tile_element->GetBaseZ(), tile_element->GetDirection() };
|
||||
auto wallRemoveAction = WallRemoveAction(wallLocation);
|
||||
GameActions::Execute(&wallRemoveAction);
|
||||
break;
|
||||
|
||||
@@ -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->GetBaseZ());
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, &parkEntranceIndex, COLOUR_WHITE, x, y + 11);
|
||||
}
|
||||
|
||||
@@ -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->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->base_height * 8, 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->base_height * 8, 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->base_height * 8, 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->base_height * 8;
|
||||
gSceneryCtrlPressZ = tile_element->GetBaseZ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1368,7 +1368,7 @@ static void sub_6E1F34(
|
||||
return;
|
||||
}
|
||||
|
||||
int16_t z = (surfaceElement->base_height * 8) & 0xFFF0;
|
||||
int16_t z = (surfaceElement->GetBaseZ()) & 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->GetBaseZ()) & 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->GetBaseZ()) & 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->GetBaseZ()) & 0xFFF0;
|
||||
z += gSceneryShiftPressZOffset;
|
||||
|
||||
z = std::clamp<int16_t>(z, 16, maxPossibleHeight);
|
||||
|
||||
@@ -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->GetBaseZ();
|
||||
|
||||
// Increase Z above slope
|
||||
if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
|
||||
|
||||
@@ -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->GetBaseZ() });
|
||||
|
||||
rct_scenery_entry* bannerEntry = get_banner_entry(_bannerType);
|
||||
if (bannerEntry == nullptr)
|
||||
|
||||
@@ -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->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->base_height * 8 }, 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->base_height * 8, 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->base_height * 8, tileElement->GetDirection() },
|
||||
{ tilePos, tileElement->GetBaseZ(), tileElement->GetDirection() },
|
||||
tileElement->AsLargeScenery()->GetSequenceIndex());
|
||||
removeSceneryAction.SetFlags(GetFlags() | GAME_COMMAND_FLAG_PATH_SCENERY);
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ private:
|
||||
continue;
|
||||
|
||||
auto bannerRemoveAction = BannerRemoveAction(
|
||||
{ x, y, tileElement->base_height * 8, tileElement->AsBanner()->GetPosition() });
|
||||
{ x, y, tileElement->GetBaseZ(), tileElement->AsBanner()->GetPosition() });
|
||||
bool isGhost = tileElement->IsGhost();
|
||||
auto bannerFlags = GetFlags() | (isGhost ? static_cast<uint32_t>(GAME_COMMAND_FLAG_GHOST) : 0);
|
||||
bannerRemoveAction.SetFlags(bannerFlags);
|
||||
|
||||
@@ -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->GetBaseZ();
|
||||
map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16);
|
||||
}
|
||||
res->Cost = gConstructionRightsPrice;
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
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->base_height * 8;
|
||||
uint16_t baseHeight = surfaceElement->GetBaseZ();
|
||||
map_invalidate_tile(loc.x, loc.y, baseHeight, baseHeight + 16);
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -364,7 +364,7 @@ private:
|
||||
if (surfaceElement == nullptr)
|
||||
continue;
|
||||
|
||||
int32_t height = surfaceElement->base_height * 8;
|
||||
int32_t height = surfaceElement->GetBaseZ();
|
||||
int32_t slope = surfaceElement->GetSlope();
|
||||
|
||||
if (slope & 0xF)
|
||||
|
||||
@@ -334,8 +334,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
map_invalidate_tile(
|
||||
floor2(_loc.x, 32), floor2(_loc.y, 32), tileElement->base_height * 8, tileElement->clearance_height * 8);
|
||||
map_invalidate_tile(floor2(_loc.x, 32), floor2(_loc.y, 32), tileElement->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
|
||||
if ((tileElement->AsTrack()->GetMazeEntry() & 0x8888) == 0x8888)
|
||||
{
|
||||
|
||||
@@ -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->GetBaseZ(), entranceElement->GetClearanceZ());
|
||||
entranceElement->Remove();
|
||||
update_park_fences({ loc.x, loc.y });
|
||||
}
|
||||
|
||||
@@ -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->GetBaseZ(), newElement->GetClearanceZ());
|
||||
|
||||
if (index == 0)
|
||||
{
|
||||
|
||||
@@ -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->GetBaseZ();
|
||||
|
||||
uint8_t rotation = it.element->GetDirection();
|
||||
uint8_t type = it.element->AsTrack()->GetTrackType();
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
uint16_t baseHeight = surfaceElement->GetBaseZ();
|
||||
map_invalidate_tile(x, y, baseHeight, baseHeight + 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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->GetBaseZ(), wallElement->GetClearanceZ());
|
||||
}
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_UPDATE_BANNER);
|
||||
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
{
|
||||
if (surfaceElement != nullptr)
|
||||
{
|
||||
if (surfaceElement->GetWaterHeight() || (surfaceElement->base_height * 8) != targetHeight)
|
||||
if (surfaceElement->GetWaterHeight() || (surfaceElement->GetBaseZ()) != 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->GetBaseZ() });
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -597,17 +597,16 @@ 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->GetBaseZ() });
|
||||
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->GetBaseZ() });
|
||||
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->GetBaseZ() });
|
||||
break;
|
||||
case TRACK_ELEM_SPINNING_TUNNEL:
|
||||
map_animation_create(
|
||||
MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, tileElement->base_height * 8 });
|
||||
map_animation_create(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, tileElement->GetBaseZ() });
|
||||
break;
|
||||
}
|
||||
if (track_element_has_speed_setting(_trackType))
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
if (tileElement == nullptr)
|
||||
break;
|
||||
|
||||
if (tileElement->base_height * 8 != _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->base_height * 8 != _origin.z)
|
||||
if (tileElement->GetBaseZ() != _origin.z)
|
||||
continue;
|
||||
|
||||
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
||||
|
||||
@@ -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->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<WallPlaceActionResult>(GA_ERROR::INVALID_PARAMETERS);
|
||||
}
|
||||
targetHeight = surfaceElement->base_height * 8;
|
||||
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->base_height * 8, wallElement->base_height * 8 + 72);
|
||||
map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72);
|
||||
|
||||
res->Cost = wallEntry->wall.price;
|
||||
return res;
|
||||
|
||||
@@ -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->GetBaseZ(), (wallElement->GetBaseZ()) + 72);
|
||||
tile_element_remove(wallElement);
|
||||
|
||||
return res;
|
||||
|
||||
@@ -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->GetBaseZ()) - 5 > location.z)
|
||||
{
|
||||
volumeDown = 10;
|
||||
}
|
||||
|
||||
@@ -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->GetBaseZ() + 3;
|
||||
uint32_t image_id = 0x20101689 + get_height_marker_offset() + (z / 16);
|
||||
image_id -= gMapBaseZ;
|
||||
|
||||
|
||||
@@ -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->GetClearanceZ() + 15, 16);
|
||||
|
||||
if (tile->flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE)
|
||||
{
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
uint16_t height2 = 3 + tile_element->GetBaseZ();
|
||||
if (tile_element->AsPath()->IsSloped())
|
||||
{
|
||||
height2 += 8;
|
||||
|
||||
@@ -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->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
|
||||
|
||||
@@ -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->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->base_height << 3, tileElement->clearance_height << 3);
|
||||
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->base_height << 3) + 32, tileElement->base_height << 3);
|
||||
map_invalidate_tile_zoom1(peep->next_x, peep->next_y, (tileElement->GetBaseZ()) + 32, tileElement->GetBaseZ());
|
||||
|
||||
peep->angriness = 16;
|
||||
}
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
+ 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->base_height * 8;
|
||||
int16_t z = tile_element->GetBaseZ();
|
||||
if (map_is_location_owned({ x, y, z }))
|
||||
{
|
||||
if (peep->outside_of_park == 1)
|
||||
|
||||
@@ -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->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->base_height * 8, tile_element->clearance_height * 8);
|
||||
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->base_height * 8, tile_element->clearance_height * 8);
|
||||
map_invalidate_tile_zoom0(next_x, next_y, tile_element->GetBaseZ(), tile_element->GetClearanceZ());
|
||||
|
||||
staff_bins_emptied++;
|
||||
window_invalidate_flags |= PEEP_INVALIDATE_STAFF_STATS;
|
||||
|
||||
@@ -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->GetBaseZ();
|
||||
entrance.direction = element->GetDirection();
|
||||
gParkEntrances.push_back(entrance);
|
||||
}
|
||||
|
||||
+18
-18
@@ -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->GetBaseZ();
|
||||
if (nextZ != z_start)
|
||||
continue;
|
||||
|
||||
if (z != nullptr)
|
||||
*z = tileElement->base_height * 8;
|
||||
*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->base_height * 8;
|
||||
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->base_height * 8;
|
||||
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->base_height * 8;
|
||||
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->base_height * 8;
|
||||
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->base_height * 8);
|
||||
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->base_height << 3);
|
||||
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->base_height << 3);
|
||||
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->base_height * 8;
|
||||
_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->base_height * 8;
|
||||
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->base_height * 8, tileElement->clearance_height * 8);
|
||||
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->base_height * 8;
|
||||
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->base_height * 8;
|
||||
vehicle->track_z = tileElement->GetBaseZ();
|
||||
|
||||
vehicle->current_station = tileElement->AsTrack()->GetStationIndex();
|
||||
z = tileElement->base_height * 8;
|
||||
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->base_height * 8;
|
||||
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->base_height * 8);
|
||||
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->base_height * 8, direction });
|
||||
{ trackElement.x, trackElement.y, trackElement.element->GetBaseZ(), direction });
|
||||
trackRemoveAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
|
||||
|
||||
auto res = GameActions::Query(&trackRemoveAction);
|
||||
|
||||
@@ -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->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->base_height * 8 == gRideRatingsCalcData.proximity_z)
|
||||
if (tileElement->GetBaseZ() == gRideRatingsCalcData.proximity_z)
|
||||
{
|
||||
proximity_score_increment(PROXIMITY_SURFACE_TOUCH);
|
||||
}
|
||||
|
||||
@@ -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->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
}
|
||||
|
||||
TileElement* ride_get_station_start_track_element(Ride* ride, int32_t stationIndex)
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
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->base_height * 8 };
|
||||
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->base_height * 8;
|
||||
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->base_height * 8;
|
||||
int32_t height = surfaceElement->GetBaseZ();
|
||||
if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
|
||||
{
|
||||
height += 16;
|
||||
|
||||
@@ -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->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<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->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<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->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<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->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<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->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<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->GetBaseZ() }, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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->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->base_height * 8 <= 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->base_height * 8 <= 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 / 8 < tileElement->base_height)
|
||||
if (z < tileElement->GetBaseZ())
|
||||
continue;
|
||||
|
||||
if (z / 8 >= tileElement->clearance_height)
|
||||
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->base_height * 8)
|
||||
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->base_height * 8 });
|
||||
map_animation_create(MAP_ANIMATION_TYPE_TRACK_ONRIDEPHOTO, { vehicle->track_x, vehicle->track_y, tileElement->GetBaseZ() });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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->clearance_height != nextTileElement->base_height)
|
||||
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);
|
||||
|
||||
@@ -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->clearance_height != nextTileElement->base_height)
|
||||
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);
|
||||
|
||||
@@ -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->clearance_height != nextTileElement->base_height)
|
||||
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);
|
||||
|
||||
@@ -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->GetClearanceZ()) + 32 <= z)
|
||||
continue;
|
||||
|
||||
resultRideIndex = rideIndex;
|
||||
|
||||
@@ -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->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->base_height * 8, tileElement->clearance_height * 8);
|
||||
map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
return;
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ void footpath_get_coordinates_from_pos(
|
||||
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_FOOTPATH)
|
||||
{
|
||||
z = myTileElement->base_height * 8;
|
||||
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->base_height * 8);
|
||||
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->base_height * 8 });
|
||||
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->base_height * 8, tileElement->clearance_height * 8);
|
||||
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->base_height * 8, tileElement->clearance_height * 8);
|
||||
map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
break;
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
}
|
||||
|
||||
@@ -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->GetBaseZ();
|
||||
|
||||
// Change pattern approximately every 51 seconds
|
||||
uint32_t pattern = (gCurrentTicks >> 11) & 7;
|
||||
|
||||
@@ -416,7 +416,7 @@ int16_t tile_element_height(const CoordsXY& loc)
|
||||
return 16;
|
||||
}
|
||||
|
||||
uint16_t height = (surfaceElement->base_height << 3);
|
||||
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->base_height * 8 });
|
||||
auto parkEntranceRemoveAction = ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->GetBaseZ() });
|
||||
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->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->base_height * 8, 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->base_height * 8, 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->base_height * 8;
|
||||
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->base_height * 8, tileElement->clearance_height * 8);
|
||||
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->base_height * 8, tileElement->clearance_height * 8);
|
||||
map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
}
|
||||
|
||||
void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs)
|
||||
|
||||
@@ -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->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->clearance_height * 8);
|
||||
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->clearance_height * 8);
|
||||
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->base_height * 8 };
|
||||
auto loc = CoordsXYZ{ it.x * 32, it.y * 32, el->GetBaseZ() };
|
||||
switch (el->GetType())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
|
||||
@@ -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->GetBaseZ();
|
||||
int32_t z1 = z0 + 16;
|
||||
map_invalidate_tile(coords.x, coords.y, z0, z1);
|
||||
surfaceElement->SetParkFences(newFences);
|
||||
|
||||
@@ -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->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->base_height * 8, tileElement->clearance_height * 8);
|
||||
map_invalidate_tile_zoom1(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)->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, base_height * 8, clearance_height * 8);
|
||||
map_invalidate_tile_zoom1(x, y, GetBaseZ(), GetClearanceZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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->GetBaseZ();
|
||||
if (pathZ < z || pathZ >= z + 32)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ void SurfaceElement::SetGrassLengthAndInvalidate(uint8_t length, CoordsXY coords
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t z = base_height * 8;
|
||||
int32_t z = GetBaseZ();
|
||||
map_invalidate_tile(coords.x, coords.y, z, z + 16);
|
||||
}
|
||||
|
||||
|
||||
@@ -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::GetBaseZ() const
|
||||
{
|
||||
return base_height * 8;
|
||||
}
|
||||
|
||||
int32_t TileElementBase::GetClearanceZ() const
|
||||
{
|
||||
return clearance_height * 8;
|
||||
}
|
||||
@@ -78,6 +78,8 @@ struct TileElementBase
|
||||
void Remove();
|
||||
uint8_t GetOccupiedQuadrants() const;
|
||||
void SetOccupiedQuadrants(uint8_t quadrants);
|
||||
int32_t GetBaseZ() const;
|
||||
int32_t GetClearanceZ() const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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->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->base_height * 8;
|
||||
int16_t originZ = trackElement->GetBaseZ();
|
||||
uint8_t rotation = trackElement->GetDirection();
|
||||
auto rideIndex = trackElement->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
|
||||
@@ -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->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->base_height * 8, tileElement->base_height * 8 + 72);
|
||||
map_invalidate_tile_zoom1(x, y, tileElement->GetBaseZ(), tileElement->GetBaseZ() + 72);
|
||||
tile_element_remove(tileElement);
|
||||
tileElement--;
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
|
||||
@@ -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::GetBaseZ() const
|
||||
{
|
||||
return base_height * 8;
|
||||
}
|
||||
|
||||
int32_t TileElementBase::GetClearanceZ() const
|
||||
{
|
||||
return clearance_height * 8;
|
||||
}
|
||||
Reference in new issue
Block a user