diff options
author | Mattes D <github@xoft.cz> | 2014-10-28 22:07:09 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-28 22:07:09 +0100 |
commit | 2f0abb73c94eb896c956ceb0375d2e72065d95d5 (patch) | |
tree | 2cf8a72a9aaf59fa218f5978045412a47662d52b /Tools/QtBiomeVisualiser/RegionLoader.cpp | |
parent | Forgotten m_SendChunksMediumPriority.empty() check. (diff) | |
parent | QtBiomeVisualiser: Reduced memory usage. (diff) | |
download | cuberite-2f0abb73c94eb896c956ceb0375d2e72065d95d5.tar cuberite-2f0abb73c94eb896c956ceb0375d2e72065d95d5.tar.gz cuberite-2f0abb73c94eb896c956ceb0375d2e72065d95d5.tar.bz2 cuberite-2f0abb73c94eb896c956ceb0375d2e72065d95d5.tar.lz cuberite-2f0abb73c94eb896c956ceb0375d2e72065d95d5.tar.xz cuberite-2f0abb73c94eb896c956ceb0375d2e72065d95d5.tar.zst cuberite-2f0abb73c94eb896c956ceb0375d2e72065d95d5.zip |
Diffstat (limited to 'Tools/QtBiomeVisualiser/RegionLoader.cpp')
-rw-r--r-- | Tools/QtBiomeVisualiser/RegionLoader.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/RegionLoader.cpp b/Tools/QtBiomeVisualiser/RegionLoader.cpp new file mode 100644 index 000000000..771c1bbac --- /dev/null +++ b/Tools/QtBiomeVisualiser/RegionLoader.cpp @@ -0,0 +1,39 @@ +#include "Globals.h" +#include "RegionLoader.h" +#include "ChunkSource.h" +#include "Region.h" + + + + + +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)); + } + } + m_Region->m_IsValid = true; + + emit loaded(m_RegionX, m_RegionZ); +} + + + + |