summaryrefslogtreecommitdiffstats
path: root/source/Generating/DistortedHeightmap.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-16 15:14:25 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-16 15:14:25 +0200
commitbd910e78e274ade7721e9674a1dd73825c2d2d7e (patch)
tree1bc7504bb2391f049127a0555d51990b98322714 /source/Generating/DistortedHeightmap.h
parentMoved noise debugging into the Noise.* files (diff)
downloadcuberite-bd910e78e274ade7721e9674a1dd73825c2d2d7e.tar
cuberite-bd910e78e274ade7721e9674a1dd73825c2d2d7e.tar.gz
cuberite-bd910e78e274ade7721e9674a1dd73825c2d2d7e.tar.bz2
cuberite-bd910e78e274ade7721e9674a1dd73825c2d2d7e.tar.lz
cuberite-bd910e78e274ade7721e9674a1dd73825c2d2d7e.tar.xz
cuberite-bd910e78e274ade7721e9674a1dd73825c2d2d7e.tar.zst
cuberite-bd910e78e274ade7721e9674a1dd73825c2d2d7e.zip
Diffstat (limited to '')
-rw-r--r--source/Generating/DistortedHeightmap.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/Generating/DistortedHeightmap.h b/source/Generating/DistortedHeightmap.h
index 2b962940a..9027b609a 100644
--- a/source/Generating/DistortedHeightmap.h
+++ b/source/Generating/DistortedHeightmap.h
@@ -35,11 +35,18 @@ public:
protected:
typedef cChunkDef::BiomeMap BiomeNeighbors[3][3];
- cNoise m_Noise1;
- cNoise m_Noise2;
- cNoise m_Noise3;
- cNoise m_Noise4;
- cNoise m_Noise5;
+ // Linear upscaling step sizes, must be divisors of cChunkDef::Width and cChunkDef::Height, respectively:
+ static const int INTERPOL_X = 8;
+ static const int INTERPOL_Y = 4;
+ static const int INTERPOL_Z = 8;
+
+ // Linear upscaling buffer dimensions, calculated from the step sizes:
+ static const int DIM_X = 1 + (17 / INTERPOL_X);
+ static const int DIM_Y = 1 + (257 / INTERPOL_Y);
+ static const int DIM_Z = 1 + (17 / INTERPOL_Z);
+
+ cPerlinNoise m_NoiseDistortX;
+ cPerlinNoise m_NoiseDistortZ;
int m_SeaLevel;
NOISE_DATATYPE m_FrequencyX;
@@ -48,7 +55,7 @@ protected:
int m_CurChunkX;
int m_CurChunkZ;
- NOISE_DATATYPE m_DistortedHeightmap[17 * 17 * 257];
+ NOISE_DATATYPE m_DistortedHeightmap[17 * 257 * 17];
cBiomeGen & m_BiomeGen;
cHeiGenBiomal m_UnderlyingHeiGen; // This generator provides us with base heightmap (before distortion)
@@ -65,8 +72,9 @@ protected:
} ;
static const sGenParam m_GenParam[biNumBiomes];
- NOISE_DATATYPE m_DistortAmpX[17 * 17];
- NOISE_DATATYPE m_DistortAmpZ[17 * 17];
+ // Distortion amplitudes for each direction, before linear upscaling
+ NOISE_DATATYPE m_DistortAmpX[DIM_X * DIM_Z];
+ NOISE_DATATYPE m_DistortAmpZ[DIM_X * DIM_Z];
/// Unless the LastChunk coords are equal to coords given, prepares the internal state (noise arrays, heightmap)