From b974b1ea59efac4a14a929b917df152d06487201 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 14 Mar 2012 21:21:03 +0000 Subject: Unified the chunk data to use the BLOCKDATA datatype. git-svn-id: http://mc-server.googlecode.com/svn/trunk@413 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/cChunk.cpp') diff --git a/source/cChunk.cpp b/source/cChunk.cpp index dad101204..2dde0cc0d 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -735,7 +735,7 @@ void cChunk::CalculateLighting() -void cChunk::SpreadLight(char* a_LightBuffer) +void cChunk::SpreadLight(BLOCKTYPE * a_LightBuffer) { // Spread the light for(int x = 0; x < Width; x++) for(int z = 0; z < Width; z++) for(int y = 0; y < Height; y++) @@ -762,7 +762,7 @@ void cChunk::SpreadLight(char* a_LightBuffer) // Spread to neighbour chunks X-axis 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; + BLOCKTYPE * LeftSky = NULL, *RightSky = NULL; if (LeftChunk->IsValid()) { LeftSky = (a_LightBuffer == m_BlockSkyLight) ? LeftChunk->m_BlockSkyLight : LeftChunk->m_BlockLight; @@ -779,8 +779,8 @@ void cChunk::SpreadLight(char* a_LightBuffer) int index = MakeIndexNoCheck( 0, y, z ); if( g_BlockSpreadLightFalloff[ m_BlockTypes[index] ] > 0 ) { - char CurrentLight = GetNibble( a_LightBuffer, 0, y, z ); - char LeftLight = GetNibble( LeftSky, Width-1, y, z ); + BLOCKTYPE CurrentLight = GetNibble( a_LightBuffer, 0, y, z ); + BLOCKTYPE LeftLight = GetNibble( LeftSky, Width-1, y, z ); if( LeftLight < CurrentLight-g_BlockSpreadLightFalloff[ m_BlockTypes[index] ] ) { SetNibble( LeftSky, Width - 1, y, z, MAX(0, CurrentLight-g_BlockSpreadLightFalloff[ m_BlockTypes[index] ]) ); @@ -793,8 +793,8 @@ void cChunk::SpreadLight(char* a_LightBuffer) int index = MakeIndexNoCheck( Width - 1, y, z ); if( g_BlockSpreadLightFalloff[ m_BlockTypes[index] ] > 0 ) { - char CurrentLight = GetNibble( a_LightBuffer, Width-1, y, z ); - char RightLight = GetNibble( RightSky, 0, y, z ); + BLOCKTYPE CurrentLight = GetNibble( a_LightBuffer, Width-1, y, z ); + BLOCKTYPE RightLight = GetNibble( RightSky, 0, y, z ); if( RightLight < CurrentLight-g_BlockSpreadLightFalloff[ m_BlockTypes[index] ] ) { SetNibble( RightSky, 0, y, z, MAX(0, CurrentLight-g_BlockSpreadLightFalloff[ m_BlockTypes[index] ]) ); @@ -807,7 +807,7 @@ void cChunk::SpreadLight(char* a_LightBuffer) // Spread to neighbour chunks Z-axis 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; + BLOCKTYPE * FrontSky = NULL, * BackSky = NULL; if (FrontChunk->IsValid()) { FrontSky = (a_LightBuffer == m_BlockSkyLight) ? FrontChunk->m_BlockSkyLight : FrontChunk->m_BlockLight; -- cgit v1.2.3