Next chunk of World/Map.h snakes (#18296)

* Next chunk of World/Map.h snakes

* Apply clang-format
This commit is contained in:
Duncan 2022-10-12 06:35:20 +01:00 committed by GitHub
parent cf9ab633a2
commit 7dd8989e70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
106 changed files with 394 additions and 397 deletions

View File

@ -356,7 +356,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
else
{
// FIXME: Why does it *2 the value?
if (!gCheatsSandboxMode && !map_is_location_owned({ info.Loc, tileElement->GetBaseZ() * 2 }))
if (!gCheatsSandboxMode && !MapIsLocationOwned({ info.Loc, tileElement->GetBaseZ() * 2 }))
{
info.SpriteType = ViewportInteractionItem::None;
return info;
@ -793,7 +793,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo
int16_t z = waterHeight;
if (info.SpriteType != ViewportInteractionItem::Water)
{
z = tile_element_height(mapPos);
z = TileElementHeight(mapPos);
}
mapPos = viewport_coord_to_map_coord(initialVPPos, z);
mapPos.x = std::clamp(mapPos.x, initialPos.x, initialPos.x + 31);

View File

@ -52,7 +52,7 @@ namespace OpenRCT2::Scripting
void range_set(DukValue value)
{
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
if (value.type() == DukValue::Type::OBJECT)
{
auto range = GetMapRange(value);
@ -70,7 +70,7 @@ namespace OpenRCT2::Scripting
{
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
}
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
DukValue tiles_get() const
@ -95,7 +95,7 @@ namespace OpenRCT2::Scripting
void tiles_set(DukValue value)
{
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectionTiles.clear();
if (value.is_array())
{
@ -125,7 +125,7 @@ namespace OpenRCT2::Scripting
{
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
}
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
}
static void Register(duk_context* ctx)

View File

@ -294,7 +294,7 @@ namespace OpenRCT2::Scripting
return CoordsXYZ(x, y, dukZ.as_int());
}
auto z = tile_element_height(CoordsXY(x, y));
auto z = TileElementHeight(CoordsXY(x, y));
return CoordsXYZ(x, y, z);
}
}

View File

@ -182,7 +182,7 @@ public:
{
FootpathProvisionalUpdate();
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
window_invalidate_by_class(WindowClass::TopToolbar);
hide_gridlines();
@ -293,7 +293,7 @@ public:
_windowFootpathCost = MONEY32_UNDEFINED;
tool_cancel();
FootpathProvisionalUpdate();
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND;
tool_set(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown);
@ -310,7 +310,7 @@ public:
_windowFootpathCost = MONEY32_UNDEFINED;
tool_cancel();
FootpathProvisionalUpdate();
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL;
tool_set(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair);
@ -765,7 +765,7 @@ private:
*/
void WindowFootpathSetProvisionalPathAtPoint(const ScreenCoordsXY& screenCoords)
{
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
auto info = get_map_coordinates_from_pos(
@ -846,7 +846,7 @@ private:
int32_t direction;
TileElement* tileElement;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
@ -878,7 +878,7 @@ private:
gMapSelectArrowPosition = CoordsXYZ{ mapCoords, z };
gMapSelectArrowDirection = direction;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
/**
@ -1115,7 +1115,7 @@ private:
TileElement* tileElement;
int32_t z, zLow;
if (!map_is_location_valid(gFootpathConstructFromPosition))
if (!MapIsLocationValid(gFootpathConstructFromPosition))
{
return nullptr;
}
@ -1188,7 +1188,7 @@ private:
{
if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL)
{
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags |= MAP_SELECT_FLAG_GREEN;
@ -1196,7 +1196,7 @@ private:
gMapSelectionTiles.clear();
gMapSelectionTiles.push_back({ gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x,
gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y });
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
}
uint64_t pressedWidgets = pressed_widgets

View File

@ -913,7 +913,7 @@ private:
if (widgetIndex != WIDX_PICKUP)
return;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
@ -924,7 +924,7 @@ private:
gMapSelectType = MAP_SELECT_TYPE_FULL;
gMapSelectPositionA = mapCoords;
gMapSelectPositionB = mapCoords;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
gPickupPeepImage = ImageId();

View File

@ -236,7 +236,7 @@ public:
void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override
{
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
auto mapTile = screen_get_map_xy(screenCoords, nullptr);
@ -303,7 +303,7 @@ public:
state_changed++;
}
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
if (!state_changed)
return;

View File

@ -427,7 +427,7 @@ public:
void SetLandRightsToolUpdate(const ScreenCoordsXY& screenCoords)
{
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
auto mapCoords = screen_get_map_xy(screenCoords, nullptr);
if (!mapCoords.has_value())
@ -447,7 +447,7 @@ public:
gMapSelectPositionA = *mapCoords;
gMapSelectPositionB.x = mapCoords->x + size;
gMapSelectPositionB.y = mapCoords->y + size;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
CoordsXYZD PlaceParkEntranceGetMapPosition(const ScreenCoordsXY& screenCoords)
@ -484,8 +484,8 @@ public:
void PlaceParkEntranceToolUpdate(const ScreenCoordsXY& screenCoords)
{
map_invalidate_selection_rect();
map_invalidate_map_selection_tiles();
MapInvalidateSelectionRect();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
@ -508,7 +508,7 @@ public:
gMapSelectArrowDirection = parkEntrancePosition.direction;
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT | MAP_SELECT_FLAG_ENABLE_ARROW;
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
if (gParkEntranceGhostExists && parkEntrancePosition == gParkEntranceGhostPosition)
{
return;
@ -547,7 +547,7 @@ public:
{
int32_t direction;
TileElement* tileElement;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement);
@ -570,7 +570,7 @@ public:
gMapSelectPositionB = mapCoords;
gMapSelectArrowPosition = CoordsXYZ{ mapCoords, mapZ };
gMapSelectArrowDirection = DirectionReverse(direction);
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
void SetPeepSpawnToolDown(const ScreenCoordsXY& screenCoords)
@ -648,7 +648,7 @@ public:
{
CoordsXY c = ScreenToMap(screenCoords);
auto mapCoords = CoordsXY{ std::clamp(c.x, 0, MAXIMUM_MAP_SIZE_BIG - 1), std::clamp(c.y, 0, MAXIMUM_MAP_SIZE_BIG - 1) };
auto mapZ = tile_element_height(mapCoords);
auto mapZ = TileElementHeight(mapCoords);
rct_window* mainWindow = window_get_main();
if (mainWindow != nullptr)
@ -664,12 +664,12 @@ public:
int32_t radius = (landToolSize * 16) - 16;
mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart();
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
gMapSelectType = MAP_SELECT_TYPE_FULL;
gMapSelectPositionA = mapCoords;
gMapSelectPositionB = mapCoords + CoordsXY{ size, size };
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
auto surfaceSetStyleAction = SurfaceSetStyleAction(
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
@ -684,12 +684,12 @@ public:
int32_t radius = (landRightsToolSize * 16) - 16;
mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart();
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
gMapSelectType = MAP_SELECT_TYPE_FULL;
gMapSelectPositionA = mapCoords;
gMapSelectPositionB = mapCoords + CoordsXY{ size, size };
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
auto landSetRightsAction = LandSetRightsAction(
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
@ -1037,7 +1037,7 @@ private:
for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++)
{
if (!map_is_edge({ x, y }))
if (!MapIsEdge({ x, y }))
{
uint16_t colour = 0;
switch (selected_tab)

View File

@ -104,7 +104,7 @@ public:
ride_construction_invalidate_current_track();
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
@ -333,7 +333,7 @@ private:
{
ride_construction_invalidate_current_track();
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;

View File

@ -176,14 +176,14 @@ public:
if (stateChanged)
{
// Invalidate previous area
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
// Update and invalidate new area
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
gMapSelectType = MAP_SELECT_TYPE_FULL;
gMapSelectPositionA = posA;
gMapSelectPositionB = posB;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
}

View File

@ -249,7 +249,7 @@ public:
ride_construction_invalidate_current_track();
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
@ -2138,7 +2138,7 @@ public:
int32_t trackType, trackDirection;
CoordsXYZ trackPos{};
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags |= MAP_SELECT_FLAG_GREEN;
@ -2170,7 +2170,7 @@ public:
if (get_ride(_currentRideIndex))
{
SelectMapTiles(trackType, trackDirection, trackPos);
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
}
}
@ -2543,7 +2543,7 @@ private:
void ToolDownEntranceExit(const ScreenCoordsXY& screenCoords)
{
ride_construction_invalidate_current_track();
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
@ -3206,7 +3206,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
int32_t z;
const rct_preview_track* trackBlock;
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
@ -3214,7 +3214,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
if (!mapCoords)
{
ride_construction_invalidate_current_track();
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
return;
}
@ -3236,7 +3236,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr))
{
ride_construction_invalidate_current_track();
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
return;
}
_currentTrackPieceType = trackType;
@ -3268,7 +3268,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
int32_t highestZ = 0;
for (const auto& selectedTile : gMapSelectionTiles)
{
if (map_is_location_valid(selectedTile))
if (MapIsLocationValid(selectedTile))
{
z = map_get_highest_z(selectedTile);
if (z > highestZ)
@ -3296,7 +3296,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
_currentTrackBegin.z = z;
if ((_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) && _currentTrackBegin == _previousTrackPiece)
{
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
return;
}
@ -3325,7 +3325,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION);
context_broadcast_intent(&intent);
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
return;
}
@ -3357,7 +3357,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
for (int8_t i = 0; i < NumOrthogonalDirections; i++)
{
const auto testLoc = CoordsXYZ{ *mapCoords + CoordsDirectionDelta[i], z };
if (!map_is_location_owned(testLoc))
if (!MapIsLocationOwned(testLoc))
{
pathsByDir[i] = nullptr;
continue;
@ -3416,7 +3416,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
}
window_ride_construction_update_active_elements();
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
}
/**
@ -3425,8 +3425,8 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
*/
void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoords)
{
map_invalidate_selection_rect();
map_invalidate_map_selection_tiles();
MapInvalidateSelectionRect();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
@ -3443,7 +3443,7 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor
gMapSelectPositionB = entranceOrExitCoords;
gMapSelectArrowPosition = entranceOrExitCoords;
gMapSelectArrowDirection = DirectionReverse(entranceOrExitCoords.direction);
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
entranceOrExitCoords.direction = DirectionReverse(gRideEntranceExitPlaceDirection);
StationIndex stationNum = gRideEntranceExitPlaceStationIndex;
@ -3470,7 +3470,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords)
rct_window* w;
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
ride_construction_invalidate_current_track();
CoordsXYZ mapCoords{};
@ -3488,7 +3488,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords)
{
for (const auto& selectedTile : gMapSelectionTiles)
{
if (!map_is_location_valid(selectedTile))
if (!MapIsLocationValid(selectedTile))
continue;
z = map_get_highest_z(selectedTile);

View File

@ -651,7 +651,7 @@ private:
if (widgetIndex != WIDX_PICKUP)
return;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
@ -662,7 +662,7 @@ private:
gMapSelectType = MAP_SELECT_TYPE_FULL;
gMapSelectPositionA = mapCoords;
gMapSelectPositionB = mapCoords;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
gPickupPeepImage = ImageId();

View File

@ -923,7 +923,7 @@ public:
void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override
{
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
CoordsXY mapCoords;
@ -953,7 +953,7 @@ public:
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectType = MAP_SELECT_TYPE_FULL;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override

View File

@ -2012,7 +2012,7 @@ static uint8_t TopToolbarToolUpdateLandPaint(const ScreenCoordsXY& screenPos)
{
uint8_t state_changed = 0;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
auto mapTile = screen_get_map_xy(screenPos, nullptr);
@ -2074,7 +2074,7 @@ static uint8_t TopToolbarToolUpdateLandPaint(const ScreenCoordsXY& screenPos)
state_changed++;
}
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
return state_changed;
}
@ -2105,7 +2105,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
{
const bool mapCtrlPressed = InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z);
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
if (gCurrentToolId == Tool::UpDownArrow)
{
@ -2194,7 +2194,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
state_changed++;
}
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
if (!state_changed)
return;
@ -2320,7 +2320,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
state_changed++;
}
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
if (!state_changed)
return;
@ -2341,7 +2341,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos)
*/
static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos)
{
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
if (gCurrentToolId == Tool::UpDownArrow)
{
@ -2436,7 +2436,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos)
state_changed++;
}
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
if (!state_changed)
return;
@ -2608,8 +2608,8 @@ static money64 TryPlaceGhostBanner(CoordsXYZD loc, ObjectEntryIndex entryIndex)
*/
static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos)
{
map_invalidate_selection_rect();
map_invalidate_map_selection_tiles();
MapInvalidateSelectionRect();
MapInvalidateMapSelectionTiles();
if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off)
{
@ -2679,7 +2679,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos)
gMapSelectType = MAP_SELECT_TYPE_QUARTER_0 + (quadrant ^ 2);
}
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
// If no change in ghost placement
if ((gSceneryGhostType & SCENERY_GHOST_FLAG_0) && mapTile == gSceneryGhostPosition && quadrant == _unkF64F0E
@ -2734,7 +2734,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos)
gMapSelectPositionB.y = mapTile.y;
gMapSelectType = MAP_SELECT_TYPE_FULL;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
// If no change in ghost placement
if ((gSceneryGhostType & SCENERY_GHOST_FLAG_1) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z)
@ -2769,7 +2769,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos)
gMapSelectPositionB.y = mapTile.y;
gMapSelectType = MAP_SELECT_TYPE_EDGE_0 + edge;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
// If no change in ghost placement
if ((gSceneryGhostType & SCENERY_GHOST_FLAG_2) && mapTile == gSceneryGhostPosition
@ -2833,7 +2833,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos)
}
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
// If no change in ghost placement
if ((gSceneryGhostType & SCENERY_GHOST_FLAG_3) && mapTile == gSceneryGhostPosition && gSceneryPlaceZ == _unkF64F0A
@ -2891,7 +2891,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos)
gMapSelectPositionB.y = mapTile.y;
gMapSelectType = MAP_SELECT_TYPE_FULL;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
// If no change in ghost placement
if ((gSceneryGhostType & SCENERY_GHOST_FLAG_4) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z
@ -3235,17 +3235,17 @@ static void WindowTopToolbarToolUp(rct_window* w, WidgetIndex widgetIndex, const
switch (widgetIndex)
{
case WIDX_LAND:
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gCurrentToolId = Tool::DigDown;
break;
case WIDX_WATER:
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gCurrentToolId = Tool::WaterDown;
break;
case WIDX_CLEAR_SCENERY:
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gCurrentToolId = Tool::Crosshair;
break;

View File

@ -93,7 +93,7 @@ public:
{
ClearProvisional();
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
hide_gridlines();
@ -146,7 +146,7 @@ public:
TrackDesignState tds{};
int16_t mapZ;
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
@ -209,7 +209,7 @@ public:
void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override
{
ClearProvisional();
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;

View File

@ -232,14 +232,14 @@ public:
auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction);
if (mapCoords)
{
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
gMapSelectPositionA.x = std::min(_selectionStart.x, mapCoords->x);
gMapSelectPositionB.x = std::max(_selectionStart.x, mapCoords->x);
gMapSelectPositionA.y = std::min(_selectionStart.y, mapCoords->y);
gMapSelectPositionB.y = std::max(_selectionStart.y, mapCoords->y);
gMapSelectType = MAP_SELECT_TYPE_FULL;
map_invalidate_selection_rect();
MapInvalidateSelectionRect();
}
}

View File

@ -144,7 +144,7 @@ public:
{
auto info = get_map_coordinates_from_pos(
{ windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll);
window_scroll_to_location(*mainWindow, { info.Loc, tile_element_height(info.Loc) });
window_scroll_to_location(*mainWindow, { info.Loc, TileElementHeight(info.Loc) });
}
break;
}

View File

@ -294,7 +294,7 @@ namespace Editor
static void ClearMapForEditing(bool fromSave)
{
map_remove_all_rides();
MapRemoveAllRides();
UnlinkAllRideBanners();
ride_init_all();

View File

@ -324,13 +324,13 @@ void GameState::UpdateLogic(LogicTimings* timings)
map_update_tiles();
report_time(LogicTimePart::MapTiles);
// Temporarily remove provisional paths to prevent peep from interacting with them
map_remove_provisional_elements();
MapRemoveProvisionalElements();
report_time(LogicTimePart::MapStashProvisionalElements);
map_update_path_wide_flags();
MapUpdatePathWideFlags();
report_time(LogicTimePart::MapPathWideFlags);
peep_update_all();
report_time(LogicTimePart::Peep);
map_restore_provisional_elements();
MapRestoreProvisionalElements();
report_time(LogicTimePart::MapRestoreProvisionalElements);
vehicle_update_all();
report_time(LogicTimePart::Vehicle);

View File

@ -73,7 +73,7 @@ GameActions::Result BannerPlaceAction::Query() const
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS);
}
if (!map_can_build_at(_loc))
if (!MapCanBuildAt(_loc))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}

View File

@ -49,7 +49,7 @@ GameActions::Result BannerRemoveAction::Query() const
res.Position.z = _loc.z;
res.ErrorTitle = STR_CANT_REMOVE_THIS;
if (!LocationValid(_loc) || !map_can_build_at({ _loc.x, _loc.y, _loc.z - 16 }))
if (!LocationValid(_loc) || !MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 }))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}

