Re-worked generator subobject ownership, added a cache for the CompositionGen
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1447 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
6b35c64658
commit
e88cdf8da7
|
@ -69,7 +69,6 @@ cBioGenCache::~cBioGenCache()
|
||||||
{
|
{
|
||||||
delete[] m_CacheData;
|
delete[] m_CacheData;
|
||||||
delete[] m_CacheOrder;
|
delete[] m_CacheOrder;
|
||||||
delete m_BioGenToCache;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class cBioGenCache :
|
||||||
typedef cBiomeGen super;
|
typedef cBiomeGen super;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cBioGenCache(cBiomeGen * a_BioGenToCache, int a_CacheSize); // Takes ownership of a_BioGenToCache
|
cBioGenCache(cBiomeGen * a_BioGenToCache, int a_CacheSize); // Doesn't take ownership of a_BioGenToCache
|
||||||
~cBioGenCache();
|
~cBioGenCache();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -30,6 +30,9 @@ class cChunkDesc
|
||||||
public:
|
public:
|
||||||
// tolua_end
|
// tolua_end
|
||||||
|
|
||||||
|
/// Uncompressed block metas, 1 meta per byte
|
||||||
|
typedef NIBBLETYPE BlockNibbleBytes[cChunkDef::NumBlocks];
|
||||||
|
|
||||||
cChunkDesc(int a_ChunkX, int a_ChunkZ);
|
cChunkDesc(int a_ChunkX, int a_ChunkZ);
|
||||||
~cChunkDesc();
|
~cChunkDesc();
|
||||||
|
|
||||||
|
@ -172,13 +175,14 @@ public:
|
||||||
void AddBlockEntity(cBlockEntity * a_BlockEntity);
|
void AddBlockEntity(cBlockEntity * a_BlockEntity);
|
||||||
|
|
||||||
// Accessors used by cChunkGenerator::Generator descendants:
|
// Accessors used by cChunkGenerator::Generator descendants:
|
||||||
inline cChunkDef::BiomeMap & GetBiomeMap (void) { return m_BiomeMap; }
|
inline cChunkDef::BiomeMap & GetBiomeMap (void) { return m_BiomeMap; }
|
||||||
inline cChunkDef::BlockTypes & GetBlockTypes (void) { return *((cChunkDef::BlockTypes *)m_BlockArea.GetBlockTypes()); }
|
inline cChunkDef::BlockTypes & GetBlockTypes (void) { return *((cChunkDef::BlockTypes *)m_BlockArea.GetBlockTypes()); }
|
||||||
// CANNOT, different compression!
|
// CANNOT, different compression!
|
||||||
// inline cChunkDef::BlockNibbles & GetBlockMetas (void) { return *((cChunkDef::BlockNibbles *)m_BlockArea.GetBlockMetas()); }
|
// inline cChunkDef::BlockNibbles & GetBlockMetas (void) { return *((cChunkDef::BlockNibbles *)m_BlockArea.GetBlockMetas()); }
|
||||||
inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; }
|
inline BlockNibbleBytes & GetBlockMetasUncompressed(void) { return *((BlockNibbleBytes *)m_BlockArea.GetBlockMetas()); }
|
||||||
inline cEntityList & GetEntities (void) { return m_Entities; }
|
inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; }
|
||||||
inline cBlockEntityList & GetBlockEntities(void) { return m_BlockEntities; }
|
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)
|
/// Compresses the metas from the BlockArea format (1 meta per byte) into regular format (2 metas per byte)
|
||||||
void CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas);
|
void CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas);
|
||||||
|
|
|
@ -272,6 +272,11 @@ void cChunkGenerator::DoGenerate(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
|
||||||
m_Generator->DoGenerate(a_ChunkX, a_ChunkZ, ChunkDesc);
|
m_Generator->DoGenerate(a_ChunkX, a_ChunkZ, ChunkDesc);
|
||||||
cRoot::Get()->GetPluginManager()->CallHookChunkGenerated(m_World, a_ChunkX, a_ChunkZ, &ChunkDesc);
|
cRoot::Get()->GetPluginManager()->CallHookChunkGenerated(m_World, a_ChunkX, a_ChunkZ, &ChunkDesc);
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
// Verify that the generator has produced valid data:
|
||||||
|
ChunkDesc.VerifyHeightmap();
|
||||||
|
#endif
|
||||||
|
|
||||||
cChunkDef::BlockNibbles BlockMetas;
|
cChunkDef::BlockNibbles BlockMetas;
|
||||||
ChunkDesc.CompressBlockMetas(BlockMetas);
|
ChunkDesc.CompressBlockMetas(BlockMetas);
|
||||||
|
|
||||||
|
|
|
@ -483,3 +483,99 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// cCompoGenCache:
|
||||||
|
|
||||||
|
cCompoGenCache::cCompoGenCache(cTerrainCompositionGen * a_Underlying, int a_CacheSize) :
|
||||||
|
m_Underlying(a_Underlying),
|
||||||
|
m_CacheSize(a_CacheSize),
|
||||||
|
m_CacheOrder(new int[a_CacheSize]),
|
||||||
|
m_CacheData(new sCacheData[a_CacheSize]),
|
||||||
|
m_NumHits(0),
|
||||||
|
m_NumMisses(0),
|
||||||
|
m_TotalChain(0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < m_CacheSize; i++)
|
||||||
|
{
|
||||||
|
m_CacheOrder[i] = i;
|
||||||
|
m_CacheData[i].m_ChunkX = 0x7fffffff;
|
||||||
|
m_CacheData[i].m_ChunkZ = 0x7fffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cCompoGenCache::~cCompoGenCache()
|
||||||
|
{
|
||||||
|
delete[] m_CacheData;
|
||||||
|
delete[] m_CacheOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void cCompoGenCache::ComposeTerrain(cChunkDesc & a_ChunkDesc)
|
||||||
|
{
|
||||||
|
//*
|
||||||
|
if (((m_NumHits + m_NumMisses) % 1024) == 10)
|
||||||
|
{
|
||||||
|
LOGD("CompoGenCache: %d hits, %d misses, saved %.2f %%", m_NumHits, m_NumMisses, 100.0 * m_NumHits / (m_NumHits + m_NumMisses));
|
||||||
|
LOGD("CompoGenCache: Avg cache chain length: %.2f", (float)m_TotalChain / m_NumHits);
|
||||||
|
}
|
||||||
|
//*/
|
||||||
|
|
||||||
|
int ChunkX = a_ChunkDesc.GetChunkX();
|
||||||
|
int ChunkZ = a_ChunkDesc.GetChunkZ();
|
||||||
|
|
||||||
|
for (int i = 0; i < m_CacheSize; i++)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
(m_CacheData[m_CacheOrder[i]].m_ChunkX != ChunkX) ||
|
||||||
|
(m_CacheData[m_CacheOrder[i]].m_ChunkZ != ChunkZ)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Found it in the cache
|
||||||
|
int Idx = m_CacheOrder[i];
|
||||||
|
|
||||||
|
// Move to front:
|
||||||
|
for (int j = i; j > 0; j--)
|
||||||
|
{
|
||||||
|
m_CacheOrder[j] = m_CacheOrder[j - 1];
|
||||||
|
}
|
||||||
|
m_CacheOrder[0] = Idx;
|
||||||
|
|
||||||
|
// Use the cached data:
|
||||||
|
memcpy(a_ChunkDesc.GetBlockTypes(), m_CacheData[Idx].m_BlockTypes, sizeof(a_ChunkDesc.GetBlockTypes()));
|
||||||
|
memcpy(a_ChunkDesc.GetBlockMetasUncompressed(), m_CacheData[Idx].m_BlockMetas, sizeof(a_ChunkDesc.GetBlockMetasUncompressed()));
|
||||||
|
|
||||||
|
m_NumHits++;
|
||||||
|
m_TotalChain += i;
|
||||||
|
return;
|
||||||
|
} // for i - cache
|
||||||
|
|
||||||
|
// Not in the cache:
|
||||||
|
m_NumMisses++;
|
||||||
|
m_Underlying->ComposeTerrain(a_ChunkDesc);
|
||||||
|
|
||||||
|
// Insert it as the first item in the MRU order:
|
||||||
|
int Idx = m_CacheOrder[m_CacheSize - 1];
|
||||||
|
for (int i = m_CacheSize - 1; i > 0; i--)
|
||||||
|
{
|
||||||
|
m_CacheOrder[i] = m_CacheOrder[i - 1];
|
||||||
|
} // for i - m_CacheOrder[]
|
||||||
|
m_CacheOrder[0] = Idx;
|
||||||
|
memcpy(m_CacheData[Idx].m_BlockTypes, a_ChunkDesc.GetBlockTypes(), sizeof(a_ChunkDesc.GetBlockTypes()));
|
||||||
|
memcpy(m_CacheData[Idx].m_BlockMetas, a_ChunkDesc.GetBlockMetasUncompressed(), sizeof(a_ChunkDesc.GetBlockMetasUncompressed()));
|
||||||
|
m_CacheData[Idx].m_ChunkX = ChunkX;
|
||||||
|
m_CacheData[Idx].m_ChunkZ = ChunkZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
- cCompoGenDebugBiomes
|
- cCompoGenDebugBiomes
|
||||||
- cCompoGenClassic
|
- cCompoGenClassic
|
||||||
- cCompoGenBiomal
|
- cCompoGenBiomal
|
||||||
|
- cCompoGenNether
|
||||||
|
- cCompoGenCache
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -139,3 +141,41 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// Caches most-recently-used chunk composition of another composition generator. Caches only the types and metas
|
||||||
|
class cCompoGenCache :
|
||||||
|
public cTerrainCompositionGen
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cCompoGenCache(cTerrainCompositionGen * a_Underlying, int a_CacheSize); // Doesn't take ownership of a_Underlying
|
||||||
|
~cCompoGenCache();
|
||||||
|
|
||||||
|
// cTerrainCompositionGen override:
|
||||||
|
virtual void ComposeTerrain(cChunkDesc & a_ChunkDesc) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
cTerrainCompositionGen * m_Underlying;
|
||||||
|
|
||||||
|
struct sCacheData
|
||||||
|
{
|
||||||
|
int m_ChunkX;
|
||||||
|
int m_ChunkZ;
|
||||||
|
cChunkDef::BlockTypes m_BlockTypes;
|
||||||
|
cChunkDesc::BlockNibbleBytes m_BlockMetas; // The metas are uncompressed, 1 meta per byte
|
||||||
|
} ;
|
||||||
|
|
||||||
|
// To avoid moving large amounts of data for the MRU behavior, we MRU-ize indices to an array of the actual data
|
||||||
|
int m_CacheSize;
|
||||||
|
int * m_CacheOrder; // MRU-ized order, indices into m_CacheData array
|
||||||
|
sCacheData * m_CacheData; // m_CacheData[m_CacheOrder[0]] is the most recently used
|
||||||
|
|
||||||
|
// Cache statistics
|
||||||
|
int m_NumHits;
|
||||||
|
int m_NumMisses;
|
||||||
|
int m_TotalChain; // Number of cache items walked to get to a hit (only added for hits)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,10 +37,9 @@ cComposableGenerator::cComposableGenerator(cChunkGenerator & a_ChunkGenerator) :
|
||||||
m_BiomeGen(NULL),
|
m_BiomeGen(NULL),
|
||||||
m_HeightGen(NULL),
|
m_HeightGen(NULL),
|
||||||
m_CompositionGen(NULL),
|
m_CompositionGen(NULL),
|
||||||
m_Noise3DComposable(NULL),
|
m_UnderlyingBiomeGen(NULL),
|
||||||
m_NumNoise3DComposableUses(0),
|
m_UnderlyingHeightGen(NULL),
|
||||||
m_DistortedHeightmap(NULL),
|
m_UnderlyingCompositionGen(NULL)
|
||||||
m_NumDistortedHeightmapUses(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,26 +61,18 @@ cComposableGenerator::~cComposableGenerator()
|
||||||
}
|
}
|
||||||
m_StructureGens.clear();
|
m_StructureGens.clear();
|
||||||
|
|
||||||
// CompositionGen must not be freed if it is shared between HeightGenCache and CompositionGen:
|
delete m_CompositionGen;
|
||||||
int NumUsed = 1;
|
|
||||||
if (m_CompositionGen == m_Noise3DComposable)
|
|
||||||
{
|
|
||||||
NumUsed = m_NumNoise3DComposableUses;
|
|
||||||
}
|
|
||||||
else if (m_CompositionGen == m_DistortedHeightmap)
|
|
||||||
{
|
|
||||||
NumUsed = m_NumDistortedHeightmapUses;
|
|
||||||
}
|
|
||||||
if (NumUsed == 1)
|
|
||||||
{
|
|
||||||
delete m_CompositionGen;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_CompositionGen = NULL;
|
m_CompositionGen = NULL;
|
||||||
delete m_HeightGen;
|
delete m_HeightGen;
|
||||||
m_HeightGen = NULL;
|
m_HeightGen = NULL;
|
||||||
delete m_BiomeGen;
|
delete m_BiomeGen;
|
||||||
m_BiomeGen = NULL;
|
m_BiomeGen = NULL;
|
||||||
|
delete m_UnderlyingCompositionGen;
|
||||||
|
m_UnderlyingCompositionGen = NULL;
|
||||||
|
delete m_UnderlyingHeightGen;
|
||||||
|
m_UnderlyingHeightGen = NULL;
|
||||||
|
delete m_UnderlyingBiomeGen;
|
||||||
|
m_UnderlyingBiomeGen = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,7 +207,8 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
|
||||||
CacheSize = 4;
|
CacheSize = 4;
|
||||||
}
|
}
|
||||||
LOGINFO("Using a cache for biomegen of size %d.", CacheSize);
|
LOGINFO("Using a cache for biomegen of size %d.", CacheSize);
|
||||||
m_BiomeGen = new cBioGenCache(m_BiomeGen, CacheSize);
|
m_UnderlyingBiomeGen = m_BiomeGen;
|
||||||
|
m_BiomeGen = new cBioGenCache(m_UnderlyingBiomeGen, CacheSize);
|
||||||
}
|
}
|
||||||
m_BiomeGen->Initialize(a_IniFile);
|
m_BiomeGen->Initialize(a_IniFile);
|
||||||
}
|
}
|
||||||
|
@ -255,24 +247,13 @@ void cComposableGenerator::InitHeightGen(cIniFile & a_IniFile)
|
||||||
}
|
}
|
||||||
else if (NoCaseCompare(HeightGenName, "DistortedHeightmap") == 0)
|
else if (NoCaseCompare(HeightGenName, "DistortedHeightmap") == 0)
|
||||||
{
|
{
|
||||||
if (m_DistortedHeightmap == NULL)
|
m_HeightGen = new cDistortedHeightmap(Seed, *m_BiomeGen);
|
||||||
{
|
((cDistortedHeightmap *)m_HeightGen)->Initialize(a_IniFile);
|
||||||
m_DistortedHeightmap = new cDistortedHeightmap(Seed, *m_BiomeGen);
|
|
||||||
m_DistortedHeightmap->Initialize(a_IniFile);
|
|
||||||
}
|
|
||||||
m_HeightGen = m_DistortedHeightmap;
|
|
||||||
m_NumDistortedHeightmapUses++;
|
|
||||||
// TODO: Optimize by sharing with CompoGen
|
|
||||||
}
|
}
|
||||||
else if (NoCaseCompare(HeightGenName, "Noise3D") == 0)
|
else if (NoCaseCompare(HeightGenName, "Noise3D") == 0)
|
||||||
{
|
{
|
||||||
if (m_Noise3DComposable == NULL)
|
m_HeightGen = new cNoise3DComposable(Seed);
|
||||||
{
|
((cNoise3DComposable *)m_HeightGen)->Initialize(a_IniFile);
|
||||||
m_Noise3DComposable = new cNoise3DComposable(Seed);
|
|
||||||
m_Noise3DComposable->Initialize(a_IniFile);
|
|
||||||
}
|
|
||||||
m_HeightGen = m_Noise3DComposable;
|
|
||||||
m_NumNoise3DComposableUses++;
|
|
||||||
}
|
}
|
||||||
else // "biomal" or <not found>
|
else // "biomal" or <not found>
|
||||||
{
|
{
|
||||||
|
@ -308,7 +289,8 @@ void cComposableGenerator::InitHeightGen(cIniFile & a_IniFile)
|
||||||
CacheSize = 4;
|
CacheSize = 4;
|
||||||
}
|
}
|
||||||
LOGINFO("Using a cache for Heightgen of size %d.", CacheSize);
|
LOGINFO("Using a cache for Heightgen of size %d.", CacheSize);
|
||||||
m_HeightGen = new cHeiGenCache(m_HeightGen, CacheSize);
|
m_UnderlyingHeightGen = m_HeightGen;
|
||||||
|
m_HeightGen = new cHeiGenCache(m_UnderlyingHeightGen, CacheSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,13 +334,8 @@ void cComposableGenerator::InitCompositionGen(cIniFile & a_IniFile)
|
||||||
}
|
}
|
||||||
else if (NoCaseCompare(CompoGenName, "DistortedHeightmap") == 0)
|
else if (NoCaseCompare(CompoGenName, "DistortedHeightmap") == 0)
|
||||||
{
|
{
|
||||||
if (m_DistortedHeightmap == NULL)
|
m_CompositionGen = new cDistortedHeightmap(m_ChunkGenerator.GetSeed(), *m_BiomeGen);
|
||||||
{
|
((cDistortedHeightmap *)m_CompositionGen)->Initialize(a_IniFile);
|
||||||
m_DistortedHeightmap = new cDistortedHeightmap(m_ChunkGenerator.GetSeed(), *m_BiomeGen);
|
|
||||||
m_DistortedHeightmap->Initialize(a_IniFile);
|
|
||||||
}
|
|
||||||
m_CompositionGen = m_DistortedHeightmap;
|
|
||||||
m_NumDistortedHeightmapUses++;
|
|
||||||
}
|
}
|
||||||
else if (NoCaseCompare(CompoGenName, "nether") == 0)
|
else if (NoCaseCompare(CompoGenName, "nether") == 0)
|
||||||
{
|
{
|
||||||
|
@ -366,13 +343,8 @@ void cComposableGenerator::InitCompositionGen(cIniFile & a_IniFile)
|
||||||
}
|
}
|
||||||
else if (NoCaseCompare(CompoGenName, "Noise3D") == 0)
|
else if (NoCaseCompare(CompoGenName, "Noise3D") == 0)
|
||||||
{
|
{
|
||||||
if (m_Noise3DComposable == NULL)
|
m_CompositionGen = new cNoise3DComposable(m_ChunkGenerator.GetSeed());
|
||||||
{
|
((cNoise3DComposable *)m_CompositionGen)->Initialize(a_IniFile);
|
||||||
m_Noise3DComposable = new cNoise3DComposable(m_ChunkGenerator.GetSeed());
|
|
||||||
m_Noise3DComposable->Initialize(a_IniFile);
|
|
||||||
}
|
|
||||||
m_CompositionGen = m_Noise3DComposable;
|
|
||||||
m_NumNoise3DComposableUses++;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -399,6 +371,13 @@ void cComposableGenerator::InitCompositionGen(cIniFile & a_IniFile)
|
||||||
LOGINFO("CompositionGen for 500 chunks took %d ticks (%.02f sec)", Duration, (double)Duration / CLOCKS_PER_SEC);
|
LOGINFO("CompositionGen for 500 chunks took %d ticks (%.02f sec)", Duration, (double)Duration / CLOCKS_PER_SEC);
|
||||||
//*/
|
//*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CompoGenCacheSize = a_IniFile.GetValueSetI("Generator", "CompositionGenCacheSize", 64);
|
||||||
|
if (CompoGenCacheSize > 1)
|
||||||
|
{
|
||||||
|
m_UnderlyingCompositionGen = m_CompositionGen;
|
||||||
|
m_CompositionGen = new cCompoGenCache(m_UnderlyingCompositionGen, 32);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -148,13 +148,12 @@ protected:
|
||||||
cStructureGenList m_StructureGens;
|
cStructureGenList m_StructureGens;
|
||||||
cFinishGenList m_FinishGens;
|
cFinishGenList m_FinishGens;
|
||||||
|
|
||||||
// Specific generators that can be reused for different purposes - we don't want to create multiple objects for them
|
// Generators underlying the caches:
|
||||||
cNoise3DComposable * m_Noise3DComposable;
|
cBiomeGen * m_UnderlyingBiomeGen;
|
||||||
int m_NumNoise3DComposableUses; ///< How many times is it actually used?
|
cTerrainHeightGen * m_UnderlyingHeightGen;
|
||||||
cDistortedHeightmap * m_DistortedHeightmap;
|
cTerrainCompositionGen * m_UnderlyingCompositionGen;
|
||||||
int m_NumDistortedHeightmapUses; ///< How many times is it actually used?
|
|
||||||
|
|
||||||
|
|
||||||
/// Reads the biome gen settings from the ini and initializes m_BiomeGen accordingly
|
/// Reads the biome gen settings from the ini and initializes m_BiomeGen accordingly
|
||||||
void InitBiomeGen(cIniFile & a_IniFile);
|
void InitBiomeGen(cIniFile & a_IniFile);
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ cHeiGenCache::~cHeiGenCache()
|
||||||
{
|
{
|
||||||
delete[] m_CacheData;
|
delete[] m_CacheData;
|
||||||
delete[] m_CacheOrder;
|
delete[] m_CacheOrder;
|
||||||
delete m_HeiGenToCache;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class cHeiGenCache :
|
||||||
public cTerrainHeightGen
|
public cTerrainHeightGen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cHeiGenCache(cTerrainHeightGen * a_HeiGenToCache, int a_CacheSize); // Takes ownership of a_HeiGenToCache
|
cHeiGenCache(cTerrainHeightGen * a_HeiGenToCache, int a_CacheSize); // Doesn't take ownership of a_HeiGenToCache
|
||||||
~cHeiGenCache();
|
~cHeiGenCache();
|
||||||
|
|
||||||
// cTerrainHeightGen override:
|
// cTerrainHeightGen override:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user