diff options
author | tron <tron@openttd.org> | 2005-01-18 18:41:56 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-18 18:41:56 +0000 |
commit | 31d6f87d80bb42c1fbb8841071937e6d86fe9e86 (patch) | |
tree | 0e41a8961f8378269224ee774e2ebd64fcf9e349 /map.h | |
parent | 64b08311b9539e3a805365155c396cec854dd5f5 (diff) | |
download | openttd-31d6f87d80bb42c1fbb8841071937e6d86fe9e86.tar.xz |
(svn r1560) Introduce SetTileType() and SetTileHeight()
Replace direct references to _map_type_and_height with these
Diffstat (limited to 'map.h')
-rw-r--r-- | map.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -79,6 +79,14 @@ static inline uint TileHeight(TileIndex tile) return _map_type_and_height[tile] & 0xf; } +static inline void SetTileHeight(TileIndex tile, uint height) +{ + assert(tile < MapSize()); + assert(height < 16); + _map_type_and_height[tile] &= ~0x0F; + _map_type_and_height[tile] |= height; +} + static inline uint TilePixelHeight(TileIndex tile) { return TileHeight(tile) * 8; @@ -90,6 +98,13 @@ static inline int TileType(TileIndex tile) return _map_type_and_height[tile] >> 4; } +static inline void SetTileType(TileIndex tile, uint type) +{ + assert(tile < MapSize()); + _map_type_and_height[tile] &= ~0xF0; + _map_type_and_height[tile] |= type << 4; +} + static inline bool IsTileType(TileIndex tile, int type) { return TileType(tile) == type; |