diff options
author | frosch <frosch@openttd.org> | 2015-02-14 12:53:07 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-02-14 12:53:07 +0000 |
commit | 2e1be6081d10863449ee1c2d0b1895704838bf1d (patch) | |
tree | 2029405a1ccde2c48879005f2d1ae5b278248be6 /src/tile_map.h | |
parent | 1cf09f804be99adbc2a046fd124330f4fc36c731 (diff) | |
download | openttd-2e1be6081d10863449ee1c2d0b1895704838bf1d.tar.xz |
(svn r27148) -Fix: Rounding and unit-conversion inconsistencies in calls to MarkAllViewportsDirty.
Diffstat (limited to 'src/tile_map.h')
-rw-r--r-- | src/tile_map.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tile_map.h b/src/tile_map.h index 08479e1aa..4d5891d7b 100644 --- a/src/tile_map.h +++ b/src/tile_map.h @@ -67,6 +67,19 @@ static inline uint TilePixelHeight(TileIndex tile) } /** + * Returns the tile height for a coordinate outside map. Such a height is + * needed for painting the area outside map using completely black tiles. + * The idea is descending to heightlevel 0 as fast as possible. + * @param x The X-coordinate (same unit as TileX). + * @param y The Y-coordinate (same unit as TileY). + * @return The height in pixels in the same unit as TilePixelHeight. + */ +static inline uint TilePixelHeightOutsideMap(int x, int y) +{ + return TileHeightOutsideMap(x, y) * TILE_HEIGHT; +} + +/** * Get the tiletype of a given tile. * * @param tile The tile to get the TileType |