summaryrefslogtreecommitdiffstats
path: root/src/Generating/ComposableGenerator.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-09-04 14:09:54 +0200
committerMattes D <github@xoft.cz>2014-09-04 14:09:54 +0200
commitb590eed42fe5a19acd3314610dc6e7fec3160ada (patch)
tree813d732ba13ae93b796b720a38a693ac790665f4 /src/Generating/ComposableGenerator.cpp
parentAnvil: Cleanly refuse to store data that is too large. (diff)
parentchange to linear calculation (diff)
downloadcuberite-b590eed42fe5a19acd3314610dc6e7fec3160ada.tar
cuberite-b590eed42fe5a19acd3314610dc6e7fec3160ada.tar.gz
cuberite-b590eed42fe5a19acd3314610dc6e7fec3160ada.tar.bz2
cuberite-b590eed42fe5a19acd3314610dc6e7fec3160ada.tar.lz
cuberite-b590eed42fe5a19acd3314610dc6e7fec3160ada.tar.xz
cuberite-b590eed42fe5a19acd3314610dc6e7fec3160ada.tar.zst
cuberite-b590eed42fe5a19acd3314610dc6e7fec3160ada.zip
Diffstat (limited to 'src/Generating/ComposableGenerator.cpp')
-rw-r--r--src/Generating/ComposableGenerator.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp
index 6f4007d24..d70438bf3 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,16 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
}
LOGD("Using a cache for biomegen of size %d.", CacheSize);
m_UnderlyingBiomeGen = m_BiomeGen;
- m_BiomeGen = new cBioGenCache(m_UnderlyingBiomeGen, CacheSize);
+ 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);
+ }
+
}
}