(svn r26900) -Fix-ish: dirty the appropriate area around map edges when terraforming there to prevent any artefacts from occuring (ic111)

This commit is contained in:
rubidium
2014-09-21 17:29:48 +00:00
parent 4d619ad10e
commit 073aa05da5
3 changed files with 95 additions and 0 deletions

View File

@@ -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.
*