summaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-16 14:50:01 +0000
committertron <tron@openttd.org>2005-01-16 14:50:01 +0000
commit022b8cea37b1ae1a3a1745c5373d202a7f267a2d (patch)
tree187e8c5437b91c17d0f652b2f0d01e30fbd131b4 /map.h
parent8e404a26f65b8851b3dcf067fddf62f188005ee9 (diff)
downloadopenttd-022b8cea37b1ae1a3a1745c5373d202a7f267a2d.tar.xz
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
Replace some direct references to _map_type_and_height with TileHeight()/IsTileType()
Diffstat (limited to 'map.h')
-rw-r--r--map.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/map.h b/map.h
index a2d37e755..126bdd0b3 100644
--- a/map.h
+++ b/map.h
@@ -73,10 +73,15 @@ static inline TileIndexDiff TileOffsByDir(uint dir)
}
-static inline uint TilePixelHeight(TileIndex tile)
+static inline uint TileHeight(TileIndex tile)
{
assert(tile < MapSize());
- return (_map_type_and_height[tile] & 0xf) * 8;
+ return _map_type_and_height[tile] & 0xf;
+}
+
+static inline uint TilePixelHeight(TileIndex tile)
+{
+ return TileHeight(tile) * 8;
}
static inline int TileType(TileIndex tile)