summaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'map.h')
-rw-r--r--map.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/map.h b/map.h
index 489cb025c..bed014bfa 100644
--- a/map.h
+++ b/map.h
@@ -72,4 +72,22 @@ static inline TileIndexDiff TileOffsByDir(uint dir)
return ToTileIndexDiff(_tileoffs_by_dir[dir]);
}
+
+static inline uint TileHeight(TileIndex tile)
+{
+ assert(tile < MapSize());
+ return (_map_type_and_height[tile] & 0xf) * 8;
+}
+
+static inline int TileType(TileIndex tile)
+{
+ assert(tile < MapSize());
+ return _map_type_and_height[tile] >> 4;
+}
+
+static inline bool IsTileType(TileIndex tile, int type)
+{
+ return TileType(tile) == type;
+}
+
#endif