From 0b23253447623cadf1c394984ce0eee977d54b9b Mon Sep 17 00:00:00 2001 From: Paramat Date: Fri, 8 Jun 2018 23:24:36 +0100 Subject: 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. --- src/mapgen/mapgen_flat.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mapgen/mapgen_flat.cpp') diff --git a/src/mapgen/mapgen_flat.cpp b/src/mapgen/mapgen_flat.cpp index dbe0bd5bb..e2bc42918 100644 --- a/src/mapgen/mapgen_flat.cpp +++ b/src/mapgen/mapgen_flat.cpp @@ -195,8 +195,10 @@ void MapgenFlat::makeChunk(BlockMakeData *data) updateHeightmap(node_min, node_max); // Init biome generator, place biome-specific nodes, and build biomemap - biomegen->calcBiomeNoise(node_min); - generateBiomes(); + if (flags & MG_BIOMES) { + biomegen->calcBiomeNoise(node_min); + generateBiomes(); + } if (flags & MG_CAVES) { // Generate tunnels @@ -217,7 +219,8 @@ void MapgenFlat::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(); //printf("makeChunk: %dms\n", t.stop()); -- cgit v1.2.3