View File

@ -70,7 +70,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
if (!map_can_build_at({ _loc.x, _loc.y, _loc.z - 16 }))
if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 }))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}

View File

@ -55,7 +55,7 @@ GameActions::Result BannerSetStyleAction::Query() const
res.Expenditure = ExpenditureType::Landscaping;
auto location = banner->position.ToCoordsXY().ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
TileElement* tileElement = BannerGetTileElement(_bannerIndex);
@ -109,7 +109,7 @@ GameActions::Result BannerSetStyleAction::Execute() const
res.Expenditure = ExpenditureType::Landscaping;
auto location = banner->position.ToCoordsXY().ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
TileElement* tileElement = BannerGetTileElement(_bannerIndex);

View File

@ -55,7 +55,7 @@ GameActions::Result ClearAction::CreateResult() const
auto x = (_range.GetLeft() + _range.GetRight()) / 2 + 16;
auto y = (_range.GetTop() + _range.GetBottom()) / 2 + 16;
auto z = tile_element_height({ x, y });
auto z = TileElementHeight({ x, y });
result.Position = CoordsXYZ(x, y, z);
return result;
@ -227,5 +227,5 @@ void ClearAction::ResetClearLargeSceneryFlag()
bool ClearAction::MapCanClearAt(const CoordsXY& location)
{
return (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode || map_is_location_owned_or_has_rights(location);
return (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode || MapIsLocationOwnedOrHasRights(location);
}

View File

@ -55,7 +55,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc))
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}

View File

@ -49,7 +49,7 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
}
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc))
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}

View File

@ -71,12 +71,12 @@ GameActions::Result FootpathPlaceAction::Query() const
gFootpathGroundFlags = 0;
if (!LocationValid(_loc) || map_is_edge(_loc))
if (!LocationValid(_loc) || MapIsEdge(_loc))
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc))
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -284,7 +284,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result
zHigh += PATH_HEIGHT_STEP;
}
auto entranceElement = map_get_park_entrance_element_at(_loc, false);
auto entranceElement = MapGetParkEntranceElementAt(_loc, false);
// Make sure the entrance part is the middle
if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0)
{
@ -353,7 +353,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul
zHigh += PATH_HEIGHT_STEP;
}
auto entranceElement = map_get_park_entrance_element_at(_loc, false);
auto entranceElement = MapGetParkEntranceElementAt(_loc, false);
// Make sure the entrance part is the middle
if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0)
{

View File

@ -57,13 +57,13 @@ GameActions::Result FootpathPlaceFromTrackAction::Query() const
gFootpathGroundFlags = 0;
if (!LocationValid(_loc) || map_is_edge(_loc))
if (!LocationValid(_loc) || MapIsEdge(_loc))
{
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc))
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@ -126,7 +126,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertQuery(GameActions
zHigh += PATH_HEIGHT_STEP;
}
auto entranceElement = map_get_park_entrance_element_at(_loc, false);
auto entranceElement = MapGetParkEntranceElementAt(_loc, false);
// Make sure the entrance part is the middle
if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0)
{
@ -196,7 +196,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertExecute(GameActio
zHigh += PATH_HEIGHT_STEP;
}
auto entranceElement = map_get_park_entrance_element_at(_loc, false);
auto entranceElement = MapGetParkEntranceElementAt(_loc, false);
// Make sure the entrance part is the middle
if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0)
{

View File

@ -56,7 +56,7 @@ GameActions::Result FootpathRemoveAction::Query() const
GameActions::Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc))
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(
GameActions::Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@ -97,7 +97,7 @@ GameActions::Result FootpathRemoveAction::Execute() const
}
FootpathRemoveEdgesAt(_loc, footpathElement);
map_invalidate_tile_full(_loc);
tile_element_remove(footpathElement);
TileElementRemove(footpathElement);
FootpathUpdateQueueChains();
// Remove the spawn point (if there is one in the current tile)

View File

@ -471,7 +471,7 @@ const char* GameAction::GetName() const
bool GameAction::LocationValid(const CoordsXY& coords) const
{
auto result = map_is_location_valid(coords);
auto result = MapIsLocationValid(coords);
if (!result)
return false;
#ifdef ENABLE_SCRIPTING

View File

@ -74,7 +74,7 @@ GameActions::Result LandBuyRightsAction::QueryExecute(bool isExecuting) const
CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16,
(validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 };
centre.z = tile_element_height(centre);
centre.z = TileElementHeight(centre);
res.Position = centre;
res.Expenditure = ExpenditureType::LandPurchase;

View File

@ -64,15 +64,15 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const
auto validRange = ClampRangeWithinMap(_range);
res.Position = { _coords.x, _coords.y, tile_element_height(_coords) };
res.Position = { _coords.x, _coords.y, TileElementHeight(_coords) };
res.Expenditure = ExpenditureType::Landscaping;
if (isExecuting)
{
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) });
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, TileElementHeight(_coords) });
}
uint8_t maxHeight = map_get_highest_land_height(validRange);
uint8_t maxHeight = MapGetHighestLandHeight(validRange);
bool withinOwnership = false;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += COORDS_XY_STEP)
@ -87,7 +87,7 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ x, y }))
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
continue;
}

View File

@ -65,15 +65,15 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const
auto validRange = ClampRangeWithinMap(_range);
res.Position = { _coords.x, _coords.y, tile_element_height(_coords) };
res.Position = { _coords.x, _coords.y, TileElementHeight(_coords) };
res.Expenditure = ExpenditureType::Landscaping;
if (isExecuting)
{
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) });
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, TileElementHeight(_coords) });
}
uint8_t minHeight = map_get_lowest_land_height(validRange);
uint8_t minHeight = MapGetLowestLandHeight(validRange);
bool withinOwnership = false;
for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += COORDS_XY_STEP)
@ -88,7 +88,7 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ x, y }))
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
continue;
}

View File

@ -60,7 +60,7 @@ GameActions::Result LandSetHeightAction::Query() const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(_coords))
if (!MapIsLocationInPark(_coords))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK, STR_NONE);
}
@ -144,7 +144,7 @@ GameActions::Result LandSetHeightAction::Query() const
GameActions::Result LandSetHeightAction::Execute() const
{
money32 cost = 0.00_GBP;
auto surfaceHeight = tile_element_height(_coords);
auto surfaceHeight = TileElementHeight(_coords);
FootpathRemoveLitter({ _coords, surfaceHeight });
if (!gCheatsDisableClearanceChecks)
@ -257,7 +257,7 @@ void LandSetHeightAction::SmallSceneryRemoval() const
continue;
if (_height + 4 < tileElement->base_height)
continue;
tile_element_remove(tileElement--);
TileElementRemove(tileElement--);
} while (!(tileElement++)->IsLastForTile());
}

View File

@ -70,7 +70,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const
auto validRange = ClampRangeWithinMap(_range.Normalise());
CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16,
(validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 };
centre.z = tile_element_height(centre);
centre.z = TileElementHeight(centre);
res.Position = centre;
res.Expenditure = ExpenditureType::LandPurchase;

