diff options
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 81c630a3a..255b9c784 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2139,6 +2139,20 @@ void MarkTileDirtyByTile(TileIndex tile) ); } +void MarkTileDirtyByTileOutsideMap(int x, int y) +{ + Point pt = RemapCoords(x * TILE_SIZE, y * TILE_SIZE, GetTilePixelZOutsideMap(x, y)); + /* Since tiles painted outside the map don't contain buildings, trees, etc., + * this reduced area for repainting should suffice. If not, adjust the offsets + * used below. */ + MarkAllViewportsDirty( + pt.x - TILE_SIZE + 1, + pt.y, + pt.x + TILE_SIZE - 1, + pt.y + TILE_SIZE + TILE_HEIGHT - 1 + ); +} + /** * Marks the selected tiles as dirty. * |