summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-23 18:18:11 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-23 18:18:11 +0200
commit8be3a8f7dc10dbc49dfcdeca572677ef1e00f714 (patch)
tree204743272c8948237a8322027510f5240bfdb71e /src/ChunkMap.h
parentUse placement new to initalise objects (diff)
downloadcuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.gz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.bz2
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.lz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.xz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.zst
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.zip
Diffstat (limited to 'src/ChunkMap.h')
-rw-r--r--src/ChunkMap.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ChunkMap.h b/src/ChunkMap.h
index c3deda088..1744c09d0 100644
--- a/src/ChunkMap.h
+++ b/src/ChunkMap.h
@@ -347,7 +347,8 @@ private:
class cChunkLayer
{
public:
- cChunkLayer(int a_LayerX, int a_LayerZ, cChunkMap * a_Parent);
+ cChunkLayer(int a_LayerX, int a_LayerZ, cChunkMap * a_Parent,
+ cAllocationPool<cChunkData::sChunkSection,1600>& a_Pool);
~cChunkLayer();
/** Always returns an assigned chunkptr, but the chunk needn't be valid (loaded / generated) - callers must check */
@@ -391,6 +392,16 @@ private:
int m_LayerZ;
cChunkMap * m_Parent;
int m_NumChunksLoaded;
+
+ cAllocationPool<cChunkData::sChunkSection,1600> & m_Pool;
+ };
+
+ class cStarvationCallbacks
+ : public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
+ {
+ virtual void OnStartingUsingBuffer() {}
+ virtual void OnStopUsingBuffer() {}
+ virtual void OnBufferEmpty() {}
};
typedef std::list<cChunkLayer *> cChunkLayerList;
@@ -423,6 +434,8 @@ private:
/** The cChunkStay descendants that are currently enabled in this chunkmap */
cChunkStays m_ChunkStays;
+ cAllocationPool<cChunkData::sChunkSection,1600> m_Pool;
+
cChunkPtr GetChunk (int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Also queues the chunk for loading / generating if not valid
cChunkPtr GetChunkNoGen (int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Also queues the chunk for loading if not valid; doesn't generate
cChunkPtr GetChunkNoLoad(int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Doesn't load, doesn't generate