Added compatibility mode.
This commit is contained in:
@ -159,6 +159,7 @@ namespace PolyVox
|
||||
void clearBlockCache(void);
|
||||
float calculateCompressionRatio(void);
|
||||
uint32_t calculateSizeInBytes(void);
|
||||
void useCompatibilityMode(void);
|
||||
/// Resizes the volume to the specified dimensions
|
||||
void resize(uint16_t uWidth, uint16_t uHeight, uint16_t uDepth, uint16_t uBlockSideLength = 32);
|
||||
|
||||
|
@ -463,4 +463,21 @@ namespace PolyVox
|
||||
|
||||
return uSizeInBytes;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
void Volume<VoxelType>::useCompatibilityMode(void)
|
||||
{
|
||||
setBlockCacheSize(m_uNoOfBlocksInVolume * 2); //Times two gives space to spare
|
||||
|
||||
for(uint32_t z = 0; z < m_uDepthInBlocks; z++)
|
||||
{
|
||||
for(uint32_t y = 0; y < m_uHeightInBlocks; y++)
|
||||
{
|
||||
for(uint32_t x = 0; x < m_uWidthInBlocks; x++)
|
||||
{
|
||||
getUncompressedBlock(x,y,z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user