diff options
author | Mattes D <github@xoft.cz> | 2014-09-05 22:08:00 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-05 22:08:00 +0200 |
commit | e15b8600a6dcc16fcfb406ee18eb6568d0de7994 (patch) | |
tree | 2dbbf590c8bb15a97c43fcc7fea6388d70dede9e /src/Generating | |
parent | Fixed style. (diff) | |
download | cuberite-e15b8600a6dcc16fcfb406ee18eb6568d0de7994.tar cuberite-e15b8600a6dcc16fcfb406ee18eb6568d0de7994.tar.gz cuberite-e15b8600a6dcc16fcfb406ee18eb6568d0de7994.tar.bz2 cuberite-e15b8600a6dcc16fcfb406ee18eb6568d0de7994.tar.lz cuberite-e15b8600a6dcc16fcfb406ee18eb6568d0de7994.tar.xz cuberite-e15b8600a6dcc16fcfb406ee18eb6568d0de7994.tar.zst cuberite-e15b8600a6dcc16fcfb406ee18eb6568d0de7994.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/ComposableGenerator.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp index d98153e22..69068d231 100644 --- a/src/Generating/ComposableGenerator.cpp +++ b/src/Generating/ComposableGenerator.cpp @@ -230,29 +230,30 @@ 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 <= 0) { - if (CacheSize < 4) - { - LOGWARNING("Biomegen cache size set too low, would hurt performance instead of helping. Increasing from %d to %d", - CacheSize, 4 - ); - CacheSize = 4; - } - LOGD("Using a cache for biomegen of size %d.", CacheSize); - m_UnderlyingBiomeGen = m_BiomeGen; - 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); - } - + return; + } + + int MultiCacheLength = a_IniFile.GetValueSetI("Generator", "BiomeGenMultiCacheLength", 4); + if (CacheSize < 4) + { + LOGWARNING("Biomegen cache size set too low, would hurt performance instead of helping. Increasing from %d to %d", + CacheSize, 4 + ); + CacheSize = 4; + } + LOGD("Using a cache for biomegen of size %d.", CacheSize); + m_UnderlyingBiomeGen = m_BiomeGen; + 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); } } |