summaryrefslogtreecommitdiffstats
path: root/src/Generating/BioGen.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-25 20:47:16 +0200
committermadmaxoft <github@xoft.cz>2014-09-25 20:47:29 +0200
commite5293706de4433d5198e510de0a3e32f572ce230 (patch)
treea7c6919672abd04e1860c979e1d7cff67a328938 /src/Generating/BioGen.cpp
parentAdded cByteBuffer::WriteBEUShort(). (diff)
downloadcuberite-e5293706de4433d5198e510de0a3e32f572ce230.tar
cuberite-e5293706de4433d5198e510de0a3e32f572ce230.tar.gz
cuberite-e5293706de4433d5198e510de0a3e32f572ce230.tar.bz2
cuberite-e5293706de4433d5198e510de0a3e32f572ce230.tar.lz
cuberite-e5293706de4433d5198e510de0a3e32f572ce230.tar.xz
cuberite-e5293706de4433d5198e510de0a3e32f572ce230.tar.zst
cuberite-e5293706de4433d5198e510de0a3e32f572ce230.zip
Diffstat (limited to 'src/Generating/BioGen.cpp')
-rw-r--r--src/Generating/BioGen.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index 217ca8f80..3ee0bd4c5 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -913,15 +913,32 @@ EMCSBiome cBioGenTwoLevel::SelectBiome(int a_BiomeGroup, int a_BiomeIdx, int a_D
void cBioGenTwoLevel::InitializeBiomeGen(cIniFile & a_IniFile)
{
- // TODO: Read these from a file
- m_VoronoiLarge.SetCellSize(1024);
- m_VoronoiSmall.SetCellSize(128);
- m_DistortX.AddOctave(0.01f, 16);
- m_DistortX.AddOctave(0.005f, 8);
- m_DistortX.AddOctave(0.0025f, 4);
- m_DistortZ.AddOctave(0.01f, 16);
- m_DistortZ.AddOctave(0.005f, 8);
- m_DistortZ.AddOctave(0.0025f, 4);
+ m_VoronoiLarge.SetCellSize(a_IniFile.GetValueSetI("Generator", "TwoLevelLargeCellSize", 1024));
+ m_VoronoiSmall.SetCellSize(a_IniFile.GetValueSetI("Generator", "TwoLevelSmallCellSize", 128));
+ m_DistortX.AddOctave(
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave1Freq", 0.01),
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave1Amp", 16)
+ );
+ m_DistortX.AddOctave(
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave2Freq", 0.005),
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave2Amp", 8)
+ );
+ m_DistortX.AddOctave(
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave3Freq", 0.0025),
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave3Amp", 4)
+ );
+ m_DistortZ.AddOctave(
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave1Freq", 0.01),
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave1Amp", 16)
+ );
+ m_DistortZ.AddOctave(
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave2Freq", 0.005),
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave2Amp", 8)
+ );
+ m_DistortZ.AddOctave(
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave3Freq", 0.0025),
+ (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave3Amp", 4)
+ );
}