Fix terrain chunk meshes constantly being removed from the cache because the default time smear is the exact same as the timeout

This commit is contained in:
Kae 2023-07-04 05:09:48 +10:00
parent 3a353ece5f
commit ced1ba32bb

View File

@ -17,7 +17,11 @@ TilePainter::TilePainter(RendererPtr renderer) {
auto assets = root.assets(); auto assets = root.assets();
m_terrainChunkCache.setTimeToLive(assets->json("/rendering.config:chunkCacheTimeout").toInt()); m_terrainChunkCache.setTimeToLive(assets->json("/rendering.config:chunkCacheTimeout").toInt());
m_terrainChunkCache.setTimeSmear(m_terrainChunkCache.timeToLive() / 4);
m_liquidChunkCache.setTimeToLive(assets->json("/rendering.config:chunkCacheTimeout").toInt()); m_liquidChunkCache.setTimeToLive(assets->json("/rendering.config:chunkCacheTimeout").toInt());
m_liquidChunkCache.setTimeSmear(m_liquidChunkCache.timeToLive() / 4);
m_textureCache.setTimeToLive(assets->json("/rendering.config:textureTimeout").toInt()); m_textureCache.setTimeToLive(assets->json("/rendering.config:textureTimeout").toInt());
m_backgroundLayerColor = jsonToColor(assets->json("/rendering.config:backgroundLayerColor")).toRgba(); m_backgroundLayerColor = jsonToColor(assets->json("/rendering.config:backgroundLayerColor")).toRgba();