diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-19 09:32:02 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-19 09:32:02 +0100 |
commit | b4697ab9dbece2afc8d4edbd86678fa8735578b9 (patch) | |
tree | c39af3d9dbb0f6323fb05820d2d29ff0ed3b18ea /source/Generating/ChunkDesc.h | |
parent | Trees: fixed a glitch in large jungle trees' leaves (1 column was missing) (diff) | |
download | cuberite-b4697ab9dbece2afc8d4edbd86678fa8735578b9.tar cuberite-b4697ab9dbece2afc8d4edbd86678fa8735578b9.tar.gz cuberite-b4697ab9dbece2afc8d4edbd86678fa8735578b9.tar.bz2 cuberite-b4697ab9dbece2afc8d4edbd86678fa8735578b9.tar.lz cuberite-b4697ab9dbece2afc8d4edbd86678fa8735578b9.tar.xz cuberite-b4697ab9dbece2afc8d4edbd86678fa8735578b9.tar.zst cuberite-b4697ab9dbece2afc8d4edbd86678fa8735578b9.zip |
Diffstat (limited to 'source/Generating/ChunkDesc.h')
-rw-r--r-- | source/Generating/ChunkDesc.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/Generating/ChunkDesc.h b/source/Generating/ChunkDesc.h index 7df7a1d35..226d22429 100644 --- a/source/Generating/ChunkDesc.h +++ b/source/Generating/ChunkDesc.h @@ -10,6 +10,7 @@ #pragma once #include "../ChunkDef.h" +#include "../BlockArea.h" @@ -67,7 +68,7 @@ public: bool IsUsingDefaultFinish(void) const; /// Writes the block area into the chunk, with its origin set at the specified relative coords. Area's data overwrite everything in the chunk. - void WriteBlockArea(const cBlockArea & a_BlockArea, int a_RelX, int a_RelY, int a_RelZ); + void WriteBlockArea(const cBlockArea & a_BlockArea, int a_RelX, int a_RelY, int a_RelZ, cBlockArea::eMergeStrategy a_MergeStrategy = cBlockArea::msOverwrite); /// Reads an area from the chunk into a cBlockArea void ReadBlockArea(cBlockArea & a_Dest, int a_MinRelX, int a_MaxRelX, int a_MinRelY, int a_MaxRelY, int a_MinRelZ, int a_MaxRelZ); @@ -80,24 +81,26 @@ public: // Accessors used by cChunkGenerator::Generator descendants: inline cChunkDef::BiomeMap & GetBiomeMap (void) { return m_BiomeMap; } - inline cChunkDef::BlockTypes & GetBlockTypes (void) { return m_BlockTypes; } - inline cChunkDef::BlockNibbles & GetBlockMetas (void) { return m_BlockMeta; } + 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; } + /// Compresses the metas from the BlockArea format (1 meta per byte) into regular format (2 metas per byte) + void CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas); + private: int m_ChunkX; int m_ChunkZ; cChunkDef::BiomeMap m_BiomeMap; - cChunkDef::BlockTypes m_BlockTypes; - cChunkDef::BlockNibbles m_BlockMeta; + cBlockArea m_BlockArea; cChunkDef::HeightMap m_HeightMap; cEntityList m_Entities; // Individual entities are NOT owned by this object! cBlockEntityList m_BlockEntities; // Individual block entities are NOT owned by this object! - bool m_bUseDefaultBiomes; bool m_bUseDefaultHeight; bool m_bUseDefaultComposition; |