summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorDayBr3ak <benj.groeneveld@gmail.com>2014-09-02 01:13:54 +0200
committerDayBr3ak <benj.groeneveld@gmail.com>2014-09-02 01:19:52 +0200
commitd9afe6dd657363f4a6e42790ba4705a9b9b89e60 (patch)
treeef247bedb0e643c6d19d8f008a88effae8bc62ab /src/Generating
parentadding the multicache behavior (diff)
downloadcuberite-d9afe6dd657363f4a6e42790ba4705a9b9b89e60.tar
cuberite-d9afe6dd657363f4a6e42790ba4705a9b9b89e60.tar.gz
cuberite-d9afe6dd657363f4a6e42790ba4705a9b9b89e60.tar.bz2
cuberite-d9afe6dd657363f4a6e42790ba4705a9b9b89e60.tar.lz
cuberite-d9afe6dd657363f4a6e42790ba4705a9b9b89e60.tar.xz
cuberite-d9afe6dd657363f4a6e42790ba4705a9b9b89e60.tar.zst
cuberite-d9afe6dd657363f4a6e42790ba4705a9b9b89e60.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/ComposableGenerator.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp
index 057d7accf..0535e89f3 100644
--- a/src/Generating/ComposableGenerator.cpp
+++ b/src/Generating/ComposableGenerator.cpp
@@ -230,6 +230,8 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
// Add a cache, if requested:
int CacheSize = a_IniFile.GetValueSetI("Generator", "BiomeGenCacheSize", CacheOffByDefault ? 0 : 64);
+ int MultiCacheLength = a_IniFile.GetValueSetI("Generator", "BiomeGenMultiCacheLength", 4);
+
if (CacheSize > 0)
{
if (CacheSize < 4)
@@ -241,7 +243,14 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
}
LOGD("Using a cache for biomegen of size %d.", CacheSize);
m_UnderlyingBiomeGen = m_BiomeGen;
- m_BiomeGen = new cBioGenMulticache(m_UnderlyingBiomeGen, CacheSize, 4);
+ if (MultiCacheLength > 0) {
+ LOGD("Enabling multicache for biomegen of length %d.", MultiCacheLength);
+ m_BiomeGen = new cBioGenMulticache(m_UnderlyingBiomeGen, CacheSize, MultiCacheLength);
+ }
+ else {
+ m_BiomeGen = new cBioGenCache(m_UnderlyingBiomeGen, CacheSize);
+ }
+
}
}