summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/QtChunk.cpp
blob: f201ef220da53b971eac2b8cf0e4ca8cdb2711ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "Globals.h"
#include "QtChunk.h"





Chunk::Chunk() :
	m_IsValid(false)
{
}





void Chunk::setBiomes(const cChunkDef::BiomeMap & a_Biomes)
{
	for (size_t idx = 0; idx < ARRAYCOUNT(a_Biomes); ++idx)
	{
		m_Biomes[idx] = static_cast<short>(a_Biomes[idx]);
	}
	m_IsValid = true;
}





EMCSBiome Chunk::getBiome(int a_RelX, int a_RelZ)
{
	if (!m_IsValid)
	{
		return biInvalidBiome;
	}
	return static_cast<EMCSBiome>(m_Biomes[a_RelX + 16 * a_RelZ]);
}