diff options
author | kwolekr <kwolekr@minetest.net> | 2014-02-03 22:42:10 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-02-03 22:50:14 -0500 |
commit | 5a34f40d80ea1a339b599bc11db549a6bd86912f (patch) | |
tree | 07ead9e3ff4732479af41b739a26b5dc8182c5fd /src/emerge.h | |
parent | a439343844cf821e4922e23f1638b92e2cfb14ac (diff) | |
download | minetest-5a34f40d80ea1a339b599bc11db549a6bd86912f.tar.gz minetest-5a34f40d80ea1a339b599bc11db549a6bd86912f.tar.bz2 minetest-5a34f40d80ea1a339b599bc11db549a6bd86912f.zip |
Huge overhaul of the entire MapgenParams system
MapgenParams is no longer a polymorphic class, eliminating the need for messy and bug-prone reallocations.
Separation between the common and mapgen-specific parameters is now strongly defined.
Mapgen parameters objects are now properly encapsulated within the proper subsystems.
Diffstat (limited to 'src/emerge.h')
-rw-r--r-- | src/emerge.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/emerge.h b/src/emerge.h index 17097327b..14a2728ba 100644 --- a/src/emerge.h +++ b/src/emerge.h @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irr_v3d.h" #include "util/container.h" #include "map.h" // for ManualMapVoxelManipulator +#include "mapgen.h" // for MapgenParams #define MGPARAMS_SET_MGNAME 1 #define MGPARAMS_SET_SEED 2 @@ -37,9 +38,8 @@ with this program; if not, write to the Free Software Foundation, Inc., infostream << "EmergeThread: " x << std::endl; } class EmergeThread; -class Mapgen; -struct MapgenParams; -struct MapgenFactory; +//class Mapgen; +//struct MapgenFactory; class Biome; class BiomeDefManager; class Decoration; @@ -90,7 +90,7 @@ public: bool threads_active; //settings - MapgenParams *params; + MapgenParams params; bool mapgen_debug_info; u16 qlimit_total; u16 qlimit_diskonly; @@ -98,10 +98,6 @@ public: u32 gennotify; - MapgenParams *luaoverride_params; - u32 luaoverride_params_modified; - u32 luaoverride_flagmask; - //block emerge queue data structures JMutex queuemutex; std::map<v3s16, BlockEmergeData *> blocks_enqueued; @@ -115,19 +111,18 @@ public: EmergeManager(IGameDef *gamedef); ~EmergeManager(); - void initMapgens(MapgenParams *mgparams); - MapgenParams *setMapgenType(MapgenParams *mgparams, std::string newname); + void initMapgens(); Mapgen *getCurrentMapgen(); Mapgen *createMapgen(std::string mgname, int mgid, MapgenParams *mgparams); - MapgenParams *createMapgenParams(std::string mgname); + MapgenSpecificParams *createMapgenParams(std::string mgname); void startThreads(); void stopThreads(); bool enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate); void registerMapgen(std::string name, MapgenFactory *mgfactory); - MapgenParams *getParamsFromSettings(Settings *settings); - void setParamsToSettings(Settings *settings); + void loadParamsFromSettings(Settings *settings); + void saveParamsToSettings(Settings *settings); //mapgen helper methods Biome *getBiomeAtPoint(v3s16 p); |