diff options
author | Weblate <42@minetest.ru> | 2013-02-08 16:29:19 +0100 |
---|---|---|
committer | Weblate <42@minetest.ru> | 2013-02-08 16:29:19 +0100 |
commit | a27857e9382fb65140748dbbefb73a463827d4d6 (patch) | |
tree | 72bf4dfbd030f04d94573d793aa150574eb9839d /src/mapgen.cpp | |
parent | 0cda2d5193a80b32d3cae8a54d5866cbd3308592 (diff) | |
parent | 9b2044351fb3a18e47eec01e9b574aa86485c101 (diff) | |
download | minetest-a27857e9382fb65140748dbbefb73a463827d4d6.tar.gz minetest-a27857e9382fb65140748dbbefb73a463827d4d6.tar.bz2 minetest-a27857e9382fb65140748dbbefb73a463827d4d6.zip |
Merge remote branch 'origin/master'
Diffstat (limited to 'src/mapgen.cpp')
-rw-r--r-- | src/mapgen.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp index f2745bdb4..b19073e90 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -35,6 +35,15 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "treegen.h" #include "mapgen_v6.h" +FlagDesc flagdesc_mapgen[] = { + {"trees", MG_TREES}, + {"caves", MG_CAVES}, + {"dungeons", MG_DUNGEONS}, + {"v6_forests", MGV6_FORESTS}, + {"v6_biome_blend", MGV6_BIOME_BLEND}, + {"flat", MG_FLAT}, + {NULL, 0} +}; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////// Emerge Manager //////////////////////////////// @@ -149,7 +158,7 @@ MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) { mgparams->seed = settings->getU64(settings == g_settings ? "fixed_map_seed" : "seed"); mgparams->water_level = settings->getS16("water_level"); mgparams->chunksize = settings->getS16("chunksize"); - mgparams->flags = settings->getS32("mg_flags"); + mgparams->flags = settings->getFlagStr("mg_flags", flagdesc_mapgen); if (!mgparams->readParams(settings)) { delete mgparams; @@ -159,7 +168,18 @@ MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) { } -bool EmergeManager::registerMapgen(std::string mgname, MapgenFactory *mgfactory) { +void EmergeManager::setParamsToSettings(Settings *settings) { + settings->set("mg_name", params->mg_name); + settings->setU64("seed", params->seed); + settings->setS16("water_level", params->water_level); + settings->setS16("chunksize", params->chunksize); + settings->setFlagStr("mg_flags", params->flags, flagdesc_mapgen); + + params->writeParams(settings); +} + + +void EmergeManager::registerMapgen(std::string mgname, MapgenFactory *mgfactory) { mglist.insert(std::make_pair(mgname, mgfactory)); infostream << "EmergeManager: registered mapgen " << mgname << std::endl; } |