summaryrefslogtreecommitdiff
path: root/tile.h
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-07-16 23:47:37 +0000
committercelestar <celestar@openttd.org>2005-07-16 23:47:37 +0000
commit9ca761b06534ed191b0624a6c7049db296997a73 (patch)
treeb32b3e56573203f32982f2fc2b3966529a6d1857 /tile.h
parent64f6839816221873b9a5327fe038533a7d3b8a98 (diff)
downloadopenttd-9ca761b06534ed191b0624a6c7049db296997a73.tar.xz
(svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is steep
(i.e. spans two height levels) and use it throughout the code. -Codechange: Add CanBuildDepotByTileh to find if a tile is suitable to build a depot on it. Wraps some bitmagic which seems quite unreadable at first glance
Diffstat (limited to 'tile.h')
-rw-r--r--tile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tile.h b/tile.h
index 2a34e85e4..9074f8601 100644
--- a/tile.h
+++ b/tile.h
@@ -61,6 +61,11 @@ static inline uint TileHeight(TileIndex tile)
return GB(_m[tile].type_height, 0, 4);
}
+static inline bool IsSteepTileh(uint tileh)
+{
+ return (tileh & 0x10);
+}
+
static inline void SetTileHeight(TileIndex tile, uint height)
{
assert(tile < MapSize());