Reduce viewport invalidation area of track reservation changes

This commit is contained in:
Jonathan G Rennison
2020-02-20 00:16:51 +00:00
parent 2c2184f89d
commit c13ff2a1d3
3 changed files with 14 additions and 3 deletions

View File

@@ -3358,6 +3358,15 @@ void MarkTileDirtyByTile(TileIndex tile, const ZoomLevel mark_dirty_if_zoomlevel
);
}
void MarkTileGroundDirtyByTile(TileIndex tile, const ZoomLevel mark_dirty_if_zoomlevel_is_below)
{
int x = TileX(tile) * TILE_SIZE;
int y = TileY(tile) * TILE_SIZE;
Point top = RemapCoords(x, y, GetTileMaxPixelZ(tile));
Point bot = RemapCoords(x + TILE_SIZE, y + TILE_SIZE, GetTilePixelZ(tile));
MarkAllViewportsDirty(top.x - TILE_PIXELS * ZOOM_LVL_BASE, top.y - TILE_HEIGHT * ZOOM_LVL_BASE, top.x + TILE_PIXELS * ZOOM_LVL_BASE, bot.y);
}
void MarkTileLineDirty(const TileIndex from_tile, const TileIndex to_tile)
{
assert(from_tile != INVALID_TILE);