diff options
author | rubidium <rubidium@openttd.org> | 2014-09-21 17:29:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-09-21 17:29:48 +0000 |
commit | 073aa05da5fa417ede47679291f2d117b119dfd6 (patch) | |
tree | 5687e77ca3045478e62b170a91037fa80c0ef0c9 /src/viewport.cpp | |
parent | 4d619ad10e8a8b35b96b9772543c8fa46d5beb10 (diff) | |
download | openttd-073aa05da5fa417ede47679291f2d117b119dfd6.tar.xz |
(svn r26900) -Fix-ish: dirty the appropriate area around map edges when terraforming there to prevent any artefacts from occuring (ic111)
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. * |