summaryrefslogtreecommitdiffstats
path: root/src/Generating/ComposableGenerator.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-10-21 16:55:22 +0200
committerHowaner <franzi.moos@googlemail.com>2014-10-21 16:55:22 +0200
commit44514e53fc5ad19e57688bed610f804b6d28be33 (patch)
tree224fce184f6d59739d77828889025467ecfd1edf /src/Generating/ComposableGenerator.h
parentAdded distance check. (diff)
parentUpdated ProtectionAreas (diff)
downloadcuberite-44514e53fc5ad19e57688bed610f804b6d28be33.tar
cuberite-44514e53fc5ad19e57688bed610f804b6d28be33.tar.gz
cuberite-44514e53fc5ad19e57688bed610f804b6d28be33.tar.bz2
cuberite-44514e53fc5ad19e57688bed610f804b6d28be33.tar.lz
cuberite-44514e53fc5ad19e57688bed610f804b6d28be33.tar.xz
cuberite-44514e53fc5ad19e57688bed610f804b6d28be33.tar.zst
cuberite-44514e53fc5ad19e57688bed610f804b6d28be33.zip
Diffstat (limited to 'src/Generating/ComposableGenerator.h')
-rw-r--r--src/Generating/ComposableGenerator.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/Generating/ComposableGenerator.h b/src/Generating/ComposableGenerator.h
index 6b7627d2e..a091f8d53 100644
--- a/src/Generating/ComposableGenerator.h
+++ b/src/Generating/ComposableGenerator.h
@@ -24,6 +24,16 @@ See http://forum.mc-server.org/showthread.php?tid=409 for details.
+// Forward-declare the shared pointers to subgenerator classes:
+class cBiomeGen;
+class cTerrainHeightGen;
+class cTerrainCompositionGen;
+class cFinishGen;
+typedef SharedPtr<cBiomeGen> cBiomeGenPtr;
+typedef SharedPtr<cTerrainHeightGen> cTerrainHeightGenPtr;
+typedef SharedPtr<cTerrainCompositionGen> cTerrainCompositionGenPtr;
+typedef SharedPtr<cFinishGen> cFinishGenPtr;
+
// fwd: Noise3DGenerator.h
class cNoise3DComposable;
@@ -53,8 +63,7 @@ public:
a_CacheOffByDefault gets set to whether the cache should be disabled by default.
Used in BiomeVisualiser, too.
Implemented in BioGen.cpp! */
- static cBiomeGen * CreateBiomeGen(cIniFile & a_IniFile, int a_Seed, bool & a_CacheOffByDefault);
-
+ static cBiomeGenPtr CreateBiomeGen(cIniFile & a_IniFile, int a_Seed, bool & a_CacheOffByDefault);
} ;
@@ -83,7 +92,7 @@ public:
a_CacheOffByDefault gets set to whether the cache should be disabled by default
Implemented in HeiGen.cpp!
*/
- static cTerrainHeightGen * CreateHeightGen(cIniFile & a_IniFile, cBiomeGen & a_BiomeGen, int a_Seed, bool & a_CacheOffByDefault);
+ static cTerrainHeightGenPtr CreateHeightGen(cIniFile & a_IniFile, cBiomeGenPtr a_BiomeGen, int a_Seed, bool & a_CacheOffByDefault);
} ;
@@ -109,7 +118,7 @@ public:
a_BiomeGen is the underlying biome generator, some composition generators may depend on it to generate more biomes
a_HeightGen is the underlying height generator, some composition generators may depend on it providing additional values
*/
- static cTerrainCompositionGen * CreateCompositionGen(cIniFile & a_IniFile, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen, int a_Seed);
+ static cTerrainCompositionGenPtr CreateCompositionGen(cIniFile & a_IniFile, cBiomeGenPtr a_BiomeGen, cTerrainHeightGen & a_HeightGen, int a_Seed);
} ;
@@ -131,7 +140,7 @@ public:
virtual void GenFinish(cChunkDesc & a_ChunkDesc) = 0;
} ;
-typedef std::list<cFinishGen *> cFinishGenList;
+typedef std::list<cFinishGenPtr> cFinishGenList;
@@ -144,7 +153,6 @@ class cComposableGenerator :
public:
cComposableGenerator(cChunkGenerator & a_ChunkGenerator);
- virtual ~cComposableGenerator();
virtual void Initialize(cIniFile & a_IniFile) override;
virtual void GenerateBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
@@ -152,15 +160,10 @@ public:
protected:
// The generation composition:
- cBiomeGen * m_BiomeGen;
- cTerrainHeightGen * m_HeightGen;
- cTerrainCompositionGen * m_CompositionGen;
- cFinishGenList m_FinishGens;
-
- // Generators underlying the caches:
- cBiomeGen * m_UnderlyingBiomeGen;
- cTerrainHeightGen * m_UnderlyingHeightGen;
- cTerrainCompositionGen * m_UnderlyingCompositionGen;
+ cBiomeGenPtr m_BiomeGen;
+ cTerrainHeightGenPtr m_HeightGen;
+ cTerrainCompositionGenPtr m_CompositionGen;
+ cFinishGenList m_FinishGens;
/** Reads the biome gen settings from the ini and initializes m_BiomeGen accordingly */