summaryrefslogtreecommitdiffstats
path: root/src/Generating/Noise3DGenerator.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-09-08 15:40:12 +0200
committerMattes D <github@xoft.cz>2019-09-08 20:21:49 +0200
commit5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755 (patch)
tree7b633e2b29ae816dcc6a56c4d1c083518db7da04 /src/Generating/Noise3DGenerator.h
parentBiomeGen: Changed to use cChunkCoords params. (diff)
downloadcuberite-5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755.tar
cuberite-5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755.tar.gz
cuberite-5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755.tar.bz2
cuberite-5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755.tar.lz
cuberite-5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755.tar.xz
cuberite-5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755.tar.zst
cuberite-5f4df3e87dc43bb9cbf19ea1e15d73ee0b5d1755.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/Noise3DGenerator.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/Generating/Noise3DGenerator.h b/src/Generating/Noise3DGenerator.h
index fa760f5f3..1f7123588 100644
--- a/src/Generating/Noise3DGenerator.h
+++ b/src/Generating/Noise3DGenerator.h
@@ -115,16 +115,15 @@ protected:
NOISE_DATATYPE m_AirThreshold;
// Cache for the last calculated chunk (reused between heightmap and composition queries):
- int m_LastChunkX;
- int m_LastChunkZ;
+ cChunkCoords m_LastChunkCoords;
NOISE_DATATYPE m_NoiseArray[17 * 17 * 257]; // x + 17 * z + 17 * 17 * y
/** Generates the 3D noise array used for terrain generation (m_NoiseArray), unless the LastChunk coords are equal to coords given */
- void GenerateNoiseArrayIfNeeded(int a_ChunkX, int a_ChunkZ);
+ void GenerateNoiseArrayIfNeeded(cChunkCoords a_ChunkCoords);
// cTerrainHeightGen overrides:
- virtual void GenShape(int a_ChunkX, int a_ChunkZ, cChunkDesc::Shape & a_Shape) override;
+ virtual void GenShape(cChunkCoords a_ChunkCoords, cChunkDesc::Shape & a_Shape) override;
virtual void InitializeShapeGen(cIniFile & a_IniFile) override { Initialize(a_IniFile); }
} ;
@@ -184,8 +183,7 @@ protected:
NOISE_DATATYPE m_AirThreshold;
// Cache for the last calculated chunk (reused between heightmap and composition queries):
- int m_LastChunkX;
- int m_LastChunkZ;
+ cChunkCoords m_LastChunkCoords;
NOISE_DATATYPE m_NoiseArray[17 * 17 * 257]; // 257 * x + y + 257 * 17 * z
/** Weights for summing up neighboring biomes. */
@@ -196,16 +194,16 @@ protected:
/** Generates the 3D noise array used for terrain generation (m_NoiseArray), unless the LastChunk coords are equal to coords given */
- void GenerateNoiseArrayIfNeeded(int a_ChunkX, int a_ChunkZ);
+ void GenerateNoiseArrayIfNeeded(cChunkCoords a_ChunkCoords);
/** Calculates the biome-related parameters for the chunk. */
- void CalcBiomeParamArrays(int a_ChunkX, int a_ChunkZ, ChunkParam & a_HeightAmp, ChunkParam & a_MidPoint);
+ void CalcBiomeParamArrays(cChunkCoords a_ChunkCoords, ChunkParam & a_HeightAmp, ChunkParam & a_MidPoint);
/** Returns the parameters for the specified biome. */
void GetBiomeParams(EMCSBiome a_Biome, NOISE_DATATYPE & a_HeightAmp, NOISE_DATATYPE & a_MidPoint);
// cTerrainShapeGen overrides:
- virtual void GenShape(int a_ChunkX, int a_ChunkZ, cChunkDesc::Shape & a_Shape) override;
+ virtual void GenShape(cChunkCoords a_ChunkCoords, cChunkDesc::Shape & a_Shape) override;
virtual void InitializeShapeGen(cIniFile & a_IniFile) override { Initialize(a_IniFile); }
} ;