aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen_fractal.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2016-06-24 18:15:56 -0400
committerkwolekr <kwolekr@minetest.net>2016-07-03 15:38:36 -0400
commit3c63c3044d5e4ca36c2649c530f31622581d90fd (patch)
treeb7924100f14f5626c11d534e2ad3602e269ac1df /src/mapgen_fractal.cpp
parent92705306bfb4994107a43514f29997cea15d48dc (diff)
downloadminetest-3c63c3044d5e4ca36c2649c530f31622581d90fd.tar.gz
minetest-3c63c3044d5e4ca36c2649c530f31622581d90fd.tar.bz2
minetest-3c63c3044d5e4ca36c2649c530f31622581d90fd.zip
Add MapSettingsManager and new mapgen setting script API functions
This commit refactors the majority of the Mapgen settings system. - MapgenParams is now owned by MapSettingsManager, itself a part of ServerMap, instead of the EmergeManager. - New Script API functions added: core.get_mapgen_setting core.get_mapgen_setting_noiseparams, core.set_mapgen_setting, and core.set_mapgen_setting_noiseparams. - minetest.get/set_mapgen_params are deprecated by the above new functions. - It is now possible to view and modify any arbitrary mapgen setting from a mod, rather than the base MapgenParams structure. - MapgenSpecificParams has been removed.
Diffstat (limited to 'src/mapgen_fractal.cpp')
-rw-r--r--src/mapgen_fractal.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/mapgen_fractal.cpp b/src/mapgen_fractal.cpp
index 9e4c210dc..0951a0afa 100644
--- a/src/mapgen_fractal.cpp
+++ b/src/mapgen_fractal.cpp
@@ -47,29 +47,27 @@ FlagDesc flagdesc_mapgen_fractal[] = {
///////////////////////////////////////////////////////////////////////////////////////
-MapgenFractal::MapgenFractal(int mapgenid, MapgenParams *params, EmergeManager *emerge)
+MapgenFractal::MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeManager *emerge)
: MapgenBasic(mapgenid, params, emerge)
{
- MapgenFractalParams *sp = (MapgenFractalParams *)params->sparams;
-
- this->spflags = sp->spflags;
- this->cave_width = sp->cave_width;
- this->fractal = sp->fractal;
- this->iterations = sp->iterations;
- this->scale = sp->scale;
- this->offset = sp->offset;
- this->slice_w = sp->slice_w;
- this->julia_x = sp->julia_x;
- this->julia_y = sp->julia_y;
- this->julia_z = sp->julia_z;
- this->julia_w = sp->julia_w;
+ this->spflags = params->spflags;
+ this->cave_width = params->cave_width;
+ this->fractal = params->fractal;
+ this->iterations = params->iterations;
+ this->scale = params->scale;
+ this->offset = params->offset;
+ this->slice_w = params->slice_w;
+ this->julia_x = params->julia_x;
+ this->julia_y = params->julia_y;
+ this->julia_z = params->julia_z;
+ this->julia_w = params->julia_w;
//// 2D terrain noise
- noise_seabed = new Noise(&sp->np_seabed, seed, csize.X, csize.Z);
- noise_filler_depth = new Noise(&sp->np_filler_depth, seed, csize.X, csize.Z);
+ noise_seabed = new Noise(&params->np_seabed, seed, csize.X, csize.Z);
+ noise_filler_depth = new Noise(&params->np_filler_depth, seed, csize.X, csize.Z);
- MapgenBasic::np_cave1 = sp->np_cave1;
- MapgenBasic::np_cave2 = sp->np_cave2;
+ MapgenBasic::np_cave1 = params->np_cave1;
+ MapgenBasic::np_cave2 = params->np_cave2;
this->formula = fractal / 2 + fractal % 2;
this->julia = fractal % 2 == 0;