diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-06-08 23:24:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 23:24:36 +0100 |
commit | 0b23253447623cadf1c394984ce0eee977d54b9b (patch) | |
tree | 6417d00f8d850eeb9e9fbda0b7dcf94705763efe /src/mapgen/mapgen_valleys.cpp | |
parent | 9ca37d86a3f8fd35150880e3c64cb81796430d68 (diff) | |
download | minetest-0b23253447623cadf1c394984ce0eee977d54b9b.tar.gz minetest-0b23253447623cadf1c394984ce0eee977d54b9b.tar.bz2 minetest-0b23253447623cadf1c394984ce0eee977d54b9b.zip |
Mapgen flags: Add 'biomes' global mapgen flag (#7355)
Previously the only way to disable biomes was to 'clear' the registered
biomes in a mod, but this method causes large amounts of unnecessary
processing:
1. Calculation of 4 2D noises.
2. Looping through all nodes of a mapchunk replacing nodes with identical
nodes.
The new flag disables those operations.
Diffstat (limited to 'src/mapgen/mapgen_valleys.cpp')
-rw-r--r-- | src/mapgen/mapgen_valleys.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mapgen/mapgen_valleys.cpp b/src/mapgen/mapgen_valleys.cpp index 843acb690..341ce3137 100644 --- a/src/mapgen/mapgen_valleys.cpp +++ b/src/mapgen/mapgen_valleys.cpp @@ -231,7 +231,8 @@ void MapgenValleys::makeChunk(BlockMakeData *data) updateHeightmap(node_min, node_max); // Place biome-specific nodes and build biomemap - generateBiomes(); + if (flags & MG_BIOMES) + generateBiomes(); // Generate tunnels, caverns and large randomwalk caves if (flags & MG_CAVES) { @@ -265,7 +266,8 @@ void MapgenValleys::makeChunk(BlockMakeData *data) m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); // Sprinkle some dust on top after everything else was generated - dustTopNodes(); + if (flags & MG_BIOMES) + dustTopNodes(); updateLiquid(&data->transforming_liquid, full_node_min, full_node_max); |