1
0

Generator: Renamed cBiomeGenerator's Initialize() to InitializeBiomeGen().

This will allow initializing generators that implement both cBiomeGenerator and other generators.
This commit is contained in:
madmaxoft 2013-10-10 15:49:24 +02:00
parent 9deb9cfa0e
commit 85eb85dbf9
4 changed files with 19 additions and 19 deletions

View File

@ -27,7 +27,7 @@ void cBioGenConstant::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap
void cBioGenConstant::Initialize(cIniFile & a_IniFile) void cBioGenConstant::InitializeBiomeGen(cIniFile & a_IniFile)
{ {
AString Biome = a_IniFile.GetValueSet("Generator", "ConstantBiome", "Plains"); AString Biome = a_IniFile.GetValueSet("Generator", "ConstantBiome", "Plains");
m_Biome = StringToBiome(Biome); m_Biome = StringToBiome(Biome);
@ -131,10 +131,10 @@ void cBioGenCache::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a
void cBioGenCache::Initialize(cIniFile & a_IniFile) void cBioGenCache::InitializeBiomeGen(cIniFile & a_IniFile)
{ {
super::Initialize(a_IniFile); super::InitializeBiomeGen(a_IniFile);
m_BioGenToCache->Initialize(a_IniFile); m_BioGenToCache->InitializeBiomeGen(a_IniFile);
} }
@ -242,9 +242,9 @@ void cBioGenCheckerboard::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::Biome
void cBioGenCheckerboard::Initialize(cIniFile & a_IniFile) void cBioGenCheckerboard::InitializeBiomeGen(cIniFile & a_IniFile)
{ {
super::Initialize(a_IniFile); super::InitializeBiomeGen(a_IniFile);
AString Biomes = a_IniFile.GetValueSet ("Generator", "CheckerBoardBiomes", ""); AString Biomes = a_IniFile.GetValueSet ("Generator", "CheckerBoardBiomes", "");
m_BiomeSize = a_IniFile.GetValueSetI("Generator", "CheckerboardBiomeSize", 64); m_BiomeSize = a_IniFile.GetValueSetI("Generator", "CheckerboardBiomeSize", 64);
m_BiomeSize = (m_BiomeSize < 8) ? 8 : m_BiomeSize; m_BiomeSize = (m_BiomeSize < 8) ? 8 : m_BiomeSize;
@ -276,9 +276,9 @@ void cBioGenVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap &
void cBioGenVoronoi::Initialize(cIniFile & a_IniFile) void cBioGenVoronoi::InitializeBiomeGen(cIniFile & a_IniFile)
{ {
super::Initialize(a_IniFile); super::InitializeBiomeGen(a_IniFile);
m_CellSize = a_IniFile.GetValueSetI("Generator", "VoronoiCellSize", 64); m_CellSize = a_IniFile.GetValueSetI("Generator", "VoronoiCellSize", 64);
AString Biomes = a_IniFile.GetValueSet ("Generator", "VoronoiBiomes", ""); AString Biomes = a_IniFile.GetValueSet ("Generator", "VoronoiBiomes", "");
InitializeBiomes(Biomes); InitializeBiomes(Biomes);
@ -358,9 +358,9 @@ void cBioGenDistortedVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::B
void cBioGenDistortedVoronoi::Initialize(cIniFile & a_IniFile) void cBioGenDistortedVoronoi::InitializeBiomeGen(cIniFile & a_IniFile)
{ {
// Do NOT call super::Initialize(), as it would try to read Voronoi params instead of DistortedVoronoi params // Do NOT call super::InitializeBiomeGen(), as it would try to read Voronoi params instead of DistortedVoronoi params
m_CellSize = a_IniFile.GetValueSetI("Generator", "DistortedVoronoiCellSize", 96); m_CellSize = a_IniFile.GetValueSetI("Generator", "DistortedVoronoiCellSize", 96);
AString Biomes = a_IniFile.GetValueSet ("Generator", "DistortedVoronoiBiomes", ""); AString Biomes = a_IniFile.GetValueSet ("Generator", "DistortedVoronoiBiomes", "");
InitializeBiomes(Biomes); InitializeBiomes(Biomes);
@ -409,7 +409,7 @@ cBioGenMultiStepMap::cBioGenMultiStepMap(int a_Seed) :
void cBioGenMultiStepMap::Initialize(cIniFile & a_IniFile) void cBioGenMultiStepMap::InitializeBiomeGen(cIniFile & a_IniFile)
{ {
m_OceanCellSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapOceanCellSize", m_OceanCellSize); m_OceanCellSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapOceanCellSize", m_OceanCellSize);
m_MushroomIslandSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapMushroomIslandSize", m_MushroomIslandSize); m_MushroomIslandSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapMushroomIslandSize", m_MushroomIslandSize);

View File

@ -33,7 +33,7 @@ protected:
// cBiomeGen overrides: // cBiomeGen overrides:
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override; virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
virtual void Initialize(cIniFile & a_IniFile) override; virtual void InitializeBiomeGen(cIniFile & a_IniFile) override;
} ; } ;
@ -72,7 +72,7 @@ protected:
int m_TotalChain; // Number of cache items walked to get to a hit (only added for hits) int m_TotalChain; // Number of cache items walked to get to a hit (only added for hits)
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override; virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
virtual void Initialize(cIniFile & a_IniFile) override; virtual void InitializeBiomeGen(cIniFile & a_IniFile) override;
} ; } ;
@ -109,7 +109,7 @@ protected:
// cBiomeGen overrides: // cBiomeGen overrides:
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override; virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
virtual void Initialize(cIniFile & a_IniFile) override; virtual void InitializeBiomeGen(cIniFile & a_IniFile) override;
} ; } ;
@ -134,7 +134,7 @@ protected:
// cBiomeGen overrides: // cBiomeGen overrides:
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override; virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
virtual void Initialize(cIniFile & a_IniFile) override; virtual void InitializeBiomeGen(cIniFile & a_IniFile) override;
EMCSBiome VoronoiBiome(int a_BlockX, int a_BlockZ); EMCSBiome VoronoiBiome(int a_BlockX, int a_BlockZ);
} ; } ;
@ -156,7 +156,7 @@ public:
protected: protected:
// cBiomeGen overrides: // cBiomeGen overrides:
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override; virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
virtual void Initialize(cIniFile & a_IniFile) override; virtual void InitializeBiomeGen(cIniFile & a_IniFile) override;
/// Distorts the coords using a Perlin-like noise /// Distorts the coords using a Perlin-like noise
void Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ); void Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ);
@ -195,7 +195,7 @@ protected:
// cBiomeGen overrides: // cBiomeGen overrides:
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override; virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
virtual void Initialize(cIniFile & a_IniFile) override; virtual void InitializeBiomeGen(cIniFile & a_IniFile) override;
/** Step 1: Decides between ocean, land and mushroom, using a DistVoronoi with special conditions and post-processing for mushroom islands /** Step 1: Decides between ocean, land and mushroom, using a DistVoronoi with special conditions and post-processing for mushroom islands
Sets biomes to biOcean, -1 (i.e. land), biMushroomIsland or biMushroomShore Sets biomes to biOcean, -1 (i.e. land), biMushroomIsland or biMushroomShore

View File

@ -211,7 +211,7 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
m_UnderlyingBiomeGen = m_BiomeGen; m_UnderlyingBiomeGen = m_BiomeGen;
m_BiomeGen = new cBioGenCache(m_UnderlyingBiomeGen, CacheSize); m_BiomeGen = new cBioGenCache(m_UnderlyingBiomeGen, CacheSize);
} }
m_BiomeGen->Initialize(a_IniFile); m_BiomeGen->InitializeBiomeGen(a_IniFile);
} }

View File

@ -47,7 +47,7 @@ public:
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) = 0; virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) = 0;
/// Reads parameters from the ini file, prepares generator for use. /// Reads parameters from the ini file, prepares generator for use.
virtual void Initialize(cIniFile & a_IniFile) {} virtual void InitializeBiomeGen(cIniFile & a_IniFile) {}
} ; } ;