summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-26 21:50:30 +0000
committerrubidium <rubidium@openttd.org>2009-07-26 21:50:30 +0000
commit2ec12a3f587f4271a2d8ba5e22af233e1094e321 (patch)
tree114688ff4bf43f5c94891a3fa67b5b172d187323 /src/terraform_gui.cpp
parent47a37b6093c3bb93dba81e4d3440c4098699a849 (diff)
downloadopenttd-2ec12a3f587f4271a2d8ba5e22af233e1094e321.tar.xz
(svn r16966) -Codechange: BEGIN_TILE_LOOP and END_TILE_LOOP reworked into TILE_LOOP, which means no more duplication of parameters between BEGIN_TILE_LOOP and END_TILE_LOOP
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 026d663f6..97fb9b92a 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -58,11 +58,11 @@ static void GenerateDesertArea(TileIndex end, TileIndex start)
size_y = (ey - sy) + 1;
_generating_world = true;
- BEGIN_TILE_LOOP(tile, size_x, size_y, TileXY(sx, sy)) {
+ TILE_LOOP(tile, size_x, size_y, TileXY(sx, sy)) {
SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT);
DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
MarkTileDirtyByTile(tile);
- } END_TILE_LOOP(tile, size_x, size_y, 0);
+ }
_generating_world = false;
}
@@ -83,7 +83,7 @@ static void GenerateRockyArea(TileIndex end, TileIndex start)
size_x = (ex - sx) + 1;
size_y = (ey - sy) + 1;
- BEGIN_TILE_LOOP(tile, size_x, size_y, TileXY(sx, sy)) {
+ TILE_LOOP(tile, size_x, size_y, TileXY(sx, sy)) {
switch (GetTileType(tile)) {
case MP_TREES:
if (GetTreeGround(tile) == TREE_GROUND_SHORE) continue;
@@ -96,7 +96,7 @@ static void GenerateRockyArea(TileIndex end, TileIndex start)
}
MarkTileDirtyByTile(tile);
success = true;
- } END_TILE_LOOP(tile, size_x, size_y, 0);
+ }
if (success) SndPlayTileFx(SND_1F_SPLAT, end);
}
@@ -410,22 +410,22 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
if (mode != 0) {
/* Raise land */
h = 15; // XXX - max height
- BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
+ TILE_LOOP(tile2, sizex, sizey, tile) {
h = min(h, TileHeight(tile2));
- } END_TILE_LOOP(tile2, sizex, sizey, tile)
+ }
} else {
/* Lower land */
h = 0;
- BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
+ TILE_LOOP(tile2, sizex, sizey, tile) {
h = max(h, TileHeight(tile2));
- } END_TILE_LOOP(tile2, sizex, sizey, tile)
+ }
}
- BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
+ TILE_LOOP(tile2, sizex, sizey, tile) {
if (TileHeight(tile2) == h) {
DoCommandP(tile2, SLOPE_N, (uint32)mode, CMD_TERRAFORM_LAND);
}
- } END_TILE_LOOP(tile2, sizex, sizey, tile)
+ }
}
}