View File

@ -330,7 +330,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const
auto b = std::clamp(normRange.GetBottom(), 0, MAXIMUM_TILE_START_XY);
auto validRange = MapRange{ l, t, r, b };
int32_t centreZ = tile_element_height(_coords);
int32_t centreZ = TileElementHeight(_coords);
auto res = GameActions::Result();
res.ErrorTitle = _ErrorTitles[_isLowering ? 0 : 1];
@ -342,8 +342,8 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const
{
case MAP_SELECT_TYPE_FULL:
{
uint8_t minHeight = heightOffset + map_get_lowest_land_height(validRange);
uint8_t maxHeight = heightOffset + map_get_highest_land_height(validRange);
uint8_t minHeight = heightOffset + MapGetLowestLandHeight(validRange);
uint8_t maxHeight = heightOffset + MapGetHighestLandHeight(validRange);
// Smooth the 4 corners
{ // top-left

View File

@ -56,7 +56,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
auto res = GameActions::Result();
res.ErrorTitle = STR_CANT_POSITION_THIS_HERE;
res.Expenditure = ExpenditureType::Landscaping;
int16_t surfaceHeight = tile_element_height(_loc);
int16_t surfaceHeight = TileElementHeight(_loc);
res.Position.x = _loc.x + 16;
res.Position.y = _loc.y + 16;
res.Position.z = surfaceHeight;
@ -148,12 +148,12 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
resultData.GroundFlags = tempSceneryGroundFlags;
if (!LocationValid(curTile) || map_is_edge(curTile))
if (!LocationValid(curTile) || MapIsEdge(curTile))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned({ curTile, zLow }) && !gCheatsSandboxMode)
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationOwned({ curTile, zLow }) && !gCheatsSandboxMode)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@ -182,7 +182,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
res.ErrorTitle = STR_CANT_POSITION_THIS_HERE;
res.Expenditure = ExpenditureType::Landscaping;
int16_t surfaceHeight = tile_element_height(_loc);
int16_t surfaceHeight = TileElementHeight(_loc);
res.Position.x = _loc.x + 16;
res.Position.y = _loc.y + 16;
res.Position.z = surfaceHeight;
@ -346,7 +346,7 @@ int16_t LargeSceneryPlaceAction::GetMaxSurfaceHeight(rct_large_scenery_tile* til
curTile.x += _loc.x;
curTile.y += _loc.y;
if (!map_is_location_valid(curTile))
if (!MapIsLocationValid(curTile))
{
continue;
}

View File

@ -54,7 +54,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const
const uint32_t flags = GetFlags();
int32_t z = tile_element_height(_loc);
int32_t z = TileElementHeight(_loc);
res.Position.x = _loc.x + 16;
res.Position.y = _loc.y + 16;
res.Position.z = z;
@ -93,7 +93,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_owned({ currentTile.x, currentTile.y, currentTile.z }))
if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z }))
{
return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -125,7 +125,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
{
auto res = GameActions::Result();
int32_t z = tile_element_height(_loc);
int32_t z = TileElementHeight(_loc);
res.Position.x = _loc.x + 16;
res.Position.y = _loc.y + 16;
res.Position.z = z;
@ -165,7 +165,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_owned({ currentTile.x, currentTile.y, currentTile.z }))
if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z }))
{
return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -175,7 +175,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
if (sceneryElement != nullptr)
{
map_invalidate_tile_full(currentTile);
tile_element_remove(sceneryElement);
TileElementRemove(sceneryElement);
}
else
{

View File

@ -52,7 +52,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
res.Expenditure = ExpenditureType::Landscaping;
res.Position.x = _loc.x + 16;
res.Position.y = _loc.y + 16;
res.Position.z = tile_element_height(_loc);
res.Position.z = TileElementHeight(_loc);
res.ErrorTitle = STR_CANT_REPAINT_THIS;
auto mapSizeMax = GetMapSizeMaxXY();
@ -119,7 +119,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_owned(currentTile))
if (!MapIsLocationOwned(currentTile))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}

View File

@ -50,7 +50,7 @@ GameActions::Result MazePlaceTrackAction::Query() const
return res;
}
if (!LocationValid(_loc) || (!map_is_location_owned(_loc) && !gCheatsSandboxMode))
if (!LocationValid(_loc) || (!MapIsLocationOwned(_loc) && !gCheatsSandboxMode))
{
res.Error = GameActions::Status::NotOwned;
res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK;

View File

@ -61,7 +61,7 @@ GameActions::Result MazeSetTrackAction::Query() const
return res;
}
if (!LocationValid(_loc) || (!map_is_location_owned(_loc) && !gCheatsSandboxMode))
if (!LocationValid(_loc) || (!MapIsLocationOwned(_loc) && !gCheatsSandboxMode))
{
res.Error = GameActions::Status::NotOwned;
res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK;
@ -292,7 +292,7 @@ GameActions::Result MazeSetTrackAction::Execute() const
if ((tileElement->AsTrack()->GetMazeEntry() & 0x8888) == 0x8888)
{
tile_element_remove(tileElement);
TileElementRemove(tileElement);
ride->ValidateStations();
ride->maze_tiles--;
}

View File

@ -85,7 +85,7 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const
void ParkEntranceRemoveAction::ParkEntranceRemoveSegment(const CoordsXYZ& loc) const
{
auto entranceElement = map_get_park_entrance_element_at(loc, true);
auto entranceElement = MapGetParkEntranceElementAt(loc, true);
if (entranceElement == nullptr)
{
return;

View File

@ -93,7 +93,7 @@ GameActions::Result PlaceParkEntranceAction::Query() const
}
// Check that entrance element does not already exist at this location
EntranceElement* entranceElement = map_get_park_entrance_element_at(entranceLoc, false);
EntranceElement* entranceElement = MapGetParkEntranceElementAt(entranceLoc, false);
if (entranceElement != nullptr)
{
return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, STR_NONE);

View File

@ -55,7 +55,7 @@ GameActions::Result PlacePeepSpawnAction::Query() const
}
// Verify footpath exists at location, and retrieve coordinates
auto pathElement = map_get_path_element_at(TileCoordsXYZ{ _location });
auto pathElement = MapGetPathElementAt(TileCoordsXYZ{ _location });
if (pathElement == nullptr)
{
return GameActions::Result(

View File

@ -150,7 +150,7 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride* ride) const
if (!ride->overall_view.IsNull())
{
auto xy = ride->overall_view.ToTileCentre();
res.Position = { xy, tile_element_height(xy) };
res.Position = { xy, TileElementHeight(xy) };
}
ride->Delete();
@ -229,7 +229,7 @@ money32 RideDemolishAction::DemolishTracks() const
auto removRes = GameActions::ExecuteNested(&trackRemoveAction);
if (removRes.Error != GameActions::Status::Ok)
{
tile_element_remove(tileElement);
TileElementRemove(tileElement);
}
else
{
@ -281,7 +281,7 @@ GameActions::Result RideDemolishAction::RefurbishRide(Ride* ride) const
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
}
window_close_by_number(WindowClass::DemolishRidePrompt, _rideIndex.ToUnderlying());

View File

@ -92,7 +92,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const
}
auto z = ride->GetStation(_stationNum).GetBaseZ();
if (!LocationValid(_loc) || (!gCheatsSandboxMode && !map_is_location_owned({ _loc, z })))
if (!LocationValid(_loc) || (!gCheatsSandboxMode && !MapIsLocationOwned({ _loc, z })))
{
return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -225,7 +225,7 @@ GameActions::Result RideEntranceExitPlaceAction::TrackPlaceQuery(const CoordsXYZ
const auto errorTitle = isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION
: STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION;
if (!gCheatsSandboxMode && !map_is_location_owned(loc))
if (!gCheatsSandboxMode && !MapIsLocationOwned(loc))
{
return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -254,7 +254,7 @@ GameActions::Result RideEntranceExitPlaceAction::TrackPlaceQuery(const CoordsXYZ
return GameActions::Result(GameActions::Status::Disallowed, errorTitle, STR_TOO_HIGH);
}
auto res = GameActions::Result();
res.Position = { loc.ToTileCentre(), tile_element_height(loc) };
res.Position = { loc.ToTileCentre(), TileElementHeight(loc) };
res.Expenditure = ExpenditureType::RideConstruction;
res.Cost += canBuild.Cost;
return res;

View File

@ -138,13 +138,13 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const
auto res = GameActions::Result();
res.Position.x = _loc.x + 16;
res.Position.y = _loc.y + 16;
res.Position.z = tile_element_height(res.Position);
res.Position.z = TileElementHeight(res.Position);
FootpathQueueChainReset();
MazeEntranceHedgeReplacement({ _loc, entranceElement });
FootpathRemoveEdgesAt(_loc, entranceElement);
tile_element_remove(entranceElement);
TileElementRemove(entranceElement);
auto& station = ride->GetStation(_stationNum);
if (_isExit)

View File

@ -148,7 +148,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
}
return res;

View File

@ -92,7 +92,7 @@ GameActions::Result RideSetNameAction::Execute() const
auto res = GameActions::Result();
auto location = ride->overall_view.ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
return res;
}

View File

@ -90,7 +90,7 @@ GameActions::Result RideSetPriceAction::Execute() const
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
}
ShopItem shopItem;

View File

@ -234,7 +234,7 @@ GameActions::Result RideSetSettingAction::Execute() const
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
}
window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying());
return res;

View File

@ -137,7 +137,7 @@ GameActions::Result RideSetStatusAction::Execute() const
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res.Position = { location, tile_element_height(location) };
res.Position = { location, TileElementHeight(location) };
}
switch (_status)

View File

@ -197,7 +197,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res.Position = { location, tile_element_height(res.Position) };
res.Position = { location, TileElementHeight(res.Position) };
}
auto intent = Intent(INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE);

View File

@ -74,8 +74,8 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
{
supportsRequired = true;
}
int32_t landHeight = tile_element_height(_loc);
int16_t waterHeight = tile_element_water_height(_loc);
int32_t landHeight = TileElementHeight(_loc);
int16_t waterHeight = TileElementWaterHeight(_loc);
int32_t surfaceHeight = landHeight;
// If on water
@ -138,8 +138,8 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
loc2.x += SceneryQuadrantOffsets[quadrant & 3].x;
loc2.y += SceneryQuadrantOffsets[quadrant & 3].y;
}
landHeight = tile_element_height(loc2);
waterHeight = tile_element_water_height(loc2);
landHeight = TileElementHeight(loc2);
waterHeight = TileElementWaterHeight(loc2);
surfaceHeight = landHeight;
// If on water
@ -159,7 +159,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
}
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode
&& !map_is_location_owned({ _loc.x, _loc.y, targetHeight }))
&& !MapIsLocationOwned({ _loc.x, _loc.y, targetHeight }))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -283,8 +283,8 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const
{
supportsRequired = true;
}
int32_t landHeight = tile_element_height(_loc);
int16_t waterHeight = tile_element_water_height(_loc);
int32_t landHeight = TileElementHeight(_loc);
int16_t waterHeight = TileElementWaterHeight(_loc);
int32_t surfaceHeight = landHeight;
// If on water
@ -332,8 +332,8 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const
x2 += SceneryQuadrantOffsets[quadrant & 3].x;
y2 += SceneryQuadrantOffsets[quadrant & 3].y;
}
landHeight = tile_element_height({ x2, y2 });
waterHeight = tile_element_water_height({ x2, y2 });
landHeight = TileElementHeight({ x2, y2 });
waterHeight = TileElementWaterHeight({ x2, y2 });
surfaceHeight = landHeight;
// If on water

View File

@ -87,7 +87,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const
}
// Check if the land is owned
if (!map_is_location_owned(_loc))
if (!MapIsLocationOwned(_loc))
{
res.Error = GameActions::Status::NoClearance;
res.ErrorTitle = STR_CANT_REMOVE_THIS;
@ -128,10 +128,10 @@ GameActions::Result SmallSceneryRemoveAction::Execute() const
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}
res.Position.z = tile_element_height(res.Position);
res.Position.z = TileElementHeight(res.Position);
map_invalidate_tile_full(_loc);
tile_element_remove(tileElement);
TileElementRemove(tileElement);
return res;
}

