From 05f52192c9389f0c28cc6d772f3625c9588273a1 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 25 Apr 2014 21:22:43 +0100 Subject: Implemented comments --- src/Chunk.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 97a8ba88b..652f56905 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -241,21 +241,21 @@ void cChunk::GetAllData(cChunkDataCallback & a_Callback) a_Callback.HeightMap (&m_HeightMap); a_Callback.BiomeData (&m_BiomeMap); - std::vector Blocks = m_BlockTypes; + COMPRESSED_BLOCKTYPE Blocks = m_BlockTypes; Blocks.resize(NumBlocks); a_Callback.BlockTypes (&Blocks[0]); - std::vector Metas = m_BlockMeta; + COMPRESSED_NIBBLETYPE Metas = m_BlockMeta; Metas.resize(NumBlocks / 2); a_Callback.BlockMeta (&Metas[0]); a_Callback.LightIsValid (m_IsLightValid); - std::vector BlockLights = m_BlockLight; + COMPRESSED_NIBBLETYPE BlockLights = m_BlockLight; BlockLights.resize(NumBlocks / 2); a_Callback.BlockLight (&BlockLights[0]); - std::vector BlockSkyLights = m_BlockSkyLight; + COMPRESSED_NIBBLETYPE BlockSkyLights = m_BlockSkyLight; BlockSkyLights.resize(NumBlocks / 2, 0xff); a_Callback.BlockSkyLight(&BlockSkyLights[0]); @@ -1579,7 +1579,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT MarkDirty(); - if (m_BlockTypes.empty() || ((size_t)index >= m_BlockTypes.size())) + if ((size_t)index >= m_BlockTypes.size()) { m_BlockTypes.resize(index + 1); } @@ -2524,7 +2524,7 @@ BLOCKTYPE cChunk::GetBlock(int a_BlockIdx) const return 0; } - if (m_BlockTypes.empty() || ((size_t)a_BlockIdx >= m_BlockTypes.size())) + if ((size_t)a_BlockIdx >= m_BlockTypes.size()) { return E_BLOCK_AIR; } -- cgit v1.2.3