diff options
author | kwolekr <kwolekr@minetest.net> | 2013-05-18 23:26:27 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2013-05-19 12:22:20 -0400 |
commit | 93474c4218eee621a96e24324b1b41a55571f0df (patch) | |
tree | dc74d8a27cfa853b4580159cde8c66e485c4f9f2 /src/mapgen_indev.h | |
parent | f577facf79729a03bb274a27c9f50f0092cd3a40 (diff) | |
download | minetest-93474c4218eee621a96e24324b1b41a55571f0df.tar.gz minetest-93474c4218eee621a96e24324b1b41a55571f0df.tar.bz2 minetest-93474c4218eee621a96e24324b1b41a55571f0df.zip |
Remove no virtual dtor warnings, make MapgenParams contain actual NoiseParams
Diffstat (limited to 'src/mapgen_indev.h')
-rw-r--r-- | src/mapgen_indev.h | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/src/mapgen_indev.h b/src/mapgen_indev.h index 87ae39d09..cfef59041 100644 --- a/src/mapgen_indev.h +++ b/src/mapgen_indev.h @@ -32,30 +32,33 @@ struct NoiseIndevParams : public NoiseParams { float farscale; float farspread; - NoiseIndevParams(){} - NoiseIndevParams(float offset_, float scale_, v3f spread_, int seed_, int octaves_, float persist_, float farscale_ = 1, float farspread_ = 1) + NoiseIndevParams() {} + NoiseIndevParams(float offset_, float scale_, v3f spread_, + int seed_, int octaves_, float persist_, + float farscale_ = 1, float farspread_ = 1) { - offset = offset_; - scale = scale_; - spread = spread_; - seed = seed_; + offset = offset_; + scale = scale_; + spread = spread_; + seed = seed_; octaves = octaves_; persist = persist_; - farscale = farscale_; + farscale = farscale_; farspread = farspread_; } - + + ~NoiseIndevParams() {} }; -#define getNoiseIndevParams(x) getStruct<NoiseIndevParams>((x), "f,f,v3,s32,s32,f,f,f") -#define setNoiseIndevParams(x, y) setStruct((x), "f,f,v3,s32,s32,f,f,f", (y)) +#define getNoiseIndevParams(x, y) getStruct((x), "f,f,v3,s32,s32,f,f,f", &(y), sizeof(y)) +#define setNoiseIndevParams(x, y) setStruct((x), "f,f,v3,s32,s32,f,f,f", &(y)) class NoiseIndev : public Noise { - public: +public: NoiseIndevParams *npindev; - //NoiseIndev() {}; + virtual ~NoiseIndev() {}; NoiseIndev(NoiseIndevParams *np, int seed, int sx, int sy); NoiseIndev(NoiseIndevParams *np, int seed, int sx, int sy, int sz); void init(NoiseIndevParams *np, int seed, int sx, int sy, int sz); @@ -77,34 +80,34 @@ extern NoiseIndevParams nparams_indev_def_float_islands; */ struct MapgenIndevParams : public MapgenV6Params { - NoiseIndevParams *npindev_terrain_base; - NoiseIndevParams *npindev_terrain_higher; - NoiseIndevParams *npindev_steepness; + NoiseIndevParams npindev_terrain_base; + NoiseIndevParams npindev_terrain_higher; + NoiseIndevParams npindev_steepness; //NoiseParams *np_height_select; //NoiseParams *np_trees; - NoiseIndevParams *npindev_mud; + NoiseIndevParams npindev_mud; //NoiseParams *np_beach; - NoiseIndevParams *npindev_biome; + NoiseIndevParams npindev_biome; //NoiseParams *np_cave; - NoiseIndevParams *npindev_float_islands1; - NoiseIndevParams *npindev_float_islands2; - NoiseIndevParams *npindev_float_islands3; + NoiseIndevParams npindev_float_islands1; + NoiseIndevParams npindev_float_islands2; + NoiseIndevParams npindev_float_islands3; MapgenIndevParams() { //freq_desert = 0.45; //freq_beach = 0.15; - npindev_terrain_base = &nparams_indev_def; //&nparams_indev_def_terrain_base; - npindev_terrain_higher = &nparams_indev_def; //&nparams_indev_def_terrain_higher; - npindev_steepness = &nparams_indev_def; //&nparams_indev_def_steepness; + npindev_terrain_base = nparams_indev_def; //&nparams_indev_def_terrain_base; + npindev_terrain_higher = nparams_indev_def; //&nparams_indev_def_terrain_higher; + npindev_steepness = nparams_indev_def; //&nparams_indev_def_steepness; //np_height_select = &nparams_v6_def_height_select; //np_trees = &nparams_v6_def_trees; - npindev_mud = &nparams_indev_def; //&nparams_indev_def_mud; + npindev_mud = nparams_indev_def; //&nparams_indev_def_mud; //np_beach = &nparams_v6_def_beach; - npindev_biome = &nparams_indev_def; //&nparams_indev_def_biome; + npindev_biome = nparams_indev_def; //&nparams_indev_def_biome; //np_cave = &nparams_v6_def_cave; - npindev_float_islands1 = &nparams_indev_def; //&nparams_indev_def_float_islands; - npindev_float_islands2 = &nparams_indev_def; //&nparams_indev_def_float_islands; - npindev_float_islands3 = &nparams_indev_def; //&nparams_indev_def_float_islands; + npindev_float_islands1 = nparams_indev_def; //&nparams_indev_def_float_islands; + npindev_float_islands2 = nparams_indev_def; //&nparams_indev_def_float_islands; + npindev_float_islands3 = nparams_indev_def; //&nparams_indev_def_float_islands; } |