From f8c95a1dbeac23296cacc83ae25d2a8b352cd83d Mon Sep 17 00:00:00 2001 From: tron Date: Thu, 6 Jan 2005 11:39:00 +0000 Subject: (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff --- clear_cmd.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'clear_cmd.c') diff --git a/clear_cmd.c b/clear_cmd.c index 4356cb729..fd6b58bfd 100644 --- a/clear_cmd.c +++ b/clear_cmd.c @@ -186,12 +186,17 @@ static bool TerraformTileHeight(TerraformerState *ts, uint tile, int height) { int direction = ts->direction, r; - const TileIndexDiff *ttm; + const TileIndexDiffC *ttm; - static const TileIndexDiff _terraform_tilepos[5] = {TILE_XY(1,0), TILE_XY(-2,0), TILE_XY(1,1), TILE_XY(0,-2), 0 }; + static const TileIndexDiffC _terraform_tilepos[] = { + { 1, 0}, + {-2, 0}, + { 1, 1}, + { 0, -2} + }; - for(ttm = _terraform_tilepos; *ttm != 0; ttm++) { - tile += *ttm; + for(ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) { + tile += ToTileIndexDiff(*ttm); r = TerraformGetHeightOfTile(ts, tile); if (r != height && r-direction != height && r+direction != height) { -- cgit v1.2.3-54-g00ecf