Work on low-level version of compression.

This commit is contained in:
Daviw Williams
2013-02-22 17:03:47 +01:00
parent eb8ace0c54
commit 81eab0ebfb
2 changed files with 38 additions and 16 deletions

View File

@ -8,12 +8,20 @@ namespace PolyVox
class MinizCompressor : public Compressor
{
public:
MinizCompressor();
MinizCompressor(int iCompressionLevel = 6); // Miniz defines MZ_DEFAULT_LEVEL = 6 so we use the same here
~MinizCompressor();
uint32_t getMaxCompressedSize(uint32_t uUncompressedInputSize);
uint32_t compress(void* pSrcData, uint32_t uSrcLength, void* pDstData, uint32_t uDstLength);
uint32_t decompress(void* pSrcData, uint32_t uSrcLength, void* pDstData, uint32_t uDstLength);
private:
int m_iCompressionLevel;
// tdefl_compressor contains all the state needed by the low-level compressor so it's a pretty big struct (~300k).
// We're storing it by void* because miniz does not supply a header and we don't want to include the .c file from
// here as it will cause linker problems.
void* g_deflator;
};
}