(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff

This commit is contained in:
tron
2005-01-06 11:39:00 +00:00
parent 9a32e38633
commit d3c6855320
21 changed files with 469 additions and 463 deletions

View File

@@ -224,11 +224,11 @@ static void ClickTile_Unmovable(uint tile)
}
}
static const TileIndexDiff _tile_add[4] = {
TILE_XY(1,0),
TILE_XY(0,1),
TILE_XY(-1,0),
TILE_XY(0,-1),
static const TileIndexDiffC _tile_add[] = {
{ 1, 0},
{ 0, 1},
{-1, 0},
{ 0, -1}
};
/* checks, if a radio tower is within a 9x9 tile square around tile */
@@ -295,7 +295,7 @@ restart:
do {
if (--j == 0)
goto restart;
tile = TILE_MASK(tile + _tile_add[dir]);
tile = TILE_MASK(tile + ToTileIndexDiff(_tile_add[dir]));
} while (!(IS_TILETYPE(tile, MP_CLEAR) && GetTileSlope(tile, &h) == 0 && h <= 16));
assert(tile == TILE_MASK(tile));