summaryrefslogtreecommitdiffstats
path: root/source/Generating/DistortedHeightmap.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-11 10:18:01 +0200
committermadmaxoft <github@xoft.cz>2013-10-11 10:18:01 +0200
commita9e70c84b59032f8efcd634069ae97660a58eba1 (patch)
tree7cbbd0e1d70288fc61f0538c30c26dab8911b8e5 /source/Generating/DistortedHeightmap.h
parentAdded GetIniItemSet() function. (diff)
downloadcuberite-a9e70c84b59032f8efcd634069ae97660a58eba1.tar
cuberite-a9e70c84b59032f8efcd634069ae97660a58eba1.tar.gz
cuberite-a9e70c84b59032f8efcd634069ae97660a58eba1.tar.bz2
cuberite-a9e70c84b59032f8efcd634069ae97660a58eba1.tar.lz
cuberite-a9e70c84b59032f8efcd634069ae97660a58eba1.tar.xz
cuberite-a9e70c84b59032f8efcd634069ae97660a58eba1.tar.zst
cuberite-a9e70c84b59032f8efcd634069ae97660a58eba1.zip
Diffstat (limited to '')
-rw-r--r--source/Generating/DistortedHeightmap.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/Generating/DistortedHeightmap.h b/source/Generating/DistortedHeightmap.h
index b2b235e61..6d7007375 100644
--- a/source/Generating/DistortedHeightmap.h
+++ b/source/Generating/DistortedHeightmap.h
@@ -30,8 +30,6 @@ class cDistortedHeightmap :
public:
cDistortedHeightmap(int a_Seed, cBiomeGen & a_BiomeGen);
- void Initialize(cIniFile & a_IniFile);
-
protected:
typedef cChunkDef::BiomeMap BiomeNeighbors[3][3];
@@ -77,6 +75,9 @@ protected:
NOISE_DATATYPE m_DistortAmpX[DIM_X * DIM_Z];
NOISE_DATATYPE m_DistortAmpZ[DIM_X * DIM_Z];
+ /// True if Initialize() has been called. Used to initialize-once even with multiple init entrypoints (HeiGen / CompoGen)
+ bool m_IsInitialized;
+
/// Unless the LastChunk coords are equal to coords given, prepares the internal state (noise arrays, heightmap)
void PrepareState(int a_ChunkX, int a_ChunkZ);
@@ -93,10 +94,15 @@ protected:
/// Calculates the X and Z distortion amplitudes based on the neighbors' biomes
void GetDistortAmpsAt(BiomeNeighbors & a_Neighbors, int a_RelX, int a_RelZ, NOISE_DATATYPE & a_DistortAmpX, NOISE_DATATYPE & a_DistortAmpZ);
+ /// Reads the settings from the ini file. Skips reading if already initialized
+ void Initialize(cIniFile & a_IniFile);
+
// cTerrainHeightGen overrides:
virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) override;
+ virtual void InitializeHeightGen(cIniFile & a_IniFile) override;
// cTerrainCompositionGen overrides:
virtual void ComposeTerrain(cChunkDesc & a_ChunkDesc) override;
+ virtual void InitializeCompoGen(cIniFile & a_IniFile) override;
} ;