diff options
Diffstat (limited to 'src/tgp.cpp')
-rw-r--r-- | src/tgp.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp index 6d17fd853..81541dd66 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -14,6 +14,7 @@ #include "clear_map.h" #include "void_map.h" #include "genworld.h" +#include "layer_func.h" #include "core/random_func.hpp" #include "landscape_type.h" @@ -165,8 +166,10 @@ struct HeightMap height_t *h; //< array of heights uint dim_x; //< height map size_x MapSizeX() + 1 uint total_size; //< height map total size - uint size_x; //< MapSizeX() - uint size_y; //< MapSizeY() + uint size_x; //< LayerSizeX() + uint size_y; //< LayerSizeY() + uint map_x; //< MapSizeX() + uint map_y; //< MapSizeY() /** * Height map accessor @@ -250,8 +253,11 @@ static inline bool AllocHeightMap() { height_t *h; - _height_map.size_x = MapSizeX(); - _height_map.size_y = MapSizeY(); + _height_map.map_x = MapSizeX(); + _height_map.map_y = MapSizeY(); + + _height_map.size_x = LayerSizeX(); + _height_map.size_y = LayerSizeY(); /* Allocate memory block for height map row pointers */ _height_map.total_size = (_height_map.size_x + 1) * (_height_map.size_y + 1); @@ -980,8 +986,8 @@ void GenerateTerrainPerlin() /* First make sure the tiles at the north border are void tiles if needed. */ if (_settings_game.construction.freeform_edges) { - for (y = 0; y < _height_map.size_y - 1; y++) MakeVoid(_height_map.size_x * y); - for (x = 0; x < _height_map.size_x; x++) MakeVoid(x); + for (y = 0; y < _height_map.map_y - 1; y++) MakeVoid(_height_map.map_x * y); + for (x = 0; x < _height_map.map_x; x++) MakeVoid(x); } /* Transfer height map into OTTD map */ |