Started moving compression code into separate class.

This commit is contained in:
David Williams
2013-07-26 16:00:29 +02:00
parent c3c4ead1f3
commit f54532a905
7 changed files with 134 additions and 2 deletions

View File

@ -100,6 +100,9 @@ namespace PolyVox
UncompressedBlock(uint16_t uSideLength);
~UncompressedBlock();
VoxelType* getData(void) const;
uint32_t getDataSizeInBytes(void) const;
VoxelType getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const;
VoxelType getVoxel(const Vector3DUint16& v3dPos) const;

View File

@ -115,6 +115,18 @@ namespace PolyVox
m_tData = 0;
}
template <typename VoxelType>
VoxelType* UncompressedBlock<VoxelType>::getData(void) const
{
return m_tData;
}
template <typename VoxelType>
uint32_t UncompressedBlock<VoxelType>::getDataSizeInBytes(void) const
{
return m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType);
}
template <typename VoxelType>
VoxelType UncompressedBlock<VoxelType>::getVoxel(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const
{