More work on block compression with miniz.

This commit is contained in:
Daviw Williams
2013-01-11 13:29:33 +01:00
parent 7bb7be0dec
commit 68ee094cec
3 changed files with 19 additions and 11 deletions

View File

@ -210,13 +210,21 @@ namespace PolyVox
pUncompressedData += m_vecCompressedData[ct].length;
}*/
m_tUncompressedData = new VoxelType[m_uSideLength * m_uSideLength * m_uSideLength];
Data src;
src.ptr = m_pCompressedData;
src.length = m_uCompressedDataLength;
Data uncompressedResult = polyvox_decompress(src);
Data dst;
dst.ptr = reinterpret_cast<uint8_t*>(m_tUncompressedData);
dst.length = m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType);
m_tUncompressedData = reinterpret_cast<VoxelType*>(uncompressedResult.ptr);
polyvox_decompress(src, dst);
POLYVOX_ASSERT(dst.length == m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType), "Destination length has changed.");
//m_tUncompressedData = reinterpret_cast<VoxelType*>(uncompressedResult.ptr);
m_bIsCompressed = false;
m_bIsUncompressedDataModified = false;

View File

@ -33,6 +33,6 @@ struct Data
};
Data polyvox_compress(Data src);
Data polyvox_decompress(Data src);
void polyvox_decompress(Data src, Data dst);
#endif //__PolyVox_Compression_H__