diff options
author | kwolekr <kwolekr@minetest.net> | 2013-03-16 22:34:12 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2013-03-16 22:34:12 -0400 |
commit | 67228160aed84e0ef07a863ac0127931f8d58b05 (patch) | |
tree | ad0fa5d71cc638ecd2b73bd6e5d95933ace2638e /src | |
parent | 165498cecfc11f3471d84855f4d019be9b353621 (diff) | |
download | minetest-67228160aed84e0ef07a863ac0127931f8d58b05.tar.gz minetest-67228160aed84e0ef07a863ac0127931f8d58b05.tar.bz2 minetest-67228160aed84e0ef07a863ac0127931f8d58b05.zip |
Some minor cleanups from the last commit
Diffstat (limited to 'src')
-rw-r--r-- | src/mapgen_indev.cpp | 5 | ||||
-rw-r--r-- | src/mapgen_v6.cpp | 10 | ||||
-rw-r--r-- | src/mapgen_v6.h | 4 | ||||
-rw-r--r-- | src/noise.cpp | 1 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/mapgen_indev.cpp b/src/mapgen_indev.cpp index e9ab36ae9..4de4fd55f 100644 --- a/src/mapgen_indev.cpp +++ b/src/mapgen_indev.cpp @@ -191,6 +191,7 @@ float MapgenIndev::baseTerrainLevelFromNoise(v2s16 p) { steepness, height_select); } + float MapgenIndev::baseTerrainLevelFromMap(int index) { if (flags & MG_FLAT) return water_level; @@ -204,6 +205,7 @@ float MapgenIndev::baseTerrainLevelFromMap(int index) { steepness, height_select); } + float MapgenIndev::getMudAmount(int index) { if (flags & MG_FLAT) @@ -216,6 +218,7 @@ float MapgenIndev::getMudAmount(int index) return noiseindev_mud->result[index]; } + void MapgenIndev::defineCave(Cave & cave, PseudoRandom ps, v3s16 node_min, bool large_cave) { cave.min_tunnel_diameter = 2; cave.max_tunnel_diameter = ps.range(2,6); @@ -243,4 +246,4 @@ void MapgenIndev::defineCave(Cave & cave, PseudoRandom ps, v3s16 node_min, bool cave.tunnel_routepoints = ps.range(10, ps.range(15,30)); } cave.large_cave_is_flat = (ps.range(0,1) == 0); -}; +} diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp index 91947df84..5f428bb8f 100644 --- a/src/mapgen_v6.cpp +++ b/src/mapgen_v6.cpp @@ -878,13 +878,12 @@ void MapgenV6::growGrass() { } } -void MapgenV6::defineCave(Cave & cave, PseudoRandom ps, v3s16 node_min, bool large_cave) { +void MapgenV6::defineCave(Cave &cave, PseudoRandom ps, + v3s16 node_min, bool large_cave) { cave.min_tunnel_diameter = 2; cave.max_tunnel_diameter = ps.range(2,6); cave.dswitchint = ps.range(1,14); - //cave.tunnel_routepoints = 0; - //cave.part_max_length_rs = 0; - cave.flooded = large_cave && ps.range(0,4); + cave.flooded = true; //large_cave && ps.range(0,4); if(large_cave){ cave.part_max_length_rs = ps.range(2,4); cave.tunnel_routepoints = ps.range(5, ps.range(15,30)); @@ -895,7 +894,8 @@ void MapgenV6::defineCave(Cave & cave, PseudoRandom ps, v3s16 node_min, bool lar cave.tunnel_routepoints = ps.range(10, ps.range(15,30)); } cave.large_cave_is_flat = (ps.range(0,1) == 0); -}; +} + void MapgenV6::generateCaves(int max_stone_y) { // 24ms @cs=8 diff --git a/src/mapgen_v6.h b/src/mapgen_v6.h index 34de7c0ed..662aed2ce 100644 --- a/src/mapgen_v6.h +++ b/src/mapgen_v6.h @@ -157,7 +157,6 @@ public: u32 get_blockseed(u64 seed, v3s16 p); - virtual void calculateNoise(); int generateGround(); void addMud(); @@ -165,7 +164,8 @@ public: void addDirtGravelBlobs(); void growGrass(); void placeTrees(); - virtual void defineCave(Cave & cave, PseudoRandom ps, v3s16 node_min, bool large_cave); + virtual void defineCave(Cave &cave, PseudoRandom ps, + v3s16 node_min, bool large_cave); void generateCaves(int max_stone_y); }; diff --git a/src/noise.cpp b/src/noise.cpp index ba7c30574..49b5f7e58 100644 --- a/src/noise.cpp +++ b/src/noise.cpp @@ -524,7 +524,6 @@ float *Noise::perlinMap2D(float x, float y) { for (j = 0; j != sy; j++) { for (i = 0; i != sx; i++) { result[index] += g * buf[index]; -//dstream << "pm2d i="<<index<<" r="<< result[index]<<std::endl; index++; } } |