summaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'map.h')
-rw-r--r--map.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/map.h b/map.h
index 289d80a13..ba69cfb8a 100644
--- a/map.h
+++ b/map.h
@@ -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];