summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-07 17:02:43 +0000
committertron <tron@openttd.org>2005-01-07 17:02:43 +0000
commit7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4 (patch)
treee4137b60a824b45ce09f668d58520e36dba10256 /macros.h
parentf5c33e50733c46cee14e84ade6da0c171d96064b (diff)
downloadopenttd-7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4.tar.xz
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/macros.h b/macros.h
index 24be9a911..d9577304d 100644
--- a/macros.h
+++ b/macros.h
@@ -1,6 +1,8 @@
#ifndef MACROS_H
#define MACROS_H
+#include "map.h"
+
#define MAX_INT 0x7FFFFFFF
#ifdef min
@@ -96,16 +98,6 @@ extern uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int
#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TILE_XY(x,y))
-#if TILE_X_BITS == 8
-#define GET_TILE_X(t) (uint)((byte)(t))
-#define GET_TILE_Y(t) (uint)((t) >> 8)
-#define TILE_MASK(x) ((uint16)(x))
-#else
-#define GET_TILE_X(t) (uint)((t) & ((1 << TILE_X_BITS)-1))
-#define GET_TILE_Y(t) (uint)((t) >> TILE_X_BITS)
-#define TILE_MASK(x) (int)((x) & ((1 << (TILE_X_BITS + TILE_Y_BITS))-1))
-#endif
-
//#define REMADP_COORDS(x,y,z) { int t = x; x = (y-t)*2; y+=t-z; }
#define PACK_POINT(x,y) ((x) | ((y) << 16))
@@ -148,8 +140,6 @@ static inline int FindFirstBit2x64(int value)
}
-typedef uint16 TileIndex;
-
/* [min,max), strictly less than */
#define IS_BYTE_INSIDE(a,min,max) ((byte)((a)-(min)) < (byte)((max)-(min)))
#define IS_INT_INSIDE(a,min,max) ((uint)((a)-(min)) < (uint)((max)-(min)))