From f558f3c6d29931090378f75f7ea0ba84e81fead0 Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Wed, 23 Oct 2013 17:41:24 -0600 Subject: Removed my hackish Light functions --- source/Chunk.cpp | 96 -------------------------------------------------------- 1 file changed, 96 deletions(-) (limited to 'source/Chunk.cpp') diff --git a/source/Chunk.cpp b/source/Chunk.cpp index 32a8b5c0f..2e81bf852 100644 --- a/source/Chunk.cpp +++ b/source/Chunk.cpp @@ -1356,102 +1356,6 @@ void cChunk::UnboundedQueueTickBlock(int a_RelX, int a_RelY, int a_RelZ) -NIBBLETYPE cChunk::UnboundedRelGetSkyLight(int a_RelX, int a_RelY, int a_RelZ) -{ -if ((a_RelY < 0) || (a_RelY > cChunkDef::Height)) - { - LOGWARNING("UnboundedRelGetSkyLight(): requesting a block with a_RelY out of range: %d", a_RelY); - return 127; - } - - // Is it in this chunk? - if ((a_RelX >= 0) && (a_RelX < cChunkDef::Width) && (a_RelZ >= 0) && (a_RelZ < cChunkDef::Width)) - { - if (!IsValid()) - { - return 127; - } - return GetSkyLight(a_RelX, a_RelY, a_RelZ); - } - - // Not in this chunk, try walking the neighbors first: - if ((a_RelX < 0) && (m_NeighborXM != NULL)) - { - return m_NeighborXM->UnboundedRelGetSkyLight(a_RelX + cChunkDef::Width, a_RelY, a_RelZ); - } - if ((a_RelX >= cChunkDef::Width) && (m_NeighborXP != NULL)) - { - return m_NeighborXP->UnboundedRelGetSkyLight(a_RelX - cChunkDef::Width, a_RelY, a_RelZ); - } - if ((a_RelZ < 0) && (m_NeighborZM != NULL)) - { - return m_NeighborZM->UnboundedRelGetSkyLight(a_RelX, a_RelY, a_RelZ + cChunkDef::Width); - } - if ((a_RelZ >= cChunkDef::Width) && (m_NeighborZP != NULL)) - { - return m_NeighborZP->UnboundedRelGetSkyLight(a_RelX, a_RelY, a_RelZ - cChunkDef::Width); - } - - // Neighbors not available, use the chunkmap to locate the chunk: - return m_ChunkMap->GetBlockSkyLight( - m_PosX * cChunkDef::Width + a_RelX, - ZERO_CHUNK_Y * cChunkDef::Height + a_RelY, - m_PosZ * cChunkDef::Width + a_RelZ - ); -} - - - - - -NIBBLETYPE cChunk::UnboundedRelGetBlockLight(int a_RelX, int a_RelY, int a_RelZ) -{ -if ((a_RelY < 0) || (a_RelY > cChunkDef::Height)) - { - LOGWARNING("UnboundedRelGetBlockLight(): requesting a block with a_RelY out of range: %d", a_RelY); - return 127; - } - - // Is it in this chunk? - if ((a_RelX >= 0) && (a_RelX < cChunkDef::Width) && (a_RelZ >= 0) && (a_RelZ < cChunkDef::Width)) - { - if (!IsValid()) - { - return 127; - } - return GetBlockLight(a_RelX, a_RelY, a_RelZ); - } - - // Not in this chunk, try walking the neighbors first: - if ((a_RelX < 0) && (m_NeighborXM != NULL)) - { - return m_NeighborXM->UnboundedRelGetBlockLight(a_RelX + cChunkDef::Width, a_RelY, a_RelZ); - } - if ((a_RelX >= cChunkDef::Width) && (m_NeighborXP != NULL)) - { - return m_NeighborXP->UnboundedRelGetBlockLight(a_RelX - cChunkDef::Width, a_RelY, a_RelZ); - } - if ((a_RelZ < 0) && (m_NeighborZM != NULL)) - { - return m_NeighborZM->UnboundedRelGetBlockLight(a_RelX, a_RelY, a_RelZ + cChunkDef::Width); - } - if ((a_RelZ >= cChunkDef::Width) && (m_NeighborZP != NULL)) - { - return m_NeighborZP->UnboundedRelGetBlockLight(a_RelX, a_RelY, a_RelZ - cChunkDef::Width); - } - - // Neighbors not available, use the chunkmap to locate the chunk: - return m_ChunkMap->GetBlockBlockLight( - m_PosX * cChunkDef::Width + a_RelX, - ZERO_CHUNK_Y * cChunkDef::Height + a_RelY, - m_PosZ * cChunkDef::Width + a_RelZ - ); -} - - - - - int cChunk::GetHeight( int a_X, int a_Z ) { ASSERT((a_X >= 0) && (a_X < Width) && (a_Z >= 0) && (a_Z < Width)); -- cgit v1.2.3