From e88cdf8da714473624b221aca5a6feed2154a885 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 5 May 2013 19:56:45 +0000 Subject: Re-worked generator subobject ownership, added a cache for the CompositionGen git-svn-id: http://mc-server.googlecode.com/svn/trunk@1447 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/ChunkDesc.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'source/Generating/ChunkDesc.h') diff --git a/source/Generating/ChunkDesc.h b/source/Generating/ChunkDesc.h index bc952fbe4..41b85a814 100644 --- a/source/Generating/ChunkDesc.h +++ b/source/Generating/ChunkDesc.h @@ -30,6 +30,9 @@ class cChunkDesc public: // tolua_end + /// Uncompressed block metas, 1 meta per byte + typedef NIBBLETYPE BlockNibbleBytes[cChunkDef::NumBlocks]; + cChunkDesc(int a_ChunkX, int a_ChunkZ); ~cChunkDesc(); @@ -172,13 +175,14 @@ public: void AddBlockEntity(cBlockEntity * a_BlockEntity); // Accessors used by cChunkGenerator::Generator descendants: - inline cChunkDef::BiomeMap & GetBiomeMap (void) { return m_BiomeMap; } - inline cChunkDef::BlockTypes & GetBlockTypes (void) { return *((cChunkDef::BlockTypes *)m_BlockArea.GetBlockTypes()); } + inline cChunkDef::BiomeMap & GetBiomeMap (void) { return m_BiomeMap; } + inline cChunkDef::BlockTypes & GetBlockTypes (void) { return *((cChunkDef::BlockTypes *)m_BlockArea.GetBlockTypes()); } // CANNOT, different compression! - // inline cChunkDef::BlockNibbles & GetBlockMetas (void) { return *((cChunkDef::BlockNibbles *)m_BlockArea.GetBlockMetas()); } - inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; } - inline cEntityList & GetEntities (void) { return m_Entities; } - inline cBlockEntityList & GetBlockEntities(void) { return m_BlockEntities; } + // inline cChunkDef::BlockNibbles & GetBlockMetas (void) { return *((cChunkDef::BlockNibbles *)m_BlockArea.GetBlockMetas()); } + inline BlockNibbleBytes & GetBlockMetasUncompressed(void) { return *((BlockNibbleBytes *)m_BlockArea.GetBlockMetas()); } + inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; } + inline cEntityList & GetEntities (void) { return m_Entities; } + inline cBlockEntityList & GetBlockEntities (void) { return m_BlockEntities; } /// Compresses the metas from the BlockArea format (1 meta per byte) into regular format (2 metas per byte) void CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas); -- cgit v1.2.3