diff options
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r-- | src/landscape.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp index 18f27807d..152aceda7 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -35,6 +35,7 @@ #include "framerate_type.h" #include <list> #include <set> +#include "layer_func.h" #include "table/strings.h" #include "table/sprites.h" @@ -760,22 +761,25 @@ void RunTileLoop() void InitializeLandscape() { - uint maxx = MapMaxX(); - uint maxy = MapMaxY(); + uint maxx = LayerMaxX(); + uint maxy = LayerMaxY(); uint sizex = MapSizeX(); - - uint y; - for (y = _settings_game.construction.freeform_edges ? 1 : 0; y < maxy; y++) { - uint x; - for (x = _settings_game.construction.freeform_edges ? 1 : 0; x < maxx; x++) { - MakeClear(sizex * y + x, CLEAR_GRASS, 3); - SetTileHeight(sizex * y + x, 0); - SetTropicZone(sizex * y + x, TROPICZONE_NORMAL); - ClearBridgeMiddle(sizex * y + x); + uint layersize = LayerSize(); + + FOR_ALL_LAYERS(layer) { + uint y; + for (y = _settings_game.construction.freeform_edges ? 1 : 0; y < maxy; y++) { + uint x; + for (x = _settings_game.construction.freeform_edges ? 1 : 0; x < maxx; x++) { + MakeClear(layer * layersize + sizex * y + x, CLEAR_GRASS, 3); + SetTileHeight(layer * layersize + sizex * y + x, 0); + SetTropicZone(layer * layersize + sizex * y + x, TROPICZONE_NORMAL); + ClearBridgeMiddle(layer * layersize + sizex * y + x); + } + MakeVoid(layer * layersize + sizex * y + x); } - MakeVoid(sizex * y + x); + for (uint x = 0; x < sizex; x++) MakeVoid(layer * layersize + sizex * y + x); } - for (uint x = 0; x < sizex; x++) MakeVoid(sizex * y + x); } static const byte _genterrain_tbl_1[5] = { 10, 22, 33, 37, 4 }; |