diff options
author | Erich Eckner <git@eckner.net> | 2018-10-30 11:13:12 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-10-30 15:28:03 +0100 |
commit | a34d095259409cf1454d9777deabbc00bcdb9407 (patch) | |
tree | 9e7c37ed33f5bd6b3c2f41cf248dcb656b2a4afa /src/tgp.cpp | |
parent | 6647cb917963c4e0d6d633b7a92af78167050893 (diff) | |
download | openttd-a34d095259409cf1454d9777deabbc00bcdb9407.tar.xz |
underground patch appliedunderground-plus-others-original
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 */ |