(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts

This commit is contained in:
tron
2005-01-16 11:24:58 +00:00
parent d2643dc483
commit ae796740aa
33 changed files with 239 additions and 217 deletions

18
map.h
View File

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