summaryrefslogtreecommitdiff
path: root/src/mapgen_v6.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-06-15 22:23:06 -0400
committerkwolekr <kwolekr@minetest.net>2013-06-17 03:21:36 -0400
commit0a8519a26fc7c10b4e7415746e9045caa3ae978f (patch)
tree27c3bb64a46f3dfeaa0dbc5443b0efe69e37cf37 /src/mapgen_v6.cpp
parenteccd1fdbeddce60717f8fcbecded5b36387e3b38 (diff)
downloadminetest-0a8519a26fc7c10b4e7415746e9045caa3ae978f.tar.gz
minetest-0a8519a26fc7c10b4e7415746e9045caa3ae978f.tar.bz2
minetest-0a8519a26fc7c10b4e7415746e9045caa3ae978f.zip
Add initial Decoration support, many misc. improvements & modifications
Diffstat (limited to 'src/mapgen_v6.cpp')
-rw-r--r--src/mapgen_v6.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp
index eaca33988..a411f966b 100644
--- a/src/mapgen_v6.cpp
+++ b/src/mapgen_v6.cpp
@@ -79,7 +79,7 @@ MapgenV6::MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge)
this->freq_beach = params->freq_beach;
this->ystride = csize.X; //////fix this
-
+
np_cave = &params->np_cave;
np_humidity = &params->np_humidity;
np_trees = &params->np_trees;
@@ -108,23 +108,6 @@ MapgenV6::~MapgenV6() {
//////////////////////// Some helper functions for the map generator
-// Returns Y one under area minimum if not found
-s16 MapgenV6::find_ground_level(v2s16 p2d) {
- v3s16 em = vm->m_area.getExtent();
- s16 y_nodes_max = vm->m_area.MaxEdge.Y;
- s16 y_nodes_min = vm->m_area.MinEdge.Y;
- u32 i = vm->m_area.index(p2d.X, y_nodes_max, p2d.Y);
- s16 y;
-
- for (y = y_nodes_max; y >= y_nodes_min; y--) {
- MapNode &n = vm->m_data[i];
- if(ndef->get(n).walkable)
- break;
-
- vm->m_area.add_y(em, i, -1);
- }
- return (y >= y_nodes_min) ? y : y_nodes_min - 1;
-}
// Returns Y one under area minimum if not found
s16 MapgenV6::find_stone_level(v2s16 p2d) {
@@ -849,7 +832,7 @@ void MapgenV6::placeTreesAndJungleGrass() {
s16 x = grassrandom.range(p2d_min.X, p2d_max.X);
s16 z = grassrandom.range(p2d_min.Y, p2d_max.Y);
- s16 y = find_ground_level(v2s16(x, z)); ////////////////optimize this!
+ s16 y = findGroundLevelFull(v2s16(x, z)); ////////////////optimize this!
if (y < water_level || y < node_min.Y || y > node_max.Y)
continue;
@@ -866,7 +849,7 @@ void MapgenV6::placeTreesAndJungleGrass() {
for (u32 i = 0; i < tree_count; i++) {
s16 x = myrand_range(p2d_min.X, p2d_max.X);
s16 z = myrand_range(p2d_min.Y, p2d_max.Y);
- s16 y = find_ground_level(v2s16(x, z)); ////////////////////optimize this!
+ s16 y = findGroundLevelFull(v2s16(x, z)); ////////////////////optimize this!
// Don't make a tree under water level
// Don't make a tree so high that it doesn't fit
if(y < water_level || y > node_max.Y - 6)