diff options
author | Mattes D <github@xoft.cz> | 2015-06-23 14:45:35 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-06-23 14:45:35 +0200 |
commit | 6cd71a1e73b33d17de061ca339e81a699ef8d624 (patch) | |
tree | c133702c4f61da750038d0e404b274dac06564d9 /src | |
parent | Merge pull request #2280 from SamJBarney/master (diff) | |
download | cuberite-6cd71a1e73b33d17de061ca339e81a699ef8d624.tar cuberite-6cd71a1e73b33d17de061ca339e81a699ef8d624.tar.gz cuberite-6cd71a1e73b33d17de061ca339e81a699ef8d624.tar.bz2 cuberite-6cd71a1e73b33d17de061ca339e81a699ef8d624.tar.lz cuberite-6cd71a1e73b33d17de061ca339e81a699ef8d624.tar.xz cuberite-6cd71a1e73b33d17de061ca339e81a699ef8d624.tar.zst cuberite-6cd71a1e73b33d17de061ca339e81a699ef8d624.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/ComposableGenerator.cpp | 2 | ||||
-rw-r--r-- | src/Generating/CompositedHeiGen.h | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp index 2c74340be..4eee8b707 100644 --- a/src/Generating/ComposableGenerator.cpp +++ b/src/Generating/ComposableGenerator.cpp @@ -274,7 +274,7 @@ void cComposableGenerator::InitCompositionGen(cIniFile & a_IniFile) } // Create a cache of the composited heightmaps, so that finishers may use it: - m_CompositedHeightCache = std::make_shared<cHeiGenMultiCache>(std::make_shared<cCompositedHeiGen>(m_ShapeGen, m_CompositionGen), 16, 24); + m_CompositedHeightCache = std::make_shared<cHeiGenMultiCache>(std::make_shared<cCompositedHeiGen>(m_BiomeGen, m_ShapeGen, m_CompositionGen), 16, 24); // 24 subcaches of depth 16 each = 96 KiB of RAM. Acceptable, for the amount of work this saves. } 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; }; |