1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-12 02:22:26 +01:00

Change MapAnimations::MarkTileForInvalidation parameter to TileCoordsXY

This commit is contained in:
mix
2025-05-25 05:06:19 +01:00
parent d98a06564a
commit 89f349f6e8
10 changed files with 13 additions and 14 deletions

View File

@@ -161,7 +161,7 @@ GameActions::Result BannerPlaceAction::Execute() const
bannerElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); bannerElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST);
MapInvalidateTileFull(_loc); MapInvalidateTileFull(_loc);
MapAnimations::MarkTileForInvalidation(_loc); MapAnimations::MarkTileForInvalidation(TileCoordsXY(_loc));
res.Cost = bannerEntry->price; res.Cost = bannerEntry->price;
return res; return res;

View File

@@ -314,7 +314,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
newSceneryElement->SetBannerIndex(banner->id); newSceneryElement->SetBannerIndex(banner->id);
} }
MapAnimations::MarkTileForInvalidation(curTile); MapAnimations::MarkTileForInvalidation(TileCoordsXY(curTile));
MapInvalidateTileFull(curTile); MapInvalidateTileFull(curTile);
if (tile.index == 0) if (tile.index == 0)

View File

@@ -186,7 +186,7 @@ GameActions::Result ParkEntrancePlaceAction::Execute() const
if (index == 0) if (index == 0)
{ {
MapAnimations::MarkTileForInvalidation(entranceLoc); MapAnimations::MarkTileForInvalidation(TileCoordsXY(entranceLoc));
} }
} }

View File

@@ -213,7 +213,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const
station.LastPeepInQueue = EntityId::GetNull(); station.LastPeepInQueue = EntityId::GetNull();
station.QueueLength = 0; station.QueueLength = 0;
MapAnimations::MarkTileForInvalidation(_loc); MapAnimations::MarkTileForInvalidation(TileCoordsXY(_loc));
} }
FootpathQueueChainReset(); FootpathQueueChainReset();

View File

@@ -456,7 +456,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const
} }
else if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED)) else if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED))
{ {
MapAnimations::MarkTileForInvalidation(_loc); MapAnimations::MarkTileForInvalidation(TileCoordsXY(_loc));
} }
return res; return res;

View File

@@ -600,7 +600,7 @@ GameActions::Result TrackPlaceAction::Execute() const
case TrackElemType::Whirlpool: case TrackElemType::Whirlpool:
[[fallthrough]]; [[fallthrough]];
case TrackElemType::SpinningTunnel: case TrackElemType::SpinningTunnel:
MapAnimations::MarkTileForInvalidation(mapLoc); MapAnimations::MarkTileForInvalidation(TileCoordsXY(mapLoc));
break; break;
case TrackElemType::Brakes: case TrackElemType::Brakes:
[[fallthrough]]; [[fallthrough]];

View File

@@ -399,7 +399,7 @@ GameActions::Result WallPlaceAction::Execute() const
wallElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); wallElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST);
MapAnimations::MarkTileForInvalidation(targetLoc); MapAnimations::MarkTileForInvalidation(TileCoordsXY(targetLoc));
MapInvalidateTileZoom1({ _loc, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 }); MapInvalidateTileZoom1({ _loc, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 });
res.Cost = wallEntry->price; res.Cost = wallEntry->price;

View File

@@ -914,7 +914,7 @@ void FootpathChainRideQueue(
lastPathElement->AsPath()->SetHasQueueBanner(true); lastPathElement->AsPath()->SetHasQueueBanner(true);
lastPathElement->AsPath()->SetQueueBannerDirection(lastPathDirection); // set the ride sign direction lastPathElement->AsPath()->SetQueueBannerDirection(lastPathDirection); // set the ride sign direction
MapAnimations::MarkTileForInvalidation(lastPath); MapAnimations::MarkTileForInvalidation(TileCoordsXY(lastPath));
} }
} }
} }

View File

@@ -592,12 +592,11 @@ static std::optional<UpdateType> IsElementAnimated(const TileElementBase& elemen
return std::nullopt; return std::nullopt;
} }
void MapAnimations::MarkTileForInvalidation(const CoordsXY coords) void MapAnimations::MarkTileForInvalidation(const TileCoordsXY coords)
{ {
const TileCoordsXY tileCoords(coords); if (!_mapAnimationsUpdate.contains(coords))
if (!_mapAnimationsUpdate.contains(tileCoords))
{ {
_mapAnimationsInvalidate.insert(tileCoords); _mapAnimationsInvalidate.insert(coords);
} }
} }
@@ -624,7 +623,7 @@ void MapAnimations::MarkAllTiles()
switch (*isAnimated) switch (*isAnimated)
{ {
case UpdateType::invalidate: case UpdateType::invalidate:
MarkTileForInvalidation(TileCoordsXY(it.x, it.y).ToCoordsXY()); MarkTileForInvalidation(TileCoordsXY(it.x, it.y));
break; break;
case UpdateType::update: case UpdateType::update:
MarkTileForUpdate(TileCoordsXY(it.x, it.y)); MarkTileForUpdate(TileCoordsXY(it.x, it.y));

View File

@@ -19,7 +19,7 @@ namespace OpenRCT2::MapAnimations
landEdgeDoor, landEdgeDoor,
}; };
void MarkTileForInvalidation(const CoordsXY coords); void MarkTileForInvalidation(const TileCoordsXY coords);
void MarkTileForUpdate(const TileCoordsXY coords); void MarkTileForUpdate(const TileCoordsXY coords);
void CreateTemporary(const CoordsXYZ& coords, const TemporaryType type); void CreateTemporary(const CoordsXYZ& coords, const TemporaryType type);
void MarkAllTiles(); void MarkAllTiles();