View File

@ -75,13 +75,13 @@ GameActions::Result SmallScenerySetColourAction::QueryExecute(bool isExecuting)
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_owned(_loc))
if (!MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
}
auto sceneryElement = map_get_small_scenery_element_at(_loc, _sceneryType, _quadrant);
auto sceneryElement = MapGetSmallSceneryElementAt(_loc, _sceneryType, _quadrant);
if (sceneryElement == nullptr)
{

View File

@ -231,7 +231,7 @@ void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const
if (guest->State == PeepState::Walking)
{
// Check the walking guest's tile. Only count them if they're on a path tile.
guest_tile = map_get_path_element_at(TileCoordsXYZ{ guest->NextLoc });
guest_tile = MapGetPathElementAt(TileCoordsXYZ{ guest->NextLoc });
if (guest_tile != nullptr)
++count;
}
@ -249,7 +249,7 @@ void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const
{
if (guest->State == PeepState::Walking)
{
guest_tile = map_get_path_element_at(TileCoordsXYZ{ guest->NextLoc });
guest_tile = MapGetPathElementAt(TileCoordsXYZ{ guest->NextLoc });
if (guest_tile != nullptr)
{
if (rand == 0)

View File

@ -78,7 +78,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const
auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16;
auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16;
auto heightMid = tile_element_height({ xMid, yMid });
auto heightMid = TileElementHeight({ xMid, yMid });
res.Position.x = xMid;
res.Position.y = yMid;
@ -104,7 +104,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(coords))
if (!MapIsLocationInPark(coords))
continue;
}
@ -154,7 +154,7 @@ GameActions::Result SurfaceSetStyleAction::Execute() const
auto validRange = ClampRangeWithinMap(_range.Normalise());
auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16;
auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16;
auto heightMid = tile_element_height({ xMid, yMid });
auto heightMid = TileElementHeight({ xMid, yMid });
res.Position.x = xMid;
res.Position.y = yMid;
@ -172,7 +172,7 @@ GameActions::Result SurfaceSetStyleAction::Execute() const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(coords))
if (!MapIsLocationInPark(coords))
continue;
}
@ -198,7 +198,7 @@ GameActions::Result SurfaceSetStyleAction::Execute() const
surfaceElement->SetSurfaceStyle(_surfaceStyle);
map_invalidate_tile_full(coords);
FootpathRemoveLitter({ coords, tile_element_height(coords) });
FootpathRemoveLitter({ coords, TileElementHeight(coords) });
}
}
}

View File

@ -217,7 +217,7 @@ GameActions::Result TileModifyAction::QueryExecute(bool isExecuting) const
res.Position.x = _loc.x;
res.Position.y = _loc.y;
res.Position.z = tile_element_height(_loc);
res.Position.z = TileElementHeight(_loc);
return res;
}

View File

@ -171,7 +171,7 @@ GameActions::Result TrackPlaceAction::Query() const
auto rotatedTrack = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(_origin.direction), 0 };
auto tileCoords = CoordsXYZ{ _origin.x, _origin.y, _origin.z } + rotatedTrack;
if (!LocationValid(tileCoords) || (!map_is_location_owned(tileCoords) && !gCheatsSandboxMode))
if (!LocationValid(tileCoords) || (!MapIsLocationOwned(tileCoords) && !gCheatsSandboxMode))
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);

View File

@ -434,7 +434,7 @@ GameActions::Result TrackRemoveAction::Execute() const
{
FootpathRemoveEdgesAt(mapLoc, tileElement);
}
tile_element_remove(tileElement);
TileElementRemove(tileElement);
ride->ValidateStations();
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{

View File

@ -70,7 +70,7 @@ GameActions::Result WallPlaceAction::Query() const
if (_loc.z == 0)
{
res.Position.z = tile_element_height(res.Position);
res.Position.z = TileElementHeight(res.Position);
}
if (!LocationValid(_loc))
@ -83,12 +83,12 @@ GameActions::Result WallPlaceAction::Query() const
{
if (_loc.z == 0)
{
if (!map_is_location_in_park(_loc))
if (!MapIsLocationInPark(_loc))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
}
else if (!map_is_location_owned(_loc))
else if (!MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -280,7 +280,7 @@ GameActions::Result WallPlaceAction::Execute() const
if (res.Position.z == 0)
{
res.Position.z = tile_element_height(res.Position);
res.Position.z = TileElementHeight(res.Position);
}
uint8_t edgeSlope = 0;

View File

@ -51,7 +51,7 @@ GameActions::Result WallRemoveAction::Query() const
}
const bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST;
if (!isGhost && !(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode && !map_is_location_owned(_loc))
if (!isGhost && !(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode && !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -84,11 +84,11 @@ GameActions::Result WallRemoveAction::Execute() const
res.Position.x = _loc.x + 16;
res.Position.y = _loc.y + 16;
res.Position.z = tile_element_height(res.Position);
res.Position.z = TileElementHeight(res.Position);
wallElement->RemoveBannerEntry();
map_invalidate_tile_zoom1({ _loc, wallElement->GetBaseZ(), (wallElement->GetBaseZ()) + 72 });
tile_element_remove(wallElement);
TileElementRemove(wallElement);
return res;
}

View File

@ -56,12 +56,12 @@ GameActions::Result WallSetColourAction::Query() const
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_in_park(_loc) && !gCheatsSandboxMode)
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationInPark(_loc) && !gCheatsSandboxMode)
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
auto wallElement = map_get_wall_element_at(_loc);
auto wallElement = MapGetWallElementAt(_loc);
if (wallElement == nullptr)
{
log_error(
@ -113,7 +113,7 @@ GameActions::Result WallSetColourAction::Execute() const
res.Position.z = _loc.z;
res.Expenditure = ExpenditureType::Landscaping;
auto wallElement = map_get_wall_element_at(_loc);
auto wallElement = MapGetWallElementAt(_loc);
if (wallElement == nullptr)
{
log_error(

View File

@ -48,8 +48,8 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const
auto validRange = ClampRangeWithinMap(_range);
res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16;
res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16;
int16_t z = tile_element_height(res.Position);
int16_t waterHeight = tile_element_water_height(res.Position);
int16_t z = TileElementHeight(res.Position);
int16_t waterHeight = TileElementWaterHeight(res.Position);
if (waterHeight != 0)
{
z = waterHeight;
@ -73,7 +73,7 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ x, y }))
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
continue;
}
@ -132,7 +132,7 @@ uint8_t WaterLowerAction::GetLowestHeight(const MapRange& validRange) const
{
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ x, y }))
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
continue;
}

View File

@ -48,8 +48,8 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const
auto validRange = ClampRangeWithinMap(_range);
res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16;
res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16;
int32_t z = tile_element_height(res.Position);
int16_t waterHeight = tile_element_water_height(res.Position);
int32_t z = TileElementHeight(res.Position);
int16_t waterHeight = TileElementWaterHeight(res.Position);
if (waterHeight != 0)
{
z = waterHeight;
@ -73,7 +73,7 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ x, y }))
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
continue;
}
@ -138,7 +138,7 @@ uint16_t WaterRaiseAction::GetHighestHeight(const MapRange& validRange) const
{
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ x, y }))
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
continue;
}

View File

@ -58,7 +58,7 @@ GameActions::Result WaterSetHeightAction::Query() const
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(_coords))
if (!MapIsLocationInPark(_coords))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -104,7 +104,7 @@ GameActions::Result WaterSetHeightAction::Execute() const
res.Expenditure = ExpenditureType::Landscaping;
res.Position = { _coords, _height * COORDS_Z_STEP };
int32_t surfaceHeight = tile_element_height(_coords);
int32_t surfaceHeight = TileElementHeight(_coords);
FootpathRemoveLitter({ _coords, surfaceHeight });
if (!gCheatsDisableClearanceChecks)
WallRemoveAtZ({ _coords, surfaceHeight });

View File

