summaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-21 22:15:02 +0000
committertron <tron@openttd.org>2005-07-21 22:15:02 +0000
commit0762aa9ec950a7c7966b1706daa7a032f5de790a (patch)
tree0e2d2d052ab58755549ef42d694f58679a4c496c /map.h
parenta446294e7cdbcf71ffe2052a4a9954dc46a64133 (diff)
downloadopenttd-0762aa9ec950a7c7966b1706daa7a032f5de790a.tar.xz
(svn r2669) Shuffle some more stuff around to reduce dependencies
Diffstat (limited to 'map.h')
-rw-r--r--map.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/map.h b/map.h
index 02513ddd0..bb11c3612 100644
--- a/map.h
+++ b/map.h
@@ -146,6 +146,20 @@ uint DistanceTrack(TileIndex, TileIndex); // Returns the shortest distance one c
uint DistanceFromEdge(TileIndex); // shortest distance from any edge of the map
+#define BEGIN_TILE_LOOP(var,w,h,tile) \
+ { \
+ int h_cur = h; \
+ uint var = tile; \
+ do { \
+ int w_cur = w; \
+ do {
+
+#define END_TILE_LOOP(var,w,h,tile) \
+ } while (++var, --w_cur != 0); \
+ } while (var += TileDiffXY(0, 1) - (w), --h_cur != 0); \
+ }
+
+
static inline TileIndexDiff TileOffsByDir(uint dir)
{
extern const TileIndexDiffC _tileoffs_by_dir[4];