Mapgen: Add global 'decorations' flag
authorparamat <mat.gregory@virginmedia.com>
Sun, 15 Nov 2015 11:55:45 +0000 (11:55 +0000)
committerparamat <mat.gregory@virginmedia.com>
Sat, 21 Nov 2015 00:10:08 +0000 (00:10 +0000)
Flag is set by default in MapgenParams
The global 'trees' flag remains but is now
undocumented and unset by default in MapgenParams
Add mgv6_spflag 'trees' set by default in
defaultsettings.cpp to affect new worlds only
This is automatically backwards
compatible for existing worlds

builtin/settingtypes.txt
minetest.conf.example
src/defaultsettings.cpp
src/mapgen.cpp
src/mapgen.h
src/mapgen_flat.cpp
src/mapgen_fractal.cpp
src/mapgen_v5.cpp
src/mapgen_v6.cpp
src/mapgen_v6.h
src/mapgen_v7.cpp

index bf452915ad5063cb519aa9700dc0031dd96e6880..cb38ec118161c8e43ba15474ee1ae88f623b2016 100644 (file)
@@ -829,10 +829,11 @@ max_block_generate_distance (Max block generate distance) int 6
 map_generation_limit (Map generation limit) int 31000 0 31000
 
 #    Global map generation attributes.
-#    The 'trees' flag only has effect in mgv6.
+#    In Mapgen v6 the 'decorations' flag controls all decorations except trees
+#    and junglegrass, in all other mapgens this flag controls all decorations.
 #    Flags that are not specified in the flag string are not modified from the default.
 #    Flags starting with "no" are used to explicitly disable them.
-mg_flags (Mapgen flags) flags trees,caves,dungeons,light trees,caves,dungeons,light,notrees,nocaves,nodungeons,nolight
+mg_flags (Mapgen flags) flags caves,dungeons,light,decorations caves,dungeons,light,decorations,nocaves,nodungeons,nolight,nodecorations
 
 [**Advanced]
 
@@ -889,7 +890,7 @@ mgv5_np_cave2 (Mapgen v5 cave2 noise parameters) noise_params 0, 12, (50, 50, 50
 #    When snowbiomes are enabled jungles are enabled and the jungles flag is ignored.
 #    Flags that are not specified in the flag string are not modified from the default.
 #    Flags starting with "no" are used to explicitly disable them.
-mgv6_spflags (Mapgen v6 flags) flags jungles,biomeblend,mudflow,snowbiomes jungles,biomeblend,mudflow,snowbiomes,flat,nojungles,nobiomeblend,nomudflow,nosnowbiomes,noflat
+mgv6_spflags (Mapgen v6 flags) flags jungles,biomeblend,mudflow,snowbiomes,trees jungles,biomeblend,mudflow,snowbiomes,flat,trees,nojungles,nobiomeblend,nomudflow,nosnowbiomes,noflat,notrees
 
 #    Controls size of deserts and beaches in Mapgen v6.
 #    When snowbiomes are enabled 'mgv6_freq_desert' is ignored.
index 39f80bf68301b21d2c1bce92f0b528274a6c7aa3..d8534a0f57a07fef4dba29725b87683113ab89ed 100644 (file)
 # map_generation_limit = 31000
 
 #    Global map generation attributes.
-#    The 'trees' flag only has effect in mgv6.
+#    In Mapgen v6 the 'decorations' flag controls all decorations except trees
+#    and junglegrass, in all other mapgens this flag controls all decorations.
 #    Flags that are not specified in the flag string are not modified from the default.
 #    Flags starting with "no" are used to explicitly disable them.
-#    type: flags possible values: trees, caves, dungeons, light, notrees, nocaves, nodungeons, nolight
-# mg_flags = trees,caves,dungeons,light
+#    type: flags possible values: caves, dungeons, light, decorations, nocaves, nodungeons, nolight, nodecorations
+# mg_flags = caves,dungeons,light,decorations
 
 ### Advanced
 
 #    When snowbiomes are enabled jungles are enabled and the jungles flag is ignored.
 #    Flags that are not specified in the flag string are not modified from the default.
 #    Flags starting with "no" are used to explicitly disable them.
-#    type: flags possible values: jungles, biomeblend, mudflow, snowbiomes, flat, nojungles, nobiomeblend, nomudflow, nosnowbiomes, noflat
-# mgv6_spflags = jungles,biomeblend,mudflow,snowbiomes
+#    type: flags possible values: jungles, biomeblend, mudflow, snowbiomes, flat, trees, nojungles, nobiomeblend, nomudflow, nosnowbiomes, noflat, notrees
+# mgv6_spflags = jungles,biomeblend,mudflow,snowbiomes,trees
 
 #    Controls size of deserts and beaches in Mapgen v6.
 #    When snowbiomes are enabled 'mgv6_freq_desert' is ignored.
index 3315f4aaa7766f18d1963b6b69883cd7d55e3569..42eddb8ceb7c4b998a1c44108acbc981fc095804 100644 (file)
@@ -313,7 +313,7 @@ void set_default_settings(Settings *settings)
        settings->setDefault("water_level", "1");
        settings->setDefault("chunksize", "5");
        settings->setDefault("mg_flags", "dungeons");
-       settings->setDefault("mgv6_spflags", "jungles, snowbiomes");
+       settings->setDefault("mgv6_spflags", "jungles, snowbiomes, trees");
 
        // IPv6
        settings->setDefault("enable_ipv6", "true");
index 8a77000fae9010de1cb1c6905d0b93eae3942acf..5a209edddab25d396ed6d5952979e9d9c4bdc85f 100644 (file)
@@ -41,11 +41,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "log.h"
 
 FlagDesc flagdesc_mapgen[] = {
-       {"trees",    MG_TREES},
-       {"caves",    MG_CAVES},
-       {"dungeons", MG_DUNGEONS},
-       {"flat",     MG_FLAT},
-       {"light",    MG_LIGHT},
+       {"trees",       MG_TREES},
+       {"caves",       MG_CAVES},
+       {"dungeons",    MG_DUNGEONS},
+       {"flat",        MG_FLAT},
+       {"light",       MG_LIGHT},
+       {"decorations", MG_DECORATIONS},
        {NULL,       0}
 };
 
index 57e9958475d9d23ac7fcced16816e7d881517b93..31cf7dc115f1f9d4001341a036b7e81008ab4c2f 100644 (file)
@@ -29,11 +29,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define DEFAULT_MAPGEN "v6"
 
 /////////////////// Mapgen flags
-#define MG_TREES         0x01
-#define MG_CAVES         0x02
-#define MG_DUNGEONS      0x04
-#define MG_FLAT          0x08
-#define MG_LIGHT         0x10
+#define MG_TREES       0x01
+#define MG_CAVES       0x02
+#define MG_DUNGEONS    0x04
+#define MG_FLAT        0x08
+#define MG_LIGHT       0x10
+#define MG_DECORATIONS 0x20
 
 class Settings;
 class MMVManip;
@@ -126,7 +127,7 @@ struct MapgenParams {
                chunksize(5),
                seed(0),
                water_level(1),
-               flags(MG_TREES | MG_CAVES | MG_LIGHT),
+               flags(MG_CAVES | MG_LIGHT | MG_DECORATIONS),
                np_biome_heat(NoiseParams(50, 50, v3f(750.0, 750.0, 750.0), 5349, 3, 0.5, 2.0)),
                np_biome_heat_blend(NoiseParams(0, 1.5, v3f(8.0, 8.0, 8.0), 13, 2, 1.0, 2.0)),
                np_biome_humidity(NoiseParams(50, 50, v3f(750.0, 750.0, 750.0), 842, 3, 0.5, 2.0)),
index 7a8fe18a6dd184e38c6e2faedf9f3f6d395cd1f0..1b41d0acf345723f08c8eeb3bc3c88b76f830c63 100644 (file)
@@ -296,7 +296,8 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
        }
 
        // Generate the registered decorations
-       m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
+       if (flags & MG_DECORATIONS)
+               m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
 
        // Generate the registered ores
        m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
index 89d4e53d380af4aeb7ce1e74a447f51e932526e9..26ebec353a5422083477938daa3ebb91cddfa9ee 100644 (file)
@@ -310,7 +310,8 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
        }
 
        // Generate the registered decorations