@ -103,7 +103,7 @@ static std::vector<RecordedPaintSession> extract_paint_session(std::string_view
viewport.flags = 0;
auto customXY = TileCoordsXY(gMapSize.x / 2, gMapSize.y / 2).ToCoordsXY().ToTileCentre();
auto customXYZ = CoordsXYZ(customXY, tile_element_height(customXY));
auto customXYZ = CoordsXYZ(customXY, TileElementHeight(customXY));
auto screenXY = translate_3d_to_2d_with_z(0, customXYZ);
viewport.viewPos = { screenXY.x - (viewport.view_width / 2), screenXY.y - (viewport.view_height / 2) };

View File

@ -180,8 +180,8 @@ void Duck::UpdateSwim()
else
{
Invalidate();
int16_t landZ = tile_element_height({ x, y });
int16_t waterZ = tile_element_water_height({ x, y });
int16_t landZ = TileElementHeight({ x, y });
int16_t waterZ = TileElementWaterHeight({ x, y });
if (z < landZ || waterZ == 0)
{
@ -200,8 +200,8 @@ void Duck::UpdateSwim()
int32_t direction = sprite_direction >> 3;
auto destination = CoordsXYZ{ CoordsXY{ x, y } + DuckMoveOffset[direction], 0 };
landZ = tile_element_height(destination);
waterZ = tile_element_water_height(destination);
landZ = TileElementHeight(destination);
waterZ = TileElementWaterHeight(destination);
if (z > landZ && z == waterZ)
{
@ -259,7 +259,7 @@ void Duck::UpdateFlyAway()
int32_t direction = sprite_direction >> 3;
auto destination = CoordsXYZ{ x + (DuckMoveOffset[direction].x * 2), y + (DuckMoveOffset[direction].y * 2),
std::min<int32_t>(z + 2, 496) };
if (map_is_location_valid(destination))
if (MapIsLocationValid(destination))
{
MoveTo(destination);
}

View File

@ -454,7 +454,7 @@ void EntityBase::MoveTo(const CoordsXYZ& newLocation)
}
auto loc = newLocation;
if (!map_is_location_valid(loc))
if (!MapIsLocationValid(loc))
{
loc.x = LOCATION_NULL;
}

View File

@ -449,7 +449,7 @@ static bool IsValidLocation(const CoordsXYZ& coords)
{
if (coords.x != LOCATION_NULL)
{
if (map_is_location_valid(coords))
if (MapIsLocationValid(coords))
{
return true;
}
@ -1885,7 +1885,7 @@ BitSet<OpenRCT2::Limits::MaxRidesInPark> Guest::FindRidesToGoOn()
for (int32_t tileY = cy - radius; tileY <= cy + radius; tileY += COORDS_XY_STEP)
{
auto location = CoordsXY{ tileX, tileY };
if (!map_is_location_valid(location))
if (!MapIsLocationValid(location))
continue;
for (auto* trackElement : TileElementsView<TrackElement>(location))
@ -2903,7 +2903,7 @@ static bool peep_really_liked_ride(Guest* peep, Ride* ride)
*/
static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre_y, int16_t centre_z)
{
if ((tile_element_height({ centre_x, centre_y })) > centre_z)
if ((TileElementHeight({ centre_x, centre_y })) > centre_z)
return PeepThoughtType::None;
uint16_t num_scenery = 0;
@ -3158,7 +3158,7 @@ template<typename T> static void peep_head_for_nearest_ride(Guest* peep, bool co
for (auto y = cy - searchRadius; y <= cy + searchRadius; y += COORDS_XY_STEP)
{
auto location = CoordsXY{ x, y };
if (!map_is_location_valid(location))
if (!MapIsLocationValid(location))
continue;
for (auto* trackElement : TileElementsView<TrackElement>(location))
@ -6276,7 +6276,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi
uint16_t x = peep->NextLoc.x + CoordsDirectionDelta[edge].x;
uint16_t y = peep->NextLoc.y + CoordsDirectionDelta[edge].y;
if (!map_is_location_valid({ x, y }))
if (!MapIsLocationValid({ x, y }))
{
return false;
}
@ -6393,7 +6393,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi
x += CoordsDirectionDelta[edge].x;
y += CoordsDirectionDelta[edge].y;
if (!map_is_location_valid({ x, y }))
if (!MapIsLocationValid({ x, y }))
{
return false;
}
@ -6510,7 +6510,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi
x += CoordsDirectionDelta[edge].x;
y += CoordsDirectionDelta[edge].y;
if (!map_is_location_valid({ x, y }))
if (!MapIsLocationValid({ x, y }))
{
return false;
}
@ -6699,7 +6699,7 @@ void Guest::UpdateSpriteType()
if (ClimateIsRaining() && (HasItem(ShopItem::Umbrella)) && x != LOCATION_NULL)
{
CoordsXY loc = { x, y };
if (map_is_location_valid(loc.ToTileStart()))
if (MapIsLocationValid(loc.ToTileStart()))
{
TileElement* tileElement = MapGetFirstElementAt(loc);
while (true)

View File

@ -20,7 +20,7 @@ static bool isLocationLitterable(const CoordsXYZ& mapPos)
{
TileElement* tileElement;
if (!map_is_location_owned(mapPos))
if (!MapIsLocationOwned(mapPos))
return false;
tileElement = MapGetFirstElementAt(mapPos);

View File

@ -93,7 +93,7 @@ void MoneyEffect::Create(money64 value, const CoordsXYZ& loc)
if (!mapPositionXY.has_value())
return;
offsetLoc = { mapPositionXY.value(), tile_element_height(*mapPositionXY) };
offsetLoc = { mapPositionXY.value(), TileElementHeight(*mapPositionXY) };
}
offsetLoc.z += 10;
CreateAt(-value, offsetLoc, false);

View File

@ -109,8 +109,8 @@ void VehicleCrashParticle::Update()
velocity_z = vz & 0xFFFF;
// Check collision with land / water
int16_t landZ = tile_element_height(newLoc);
int16_t waterZ = tile_element_water_height(newLoc);
int16_t landZ = TileElementHeight(newLoc);
int16_t waterZ = TileElementWaterHeight(newLoc);
if (waterZ != 0 && z >= waterZ && newLoc.z <= waterZ)
{

View File

@ -620,7 +620,7 @@ void Peep::PickupAbort(int32_t old_x)
// dropped.
GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply)
{
auto* pathElement = map_get_path_element_at(location);
auto* pathElement = MapGetPathElementAt(location);
TileElement* tileElement = reinterpret_cast<TileElement*>(pathElement);
if (pathElement == nullptr)
{
@ -635,7 +635,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply)
// in the middle of a tile.
CoordsXYZ destination = { location.ToCoordsXY().ToTileCentre(), tileElement->GetBaseZ() + 16 };
if (!map_is_location_owned(destination))
if (!MapIsLocationOwned(destination))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
@ -810,7 +810,7 @@ void Peep::UpdateFalling()
return;
}
}
int32_t map_height = tile_element_height({ x, y });
int32_t map_height = TileElementHeight({ x, y });
if (map_height < z || map_height - 4 > z)
continue;
saved_height = map_height;
@ -2140,7 +2140,7 @@ static void peep_interact_with_path(Peep* peep, const CoordsXYE& coords)
int16_t z = tile_element->GetBaseZ();
auto* guest = peep->As<Guest>();
if (map_is_location_owned({ coords, z }))
if (MapIsLocationOwned({ coords, z }))
{
if (guest != nullptr && guest->OutsideOfPark)
{
@ -2410,7 +2410,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result)
return;
}
if (map_is_edge(newLoc))
if (MapIsEdge(newLoc))
{
if (guest != nullptr && guest->OutsideOfPark)
{
@ -2462,7 +2462,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result)
if (Is<Staff>() || (GetNextIsSurface()))
{
int16_t height = abs(tile_element_height(newLoc) - z);
int16_t height = abs(TileElementHeight(newLoc) - z);
if (height <= 3 || (Is<Staff>() && height <= 32))
{
InteractionRideIndex = RideId::GetNull();
@ -2472,7 +2472,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result)
SetState(PeepState::One);
}
if (!map_is_location_in_park(newLoc))
if (!MapIsLocationInPark(newLoc))
{
peep_return_to_centre_of_tile(this);
return;
@ -2528,7 +2528,7 @@ int32_t Peep::GetZOnSlope(int32_t tile_x, int32_t tile_y)
if (GetNextIsSurface())
{
return tile_element_height({ tile_x, tile_y });
return TileElementHeight({ tile_x, tile_y });
}
uint8_t slope = GetNextDirection();

View File

@ -81,7 +81,7 @@ template<> bool EntityBase::Is<Staff>() const
bool Staff::IsLocationInPatrol(const CoordsXY& loc) const
{
// Check if location is in the park
if (!map_is_location_owned_or_has_rights(loc))
if (!MapIsLocationOwnedOrHasRights(loc))
return false;
// Check if staff has patrol area
@ -428,7 +428,7 @@ uint8_t Staff::HandymanDirectionToUncutGrass(uint8_t valid_directions) const
CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[chosenDirection];
if (!map_is_location_valid(chosenTile))
if (!MapIsLocationValid(chosenTile))
continue;
auto surfaceElement = MapGetSurfaceElementAt(chosenTile);
@ -461,7 +461,7 @@ Direction Staff::HandymanDirectionRandSurface(uint8_t validDirections) const
CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection];
if (map_surface_is_blocked(chosenTile))
if (MapSurfaceIsBlocked(chosenTile))
continue;
break;
@ -503,7 +503,7 @@ bool Staff::DoHandymanPathFinding()
}
else
{
auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ NextLoc });
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ NextLoc });
if (pathElement == nullptr)
return true;
@ -554,7 +554,7 @@ bool Staff::DoHandymanPathFinding()
CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection];
while (!map_is_location_valid(chosenTile))
while (!MapIsLocationValid(chosenTile))
{
newDirection = HandymanDirectionRandSurface(validDirections);
chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection];
@ -599,7 +599,7 @@ Direction Staff::DirectionSurface(Direction initialDirection) const
CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[direction];
if (!map_surface_is_blocked(chosenTile))
if (!MapSurfaceIsBlocked(chosenTile))
{
return direction;
}
@ -759,7 +759,7 @@ bool Staff::DoMechanicPathFinding()
}
else
{
auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ NextLoc });
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ NextLoc });
if (pathElement == nullptr)
return true;
@ -771,7 +771,7 @@ bool Staff::DoMechanicPathFinding()
CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection];
while (!map_is_location_valid(chosenTile))
while (!MapIsLocationValid(chosenTile))
{
newDirection = MechanicDirectionSurface();
chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection];
@ -840,7 +840,7 @@ bool Staff::DoMiscPathFinding()
}
else
{
auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ NextLoc });
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ NextLoc });
if (pathElement == nullptr)
return true;
@ -849,7 +849,7 @@ bool Staff::DoMiscPathFinding()
CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection];
while (!map_is_location_valid(chosenTile))
while (!MapIsLocationValid(chosenTile))
{
newDirection = DirectionSurface(scenario_rand() & 3);
chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection];
@ -1074,7 +1074,7 @@ void Staff::UpdateMowing()
{
if (auto loc = UpdateAction(); loc.has_value())
{
int16_t checkZ = tile_element_height(*loc);
int16_t checkZ = TileElementHeight(*loc);
MoveTo({ loc.value(), checkZ });
return;
}

View File

@ -1058,7 +1058,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
if (w != nullptr)
{
auto location = TileCoordsXYZ(int_val[0], int_val[1], 0).ToCoordsXYZ().ToTileCentre();
location.z = tile_element_height(location);
location.z = TileElementHeight(location);
w->SetLocation(location);
viewport_update_position(w);
console.Execute("get location");

View File

@ -667,7 +667,7 @@ int32_t cmdline_for_screenshot(const char** argv, int32_t argc, ScreenshotOption
if (centreMapY)
customY = (mapSize.y / 2) * 32 + 16;
int32_t z = tile_element_height({ customX, customY });
int32_t z = TileElementHeight({ customX, customY });
CoordsXYZ coords3d = { customX, customY, z };
auto coords2d = translate_3d_to_2d_with_z(customRotation, coords3d);
@ -763,7 +763,7 @@ void CaptureImage(const CaptureOptions& options)
viewport.view_width = viewport.width;
viewport.view_height = viewport.height;
auto z = tile_element_height(options.View->Position);
auto z = TileElementHeight(options.View->Position);
CoordsXYZ coords3d(options.View->Position, z);
auto coords2d = translate_3d_to_2d_with_z(options.Rotation, coords3d);
viewport.viewPos = { coords2d.x - ((options.Zoom.ApplyTo(viewport.view_width)) / 2),

View File

@ -248,7 +248,7 @@ CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords)
for (int32_t i = 0; i < 6; i++)
{
pos = viewport_coord_to_map_coord(startCoords, height);
height = tile_element_height(pos);
height = TileElementHeight(pos);
// HACK: This is to prevent the x and y values being set to values outside
// of the map. This can happen when the height is larger than the map size.
@ -673,7 +673,7 @@ void viewport_update_sprite_follow(rct_window* window)
if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
{
int32_t height = (tile_element_height({ sprite->x, sprite->y })) - 16;
int32_t height = (TileElementHeight({ sprite->x, sprite->y })) - 16;
int32_t underground = sprite->z < height;
viewport_set_underground_flag(underground, window, window->viewport);
}
@ -761,7 +761,7 @@ void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep)
CoordsXYZ coordFocus;
coordFocus.x = xy.x;
coordFocus.y = xy.y;
coordFocus.z = tile_element_height(xy) + (4 * COORDS_Z_STEP);
coordFocus.z = TileElementHeight(xy) + (4 * COORDS_Z_STEP);
focus = Focus(coordFocus);
window->viewport_target_sprite = EntityId::GetNull();
}
@ -1998,7 +1998,7 @@ std::optional<CoordsXY> screen_get_map_xy(const ScreenCoordsXY& screenCoords, rc
// Iterates the cursor location to work out exactly where on the tile it is
for (int32_t i = 0; i < 5; i++)
{
int32_t z = tile_element_height(cursorMapPos);
int32_t z = TileElementHeight(cursorMapPos);
cursorMapPos = viewport_coord_to_map_coord(start_vp_pos, z);
cursorMapPos.x = std::clamp(cursorMapPos.x, info.Loc.x, info.Loc.x + 31);
cursorMapPos.y = std::clamp(cursorMapPos.y, info.Loc.y, info.Loc.y + 31);
@ -2024,7 +2024,7 @@ std::optional<CoordsXY> screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoo
auto vpCoords = viewport->ScreenToViewportCoord(screenCoords);
auto mapPosition = viewport_coord_to_map_coord(vpCoords, z);
if (!map_is_location_valid(mapPosition))
if (!MapIsLocationValid(mapPosition))
{
return std::nullopt;
}

View File

@ -820,7 +820,7 @@ void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords)
window_unfollow_sprite(w);
if (w.viewport != nullptr)
{
int16_t height = tile_element_height(coords);
int16_t height = TileElementHeight(coords);
if (coords.z < height - 16)
{
if (!(w.viewport->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE))
@ -932,7 +932,7 @@ void window_rotate_camera(rct_window& w, int32_t direction)
{
coords.x = mapXYCoords->x;
coords.y = mapXYCoords->y;
coords.z = tile_element_height(coords);
coords.z = TileElementHeight(coords);
}
gCurrentRotation = (get_current_rotation() + direction) & 3;
@ -965,7 +965,7 @@ void window_viewport_get_map_coords_by_cursor(
*map_y = mapCoords.y;
// Get viewport coordinates centring around the tile.
int32_t z = tile_element_height(mapCoords);
int32_t z = TileElementHeight(mapCoords);
auto centreLoc = centre_2d_coordinates({ mapCoords.x, mapCoords.y, z }, w.viewport);
if (!centreLoc)
@ -986,7 +986,7 @@ void window_viewport_get_map_coords_by_cursor(
void window_viewport_centre_tile_around_cursor(rct_window& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y)
{
// Get viewport coordinates centring around the tile.
int32_t z = tile_element_height({ map_x, map_y });
int32_t z = TileElementHeight({ map_x, map_y });
auto centreLoc = centre_2d_coordinates({ map_x, map_y, z }, w.viewport);
if (!centreLoc.has_value())
@ -1380,8 +1380,8 @@ void tool_cancel()
{
input_set_flag(INPUT_FLAG_TOOL_ACTIVE, false);
map_invalidate_selection_rect();
map_invalidate_map_selection_tiles();
MapInvalidateSelectionRect();
MapInvalidateMapSelectionTiles();
// Reset map selection
gMapSelectFlags = 0;

View File

@ -219,7 +219,7 @@ std::optional<CoordsXYZ> News::GetSubjectLocation(News::ItemType type, int32_t s
break;
}
auto rideViewCentre = ride->overall_view.ToTileCentre();
subjectLoc = CoordsXYZ{ rideViewCentre, tile_element_height(rideViewCentre) };
subjectLoc = CoordsXYZ{ rideViewCentre, TileElementHeight(rideViewCentre) };
break;
}
case News::ItemType::PeepOnRide:
@ -275,7 +275,7 @@ std::optional<CoordsXYZ> News::GetSubjectLocation(News::ItemType type, int32_t s
static_cast<int16_t>(subjectUnsigned >> 16) };
if (!subjectXY.IsNull())
{
subjectLoc = CoordsXYZ{ subjectXY, tile_element_height(subjectXY) };
subjectLoc = CoordsXYZ{ subjectXY, TileElementHeight(subjectXY) };
}
break;
}

View File

@ -38,7 +38,7 @@ void EntityPaintSetup(paint_session& session, const CoordsXY& pos)
{
PROFILED_FUNCTION();
if (!map_is_location_valid(pos))
if (!MapIsLocationValid(pos))
{
return;
}

View File

@ -239,7 +239,7 @@ static void VirtualFloorGetTileProperties(
}
}
*tileOwned = map_is_location_owned({ loc, height });
*tileOwned = MapIsLocationOwned({ loc, height });
if (gCheatsSandboxMode)
*tileOwned = true;

View File

@ -1055,7 +1055,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co
tile_descriptor& descriptor = tileDescriptors[i + 1];
descriptor.tile_element = nullptr;
if (!map_is_location_valid(position))
if (!MapIsLocationValid(position))
{
continue;
}
@ -1085,7 +1085,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co
const int16_t x = session.MapPosition.x;
const int16_t y = session.MapPosition.y;
int32_t surfaceHeight = tile_element_height({ x + 16, y + 16 });
int32_t surfaceHeight = TileElementHeight({ x + 16, y + 16 });
int32_t dx = surfaceHeight + 3;
int32_t image_id = (SPR_HEIGHT_MARKER_BASE + dx / 16);
@ -1174,7 +1174,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co
else if (tileElement.GetOwnership() & OWNERSHIP_AVAILABLE)
{
const CoordsXY& pos = session.MapPosition;
const int32_t height2 = (tile_element_height({ pos.x + 16, pos.y + 16 })) + 3;
const int32_t height2 = (TileElementHeight({ pos.x + 16, pos.y + 16 })) + 3;
paint_struct* backup = session.LastPS;
PaintAddImageAsParent(session, ImageId(SPR_LAND_OWNERSHIP_AVAILABLE), { 16, 16, height2 }, { 1, 1, 0 });
session.LastPS = backup;
@ -1191,7 +1191,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co
else if (tileElement.GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE)
{
const CoordsXY& pos = session.MapPosition;
const int32_t height2 = tile_element_height({ pos.x + 16, pos.y + 16 });
const int32_t height2 = TileElementHeight({ pos.x + 16, pos.y + 16 });
paint_struct* backup = session.LastPS;
PaintAddImageAsParent(
session, ImageId(SPR_LAND_CONSTRUCTION_RIGHTS_AVAILABLE), { 16, 16, height2 + 3 }, { 1, 1, 0 });

View File

@ -48,7 +48,7 @@ void TileElementPaintSetup(paint_session& session, const CoordsXY& mapCoords, bo
{
PROFILED_FUNCTION();
if (!map_is_edge(mapCoords))
if (!MapIsEdge(mapCoords))
{
PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0);
PaintUtilForceSetGeneralSupportHeight(session, -1, 0);

View File

@ -193,7 +193,7 @@ static int32_t guest_surface_path_finding(Peep& peep)
if (!WallInTheWay(pathPos, backwardsDirection))
{
if (!map_surface_is_blocked(pathPos))
if (!MapSurfaceIsBlocked(pathPos))
{
return peep_move_one_tile(randDirection, peep);
}
@ -218,7 +218,7 @@ static int32_t guest_surface_path_finding(Peep& peep)
if (!WallInTheWay(pathPos, backwardsDirection))
{
if (!map_surface_is_blocked(pathPos))
if (!MapSurfaceIsBlocked(pathPos))
{
return peep_move_one_tile(randDirection, peep);
}
@ -238,7 +238,7 @@ static int32_t guest_surface_path_finding(Peep& peep)
if (!WallInTheWay(pathPos, backwardsDirection))
{
if (!map_surface_is_blocked(pathPos))
if (!MapSurfaceIsBlocked(pathPos))
{
return peep_move_one_tile(randDirection, peep);
}
@ -1747,7 +1747,7 @@ int32_t OriginalPathfinding::GuestPathFindParkEntranceLeaving(Peep& peep, uint8_
if (peep.PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN)
{
entranceGoal = peep.PathfindGoal;
auto* entranceElement = map_get_park_entrance_element_at(entranceGoal.ToCoordsXYZ(), false);
auto* entranceElement = MapGetParkEntranceElementAt(entranceGoal.ToCoordsXYZ(), false);
// If entrance no longer exists, choose a new one
if (entranceElement == nullptr)
{
@ -1988,7 +1988,7 @@ int32_t OriginalPathfinding::CalculateNextDestination(Guest& peep)
TileCoordsXYZ loc{ peep.NextLoc };
auto* pathElement = map_get_path_element_at(loc);
auto* pathElement = MapGetPathElementAt(loc);
if (pathElement == nullptr)
{
return 1;

View File

@ -2538,9 +2538,9 @@ namespace RCT1
station.Entrance = entranceCoords;
station.Exit = exitCoords;
auto entranceElement = map_get_ride_exit_element_at(entranceCoords.ToCoordsXYZD(), false);
auto entranceElement = MapGetRideExitElementAt(entranceCoords.ToCoordsXYZD(), false);
entranceElement->SetEntranceType(ENTRANCE_TYPE_RIDE_ENTRANCE);
auto exitElement = map_get_ride_entrance_element_at(exitCoords.ToCoordsXYZD(), false);
auto exitElement = MapGetRideEntranceElementAt(exitCoords.ToCoordsXYZD(), false);
exitElement->SetEntranceType(ENTRANCE_TYPE_RIDE_EXIT);
// Trigger footpath update

View File

@ -1766,7 +1766,7 @@ Staff* find_closest_mechanic(const CoordsXY& entrancePosition, int32_t forInspec
}
auto location = entrancePosition.ToTileStart();
if (map_is_location_in_park(location))
if (MapIsLocationInPark(location))
if (!peep->IsLocationInPatrol(location))
continue;
@ -2262,7 +2262,7 @@ static bool ride_entrance_exit_is_reachable(const TileCoordsXYZD& coordinates)
TileCoordsXYZ loc{ coordinates.x, coordinates.y, coordinates.z };
loc -= TileDirectionDelta[coordinates.direction];
return map_coord_is_connected(loc, coordinates.direction);
return MapCoordIsConnected(loc, coordinates.direction);
}
static void ride_entrance_exit_connected(Ride* ride)
@ -2354,7 +2354,7 @@ static void ride_shop_connected(Ride* ride)
int32_t y2 = shopLoc.y - TileDirectionDelta[face_direction].y;
int32_t x2 = shopLoc.x - TileDirectionDelta[face_direction].x;
if (map_coord_is_connected({ x2, y2, tileElement->base_height }, face_direction))
if (MapCoordIsConnected({ x2, y2, tileElement->base_height }, face_direction))
return;
}
@ -5642,7 +5642,7 @@ void determine_ride_entrance_and_exit_locations()
// Skip if the station has no entrance
if (!entranceLoc.IsNull())
{
const EntranceElement* entranceElement = map_get_ride_entrance_element_at(entranceLoc.ToCoordsXYZD(), false);
const EntranceElement* entranceElement = MapGetRideEntranceElementAt(entranceLoc.ToCoordsXYZD(), false);
if (entranceElement == nullptr || entranceElement->GetRideIndex() != ride.id
|| entranceElement->GetStationIndex() != stationIndex)
@ -5657,7 +5657,7 @@ void determine_ride_entrance_and_exit_locations()
if (!exitLoc.IsNull())
{
const EntranceElement* entranceElement = map_get_ride_exit_element_at(exitLoc.ToCoordsXYZD(), false);
const EntranceElement* entranceElement = MapGetRideExitElementAt(exitLoc.ToCoordsXYZD(), false);
if (entranceElement == nullptr || entranceElement->GetRideIndex() != ride.id
|| entranceElement->GetStationIndex() != stationIndex)
@ -5778,7 +5778,7 @@ void ride_clear_leftover_entrances(Ride* ride)
if (entrance->GetRideIndex() != ride->id)
continue;
tile_element_remove(entrance->as<TileElement>());
TileElementRemove(entrance->as<TileElement>());
}
}
}

View File

@ -1288,7 +1288,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC
// search for TrackElement one tile over, shifted in the search direction
auto nextLocation = entranceExitCoords;
nextLocation += CoordsDirectionDelta[entranceExitCoords.direction];
if (map_is_location_valid(nextLocation))
if (MapIsLocationValid(nextLocation))
{
// iterate over every element in the tile until we find what we want
auto* tileElement = MapGetFirstElementAt(nextLocation);
@ -1577,7 +1577,7 @@ void Ride::ValidateStations()
FootpathRemoveEdgesAt(location, tileElement);
FootpathUpdateQueueChains();
map_invalidate_tile_full(location);
tile_element_remove(tileElement);
TileElementRemove(tileElement);
tileElement--;
}
} while (!(tileElement++)->IsLastForTile());

View File

@ -417,7 +417,7 @@ static void ride_ratings_score_close_proximity_in_direction(
RideRatingUpdateState& state, TileElement* inputTileElement, int32_t direction)
{
auto scorePos = CoordsXY{ CoordsXY{ state.Proximity } + CoordsDirectionDelta[direction] };
if (!map_is_location_valid(scorePos))
if (!MapIsLocationValid(scorePos))
return;
TileElement* tileElement = MapGetFirstElementAt(scorePos);
@ -1445,7 +1445,7 @@ static int32_t ride_ratings_get_scenery_score(Ride* ride)
location = ride->GetStation(stationIndex).Start;
}
int32_t z = tile_element_height(location);
int32_t z = TileElementHeight(location);
// Check if station is underground, returns a fixed mediocre score since you can't have scenery underground
if (z > ride->GetStation(stationIndex).GetBaseZ())

View File

@ -1251,7 +1251,7 @@ static GameActions::Result TrackDesignPlaceSceneryElement(
return GameActions::Result();
}
auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ CoordsXYZ{ mapCoord.x, mapCoord.y, z } });
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ CoordsXYZ{ mapCoord.x, mapCoord.y, z } });
if (pathElement == nullptr)
{
return GameActions::Result();
@ -1350,7 +1350,7 @@ static GameActions::Result TrackDesignPlaceMaze(TrackDesignState& tds, TrackDesi
if (tds.PlaceOperation == PTD_OPERATION_DRAW_OUTLINES)
{
gMapSelectionTiles.clear();
gMapSelectArrowPosition = CoordsXYZ{ coords, tile_element_height(coords) };
gMapSelectArrowPosition = CoordsXYZ{ coords, TileElementHeight(coords) };
gMapSelectArrowDirection = _currentTrackPieceDirection;
}
@ -1511,7 +1511,7 @@ static GameActions::Result TrackDesignPlaceMaze(TrackDesignState& tds, TrackDesi
if (tds.PlaceOperation == PTD_OPERATION_GET_PLACE_Z)
{
if (!map_is_location_valid(mapCoord))
if (!MapIsLocationValid(mapCoord))
{
continue;
}
@ -1564,7 +1564,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi
if (tds.PlaceOperation == PTD_OPERATION_DRAW_OUTLINES)
{
gMapSelectionTiles.clear();
gMapSelectArrowPosition = CoordsXYZ{ origin, tile_element_height(origin) };
gMapSelectArrowPosition = CoordsXYZ{ origin, TileElementHeight(origin) };
gMapSelectArrowDirection = _currentTrackPieceDirection;
}
@ -1668,7 +1668,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi
for (const rct_preview_track* trackBlock = ted.Block; trackBlock->index != 0xFF; trackBlock++)
{
auto tile = CoordsXY{ newCoords } + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation);
if (!map_is_location_valid(tile))
if (!MapIsLocationValid(tile))
{
continue;
}
@ -1904,7 +1904,7 @@ static GameActions::Result TrackDesignPlaceVirtual(
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW;
gMapSelectFlags &= ~MAP_SELECT_FLAG_GREEN;
map_invalidate_map_selection_tiles();
MapInvalidateMapSelectionTiles();
}
auto res = GameActions::Result();

View File

@ -2619,7 +2619,7 @@ static rct_synchronised_vehicle* _lastSynchronisedVehicle = nullptr;
static bool try_add_synchronised_station(const CoordsXYZ& coords)
{
// make sure we are in map bounds
if (!map_is_location_valid(coords))
if (!MapIsLocationValid(coords))
{
return false;
}
@ -5415,8 +5415,8 @@ void Vehicle::UpdateCrash()
continue;
}
int16_t height = tile_element_height(curPos);
int16_t waterHeight = tile_element_water_height(curPos);
int16_t height = TileElementHeight(curPos);
int16_t waterHeight = TileElementWaterHeight(curPos);
int16_t zDiff;
if (waterHeight != 0)
{
@ -5442,7 +5442,7 @@ void Vehicle::UpdateCrash()
curPos.z += static_cast<int8_t>(curVehicle->crash_z >> 8);
curVehicle->TrackLocation = { (curVehicle->crash_x << 8), (curVehicle->crash_y << 8), (curVehicle->crash_z << 8) };
if (!map_is_location_valid(curPos))
if (!MapIsLocationValid(curPos))
{
curVehicle->CrashOnLand();
continue;
@ -6844,7 +6844,7 @@ static void play_scenery_door_close_sound(const CoordsXYZ& loc, WallElement* til
template<bool isBackwards>
static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ& trackLocation, bool isLastVehicle)
{
auto door = map_get_wall_element_at(doorLocation);
auto door = MapGetWallElementAt(doorLocation);
if (door == nullptr)
{
return;
@ -7320,7 +7320,7 @@ void Vehicle::Sub6DBF3E()
_vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_3;
TileElement* tileElement = nullptr;
if (map_is_location_valid(TrackLocation))
if (MapIsLocationValid(TrackLocation))
{
tileElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0);
}
@ -9201,7 +9201,7 @@ void Vehicle::UpdateCrossings() const
while (true)
{
auto* pathElement = map_get_path_element_at(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() }));
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() }));
auto curRide = GetRide();
// Many New Element parks have invisible rides hacked into the path.
@ -9263,7 +9263,7 @@ void Vehicle::UpdateCrossings() const
uint8_t freeCount = travellingForwards ? 3 : 1;
while (freeCount-- > 0)
{
auto* pathElement = map_get_path_element_at(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() }));
auto* pathElement = MapGetPathElementAt(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() }));
if (pathElement != nullptr)
{
pathElement->SetIsBlockedByVehicle(false);

View File

@ -443,12 +443,12 @@ bool scenario_create_ducks()
centrePos.x = SquareRadiusSize + (scenario_rand_max(gMapSize.x - SquareCentre) * 32);
centrePos.y = SquareRadiusSize + (scenario_rand_max(gMapSize.y - SquareCentre) * 32);
Guard::Assert(map_is_location_valid(centrePos));
Guard::Assert(MapIsLocationValid(centrePos));
if (!map_is_location_in_park(centrePos))
if (!MapIsLocationInPark(centrePos))
return false;
int32_t centreWaterZ = (tile_element_water_height(centrePos));
int32_t centreWaterZ = (TileElementWaterHeight(centrePos));
if (centreWaterZ == 0)
return false;
@ -458,13 +458,13 @@ bool scenario_create_ducks()
{
for (int32_t x = 0; x < SquareSize; x++)
{
if (!map_is_location_valid(innerPos))
if (!MapIsLocationValid(innerPos))
continue;
if (!map_is_location_in_park(innerPos))
if (!MapIsLocationInPark(innerPos))
continue;
int32_t waterZ = (tile_element_water_height(innerPos));
int32_t waterZ = (TileElementWaterHeight(innerPos));
if (waterZ == centreWaterZ)
waterTiles++;
@ -491,7 +491,7 @@ bool scenario_create_ducks()
CoordsXY targetPos{ centrePos.x + innerPos.x - SquareRadiusSize, centrePos.y + innerPos.y - SquareRadiusSize };
Guard::Assert(map_is_location_valid(targetPos));
Guard::Assert(MapIsLocationValid(targetPos));
Duck::Create(targetPos);
}

View File

@ -105,7 +105,7 @@ namespace OpenRCT2::Scripting
auto numToInsert = numElements - currentNumElements;
for (size_t i = 0; i < numToInsert; i++)
{
tile_element_insert(pos, 0, TileElementType::Surface);
TileElementInsert(pos, 0, TileElementType::Surface);
}
// Copy data to element span
@ -150,7 +150,7 @@ namespace OpenRCT2::Scripting
std::vector<TileElement> data(first, first + origNumElements);
auto pos = TileCoordsXYZ(TileCoordsXY(_coords), 0).ToCoordsXYZ();
auto newElement = tile_element_insert(pos, 0, TileElementType::Surface);
auto newElement = TileElementInsert(pos, 0, TileElementType::Surface);
if (newElement == nullptr)
{
auto ctx = GetDukContext();
@ -195,7 +195,7 @@ namespace OpenRCT2::Scripting
auto first = GetFirstElement();
if (index < GetNumElements(first))
{
tile_element_remove(&first[index]);
TileElementRemove(&first[index]);
map_invalidate_tile_full(_coords);
}
}

View File

@ -22,7 +22,7 @@ namespace OpenRCT2::Title
if (w != nullptr)
{
auto loc = TileCoordsXY(Location.X, Location.Y).ToCoordsXY().ToTileCentre();
int32_t z = tile_element_height(loc);
int32_t z = TileElementHeight(loc);
// Prevent scroll adjustment due to window placement when in-game
auto oldScreenFlags = gScreenFlags;

View File

@ -47,7 +47,7 @@ static int32_t MapPlaceClearFunc(
map_invalidate_tile({ coords, (*tile_element)->GetBaseZ(), (*tile_element)->GetClearanceZ() });
tile_element_remove(*tile_element);
TileElementRemove(*tile_element);
(*tile_element)--;
return 0;
@ -124,7 +124,7 @@ GameActions::Result MapCanConstructWithClearAt(
res.SetData(ConstructClearResult{ groundFlags });
bool canBuildCrossing = false;
if (map_is_edge(pos))
if (MapIsEdge(pos))
{
res.Error = GameActions::Status::InvalidParameters;
res.ErrorMessage = STR_OFF_EDGE_OF_MAP;

View File

@ -214,7 +214,7 @@ void ParkEntranceFixLocations(void)
gParkEntrances.erase(
std::remove_if(
gParkEntrances.begin(), gParkEntrances.end(),
[](const auto& entrance) { return map_get_park_entrance_element_at(entrance, false) == nullptr; }),
[](const auto& entrance) { return MapGetParkEntranceElementAt(entrance, false) == nullptr; }),
gParkEntrances.end());
}

View File

@ -282,7 +282,7 @@ CoordsXY FootpathGetCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32
{
if (info.SpriteType != ViewportInteractionItem::Footpath)
{
z = tile_element_height(position);
z = TileElementHeight(position);
}
position = viewport_coord_to_map_coord(start_vp_pos, z);
position.x = std::clamp(position.x, minPosition.x, maxPosition.x);
@ -463,7 +463,7 @@ bool WallInTheWay(const CoordsXYRangedZ& fencePos, int32_t direction)
static PathElement* FootpathConnectCornersGetNeighbour(const CoordsXYZ& footpathPos, int32_t requireEdges)
{
if (!map_is_location_valid(footpathPos))
if (!MapIsLocationValid(footpathPos))
{
return nullptr;
}
@ -825,7 +825,7 @@ static void loc_6A6D7E(
rct_neighbour_list* neighbourList)
{
auto targetPos = CoordsXY{ initialTileElementPos } + CoordsDirectionDelta[direction];
if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && map_is_edge(targetPos))
if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && MapIsEdge(targetPos))
{
if (query)
{
@ -1397,7 +1397,7 @@ static int32_t FootpathIsConnectedToMapEdgeHelper(CoordsXYZ footpathPos, int32_t
// Return immediately if we are at the edge of the map and not unowning
// Or if we are unowning and have no tiles left
if ((map_is_edge(targetPos) && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_UNOWN)))
if ((MapIsEdge(targetPos) && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_UNOWN)))
{
return FOOTPATH_SEARCH_SUCCESS;
}
@ -2109,7 +2109,7 @@ static void FootpathRemoveEdgesTowardsHere(
*/
static void FootpathRemoveEdgesTowards(const CoordsXYRangedZ& footPathPos, int32_t direction, bool isQueue)
{
if (!map_is_location_valid(footPathPos))
if (!MapIsLocationValid(footPathPos))
{
return;
}

View File

@ -389,7 +389,7 @@ TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRange
void MapSetTileElement(const TileCoordsXY& tilePos, TileElement* elements)
{
if (!map_is_location_valid(tilePos.ToCoordsXY()))
if (!MapIsLocationValid(tilePos.ToCoordsXY()))
{
log_error("Trying to access element outside of range");
return;
@ -404,7 +404,7 @@ SurfaceElement* MapGetSurfaceElementAt(const CoordsXY& coords)
return *view.begin();
}
PathElement* map_get_path_element_at(const TileCoordsXYZ& loc)
PathElement* MapGetPathElementAt(const TileCoordsXYZ& loc)
{
for (auto* element : TileElementsView<PathElement>(loc.ToCoordsXY()))
{
@ -517,10 +517,10 @@ void MapStripGhostFlagFromElements()
* dx: return remember to & with 0xFFFF if you don't want water affecting results
* rct2: 0x00662783
*/
int16_t tile_element_height(const CoordsXY& loc)
int16_t TileElementHeight(const CoordsXY& loc)
{
// Off the map
if (!map_is_location_valid(loc))
if (!MapIsLocationValid(loc))
return MINIMUM_LAND_HEIGHT_BIG;
// Get the surface element for the tile
@ -654,10 +654,10 @@ int16_t tile_element_height(const CoordsXY& loc)
return height;
}
int16_t tile_element_water_height(const CoordsXY& loc)
int16_t TileElementWaterHeight(const CoordsXY& loc)
{
// Off the map
if (!map_is_location_valid(loc))
if (!MapIsLocationValid(loc))
return 0;
// Get the surface element for the tile
@ -675,7 +675,7 @@ int16_t tile_element_water_height(const CoordsXY& loc)
* Checks if the tile at coordinate at height counts as connected.
* @return 1 if connected, 0 otherwise
*/
bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection)
bool MapCoordIsConnected(const TileCoordsXYZ& loc, uint8_t faceDirection)
{
TileElement* tileElement = MapGetFirstElementAt(loc);
@ -715,7 +715,7 @@ bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection)
*
* rct2: 0x006A876D
*/
void map_update_path_wide_flags()
void MapUpdatePathWideFlags()
{
PROFILED_FUNCTION();
@ -772,26 +772,26 @@ int32_t MapHeightFromSlope(const CoordsXY& coords, int32_t slopeDirection, bool
return 0;
}
bool map_is_location_valid(const CoordsXY& coords)
bool MapIsLocationValid(const CoordsXY& coords)
{
const bool is_x_valid = coords.x < MAXIMUM_MAP_SIZE_BIG && coords.x >= 0;
const bool is_y_valid = coords.y < MAXIMUM_MAP_SIZE_BIG && coords.y >= 0;
return is_x_valid && is_y_valid;
}
bool map_is_edge(const CoordsXY& coords)
bool MapIsEdge(const CoordsXY& coords)
{
auto mapSizeUnits = GetMapSizeUnits();
return (coords.x < 32 || coords.y < 32 || coords.x >= mapSizeUnits.x || coords.y >= mapSizeUnits.y);
}
bool map_can_build_at(const CoordsXYZ& loc)
bool MapCanBuildAt(const CoordsXYZ& loc)
{
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
return true;
if (gCheatsSandboxMode)
return true;
if (map_is_location_owned(loc))
if (MapIsLocationOwned(loc))
return true;
return false;
}
@ -800,10 +800,10 @@ bool map_can_build_at(const CoordsXYZ& loc)
*
* rct2: 0x00664F72
*/
bool map_is_location_owned(const CoordsXYZ& loc)
bool MapIsLocationOwned(const CoordsXYZ& loc)
{
// This check is to avoid throwing lots of messages in logs.
if (map_is_location_valid(loc))
if (MapIsLocationValid(loc))
{
auto* surfaceElement = MapGetSurfaceElementAt(loc);
if (surfaceElement != nullptr)
@ -825,9 +825,9 @@ bool map_is_location_owned(const CoordsXYZ& loc)
*
* rct2: 0x00664F2C
*/
bool map_is_location_in_park(const CoordsXY& coords)
bool MapIsLocationInPark(const CoordsXY& coords)
{
if (map_is_location_valid(coords))
if (MapIsLocationValid(coords))
{
auto surfaceElement = MapGetSurfaceElementAt(coords);
if (surfaceElement == nullptr)
@ -838,9 +838,9 @@ bool map_is_location_in_park(const CoordsXY& coords)
return false;
}
bool map_is_location_owned_or_has_rights(const CoordsXY& loc)
bool MapIsLocationOwnedOrHasRights(const CoordsXY& loc)
{
if (map_is_location_valid(loc))
if (MapIsLocationValid(loc))
{
auto surfaceElement = MapGetSurfaceElementAt(loc);
if (surfaceElement == nullptr)
@ -997,7 +997,7 @@ int32_t tile_element_get_corner_height(const SurfaceElement* surfaceElement, int
return map_get_corner_height(z, slope, direction);
}
uint8_t map_get_lowest_land_height(const MapRange& range)
uint8_t MapGetLowestLandHeight(const MapRange& range)
{
auto mapSizeMax = GetMapSizeMaxXY();
MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32),
@ -1014,7 +1014,7 @@ uint8_t map_get_lowest_land_height(const MapRange& range)
{
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ xi, yi }))
if (!MapIsLocationInPark(CoordsXY{ xi, yi }))
{
continue;
}
@ -1027,7 +1027,7 @@ uint8_t map_get_lowest_land_height(const MapRange& range)
return min_height;
}
uint8_t map_get_highest_land_height(const MapRange& range)
uint8_t MapGetHighestLandHeight(const MapRange& range)
{
auto mapSizeMax = GetMapSizeMaxXY();
MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32),
@ -1043,7 +1043,7 @@ uint8_t map_get_highest_land_height(const MapRange& range)
{
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
{
if (!map_is_location_in_park(CoordsXY{ xi, yi }))
if (!MapIsLocationInPark(CoordsXY{ xi, yi }))
{
continue;
}
@ -1071,7 +1071,7 @@ bool map_is_location_at_edge(const CoordsXY& loc)
*
* rct2: 0x0068B280
*/
void tile_element_remove(TileElement* tileElement)
void TileElementRemove(TileElement* tileElement)
{
// Replace Nth element by (N+1)th element.
// This loop will make tileElement point to the old last element position,
@ -1098,7 +1098,7 @@ void tile_element_remove(TileElement* tileElement)
*
* rct2: 0x00675A8E
*/
void map_remove_all_rides()
void MapRemoveAllRides()
{
tile_element_iterator it;
@ -1121,7 +1121,7 @@ void map_remove_all_rides()
case TileElementType::Track:
FootpathQueueChainReset();
FootpathRemoveEdgesAt(TileCoordsXY{ it.x, it.y }.ToCoordsXY(), it.element);
tile_element_remove(it.element);
TileElementRemove(it.element);
tile_element_iterator_restart_for_tile(&it);
break;
default:
@ -1134,7 +1134,7 @@ void map_remove_all_rides()
*
* rct2: 0x0068AB1B
*/
void map_invalidate_map_selection_tiles()
void MapInvalidateMapSelectionTiles()
{
if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT))
return;
@ -1176,7 +1176,7 @@ static void map_get_bounding_box(const MapRange& _range, int32_t* left, int32_t*
*
* rct2: 0x0068AAE1
*/
void map_invalidate_selection_rect()
void MapInvalidateSelectionRect()
{
int32_t x0, y0, x1, y1, left, right, top, bottom;
@ -1225,7 +1225,7 @@ static TileElement* AllocateTileElements(size_t numElementsOnTile, size_t numNew
*
* rct2: 0x0068B1F6
*/
TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type)
TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type)
{
const auto& tileLoc = TileCoordsXYZ(loc);
@ -1344,7 +1344,7 @@ void map_update_tiles()
}
}
void map_remove_provisional_elements()
void MapRemoveProvisionalElements()
{
PROFILED_FUNCTION();
@ -1367,7 +1367,7 @@ void map_remove_provisional_elements()
}
}
void map_restore_provisional_elements()
void MapRestoreProvisionalElements()
{
PROFILED_FUNCTION();
@ -1547,7 +1547,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
TileElementRemove(element);
}
break;
}
@ -1559,7 +1559,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
TileElementRemove(element);
}
}
break;
@ -1571,7 +1571,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
TileElementRemove(element);
}
}
break;
@ -1583,12 +1583,12 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
TileElementRemove(element);
}
break;
}
default:
tile_element_remove(element);
TileElementRemove(element);
break;
}
}
@ -1660,7 +1660,7 @@ LargeSceneryElement* map_get_large_scenery_segment(const CoordsXYZD& sceneryPos,
return nullptr;
}
EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost)
EntranceElement* MapGetParkEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost)
{
auto entranceTileCoords = TileCoordsXYZ(entranceCoords);
TileElement* tileElement = MapGetFirstElementAt(entranceCoords);
@ -1686,7 +1686,7 @@ EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoord
return nullptr;
}
EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost)
EntranceElement* MapGetRideEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost)
{
auto entranceTileCoords = TileCoordsXYZ{ entranceCoords };
TileElement* tileElement = MapGetFirstElementAt(entranceCoords);
@ -1712,7 +1712,7 @@ EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoord
return nullptr;
}
EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool ghost)
EntranceElement* MapGetRideExitElementAt(const CoordsXYZ& exitCoords, bool ghost)
{
auto exitTileCoords = TileCoordsXYZ{ exitCoords };
TileElement* tileElement = MapGetFirstElementAt(exitCoords);
@ -1738,7 +1738,7 @@ EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool
return nullptr;
}
SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant)
SmallSceneryElement* MapGetSmallSceneryElementAt(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant)
{
auto sceneryTileCoords = TileCoordsXYZ{ sceneryCoords };
TileElement* tileElement = MapGetFirstElementAt(sceneryCoords);
@ -1933,9 +1933,9 @@ int32_t map_get_tile_quadrant(const CoordsXY& mapPos)
*
* rct2: 0x00693BFF
*/
bool map_surface_is_blocked(const CoordsXY& mapCoords)
bool MapSurfaceIsBlocked(const CoordsXY& mapCoords)
{
if (!map_is_location_valid(mapCoords))
if (!MapIsLocationValid(mapCoords))
return true;
auto surfaceElement = MapGetSurfaceElementAt(mapCoords);
@ -2205,7 +2205,7 @@ TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD&
return nullptr;
};
WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords)
WallElement* MapGetWallElementAt(const CoordsXYRangedZ& coords)
{
auto tileElement = MapGetFirstElementAt(coords);
@ -2224,7 +2224,7 @@ WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords)
return nullptr;
}
WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords)
WallElement* MapGetWallElementAt(const CoordsXYZD& wallCoords)
{
auto tileWallCoords = TileCoordsXYZ(wallCoords);
TileElement* tileElement = MapGetFirstElementAt(wallCoords);

View File

@ -169,34 +169,34 @@ void MapSetTileElement(const TileCoordsXY& tilePos, TileElement* elements);
int32_t MapHeightFromSlope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped);
BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t direction);
SurfaceElement* MapGetSurfaceElementAt(const CoordsXY& coords);
PathElement* map_get_path_element_at(const TileCoordsXYZ& loc);
WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords);
WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords);
SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant);
EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost);
EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost);
EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool ghost);
int16_t tile_element_height(const CoordsXY& loc);
int16_t tile_element_water_height(const CoordsXY& loc);
uint8_t map_get_highest_land_height(const MapRange& range);
uint8_t map_get_lowest_land_height(const MapRange& range);
bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection);
void map_remove_provisional_elements();
void map_restore_provisional_elements();
void map_update_path_wide_flags();
bool map_is_location_valid(const CoordsXY& coords);
bool map_is_edge(const CoordsXY& coords);
bool map_can_build_at(const CoordsXYZ& loc);
bool map_is_location_owned(const CoordsXYZ& loc);
bool map_is_location_in_park(const CoordsXY& coords);
bool map_is_location_owned_or_has_rights(const CoordsXY& loc);
bool map_surface_is_blocked(const CoordsXY& mapCoords);
void tile_element_remove(TileElement* tileElement);
void map_remove_all_rides();
void map_invalidate_map_selection_tiles();
void map_invalidate_selection_rect();
PathElement* MapGetPathElementAt(const TileCoordsXYZ& loc);
WallElement* MapGetWallElementAt(const CoordsXYZD& wallCoords);
WallElement* MapGetWallElementAt(const CoordsXYRangedZ& coords);
SmallSceneryElement* MapGetSmallSceneryElementAt(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant);
EntranceElement* MapGetParkEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost);
EntranceElement* MapGetRideEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost);
EntranceElement* MapGetRideExitElementAt(const CoordsXYZ& exitCoords, bool ghost);
uint8_t MapGetHighestLandHeight(const MapRange& range);
uint8_t MapGetLowestLandHeight(const MapRange& range);
bool MapCoordIsConnected(const TileCoordsXYZ& loc, uint8_t faceDirection);
void MapRemoveProvisionalElements();
void MapRestoreProvisionalElements();
void MapUpdatePathWideFlags();
bool MapIsLocationValid(const CoordsXY& coords);
bool MapIsEdge(const CoordsXY& coords);
bool MapCanBuildAt(const CoordsXYZ& loc);
bool MapIsLocationOwned(const CoordsXYZ& loc);
bool MapIsLocationInPark(const CoordsXY& coords);
bool MapIsLocationOwnedOrHasRights(const CoordsXY& loc);
bool MapSurfaceIsBlocked(const CoordsXY& mapCoords);
void MapRemoveAllRides();
void MapInvalidateMapSelectionTiles();
void MapInvalidateSelectionRect();
bool MapCheckCapacityAndReorganise(const CoordsXY& loc, size_t numElements = 1);
TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type);
int16_t TileElementHeight(const CoordsXY& loc);
int16_t TileElementWaterHeight(const CoordsXY& loc);
void TileElementRemove(TileElement* tileElement);
TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type);
template<typename T = TileElement> T* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRangedZ& loc)
{
@ -206,7 +206,7 @@ template<typename T = TileElement> T* MapGetFirstTileElementWithBaseHeightBetwee
template<typename T> T* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants)
{
auto* element = tile_element_insert(loc, occupiedQuadrants, T::ElementType);
auto* element = TileElementInsert(loc, occupiedQuadrants, T::ElementType);
return (element != nullptr) ? element->template as<T>() : nullptr;
}

View File

@ -259,7 +259,7 @@ static void MapGenPlaceTree(ObjectEntryIndex type, const CoordsXY& loc)
return;
}
int32_t surfaceZ = tile_element_height(loc.ToTileCentre());
int32_t surfaceZ = TileElementHeight(loc.ToTileCentre());
auto* sceneryElement = TileElementInsert<SmallSceneryElement>({ loc, surfaceZ }, 0b1111);
Guard::Assert(sceneryElement != nullptr);

Some files were not shown because too many files have changed in this diff Show More