summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/QtChunk.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/QtChunk.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/QtChunk.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/Tools/QtBiomeVisualiser/QtChunk.cpp b/Tools/QtBiomeVisualiser/QtChunk.cpp
index 80109b2f8..f201ef220 100644
--- a/Tools/QtBiomeVisualiser/QtChunk.cpp
+++ b/Tools/QtBiomeVisualiser/QtChunk.cpp
@@ -14,20 +14,26 @@ Chunk::Chunk() :
-const uchar * Chunk::getImage(void) const
+void Chunk::setBiomes(const cChunkDef::BiomeMap & a_Biomes)
{
- ASSERT(m_IsValid);
- return m_Image;
+ for (size_t idx = 0; idx < ARRAYCOUNT(a_Biomes); ++idx)
+ {
+ m_Biomes[idx] = static_cast<short>(a_Biomes[idx]);
+ }
+ m_IsValid = true;
}
-void Chunk::setImage(const Image & a_Image)
+EMCSBiome Chunk::getBiome(int a_RelX, int a_RelZ)
{
- memcpy(m_Image, a_Image, sizeof(a_Image));
- m_IsValid = true;
+ if (!m_IsValid)
+ {
+ return biInvalidBiome;
+ }
+ return static_cast<EMCSBiome>(m_Biomes[a_RelX + 16 * a_RelZ]);
}