summaryrefslogtreecommitdiffstats
path: root/source/cChunk.h
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-03 21:55:16 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-03 21:55:16 +0100
commitad89cf88ba997651257412594cdd88e84a525a19 (patch)
tree7706bc9b0b9ae25cbb4b2b097e3c27bed5ba2e30 /source/cChunk.h
parentThat should not have been committed... (diff)
downloadcuberite-ad89cf88ba997651257412594cdd88e84a525a19.tar
cuberite-ad89cf88ba997651257412594cdd88e84a525a19.tar.gz
cuberite-ad89cf88ba997651257412594cdd88e84a525a19.tar.bz2
cuberite-ad89cf88ba997651257412594cdd88e84a525a19.tar.lz
cuberite-ad89cf88ba997651257412594cdd88e84a525a19.tar.xz
cuberite-ad89cf88ba997651257412594cdd88e84a525a19.tar.zst
cuberite-ad89cf88ba997651257412594cdd88e84a525a19.zip
Diffstat (limited to 'source/cChunk.h')
-rw-r--r--source/cChunk.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/cChunk.h b/source/cChunk.h
index 7e1a8493d..cbf3b3b85 100644
--- a/source/cChunk.h
+++ b/source/cChunk.h
@@ -112,7 +112,9 @@ typedef std::list< sSetBlock > sSetBlockList;
class cChunk
{
public:
- static const int c_NumBlocks = 16 * 128 * 16;
+ static const int c_ChunkWidth = 16;
+ static const int c_ChunkHeight = 128;
+ static const int c_NumBlocks = c_ChunkWidth * c_ChunkHeight * c_ChunkWidth;
static const int c_BlockDataSize = c_NumBlocks * 2 + (c_NumBlocks/2); // 2.5 * numblocks
cChunk(int a_X, int a_Y, int a_Z, cChunkMap * a_ChunkMap, cWorld * a_World);
@@ -214,9 +216,9 @@ public:
inline static unsigned int MakeIndex(int x, int y, int z )
{
- if( x < 16 && x > -1 && y < 128 && y > -1 && z < 16 && z > -1 )
+ if( x < c_ChunkWidth && x > -1 && y < c_ChunkHeight && y > -1 && z < c_ChunkWidth && z > -1 )
{
- return y + (z * 128) + (x * 128 * 16);
+ return y + (z * c_ChunkHeight) + (x * c_ChunkHeight * c_ChunkWidth);
}
return 0;
}
@@ -261,7 +263,7 @@ private:
char *m_BlockLight; // += NumBlocks/2
char *m_BlockSkyLight; // += NumBlocks/2
- unsigned char m_HeightMap[16 * 16];
+ unsigned char m_HeightMap[c_ChunkWidth * c_ChunkWidth];
unsigned int m_BlockTickNum;
unsigned int m_BlockTickX, m_BlockTickY, m_BlockTickZ;