summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/ChunkCache.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-09-15 17:29:34 +0200
committerMattes D <github@xoft.cz>2014-09-15 17:29:34 +0200
commit21b70f17c264de4f7c216cfca580e8254df5cbee (patch)
treeab513d7146904bfdfa88943c787548311997cfdd /Tools/QtBiomeVisualiser/ChunkCache.cpp
parentQtBiomeVisualiser: removed multithreading. (diff)
downloadcuberite-21b70f17c264de4f7c216cfca580e8254df5cbee.tar
cuberite-21b70f17c264de4f7c216cfca580e8254df5cbee.tar.gz
cuberite-21b70f17c264de4f7c216cfca580e8254df5cbee.tar.bz2
cuberite-21b70f17c264de4f7c216cfca580e8254df5cbee.tar.lz
cuberite-21b70f17c264de4f7c216cfca580e8254df5cbee.tar.xz
cuberite-21b70f17c264de4f7c216cfca580e8254df5cbee.tar.zst
cuberite-21b70f17c264de4f7c216cfca580e8254df5cbee.zip
Diffstat (limited to 'Tools/QtBiomeVisualiser/ChunkCache.cpp')
-rw-r--r--Tools/QtBiomeVisualiser/ChunkCache.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/ChunkCache.cpp b/Tools/QtBiomeVisualiser/ChunkCache.cpp
index b2230def0..05c267d30 100644
--- a/Tools/QtBiomeVisualiser/ChunkCache.cpp
+++ b/Tools/QtBiomeVisualiser/ChunkCache.cpp
@@ -76,6 +76,22 @@ void ChunkCache::setChunkSource(std::shared_ptr<ChunkSource> a_ChunkSource)
+void ChunkCache::reload()
+{
+ assert(m_ChunkSource.get() != nullptr);
+
+ // Reload the chunk source:
+ m_ChunkSource->reload();
+
+ // Clear the cache:
+ QMutexLocker lock(&m_Mtx);
+ m_Cache.clear();
+}
+
+
+
+
+
void ChunkCache::gotChunk(int a_ChunkX, int a_ChunkZ)
{
emit chunkAvailable(a_ChunkX, a_ChunkZ);