diff options
author | tron <tron@openttd.org> | 2005-01-06 11:39:00 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-06 11:39:00 +0000 |
commit | f8c95a1dbeac23296cacc83ae25d2a8b352cd83d (patch) | |
tree | f875975dc056d7d3fea370018fa0bdf62837fd3e /clear_cmd.c | |
parent | 790b03c7071388addd4cb064e473e96f8e1f12e0 (diff) | |
download | openttd-f8c95a1dbeac23296cacc83ae25d2a8b352cd83d.tar.xz |
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
Diffstat (limited to 'clear_cmd.c')
-rw-r--r-- | clear_cmd.c | 13 |
1 files changed, 9 insertions, 4 deletions
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) { |