summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/RegionLoader.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-11-18 14:56:32 +0100
committerHowaner <franzi.moos@googlemail.com>2014-11-18 14:56:32 +0100
commit42120e2ea5db0cdb9920ff1c5efef33e0f496d48 (patch)
tree20ba1ae0a53f757cb8814b6cd6a466fe5acf1308 /Tools/QtBiomeVisualiser/RegionLoader.cpp
parentFixed compile errors. (diff)
parentMerge pull request #1598 from mc-server/SignEditor (diff)
downloadcuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.gz
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.bz2
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.lz
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.xz
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.zst
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.zip
Diffstat (limited to '')
-rw-r--r--Tools/QtBiomeVisualiser/RegionLoader.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/RegionLoader.cpp b/Tools/QtBiomeVisualiser/RegionLoader.cpp
new file mode 100644
index 000000000..2a318098b
--- /dev/null
+++ b/Tools/QtBiomeVisualiser/RegionLoader.cpp
@@ -0,0 +1,49 @@
+#include "Globals.h"
+#include "RegionLoader.h"
+#include "ChunkSource.h"
+#include "Region.h"
+
+
+
+
+
+volatile bool RegionLoader::m_IsShuttingDown = false;
+
+
+
+
+
+RegionLoader::RegionLoader(int a_RegionX, int a_RegionZ, RegionPtr a_Region, ChunkSourcePtr a_ChunkSource) :
+ m_RegionX(a_RegionX),
+ m_RegionZ(a_RegionZ),
+ m_Region(a_Region),
+ m_ChunkSource(a_ChunkSource)
+{
+}
+
+
+
+
+
+void RegionLoader::run()
+{
+ // Load all the chunks in this region:
+ for (int z = 0; z < 32; z++)
+ {
+ for (int x = 0; x < 32; x++)
+ {
+ m_ChunkSource->getChunkBiomes(m_RegionX * 32 + x, m_RegionZ * 32 + z, m_Region->getRelChunk(x, z));
+ if (m_IsShuttingDown)
+ {
+ return;
+ }
+ }
+ }
+ m_Region->m_IsValid = true;
+
+ emit loaded(m_RegionX, m_RegionZ);
+}
+
+
+
+