summaryrefslogtreecommitdiffstats
path: root/src/ChunkData.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-28 22:40:19 +0200
committermadmaxoft <github@xoft.cz>2014-05-28 22:40:19 +0200
commit81f756cbda76507cc676fd50f20f33483c4ce6f8 (patch)
tree90dae000306f1c9eefa124fb298ae67755468451 /src/ChunkData.h
parentFixed cChunkData formatting. (diff)
downloadcuberite-81f756cbda76507cc676fd50f20f33483c4ce6f8.tar
cuberite-81f756cbda76507cc676fd50f20f33483c4ce6f8.tar.gz
cuberite-81f756cbda76507cc676fd50f20f33483c4ce6f8.tar.bz2
cuberite-81f756cbda76507cc676fd50f20f33483c4ce6f8.tar.lz
cuberite-81f756cbda76507cc676fd50f20f33483c4ce6f8.tar.xz
cuberite-81f756cbda76507cc676fd50f20f33483c4ce6f8.tar.zst
cuberite-81f756cbda76507cc676fd50f20f33483c4ce6f8.zip
Diffstat (limited to 'src/ChunkData.h')
-rw-r--r--src/ChunkData.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/ChunkData.h b/src/ChunkData.h
index 6544b246e..09b2cb563 100644
--- a/src/ChunkData.h
+++ b/src/ChunkData.h
@@ -25,12 +25,12 @@ public:
#if __cplusplus < 201103L
// auto_ptr style interface for memory management
- cChunkData(const cChunkData & other);
- cChunkData & operator =(const cChunkData & other);
+ cChunkData(const cChunkData & a_Other);
+ cChunkData & operator =(const cChunkData & a_Other);
#else
// unique_ptr style interface for memory management
- cChunkData(cChunkData && other);
- cChunkData & operator =(cChunkData && other);
+ cChunkData(cChunkData && a_Other);
+ cChunkData & operator =(cChunkData && a_ther);
#endif
BLOCKTYPE GetBlock(int a_X, int a_Y, int a_Z) const;
@@ -44,10 +44,10 @@ public:
NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const;
cChunkData Copy(void) const;
- void CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx = 0, size_t length = cChunkDef::NumBlocks) const;
- void CopyMeta (NIBBLETYPE * a_dest) const;
- void CopyBlockLight(NIBBLETYPE * a_dest) const;
- void CopySkyLight (NIBBLETYPE * a_dest) const;
+ void CopyBlocks (BLOCKTYPE * a_Dest, size_t a_Idx = 0, size_t a_Length = cChunkDef::NumBlocks) const;
+ void CopyMeta (NIBBLETYPE * a_Dest) const;
+ void CopyBlockLight(NIBBLETYPE * a_Dest) const;
+ void CopySkyLight (NIBBLETYPE * a_Dest) const;
void SetBlocks (const BLOCKTYPE * a_src);
void SetMeta (const NIBBLETYPE * a_src);
@@ -73,10 +73,15 @@ private:
sChunkSection * m_Sections[CHUNK_SECTION_COUNT];
- sChunkSection * Allocate(void) const;
- void Free(sChunkSection * ptr) const;
+ /** Allocates a new section. Entry-point to custom allocators. */
+ static sChunkSection * Allocate(void);
- void ZeroSection(sChunkSection * ptr) const;
+ /** Frees the specified section, previously allocated using Allocate().
+ Note that a_Section may be NULL. */
+ static void Free(sChunkSection * a_Section);
+
+ /** Sets the data in the specified section to their default values. */
+ void ZeroSection(sChunkSection * a_Section) const;
};