forked from mirror/OpenTTD
(svn r27157) -Fix: Mark bridge middle tiles dirty when building/removing/changing bridges.
This commit is contained in:
@@ -2232,14 +2232,15 @@ void ConstrainAllViewportsZoom()
|
||||
/**
|
||||
* Mark a tile given by its index dirty for repaint.
|
||||
* @param tile The tile to mark dirty.
|
||||
* @param bridge_level_offset Height of bridge on tile to also mark dirty. (Height level relative to north corner.)
|
||||
* @ingroup dirty
|
||||
*/
|
||||
void MarkTileDirtyByTile(TileIndex tile)
|
||||
void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset)
|
||||
{
|
||||
Point pt = RemapCoords(TileX(tile) * TILE_SIZE, TileY(tile) * TILE_SIZE, TilePixelHeight(tile));
|
||||
MarkAllViewportsDirty(
|
||||
pt.x - MAX_TILE_EXTENT_LEFT,
|
||||
pt.y - MAX_TILE_EXTENT_TOP,
|
||||
pt.y - MAX_TILE_EXTENT_TOP - ZOOM_LVL_BASE * TILE_HEIGHT * bridge_level_offset,
|
||||
pt.x + MAX_TILE_EXTENT_RIGHT,
|
||||
pt.y + MAX_TILE_EXTENT_BOTTOM);
|
||||
}
|
||||
|
Reference in New Issue
Block a user