diff options
author | madmaxoft <github@xoft.cz> | 2014-06-20 17:10:18 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-06-20 17:10:18 +0200 |
commit | 9db9445e9fec2ce0ab52434e50cc21f30d4ef313 (patch) | |
tree | 6dc2f036b912d2074b4277424c69bfc75f2d7468 /src/Generating/BioGen.cpp | |
parent | Merge pull request #1112 from mc-server/danglingptrs (diff) | |
download | cuberite-9db9445e9fec2ce0ab52434e50cc21f30d4ef313.tar cuberite-9db9445e9fec2ce0ab52434e50cc21f30d4ef313.tar.gz cuberite-9db9445e9fec2ce0ab52434e50cc21f30d4ef313.tar.bz2 cuberite-9db9445e9fec2ce0ab52434e50cc21f30d4ef313.tar.lz cuberite-9db9445e9fec2ce0ab52434e50cc21f30d4ef313.tar.xz cuberite-9db9445e9fec2ce0ab52434e50cc21f30d4ef313.tar.zst cuberite-9db9445e9fec2ce0ab52434e50cc21f30d4ef313.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/BioGen.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index 3e3a034b2..a17555f37 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -747,7 +747,12 @@ cBioGenTwoLevel::cBioGenTwoLevel(int a_Seed) : m_VoronoiSmall(a_Seed + 2000), m_DistortX(a_Seed + 3000), m_DistortZ(a_Seed + 4000), - m_Noise(a_Seed + 5000) + m_Noise1(a_Seed + 5001), + m_Noise2(a_Seed + 5002), + m_Noise3(a_Seed + 5003), + m_Noise4(a_Seed + 5004), + m_Noise5(a_Seed + 5005), + m_Noise6(a_Seed + 5006) { } @@ -769,12 +774,12 @@ void cBioGenTwoLevel::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap int BlockZ = BaseZ + z * 4; float BlockXF = (float)(16 * BlockX) / 128; float BlockZF = (float)(16 * BlockZ) / 128; - double NoiseX = m_Noise.CubicNoise3D(BlockXF / 16, BlockZF / 16, 1000); - NoiseX += 0.5 * m_Noise.CubicNoise3D(BlockXF / 8, BlockZF / 8, 2000); - NoiseX += 0.08 * m_Noise.CubicNoise3D(BlockXF, BlockZF, 3000); - double NoiseZ = m_Noise.CubicNoise3D(BlockXF / 16, BlockZF / 16, 4000); - NoiseZ += 0.5 * m_Noise.CubicNoise3D(BlockXF / 8, BlockZF / 8, 5000); - NoiseZ += 0.08 * m_Noise.CubicNoise3D(BlockXF, BlockZF, 6000); + double NoiseX = m_Noise1.CubicNoise2D(BlockXF / 16, BlockZF / 16); + NoiseX += 0.5 * m_Noise2.CubicNoise2D(BlockXF / 8, BlockZF / 8); + NoiseX += 0.08 * m_Noise3.CubicNoise2D(BlockXF, BlockZF); + double NoiseZ = m_Noise4.CubicNoise2D(BlockXF / 16, BlockZF / 16); + NoiseZ += 0.5 * m_Noise5.CubicNoise2D(BlockXF / 8, BlockZF / 8); + NoiseZ += 0.08 * m_Noise6.CubicNoise2D(BlockXF, BlockZF); DistortX[4 * x][4 * z] = BlockX + (int)(64 * NoiseX); DistortZ[4 * x][4 * z] = BlockZ + (int)(64 * NoiseZ); @@ -788,8 +793,8 @@ void cBioGenTwoLevel::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap { for (int x = 0; x < cChunkDef::Width; x++) { - int BiomeGroup = m_VoronoiLarge.GetValueAt(DistortX[x][z], DistortZ[x][z]) / 7; int MinDist1, MinDist2; + int BiomeGroup = m_VoronoiLarge.GetValueAt(DistortX[x][z], DistortZ[x][z], MinDist1, MinDist2) / 7; int BiomeIdx = m_VoronoiSmall.GetValueAt(DistortX[x][z], DistortZ[x][z], MinDist1, MinDist2) / 11; cChunkDef::SetBiome(a_BiomeMap, x, z, SelectBiome(BiomeGroup, BiomeIdx, (MinDist1 < MinDist2 / 4) ? 0 : 1)); } |