summaryrefslogtreecommitdiff
path: root/tile.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-02-22 12:48:03 +0000
committertron <tron@openttd.org>2005-02-22 12:48:03 +0000
commit51eef8c5b7b54a64802fc3b833898f0fd75b6a51 (patch)
treeb51c88c837ee8419763f34a5fbfd2ff8969ecaa3 /tile.h
parentf22eab55442cc77096ec1cd713c358c0208f2c62 (diff)
downloadopenttd-51eef8c5b7b54a64802fc3b833898f0fd75b6a51.tar.xz
(svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers
Diffstat (limited to 'tile.h')
-rw-r--r--tile.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tile.h b/tile.h
index cb0fa1e03..3752ed29f 100644
--- a/tile.h
+++ b/tile.h
@@ -1,6 +1,7 @@
#ifndef TILE_H
#define TILE_H
+#include "macros.h"
#include "map.h"
typedef enum TileType {
@@ -23,6 +24,13 @@ uint GetMapExtraBits(TileIndex tile);
uint GetTileSlope(TileIndex tile, uint *h);
uint GetTileZ(TileIndex tile);
+static inline bool CorrectZ(uint tileh)
+{
+ /* tile height must be corrected if the north corner is not raised, but
+ * any other corner is. These are the cases 1 till 7 */
+ return IS_INT_INSIDE(tileh, 1, 8);
+}
+
static inline uint TileHeight(TileIndex tile)
{
assert(tile < MapSize());