From 7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4 Mon Sep 17 00:00:00 2001 From: tron Date: Fri, 7 Jan 2005 17:02:43 +0000 Subject: (svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY] --- macros.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'macros.h') 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))) -- cgit v1.2.3-54-g00ecf