summaryrefslogtreecommitdiffstats
path: root/source/cChunk.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-21 17:27:30 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-21 17:27:30 +0100
commitb653e6a01271c05bdbd947ab7120d10d30ecee91 (patch)
tree43d7a6e5ce26b77d1c759a8dc0cc533a13a933e7 /source/cChunk.cpp
parentFixed heightmap optimization from rev 302; removed a few more cChunkPtrs (diff)
downloadcuberite-b653e6a01271c05bdbd947ab7120d10d30ecee91.tar
cuberite-b653e6a01271c05bdbd947ab7120d10d30ecee91.tar.gz
cuberite-b653e6a01271c05bdbd947ab7120d10d30ecee91.tar.bz2
cuberite-b653e6a01271c05bdbd947ab7120d10d30ecee91.tar.lz
cuberite-b653e6a01271c05bdbd947ab7120d10d30ecee91.tar.xz
cuberite-b653e6a01271c05bdbd947ab7120d10d30ecee91.tar.zst
cuberite-b653e6a01271c05bdbd947ab7120d10d30ecee91.zip
Diffstat (limited to 'source/cChunk.cpp')
-rw-r--r--source/cChunk.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index a783e30b4..c8ba8ba4c 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -67,7 +67,7 @@ sSetBlock::sSetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_BlockM
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cChunk:
-cChunk::cChunk(int a_X, int a_Y, int a_Z, cWorld * a_World)
+cChunk::cChunk(int a_X, int a_Y, int a_Z, cChunkMap * a_ChunkMap, cWorld * a_World)
: m_bCalculateLighting( false )
, m_bCalculateHeightmap( false )
, m_PosX( a_X )
@@ -82,6 +82,7 @@ cChunk::cChunk(int a_X, int a_Y, int a_Z, cWorld * a_World)
, m_BlockTickY( 0 )
, m_BlockTickZ( 0 )
, m_World( a_World )
+ , m_ChunkMap(a_ChunkMap)
, m_IsValid(false)
, m_IsDirty(false)
, m_IsSaving(false)
@@ -700,8 +701,8 @@ void cChunk::SpreadLight(char* a_LightBuffer)
bCalcLeft = bCalcRight = bCalcFront = bCalcBack = false;
// Spread to neighbour chunks X-axis
- cChunkPtr LeftChunk = m_World->GetChunkNoGen( m_PosX - 1, m_PosY, m_PosZ );
- cChunkPtr RightChunk = m_World->GetChunkNoGen( m_PosX + 1, m_PosY, m_PosZ );
+ cChunkPtr LeftChunk = m_ChunkMap->GetChunkNoGen( m_PosX - 1, m_PosY, m_PosZ );
+ cChunkPtr RightChunk = m_ChunkMap->GetChunkNoGen( m_PosX + 1, m_PosY, m_PosZ );
char * LeftSky = NULL, *RightSky = NULL;
if (LeftChunk->IsValid())
{
@@ -745,8 +746,8 @@ void cChunk::SpreadLight(char* a_LightBuffer)
}
// Spread to neighbour chunks Z-axis
- cChunkPtr FrontChunk = m_World->GetChunkNoGen( m_PosX, m_PosY, m_PosZ - 1 );
- cChunkPtr BackChunk = m_World->GetChunkNoGen( m_PosX, m_PosY, m_PosZ + 1 );
+ cChunkPtr FrontChunk = m_ChunkMap->GetChunkNoGen( m_PosX, m_PosY, m_PosZ - 1 );
+ cChunkPtr BackChunk = m_ChunkMap->GetChunkNoGen( m_PosX, m_PosY, m_PosZ + 1 );
char * FrontSky = NULL, * BackSky = NULL;
if (FrontChunk->IsValid())
{