(svn r18718) -Codechange: make a wrapper macro for looping TileAreas

This commit is contained in:
rubidium
2010-01-04 18:30:10 +00:00
parent 87466a4ed0
commit 3e131e2fec
9 changed files with 23 additions and 13 deletions

View File

@@ -347,6 +347,16 @@ uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the ma
for (uint var = tile, cur_h = (h); cur_h > 0; --cur_h, var += TileDiffXY(0, 1) - (w)) \
for (uint cur_w = (w); cur_w > 0; --cur_w, var++)
/**
* A loop which iterates over the tiles of a TileArea
*
* This macro starts 2 nested loops which iterates over a square of tiles.
*
* @param var The name of the variable which contains the current tile
* @param ta The tile area to search over
*/
#define TILE_AREA_LOOP(var, ta) TILE_LOOP(var, ta.w, ta.h, ta.tile)
/**
* Convert a DiagDirection to a TileIndexDiff
*