summaryrefslogtreecommitdiffstats
path: root/src/Generating/DistortedHeightmap.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-30 13:34:52 +0100
committermadmaxoft <github@xoft.cz>2013-11-30 13:34:52 +0100
commit754d991b4f6d9d7f297daae65a49b4cb4d2ba362 (patch)
tree124cf1cd03b0003b093efffdbfe59445b64868de /src/Generating/DistortedHeightmap.cpp
parentImplemented mesa biomes in DistortedHeightmap CompoGen. (diff)
downloadcuberite-754d991b4f6d9d7f297daae65a49b4cb4d2ba362.tar
cuberite-754d991b4f6d9d7f297daae65a49b4cb4d2ba362.tar.gz
cuberite-754d991b4f6d9d7f297daae65a49b4cb4d2ba362.tar.bz2
cuberite-754d991b4f6d9d7f297daae65a49b4cb4d2ba362.tar.lz
cuberite-754d991b4f6d9d7f297daae65a49b4cb4d2ba362.tar.xz
cuberite-754d991b4f6d9d7f297daae65a49b4cb4d2ba362.tar.zst
cuberite-754d991b4f6d9d7f297daae65a49b4cb4d2ba362.zip
Diffstat (limited to 'src/Generating/DistortedHeightmap.cpp')
-rw-r--r--src/Generating/DistortedHeightmap.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp
index d4a0eb6de..a61d79bec 100644
--- a/src/Generating/DistortedHeightmap.cpp
+++ b/src/Generating/DistortedHeightmap.cpp
@@ -639,6 +639,10 @@ void cDistortedHeightmap::GetDistortAmpsAt(BiomeNeighbors & a_Neighbors, int a_R
void cDistortedHeightmap::ComposeColumn(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelZ)
{
+ // Frequencies for the podzol floor selecting noise:
+ const NOISE_DATATYPE FrequencyX = 8;
+ const NOISE_DATATYPE FrequencyZ = 8;
+
EMCSBiome Biome = a_ChunkDesc.GetBiome(a_RelX, a_RelZ);
switch (Biome)
{
@@ -695,7 +699,12 @@ void cDistortedHeightmap::ComposeColumn(cChunkDesc & a_ChunkDesc, int a_RelX, in
case biMegaSpruceTaiga:
case biMegaSpruceTaigaHills:
{
- FillColumnPattern(a_ChunkDesc, a_RelX, a_RelZ, patPodzol.Get());
+ // Select the pattern to use - podzol, grass or grassless dirt:
+ NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(m_CurChunkX * cChunkDef::Width + a_RelX)) / FrequencyX;
+ NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(m_CurChunkZ * cChunkDef::Width + a_RelZ)) / FrequencyZ;
+ NOISE_DATATYPE Val = m_OceanFloorSelect.CubicNoise2D(NoiseX, NoiseY);
+ const sBlockInfo * Pattern = (Val < -0.9) ? patGrassLess.Get() : ((Val > 0) ? patPodzol.Get() : patGrass.Get());
+ FillColumnPattern(a_ChunkDesc, a_RelX, a_RelZ, Pattern);
return;
}