summaryrefslogtreecommitdiffstats
path: root/source/ChunkDef.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-04-23 23:20:32 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-04-23 23:20:32 +0200
commit9cb88728511c314695731d92cb4ab16c8e3b051e (patch)
tree6503c19dec45a7dc39377de39a1ff625ea321fbf /source/ChunkDef.h
parentLapis gets generated (thanks, Fordship) (diff)
downloadcuberite-9cb88728511c314695731d92cb4ab16c8e3b051e.tar
cuberite-9cb88728511c314695731d92cb4ab16c8e3b051e.tar.gz
cuberite-9cb88728511c314695731d92cb4ab16c8e3b051e.tar.bz2
cuberite-9cb88728511c314695731d92cb4ab16c8e3b051e.tar.lz
cuberite-9cb88728511c314695731d92cb4ab16c8e3b051e.tar.xz
cuberite-9cb88728511c314695731d92cb4ab16c8e3b051e.tar.zst
cuberite-9cb88728511c314695731d92cb4ab16c8e3b051e.zip
Diffstat (limited to '')
-rw-r--r--source/ChunkDef.h49
1 files changed, 48 insertions, 1 deletions
diff --git a/source/ChunkDef.h b/source/ChunkDef.h
index 647f9b51e..837a515b5 100644
--- a/source/ChunkDef.h
+++ b/source/ChunkDef.h
@@ -235,9 +235,12 @@ public:
class cChunkDataCollector :
public cChunkDataCallback
{
-protected:
+public:
+
BLOCKTYPE m_BlockData[cChunkDef::BlockDataSize];
+protected:
+
virtual void BlockTypes(const BLOCKTYPE * a_BlockTypes) override
{
memcpy(m_BlockData, a_BlockTypes, cChunkDef::NumBlocks);
@@ -266,6 +269,50 @@ protected:
+/** A simple implementation of the cChunkDataCallback interface that collects all block data into a separate buffers
+*/
+class cChunkDataSeparateCollector :
+ public cChunkDataCallback
+{
+public:
+
+ BLOCKTYPE m_BlockTypes[cChunkDef::NumBlocks];
+
+ // TODO: These should be NIBBLETYPE:
+ BLOCKTYPE m_BlockMetas[cChunkDef::NumBlocks / 2];
+ BLOCKTYPE m_BlockLight[cChunkDef::NumBlocks / 2];
+ BLOCKTYPE m_BlockSkyLight[cChunkDef::NumBlocks / 2];
+
+protected:
+
+ virtual void BlockTypes(const BLOCKTYPE * a_BlockTypes) override
+ {
+ memcpy(m_BlockTypes, a_BlockTypes, sizeof(m_BlockTypes));
+ }
+
+
+ virtual void BlockMeta(const BLOCKTYPE * a_BlockMeta) override
+ {
+ memcpy(m_BlockMetas, a_BlockMeta, sizeof(m_BlockMetas));
+ }
+
+
+ virtual void BlockLight(const BLOCKTYPE * a_BlockLight) override
+ {
+ memcpy(m_BlockLight, a_BlockLight, sizeof(m_BlockLight));
+ }
+
+
+ virtual void BlockSkyLight(const BLOCKTYPE * a_BlockSkyLight) override
+ {
+ memcpy(m_BlockSkyLight, a_BlockSkyLight, sizeof(m_BlockSkyLight));
+ }
+} ;
+
+
+
+
+
/** Interface class used for comparing clients of two chunks.
Used primarily for entity moving while both chunks are locked.
*/