aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-17 19:11:28 +0200
committerGitHub <noreply@github.com>2017-06-17 19:11:28 +0200
commit8f7785771b9e02b1a1daf7a252550d78ea93053d (patch)
tree7a4e4b524dbc63fed3dac99a3844b634cc621d0d /src/mapgen.h
parent76be103a91d6987527af19e87d93007be8ba8a67 (diff)
downloaddragonfireclient-8f7785771b9e02b1a1daf7a252550d78ea93053d.tar.xz
Cpp11 initializers 2 (#5999)
* C++11 patchset 10: continue cleanup on constructors * Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop) * More classes cleanup * More classes cleanup + change NULL tests to boolean tests
Diffstat (limited to 'src/mapgen.h')
-rw-r--r--src/mapgen.h72
1 files changed, 28 insertions, 44 deletions
diff --git a/src/mapgen.h b/src/mapgen.h
index ddc676e39..dde4e5c25 100644
--- a/src/mapgen.h
+++ b/src/mapgen.h
@@ -105,7 +105,7 @@ public:
bool peek_events=false);
private:
- u32 m_notify_on;
+ u32 m_notify_on = 0;
std::set<u32> *m_notify_on_deco_ids;
std::list<GenNotifyEvent> m_notify_events;
};
@@ -122,37 +122,21 @@ enum MapgenType {
};
struct MapgenParams {
- MapgenType mgtype;
- s16 chunksize;
- u64 seed;
- s16 water_level;
- s16 mapgen_limit;
- u32 flags;
-
- BiomeParams *bparams;
-
- s16 mapgen_edge_min;
- s16 mapgen_edge_max;
-
- MapgenParams() :
- mgtype(MAPGEN_DEFAULT),
- chunksize(5),
- seed(0),
- water_level(1),
- mapgen_limit(MAX_MAP_GENERATION_LIMIT),
- flags(MG_CAVES | MG_LIGHT | MG_DECORATIONS),
- bparams(NULL),
-
- mapgen_edge_min(-MAX_MAP_GENERATION_LIMIT),
- mapgen_edge_max(MAX_MAP_GENERATION_LIMIT),
- m_sao_limit_min(-MAX_MAP_GENERATION_LIMIT * BS),
- m_sao_limit_max(MAX_MAP_GENERATION_LIMIT * BS),
- m_mapgen_edges_calculated(false)
- {
- }
-
+ MapgenParams() {}
virtual ~MapgenParams();
+ MapgenType mgtype = MAPGEN_DEFAULT;
+ s16 chunksize = 5;
+ u64 seed = 0;
+ s16 water_level = 1;
+ s16 mapgen_limit = MAX_MAP_GENERATION_LIMIT;
+ u32 flags = MG_CAVES | MG_LIGHT | MG_DECORATIONS;
+
+ BiomeParams *bparams = nullptr;
+
+ s16 mapgen_edge_min = -MAX_MAP_GENERATION_LIMIT;
+ s16 mapgen_edge_max = MAX_MAP_GENERATION_LIMIT;
+
virtual void readParams(const Settings *settings);
virtual void writeParams(Settings *settings) const;
@@ -162,9 +146,9 @@ struct MapgenParams {
private:
void calcMapgenEdges();
- float m_sao_limit_min;
- float m_sao_limit_max;
- bool m_mapgen_edges_calculated;
+ float m_sao_limit_min = -MAX_MAP_GENERATION_LIMIT * BS;
+ float m_sao_limit_max = MAX_MAP_GENERATION_LIMIT * BS;
+ bool m_mapgen_edges_calculated = false;
};
@@ -179,22 +163,22 @@ private:
*/
class Mapgen {
public:
- s32 seed;
- int water_level;
- int mapgen_limit;
- u32 flags;
- bool generating;
- int id;
+ s32 seed = 0;
+ int water_level = 0;
+ int mapgen_limit = 0;
+ u32 flags = 0;
+ bool generating = false;
+ int id = -1;
- MMVManip *vm;
- INodeDefManager *ndef;
+ MMVManip *vm = nullptr;
+ INodeDefManager *ndef = nullptr;
u32 blockseed;
- s16 *heightmap;
- biome_t *biomemap;
+ s16 *heightmap = nullptr;
+ biome_t *biomemap = nullptr;
v3s16 csize;
- BiomeGen *biomegen;
+ BiomeGen *biomegen = nullptr;
GenerateNotifier gennotify;
Mapgen();