diff options
author | Mattes D <github@xoft.cz> | 2014-04-26 15:12:10 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-04-26 15:12:10 +0200 |
commit | 1139b117c42d7cf9646599a74fac38536f67c616 (patch) | |
tree | c86aa4f3f4354ce54080c4bc5f4e358913d9c8a1 /src/Chunk.h | |
parent | Merge pull request #936 from archshift/patch-1 (diff) | |
parent | Implemented comments (diff) | |
download | cuberite-1139b117c42d7cf9646599a74fac38536f67c616.tar cuberite-1139b117c42d7cf9646599a74fac38536f67c616.tar.gz cuberite-1139b117c42d7cf9646599a74fac38536f67c616.tar.bz2 cuberite-1139b117c42d7cf9646599a74fac38536f67c616.tar.lz cuberite-1139b117c42d7cf9646599a74fac38536f67c616.tar.xz cuberite-1139b117c42d7cf9646599a74fac38536f67c616.tar.zst cuberite-1139b117c42d7cf9646599a74fac38536f67c616.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Chunk.h b/src/Chunk.h index f20134e66..a15d43e00 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -267,7 +267,7 @@ public: void UseBlockEntity(cPlayer * a_Player, int a_X, int a_Y, int a_Z); // [x, y, z] in world block coords void CalculateLighting(); // Recalculate right now - void CalculateHeightmap(); + void CalculateHeightmap(const BLOCKTYPE * a_BlockTypes); // Broadcast various packets to all clients of this chunk: // (Please keep these alpha-sorted) @@ -326,9 +326,9 @@ public: inline void SetMeta(int a_BlockIdx, NIBBLETYPE a_Meta) { cChunkDef::SetNibble(m_BlockMeta, a_BlockIdx, a_Meta); } inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockLight, a_RelX, a_RelY, a_RelZ); } - inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockSkyLight, a_RelX, a_RelY, a_RelZ); } + inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockSkyLight, a_RelX, a_RelY, a_RelZ, true); } inline NIBBLETYPE GetBlockLight(int a_Idx) const {return cChunkDef::GetNibble(m_BlockLight, a_Idx); } - inline NIBBLETYPE GetSkyLight (int a_Idx) const {return cChunkDef::GetNibble(m_BlockSkyLight, a_Idx); } + inline NIBBLETYPE GetSkyLight (int a_Idx) const {return cChunkDef::GetNibble(m_BlockSkyLight, a_Idx, true); } /** Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success */ bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const; @@ -421,10 +421,10 @@ private: cChunkMap * m_ChunkMap; // TODO: Make these pointers and don't allocate what isn't needed - BLOCKTYPE m_BlockTypes [cChunkDef::NumBlocks]; - NIBBLETYPE m_BlockMeta [cChunkDef::NumBlocks / 2]; - NIBBLETYPE m_BlockLight [cChunkDef::NumBlocks / 2]; - NIBBLETYPE m_BlockSkyLight[cChunkDef::NumBlocks / 2]; + COMPRESSED_BLOCKTYPE m_BlockTypes; + COMPRESSED_NIBBLETYPE m_BlockMeta; + COMPRESSED_NIBBLETYPE m_BlockLight; + COMPRESSED_NIBBLETYPE m_BlockSkyLight; cChunkDef::HeightMap m_HeightMap; cChunkDef::BiomeMap m_BiomeMap; |