summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Generating/BioGen.cpp7
-rw-r--r--src/Generating/BioGen.h8
-rw-r--r--src/Generating/ComposableGenerator.cpp6
3 files changed, 14 insertions, 7 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index 69af5c79a..46516b327 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -212,11 +212,12 @@ void cBioGenCache::InitializeBiomeGen(cIniFile & a_IniFile)
// cBioGenMulticache:
cBioGenMulticache::cBioGenMulticache(cBiomeGen * a_BioGenToCache, size_t a_CacheSize, size_t a_CachesLength) :
-m_CachesLength(a_CachesLength),
-m_InternalCacheLength(a_CachesLength * a_CacheSize)
+ m_CachesLength(a_CachesLength),
+ m_InternalCacheLength(a_CachesLength * a_CacheSize)
{
m_Caches.reserve(m_InternalCacheLength);
- for (size_t i = 0; i < m_InternalCacheLength; i++) {
+ for (size_t i = 0; i < m_InternalCacheLength; i++)
+ {
m_Caches.push_back(new cBioGenCache(a_BioGenToCache, a_CacheSize));
}
}
diff --git a/src/Generating/BioGen.h b/src/Generating/BioGen.h
index cfa748ec7..47383633f 100644
--- a/src/Generating/BioGen.h
+++ b/src/Generating/BioGen.h
@@ -87,12 +87,16 @@ class cBioGenMulticache :
typedef cBiomeGen super;
public:
+ /*
+ a_CacheSize defines the size of each singular cache
+ a_CachesLength defines how many caches are used for the multicache
+ */
cBioGenMulticache(cBiomeGen * a_BioGenToCache, size_t a_CacheSize, size_t a_CachesLength); // Doesn't take ownership of a_BioGenToCache
~cBioGenMulticache();
protected:
- size_t m_CachesLength;
- size_t m_InternalCacheLength;
+ size_t m_CachesLength;
+ size_t m_InternalCacheLength; // used internally only
std::vector<cBiomeGen*> m_Caches;
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp
index 0535e89f3..d70438bf3 100644
--- a/src/Generating/ComposableGenerator.cpp
+++ b/src/Generating/ComposableGenerator.cpp
@@ -243,11 +243,13 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
}
LOGD("Using a cache for biomegen of size %d.", CacheSize);
m_UnderlyingBiomeGen = m_BiomeGen;
- if (MultiCacheLength > 0) {
+ if (MultiCacheLength > 0)
+ {
LOGD("Enabling multicache for biomegen of length %d.", MultiCacheLength);
m_BiomeGen = new cBioGenMulticache(m_UnderlyingBiomeGen, CacheSize, MultiCacheLength);
}
- else {
+ else
+ {
m_BiomeGen = new cBioGenCache(m_UnderlyingBiomeGen, CacheSize);
}