diff options
author | kwolekr <kwolekr@minetest.net> | 2014-11-12 23:01:13 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-11-12 23:02:41 -0500 |
commit | 7616537bc071bc93f8d36c84b94603528be1efb0 (patch) | |
tree | 487185069e4f39f1f828a831b1d1ba9c88ed4298 /src/emerge.cpp | |
parent | f25cc0dbae0209f2647ac5eec9fe6ddb08174f55 (diff) | |
download | minetest-7616537bc071bc93f8d36c84b94603528be1efb0.tar.gz minetest-7616537bc071bc93f8d36c84b94603528be1efb0.tar.bz2 minetest-7616537bc071bc93f8d36c84b94603528be1efb0.zip |
Add Generator Element Management framework
Add BiomeManager, OreManager, DecorationManager, and SchematicManager
Diffstat (limited to 'src/emerge.cpp')
-rw-r--r-- | src/emerge.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/emerge.cpp b/src/emerge.cpp index 7427f6f4b..6410e56e9 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -40,8 +40,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "nodedef.h" #include "mg_biome.h" -#include "mg_decoration.h" #include "mg_ore.h" +#include "mg_decoration.h" +#include "mg_schematic.h" #include "mapgen_v5.h" #include "mapgen_v6.h" #include "mapgen_v7.h" @@ -88,8 +89,11 @@ EmergeManager::EmergeManager(IGameDef *gamedef) { registerMapgen("v7", new MapgenFactoryV7()); registerMapgen("singlenode", new MapgenFactorySinglenode()); - this->ndef = gamedef->getNodeDefManager(); - this->biomedef = new BiomeDefManager(gamedef->getNodeDefManager()->getResolver()); + this->ndef = gamedef->getNodeDefManager(); + this->biomemgr = new BiomeManager(gamedef); + this->oremgr = new OreManager(gamedef); + this->decomgr = new DecorationManager(gamedef); + this->schemmgr = new SchematicManager(gamedef); this->gennotify = 0; // Note that accesses to this variable are not synchronized. @@ -141,21 +145,15 @@ EmergeManager::~EmergeManager() { emergethread.clear(); mapgen.clear(); - for (unsigned int i = 0; i < ores.size(); i++) - delete ores[i]; - ores.clear(); - - for (unsigned int i = 0; i < decorations.size(); i++) - delete decorations[i]; - decorations.clear(); - - for (std::map<std::string, MapgenFactory *>::iterator it = mglist.begin(); - it != mglist.end(); ++it) { + std::map<std::string, MapgenFactory *>::iterator it; + for (it = mglist.begin(); it != mglist.end(); ++it) delete it->second; - } mglist.clear(); - delete biomedef; + delete biomemgr; + delete oremgr; + delete decomgr; + delete schemmgr; if (params.sparams) { delete params.sparams; |