summaryrefslogtreecommitdiffstats
path: root/source/Generating/BioGen.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-02 19:17:46 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-02 19:17:46 +0100
commit5856500be7440f56ab60be53b610ab49ee9b41ba (patch)
treeb756a166b462d4311ef2faf22f10a0127e50a004 /source/Generating/BioGen.cpp
parentFixed GCC error in ManualBindings (diff)
downloadcuberite-5856500be7440f56ab60be53b610ab49ee9b41ba.tar
cuberite-5856500be7440f56ab60be53b610ab49ee9b41ba.tar.gz
cuberite-5856500be7440f56ab60be53b610ab49ee9b41ba.tar.bz2
cuberite-5856500be7440f56ab60be53b610ab49ee9b41ba.tar.lz
cuberite-5856500be7440f56ab60be53b610ab49ee9b41ba.tar.xz
cuberite-5856500be7440f56ab60be53b610ab49ee9b41ba.tar.zst
cuberite-5856500be7440f56ab60be53b610ab49ee9b41ba.zip
Diffstat (limited to 'source/Generating/BioGen.cpp')
-rw-r--r--source/Generating/BioGen.cpp63
1 files changed, 62 insertions, 1 deletions
diff --git a/source/Generating/BioGen.cpp b/source/Generating/BioGen.cpp
index bee0eda87..e5c863d75 100644
--- a/source/Generating/BioGen.cpp
+++ b/source/Generating/BioGen.cpp
@@ -26,6 +26,21 @@ void cBioGenConstant::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap
+void cBioGenConstant::Initialize(cIniFile & a_IniFile)
+{
+ AString Biome = a_IniFile.GetValueSet("Generator", "ConstantBiome", "Plains");
+ m_Biome = StringToBiome(Biome);
+ if (m_Biome == -1)
+ {
+ LOGWARN("[Generator]::ConstantBiome value \"%s\" not recognized, using \"Plains\".", Biome.c_str());
+ m_Biome = biPlains;
+ }
+}
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cBioGenCache:
@@ -116,6 +131,16 @@ void cBioGenCache::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a
+void cBioGenCache::Initialize(cIniFile & a_IniFile)
+{
+ super::Initialize(a_IniFile);
+ m_BioGenToCache->Initialize(a_IniFile);
+}
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cBiomeGenList:
@@ -217,6 +242,19 @@ void cBioGenCheckerboard::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::Biome
+void cBioGenCheckerboard::Initialize(cIniFile & a_IniFile)
+{
+ super::Initialize(a_IniFile);
+ AString Biomes = a_IniFile.GetValueSet ("Generator", "CheckerBoardBiomes", "");
+ m_BiomeSize = a_IniFile.GetValueSetI("Generator", "CheckerboardBiomeSize", 64);
+ m_BiomeSize = (m_BiomeSize < 8) ? 8 : m_BiomeSize;
+ InitializeBiomes(Biomes);
+}
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cBioGenVoronoi :
@@ -238,6 +276,18 @@ void cBioGenVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap &
+void cBioGenVoronoi::Initialize(cIniFile & a_IniFile)
+{
+ super::Initialize(a_IniFile);
+ m_CellSize = a_IniFile.GetValueSetI("Generator", "VoronoiCellSize", 64);
+ AString Biomes = a_IniFile.GetValueSet ("Generator", "VoronoiBiomes", "");
+ InitializeBiomes(Biomes);
+}
+
+
+
+
+
EMCSBiome cBioGenVoronoi::VoronoiBiome(int a_BlockX, int a_BlockZ)
{
int CellX = a_BlockX / m_CellSize;
@@ -308,6 +358,17 @@ void cBioGenDistortedVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::B
+void cBioGenDistortedVoronoi::Initialize(cIniFile & a_IniFile)
+{
+ // Do NOT call super::Initialize(), as it would try to read Voronoi params instead of DistortedVoronoi params
+ m_CellSize = a_IniFile.GetValueSetI("Generator", "DistortedVoronoiCellSize", 96);
+ AString Biomes = a_IniFile.GetValueSet ("Generator", "DistortedVoronoiBiomes", "");
+ InitializeBiomes(Biomes);
+}
+
+
+
+
void cBioGenDistortedVoronoi::Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ)
{
double NoiseX = m_Noise.CubicNoise3D((float)a_BlockX / m_CellSize, (float)a_BlockZ / m_CellSize, 1000);
@@ -343,7 +404,7 @@ cBioGenMultiStepMap::cBioGenMultiStepMap(int a_Seed) :
-void cBioGenMultiStepMap::Init(cIniFile & a_IniFile)
+void cBioGenMultiStepMap::Initialize(cIniFile & a_IniFile)
{
m_OceanCellSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapOceanCellSize", m_OceanCellSize);
m_MushroomIslandSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapMushroomIslandSize", m_MushroomIslandSize);