fixed spaces
This commit is contained in:
parent
a2df68b80b
commit
0310a50192
@ -19,7 +19,7 @@ class cAllocationPool {
|
|||||||
cAllocationPool(std::auto_ptr<cStarvationCallbacks> a_Callbacks) :
|
cAllocationPool(std::auto_ptr<cStarvationCallbacks> a_Callbacks) :
|
||||||
m_Callbacks(a_Callbacks)
|
m_Callbacks(a_Callbacks)
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < NumElementsInReserve; i++)
|
for (size_t i = 0; i < NumElementsInReserve; i++)
|
||||||
{
|
{
|
||||||
void * space = malloc(sizeof(T));
|
void * space = malloc(sizeof(T));
|
||||||
if (space == NULL)
|
if (space == NULL)
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
cChunkMap::cChunkMap(cWorld * a_World )
|
cChunkMap::cChunkMap(cWorld * a_World )
|
||||||
: m_World( a_World ),
|
: m_World( a_World ),
|
||||||
m_Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()))
|
m_Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks>(new cStarvationCallbacks()))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ private:
|
|||||||
{
|
{
|
||||||
public:
|
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);
|
cAllocationPool<cChunkData::sChunkSection, 1600>& a_Pool);
|
||||||
~cChunkLayer();
|
~cChunkLayer();
|
||||||
|
|
||||||
/** Always returns an assigned chunkptr, but the chunk needn't be valid (loaded / generated) - callers must check */
|
/** Always returns an assigned chunkptr, but the chunk needn't be valid (loaded / generated) - callers must check */
|
||||||
@ -397,11 +397,11 @@ private:
|
|||||||
cChunkMap * m_Parent;
|
cChunkMap * m_Parent;
|
||||||
int m_NumChunksLoaded;
|
int m_NumChunksLoaded;
|
||||||
|
|
||||||
cAllocationPool<cChunkData::sChunkSection,1600> & m_Pool;
|
cAllocationPool<cChunkData::sChunkSection, 1600> & m_Pool;
|
||||||
};
|
};
|
||||||
|
|
||||||
class cStarvationCallbacks
|
class cStarvationCallbacks
|
||||||
: public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
|
: public cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks
|
||||||
{
|
{
|
||||||
virtual void OnStartingUsingBuffer()
|
virtual void OnStartingUsingBuffer()
|
||||||
{
|
{
|
||||||
@ -447,7 +447,7 @@ private:
|
|||||||
/** The cChunkStay descendants that are currently enabled in this chunkmap */
|
/** The cChunkStay descendants that are currently enabled in this chunkmap */
|
||||||
cChunkStays m_ChunkStays;
|
cChunkStays m_ChunkStays;
|
||||||
|
|
||||||
cAllocationPool<cChunkData::sChunkSection,1600> m_Pool;
|
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 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 GetChunkNoGen (int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Also queues the chunk for loading if not valid; doesn't generate
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
class cStarvationCallbacks
|
class cStarvationCallbacks
|
||||||
: public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
|
: public cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks
|
||||||
{
|
{
|
||||||
virtual void OnStartingUsingBuffer() {}
|
virtual void OnStartingUsingBuffer() {}
|
||||||
virtual void OnStopUsingBuffer() {}
|
virtual void OnStopUsingBuffer() {}
|
||||||
virtual void OnBufferEmpty() {}
|
virtual void OnBufferEmpty() {}
|
||||||
};
|
};
|
||||||
cAllocationPool<cChunkData::sChunkSection,1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
cAllocationPool<cChunkData::sChunkSection, 1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
||||||
{
|
{
|
||||||
|
|
||||||
// Test first segment
|
// Test first segment
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
class cStarvationCallbacks
|
class cStarvationCallbacks
|
||||||
: public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
|
: public cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks
|
||||||
{
|
{
|
||||||
virtual void OnStartingUsingBuffer() {}
|
virtual void OnStartingUsingBuffer() {}
|
||||||
virtual void OnStopUsingBuffer() {}
|
virtual void OnStopUsingBuffer() {}
|
||||||
virtual void OnBufferEmpty() {}
|
virtual void OnBufferEmpty() {}
|
||||||
};
|
};
|
||||||
cAllocationPool<cChunkData::sChunkSection,1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
cAllocationPool<cChunkData::sChunkSection, 1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
||||||
{
|
{
|
||||||
cChunkData buffer(Pool);
|
cChunkData buffer(Pool);
|
||||||
|
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
class cStarvationCallbacks
|
class cStarvationCallbacks
|
||||||
: public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
|
: public cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks
|
||||||
{
|
{
|
||||||
virtual void OnStartingUsingBuffer() {}
|
virtual void OnStartingUsingBuffer() {}
|
||||||
virtual void OnStopUsingBuffer() {}
|
virtual void OnStopUsingBuffer() {}
|
||||||
virtual void OnBufferEmpty() {}
|
virtual void OnBufferEmpty() {}
|
||||||
};
|
};
|
||||||
cAllocationPool<cChunkData::sChunkSection,1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
cAllocationPool<cChunkData::sChunkSection, 1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
||||||
{
|
{
|
||||||
cChunkData buffer(Pool);
|
cChunkData buffer(Pool);
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@ int main(int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
// Set up a cChunkData with known contents - all blocks 0x01, all metas 0x02:
|
// Set up a cChunkData with known contents - all blocks 0x01, all metas 0x02:
|
||||||
class cStarvationCallbacks
|
class cStarvationCallbacks
|
||||||
: public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
|
: public cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks
|
||||||
{
|
{
|
||||||
virtual void OnStartingUsingBuffer() {}
|
virtual void OnStartingUsingBuffer() {}
|
||||||
virtual void OnStopUsingBuffer() {}
|
virtual void OnStopUsingBuffer() {}
|
||||||
virtual void OnBufferEmpty() {}
|
virtual void OnBufferEmpty() {}
|
||||||
};
|
};
|
||||||
cAllocationPool<cChunkData::sChunkSection,1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
cAllocationPool<cChunkData::sChunkSection, 1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
||||||
cChunkData Data(Pool);
|
cChunkData Data(Pool);
|
||||||
cChunkDef::BlockTypes BlockTypes;
|
cChunkDef::BlockTypes BlockTypes;
|
||||||
cChunkDef::BlockNibbles BlockMetas;
|
cChunkDef::BlockNibbles BlockMetas;
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
class cStarvationCallbacks
|
class cStarvationCallbacks
|
||||||
: public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
|
: public cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks
|
||||||
{
|
{
|
||||||
virtual void OnStartingUsingBuffer() {}
|
virtual void OnStartingUsingBuffer() {}
|
||||||
virtual void OnStopUsingBuffer() {}
|
virtual void OnStopUsingBuffer() {}
|
||||||
virtual void OnBufferEmpty() {}
|
virtual void OnBufferEmpty() {}
|
||||||
};
|
};
|
||||||
cAllocationPool<cChunkData::sChunkSection,1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
cAllocationPool<cChunkData::sChunkSection, 1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection, 1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
|
||||||
cChunkData buffer(Pool);
|
cChunkData buffer(Pool);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user