diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cavegen.cpp | 5 | ||||
-rw-r--r-- | src/cavegen.h | 4 | ||||
-rw-r--r-- | src/mapgen.cpp | 2 | ||||
-rw-r--r-- | src/mapgen.h | 1 | ||||
-rw-r--r-- | src/mapgen_flat.cpp | 3 | ||||
-rw-r--r-- | src/mapgen_flat.h | 1 | ||||
-rw-r--r-- | src/mapgen_fractal.cpp | 3 | ||||
-rw-r--r-- | src/mapgen_fractal.h | 1 | ||||
-rw-r--r-- | src/mapgen_v5.cpp | 3 | ||||
-rw-r--r-- | src/mapgen_v5.h | 1 | ||||
-rw-r--r-- | src/mapgen_v7.cpp | 3 | ||||
-rw-r--r-- | src/mapgen_v7.h | 1 |
12 files changed, 23 insertions, 5 deletions
diff --git a/src/cavegen.cpp b/src/cavegen.cpp index dbed79951..a2ecca483 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -258,7 +258,8 @@ CavesRandomWalk::CavesRandomWalk( s32 seed, int water_level, content_t water_source, - content_t lava_source) + content_t lava_source, + int lava_depth) { assert(ndef); @@ -267,7 +268,7 @@ CavesRandomWalk::CavesRandomWalk( this->seed = seed; this->water_level = water_level; this->np_caveliquids = &nparams_caveliquids; - this->lava_depth = DEFAULT_LAVA_DEPTH; + this->lava_depth = lava_depth; c_water_source = water_source; if (c_water_source == CONTENT_IGNORE) diff --git a/src/cavegen.h b/src/cavegen.h index a1140594e..7230cf6db 100644 --- a/src/cavegen.h +++ b/src/cavegen.h @@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #define CAVEGEN_HEADER #define VMANIP_FLAG_CAVE VOXELFLAG_CHECKED1 -#define DEFAULT_LAVA_DEPTH (-256) class GenerateNotifier; @@ -157,7 +156,8 @@ public: CavesRandomWalk(INodeDefManager *ndef, GenerateNotifier *gennotify = NULL, s32 seed = 0, int water_level = 1, content_t water_source = CONTENT_IGNORE, - content_t lava_source = CONTENT_IGNORE); + content_t lava_source = CONTENT_IGNORE, + int lava_depth = -256); // vm and ps are mandatory parameters. // If heightmap is NULL, the surface level at all points is assumed to diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 70de8c8e8..e40bf2a7e 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -817,7 +817,7 @@ void MapgenBasic::generateCaves(s16 max_stone_y, s16 large_cave_depth) u32 bruises_count = ps.range(0, 2); for (u32 i = 0; i < bruises_count; i++) { CavesRandomWalk cave(ndef, &gennotify, seed, water_level, - c_water_source, CONTENT_IGNORE); + c_water_source, CONTENT_IGNORE, lava_depth); cave.makeCave(vm, node_min, node_max, &ps, true, max_stone_y, heightmap); } diff --git a/src/mapgen.h b/src/mapgen.h index dde4e5c25..9369a6c35 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -294,6 +294,7 @@ protected: float cavern_limit; float cavern_taper; float cavern_threshold; + int lava_depth; }; #endif diff --git a/src/mapgen_flat.cpp b/src/mapgen_flat.cpp index a6efcee23..e7f5f4dfe 100644 --- a/src/mapgen_flat.cpp +++ b/src/mapgen_flat.cpp @@ -54,6 +54,7 @@ MapgenFlat::MapgenFlat(int mapgenid, MapgenFlatParams *params, EmergeManager *em this->spflags = params->spflags; this->ground_level = params->ground_level; this->large_cave_depth = params->large_cave_depth; + this->lava_depth = params->lava_depth; this->cave_width = params->cave_width; this->lake_threshold = params->lake_threshold; this->lake_steepness = params->lake_steepness; @@ -94,6 +95,7 @@ void MapgenFlatParams::readParams(const Settings *settings) settings->getFlagStrNoEx("mgflat_spflags", spflags, flagdesc_mapgen_flat); settings->getS16NoEx("mgflat_ground_level", ground_level); settings->getS16NoEx("mgflat_large_cave_depth", large_cave_depth); + settings->getS16NoEx("mgflat_lava_depth", lava_depth); settings->getFloatNoEx("mgflat_cave_width", cave_width); settings->getFloatNoEx("mgflat_lake_threshold", lake_threshold); settings->getFloatNoEx("mgflat_lake_steepness", lake_steepness); @@ -112,6 +114,7 @@ void MapgenFlatParams::writeParams(Settings *settings) const settings->setFlagStr("mgflat_spflags", spflags, flagdesc_mapgen_flat, U32_MAX); settings->setS16("mgflat_ground_level", ground_level); settings->setS16("mgflat_large_cave_depth", large_cave_depth); + settings->setS16("mgflat_lava_depth", lava_depth); settings->setFloat("mgflat_cave_width", cave_width); settings->setFloat("mgflat_lake_threshold", lake_threshold); settings->setFloat("mgflat_lake_steepness", lake_steepness); diff --git a/src/mapgen_flat.h b/src/mapgen_flat.h index ab3531226..7c2929d39 100644 --- a/src/mapgen_flat.h +++ b/src/mapgen_flat.h @@ -36,6 +36,7 @@ struct MapgenFlatParams : public MapgenParams u32 spflags = 0; s16 ground_level = 8; s16 large_cave_depth = -33; + s16 lava_depth = -256; float cave_width = 0.09f; float lake_threshold = -0.45f; float lake_steepness = 48.0f; diff --git a/src/mapgen_fractal.cpp b/src/mapgen_fractal.cpp index a99b3006b..b43dcd3f0 100644 --- a/src/mapgen_fractal.cpp +++ b/src/mapgen_fractal.cpp @@ -52,6 +52,7 @@ MapgenFractal::MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeMa this->spflags = params->spflags; this->cave_width = params->cave_width; this->large_cave_depth = params->large_cave_depth; + this->lava_depth = params->lava_depth; this->fractal = params->fractal; this->iterations = params->iterations; this->scale = params->scale; @@ -95,6 +96,7 @@ void MapgenFractalParams::readParams(const Settings *settings) settings->getFlagStrNoEx("mgfractal_spflags", spflags, flagdesc_mapgen_fractal); settings->getFloatNoEx("mgfractal_cave_width", cave_width); settings->getS16NoEx("mgfractal_large_cave_depth", large_cave_depth); + settings->getS16NoEx("mgfractal_lava_depth", lava_depth); settings->getU16NoEx("mgfractal_fractal", fractal); settings->getU16NoEx("mgfractal_iterations", iterations); settings->getV3FNoEx("mgfractal_scale", scale); @@ -117,6 +119,7 @@ void MapgenFractalParams::writeParams(Settings *settings) const settings->setFlagStr("mgfractal_spflags", spflags, flagdesc_mapgen_fractal, U32_MAX); settings->setFloat("mgfractal_cave_width", cave_width); settings->setS16("mgfractal_large_cave_depth", large_cave_depth); + settings->setS16("mgfractal_lava_depth", lava_depth); settings->setU16("mgfractal_fractal", fractal); settings->setU16("mgfractal_iterations", iterations); settings->setV3F("mgfractal_scale", scale); diff --git a/src/mapgen_fractal.h b/src/mapgen_fractal.h index 688e41c0a..a14c5c5e1 100644 --- a/src/mapgen_fractal.h +++ b/src/mapgen_fractal.h @@ -35,6 +35,7 @@ struct MapgenFractalParams : public MapgenParams u32 spflags = 0; float cave_width = 0.09f; s16 large_cave_depth = -33; + s16 lava_depth = -256; u16 fractal = 1; u16 iterations = 11; v3f scale = v3f(4096.0, 1024.0, 4096.0); diff --git a/src/mapgen_v5.cpp b/src/mapgen_v5.cpp index ebf9424e9..044826705 100644 --- a/src/mapgen_v5.cpp +++ b/src/mapgen_v5.cpp @@ -51,6 +51,7 @@ MapgenV5::MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge) this->spflags = params->spflags; this->cave_width = params->cave_width; this->large_cave_depth = params->large_cave_depth; + this->lava_depth = params->lava_depth; this->cavern_limit = params->cavern_limit; this->cavern_taper = params->cavern_taper; this->cavern_threshold = params->cavern_threshold; @@ -96,6 +97,7 @@ void MapgenV5Params::readParams(const Settings *settings) settings->getFlagStrNoEx("mgv5_spflags", spflags, flagdesc_mapgen_v5); settings->getFloatNoEx("mgv5_cave_width", cave_width); settings->getS16NoEx("mgv5_large_cave_depth", large_cave_depth); + settings->getS16NoEx("mgv5_lava_depth", lava_depth); settings->getS16NoEx("mgv5_cavern_limit", cavern_limit); settings->getS16NoEx("mgv5_cavern_taper", cavern_taper); settings->getFloatNoEx("mgv5_cavern_threshold", cavern_threshold); @@ -115,6 +117,7 @@ void MapgenV5Params::writeParams(Settings *settings) const settings->setFlagStr("mgv5_spflags", spflags, flagdesc_mapgen_v5, U32_MAX); settings->setFloat("mgv5_cave_width", cave_width); settings->setS16("mgv5_large_cave_depth", large_cave_depth); + settings->setS16("mgv5_lava_depth", lava_depth); settings->setS16("mgv5_cavern_limit", cavern_limit); settings->setS16("mgv5_cavern_taper", cavern_taper); settings->setFloat("mgv5_cavern_threshold", cavern_threshold); diff --git a/src/mapgen_v5.h b/src/mapgen_v5.h index 9b3f98d73..3aaff5878 100644 --- a/src/mapgen_v5.h +++ b/src/mapgen_v5.h @@ -35,6 +35,7 @@ struct MapgenV5Params : public MapgenParams u32 spflags = MGV5_CAVERNS; float cave_width = 0.125f; s16 large_cave_depth = -256; + s16 lava_depth = -256; s16 cavern_limit = -256; s16 cavern_taper = 256; float cavern_threshold = 0.7f; diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp index 409863fa2..5d150ee1c 100644 --- a/src/mapgen_v7.cpp +++ b/src/mapgen_v7.cpp @@ -57,6 +57,7 @@ MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge) this->spflags = params->spflags; this->cave_width = params->cave_width; this->large_cave_depth = params->large_cave_depth; + this->lava_depth = params->lava_depth; this->float_mount_density = params->float_mount_density; this->float_mount_height = params->float_mount_height; this->floatland_level = params->floatland_level; @@ -145,6 +146,7 @@ void MapgenV7Params::readParams(const Settings *settings) settings->getFlagStrNoEx("mgv7_spflags", spflags, flagdesc_mapgen_v7); settings->getFloatNoEx("mgv7_cave_width", cave_width); settings->getS16NoEx("mgv7_large_cave_depth", large_cave_depth); + settings->getS16NoEx("mgv7_lava_depth", lava_depth); settings->getFloatNoEx("mgv7_float_mount_density", float_mount_density); settings->getFloatNoEx("mgv7_float_mount_height", float_mount_height); settings->getS16NoEx("mgv7_floatland_level", floatland_level); @@ -175,6 +177,7 @@ void MapgenV7Params::writeParams(Settings *settings) const settings->setFlagStr("mgv7_spflags", spflags, flagdesc_mapgen_v7, U32_MAX); settings->setFloat("mgv7_cave_width", cave_width); settings->setS16("mgv7_large_cave_depth", large_cave_depth); + settings->setS16("mgv7_lava_depth", lava_depth); settings->setFloat("mgv7_float_mount_density", float_mount_density); settings->setFloat("mgv7_float_mount_height", float_mount_height); settings->setS16("mgv7_floatland_level", floatland_level); diff --git a/src/mapgen_v7.h b/src/mapgen_v7.h index 3b0d11fff..7b4364ef1 100644 --- a/src/mapgen_v7.h +++ b/src/mapgen_v7.h @@ -38,6 +38,7 @@ struct MapgenV7Params : public MapgenParams { u32 spflags = MGV7_MOUNTAINS | MGV7_RIDGES | MGV7_CAVERNS; float cave_width = 0.09f; s16 large_cave_depth = -33; + s16 lava_depth = -256; float float_mount_density = 0.6f; float float_mount_height = 128.0f; s16 floatland_level = 1280; |