-       m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
+       if (flags & MG_DECORATIONS)
+               m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
 
        // Generate the registered ores
        m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
index 10e9f5e65993b0147466546710f39721246408b3..3d7e3bf83f8067252abf0f034d0ec4b33e5e7263 100644 (file)
@@ -296,7 +296,8 @@ void MapgenV5::makeChunk(BlockMakeData *data)
        }
 
        // Generate the registered decorations
-       m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
+       if (flags & MG_DECORATIONS)
+               m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
 
        // Generate the registered ores
        m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
index 3f3ccba4fd524961dc983a64903cc20b46671f29..3b5915bd1d390b1162357a08d50e1c2196f53c27 100644 (file)
@@ -43,6 +43,7 @@ FlagDesc flagdesc_mapgen_v6[] = {
        {"mudflow",    MGV6_MUDFLOW},
        {"snowbiomes", MGV6_SNOWBIOMES},
        {"flat",       MGV6_FLAT},
+       {"trees",      MGV6_TREES},
        {NULL,         0}
 };
 
@@ -580,11 +581,12 @@ void MapgenV6::makeChunk(BlockMakeData *data)
        growGrass();
 
        // Generate some trees, and add grass, if a jungle
-       if (flags & MG_TREES)
+       if ((spflags & MGV6_TREES) || (flags & MG_TREES))
                placeTreesAndJungleGrass();
 
        // Generate the registered decorations
-       m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
+       if (flags & MG_DECORATIONS)
+               m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
 
        // Generate the registered ores
        m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
index dec92ab48bbaec778f417777f606c95923f9ed5b..612e2322ab32f226dd798062450efc88a4e11738 100644 (file)
@@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define MGV6_MUDFLOW    0x04
 #define MGV6_SNOWBIOMES 0x08
 #define MGV6_FLAT       0x10
+#define MGV6_TREES      0x20
 
 
 extern FlagDesc flagdesc_mapgen_v6[];
index 77b9721c782557b8baed72546ecec3a07e2c48b7..679d860dc95cac61ed23bbd16120ea9fc58660d2 100644 (file)
@@ -317,7 +317,8 @@ void MapgenV7::makeChunk(BlockMakeData *data)
        }
 
        // Generate the registered decorations
-       m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
+       if (flags & MG_DECORATIONS)
+               m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
 
        // Generate the registered ores
        m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);