1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Use CoordsXY on footpath_connect_edges()

This commit is contained in:
Tulio Leao
2020-01-04 07:31:02 -03:00
parent e87607fa6d
commit b1dc6ed6ed
8 changed files with 12 additions and 12 deletions

View File

@@ -426,7 +426,7 @@ private:
}
if (!(GetFlags() & GAME_COMMAND_FLAG_PATH_SCENERY))
footpath_connect_edges(_loc.x, _loc.y, (TileElement*)pathElement, GetFlags());
footpath_connect_edges(_loc, reinterpret_cast<TileElement*>(pathElement), GetFlags());
footpath_update_queue_chains();
map_invalidate_tile_full(_loc);

View File

@@ -171,7 +171,7 @@ public:
if (!(flags & GAME_COMMAND_FLAG_GHOST))
{
footpath_connect_edges(entranceLoc.x, entranceLoc.y, newElement, 1);
footpath_connect_edges(entranceLoc, newElement, GAME_COMMAND_FLAG_APPLY);
}
update_park_fences(entranceLoc);

View File

@@ -224,7 +224,7 @@ public:
maze_entrance_hedge_removal(_loc.x, _loc.y, tileElement);
}
footpath_connect_edges(_loc.x, _loc.y, tileElement, GetFlags());
footpath_connect_edges(_loc, tileElement, GetFlags());
footpath_update_queue_chains();
map_invalidate_tile_full(_loc);

View File

@@ -676,7 +676,7 @@ public:
if (!gCheatsDisableClearanceChecks || !(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
footpath_connect_edges(mapLoc.x, mapLoc.y, tileElement, GetFlags());
footpath_connect_edges(mapLoc, tileElement, GetFlags());
}
map_invalidate_tile_full(mapLoc);
}

View File

@@ -3001,7 +3001,7 @@ private:
// Trigger footpath update
footpath_queue_chain_reset();
footpath_connect_edges(
entranceCoords.x * 32, (entranceCoords.y) * 32, (TileElement*)entranceElement,
entranceCoords.ToCoordsXY(), reinterpret_cast<TileElement*>(entranceElement),
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
footpath_update_queue_chains();
}

View File

@@ -1205,7 +1205,7 @@ static bool TrackDesignPlaceSceneryElement(
| GAME_COMMAND_FLAG_GHOST;
}
footpath_connect_edges(mapCoord.x, mapCoord.y, reinterpret_cast<TileElement*>(pathElement), flags);
footpath_connect_edges(mapCoord, reinterpret_cast<TileElement*>(pathElement), flags);
footpath_update_queue_chains();
return true;
}

View File

@@ -987,7 +987,7 @@ static void loc_6A6C85(
*
* rct2: 0x006A6C66
*/
void footpath_connect_edges(int32_t x, int32_t y, TileElement* tileElement, int32_t flags)
void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElement, int32_t flags)
{
rct_neighbour_list neighbourList;
rct_neighbour neighbour;
@@ -996,10 +996,10 @@ void footpath_connect_edges(int32_t x, int32_t y, TileElement* tileElement, int3
neighbour_list_init(&neighbourList);
footpath_update_queue_entrance_banner(x, y, tileElement);
footpath_update_queue_entrance_banner(footpathPos.x, footpathPos.y, tileElement);
for (Direction direction : ALL_DIRECTIONS)
{
loc_6A6C85(x, y, direction, tileElement, flags, true, &neighbourList);
loc_6A6C85(footpathPos.x, footpathPos.y, direction, tileElement, flags, true, &neighbourList);
}
neighbour_list_sort(&neighbourList);
@@ -1035,12 +1035,12 @@ void footpath_connect_edges(int32_t x, int32_t y, TileElement* tileElement, int3
while (neighbour_list_pop(&neighbourList, &neighbour))
{
loc_6A6C85(x, y, neighbour.direction, tileElement, flags, false, nullptr);
loc_6A6C85(footpathPos.x, footpathPos.y, neighbour.direction, tileElement, flags, false, nullptr);
}
if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH)
{
footpath_connect_corners(x, y, tileElement);
footpath_connect_corners(footpathPos.x, footpathPos.y, tileElement);
}
}

View File

@@ -187,7 +187,7 @@ void footpath_get_coordinates_from_pos(
void footpath_bridge_get_info_from_pos(
ScreenCoordsXY screenCoords, int32_t* x, int32_t* y, int32_t* direction, TileElement** tileElement);
void footpath_remove_litter(int32_t x, int32_t y, int32_t z);
void footpath_connect_edges(int32_t x, int32_t y, TileElement* tileElement, int32_t flags);
void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElement, int32_t flags);
void footpath_update_queue_chains();
bool fence_in_the_way(int32_t x, int32_t y, int32_t z0, int32_t z1, int32_t direction);
void footpath_chain_ride_queue(