diff options
author | tron <tron@openttd.org> | 2005-01-09 17:55:11 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-09 17:55:11 +0000 |
commit | 55e6b4f928656c23b1f8bb5cbb3763152213a0b0 (patch) | |
tree | 0fc0024c473c2a61c0b6b9be4b9fcaae7e056ddd /map.h | |
parent | 32f480a4aebb85abc03dad56149c2d05bcf8a65b (diff) | |
download | openttd-55e6b4f928656c23b1f8bb5cbb3763152213a0b0.tar.xz |
(svn r1447) Move TILE_ADD(), TILE_ADDXY() and SafeTileAdd() to map.[ch] and make the latter map size agnostic
Diffstat (limited to 'map.h')
-rw-r--r-- | map.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -52,6 +52,18 @@ static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc) return (tidc.y << MapLogX()) + tidc.x; } + +#ifndef _DEBUG + #define TILE_ADD(x,y) ((x) + (y)) +#else + extern TileIndex TileAdd(TileIndex tile, TileIndexDiff add, + const char *exp, const char *file, int line); + #define TILE_ADD(x, y) (TileAdd((x), (y), #x " + " #y, __FILE__, __LINE__)) +#endif + +#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TILE_XY(x, y)) + + static inline TileIndexDiff TileOffsByDir(uint dir) { extern const TileIndexDiffC _tileoffs_by_dir[4]; |