From 812375fab1517c70f56360719c10c2c61c03180d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 20 Dec 2013 16:15:39 +0100 Subject: Attempt at fixing cChunkDef::Height signedness. --- src/WorldStorage/WSSCompact.cpp | 6 +++--- src/WorldStorage/WSSCompact.h | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/WorldStorage') diff --git a/src/WorldStorage/WSSCompact.cpp b/src/WorldStorage/WSSCompact.cpp index 287938b24..e2556b96e 100644 --- a/src/WorldStorage/WSSCompact.cpp +++ b/src/WorldStorage/WSSCompact.cpp @@ -871,9 +871,9 @@ bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int & a_Uncomp } BLOCKTYPE * BlockData = (BLOCKTYPE *)UncompressedData.data(); - NIBBLETYPE * MetaData = (NIBBLETYPE *)(BlockData + cChunkDef::MetaOffset); - NIBBLETYPE * BlockLight = (NIBBLETYPE *)(BlockData + cChunkDef::LightOffset); - NIBBLETYPE * SkyLight = (NIBBLETYPE *)(BlockData + cChunkDef::SkyLightOffset); + NIBBLETYPE * MetaData = (NIBBLETYPE *)(BlockData + MetaOffset); + NIBBLETYPE * BlockLight = (NIBBLETYPE *)(BlockData + LightOffset); + NIBBLETYPE * SkyLight = (NIBBLETYPE *)(BlockData + SkyLightOffset); a_World->SetChunkData( a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, diff --git a/src/WorldStorage/WSSCompact.h b/src/WorldStorage/WSSCompact.h index a75c41ccb..3223a986e 100644 --- a/src/WorldStorage/WSSCompact.h +++ b/src/WorldStorage/WSSCompact.h @@ -58,6 +58,14 @@ public: protected: + enum + { + // Offsets to individual components in the joined blockdata array + MetaOffset = cChunkDef::NumBlocks, + LightOffset = MetaOffset + cChunkDef::NumBlocks / 2, + SkyLightOffset = LightOffset + cChunkDef::NumBlocks / 2, + } ; + struct sChunkHeader; typedef std::vector sChunkHeaders; -- cgit v1.2.3