summaryrefslogtreecommitdiff
path: root/src/landscape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r--src/landscape.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index b921deef2..ac9040e16 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -35,6 +35,7 @@
#include <array>
#include <list>
#include <set>
+#include "layer_func.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -835,17 +836,23 @@ void RunTileLoop()
void InitializeLandscape()
{
- for (uint y = _settings_game.construction.freeform_edges ? 1 : 0; y < MapMaxY(); y++) {
- for (uint x = _settings_game.construction.freeform_edges ? 1 : 0; x < MapMaxX(); x++) {
- MakeClear(TileXY(x, y), CLEAR_GRASS, 3);
- SetTileHeight(TileXY(x, y), 0);
- SetTropicZone(TileXY(x, y), TROPICZONE_NORMAL);
- ClearBridgeMiddle(TileXY(x, y));
+ uint maxx = LayerMaxX();
+ uint maxy = LayerMaxY();
+ uint sizex = MapSizeX();
+ uint layersize = LayerSize();
+
+ FOR_ALL_LAYERS(layer) {
+ for (uint y = _settings_game.construction.freeform_edges ? 1 : 0; y < LayerMaxY(); y++) {
+ for (uint x = _settings_game.construction.freeform_edges ? 1 : 0; x < LayerMaxX(); x++) {
+ MakeClear(layer * layersize + TileXY(x, y), CLEAR_GRASS, 3);
+ SetTileHeight(layer * layersize + TileXY(x, y), 0);
+ SetTropicZone(layer * layersize + TileXY(x, y), TROPICZONE_NORMAL);
+ ClearBridgeMiddle(layer * layersize + TileXY(x, y));
+ }
+ MakeVoid(layer * layersize + TileXY(LayerMaxX(), y));
}
+ for (uint x = 0; x < LayerSizeX(); x++) MakeVoid(TileXY(x, LayerMaxY()));
}
-
- for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, MapMaxY()));
- for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(MapMaxX(), y));
}
static const byte _genterrain_tbl_1[5] = { 10, 22, 33, 37, 4 };