summaryrefslogtreecommitdiffstats
path: root/src/Generating/CompositedHeiGen.h
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-06-23 18:26:39 +0200
committerworktycho <work.tycho@gmail.com>2015-06-23 18:26:39 +0200
commitc0d8a4933e39ecac19fb6edb7e16ae158d5f1c97 (patch)
treedcf7086e1b74af4190ecc06c690f0919f2717831 /src/Generating/CompositedHeiGen.h
parentMerge pull request #2285 from cuberite/MelonFix (diff)
parentGenerate biomes when pregenerating heights through CompositedHeiGen. (diff)
downloadcuberite-c0d8a4933e39ecac19fb6edb7e16ae158d5f1c97.tar
cuberite-c0d8a4933e39ecac19fb6edb7e16ae158d5f1c97.tar.gz
cuberite-c0d8a4933e39ecac19fb6edb7e16ae158d5f1c97.tar.bz2
cuberite-c0d8a4933e39ecac19fb6edb7e16ae158d5f1c97.tar.lz
cuberite-c0d8a4933e39ecac19fb6edb7e16ae158d5f1c97.tar.xz
cuberite-c0d8a4933e39ecac19fb6edb7e16ae158d5f1c97.tar.zst
cuberite-c0d8a4933e39ecac19fb6edb7e16ae158d5f1c97.zip
Diffstat (limited to 'src/Generating/CompositedHeiGen.h')
-rw-r--r--src/Generating/CompositedHeiGen.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Generating/CompositedHeiGen.h b/src/Generating/CompositedHeiGen.h
index fa33a7861..c4e6ce77d 100644
--- a/src/Generating/CompositedHeiGen.h
+++ b/src/Generating/CompositedHeiGen.h
@@ -20,7 +20,8 @@ class cCompositedHeiGen:
public cTerrainHeightGen
{
public:
- cCompositedHeiGen(cTerrainShapeGenPtr a_ShapeGen, cTerrainCompositionGenPtr a_CompositionGen):
+ cCompositedHeiGen(cBiomeGenPtr a_BiomeGen, cTerrainShapeGenPtr a_ShapeGen, cTerrainCompositionGenPtr a_CompositionGen):
+ m_BiomeGen(a_BiomeGen),
m_ShapeGen(a_ShapeGen),
m_CompositionGen(a_CompositionGen)
{
@@ -28,18 +29,20 @@ public:
- // cTerrainheightGen overrides:
+ // cTerrainHeightGen overrides:
virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) override
{
cChunkDesc::Shape shape;
m_ShapeGen->GenShape(a_ChunkX, a_ChunkZ, shape);
cChunkDesc desc(a_ChunkX, a_ChunkZ);
+ m_BiomeGen->GenBiomes(a_ChunkX, a_ChunkZ, desc.GetBiomeMap()); // Need to initialize biomes for the composition gen
desc.SetHeightFromShape(shape);
m_CompositionGen->ComposeTerrain(desc, shape);
memcpy(a_HeightMap, desc.GetHeightMap(), sizeof(a_HeightMap));
}
protected:
+ cBiomeGenPtr m_BiomeGen;
cTerrainShapeGenPtr m_ShapeGen;
cTerrainCompositionGenPtr m_CompositionGen;
};