summaryrefslogtreecommitdiff
path: root/tile.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-23 13:48:16 +0000
committertron <tron@openttd.org>2006-04-23 13:48:16 +0000
commit0347fb2ab67e942826523424c35ede66d27339fe (patch)
tree3f0769bd955cefba7ab80063e64546c1874e0a62 /tile.h
parentb5ce99c52d1ce36f56431652f7fcc67eb9d5bf6d (diff)
downloadopenttd-0347fb2ab67e942826523424c35ede66d27339fe.tar.xz
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
Diffstat (limited to 'tile.h')
-rw-r--r--tile.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/tile.h b/tile.h
index 81bb6d0a0..cb51208e3 100644
--- a/tile.h
+++ b/tile.h
@@ -5,6 +5,7 @@
#include "macros.h"
#include "map.h"
+#include "slope.h"
typedef enum TileTypes {
MP_CLEAR,
@@ -26,11 +27,11 @@ typedef enum TropicZones {
TROPICZONE_RAINFOREST = 2,
} TropicZone;
-uint GetTileh(uint n, uint w, uint e, uint s, uint *h);
-uint GetTileSlope(TileIndex tile, uint *h);
+Slope GetTileh(uint n, uint w, uint e, uint s, uint *h);
+Slope GetTileSlope(TileIndex tile, uint *h);
uint GetTileZ(TileIndex tile);
-static inline bool CorrectZ(uint tileh)
+static inline bool CorrectZ(Slope 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 */
@@ -43,11 +44,6 @@ 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());