Work on compression.
This commit is contained in:
@ -26,7 +26,7 @@ freely, subject to the following restrictions:
|
||||
|
||||
#include "PolyVoxCore/Impl/TypeDef.h"
|
||||
|
||||
#include "PolyVoxCore/Compressor.h"
|
||||
#include "PolyVoxCore/PolyVoxForwardDeclarations.h"
|
||||
#include "PolyVoxCore/Vector.h"
|
||||
|
||||
#include <limits>
|
||||
|
@ -24,8 +24,7 @@ freely, subject to the following restrictions:
|
||||
#include "PolyVoxCore/Impl/ErrorHandling.h"
|
||||
#include "PolyVoxCore/Impl/Utility.h"
|
||||
|
||||
#include "PolyVoxCore/MinizCompressor.h"
|
||||
#include "PolyVoxCore/RLECompressor.h"
|
||||
#include "PolyVoxCore/Compressor.h"
|
||||
#include "PolyVoxCore/Vector.h"
|
||||
|
||||
#include "PolyVoxCore/Impl/ErrorHandling.h"
|
||||
|
@ -17,7 +17,10 @@ namespace PolyVox
|
||||
template<typename ValueType, typename LengthType>
|
||||
uint32_t RLECompressor<ValueType, LengthType>::compress(void* pSrcData, uint32_t uSrcLength, void* pDstData, uint32_t uDstLength)
|
||||
{
|
||||
assert(uSrcLength % sizeof(ValueType) == 0);
|
||||
if(uSrcLength % sizeof(ValueType) != 0)
|
||||
{
|
||||
POLYVOX_THROW(std::length_error, "Source length must be a integer multiple of the ValueType size");
|
||||
}
|
||||
|
||||
uSrcLength /= sizeof(ValueType);
|
||||
uDstLength /= sizeof(Run);
|
||||
@ -60,7 +63,10 @@ namespace PolyVox
|
||||
template<typename ValueType, typename LengthType>
|
||||
uint32_t RLECompressor<ValueType, LengthType>::decompress(void* pSrcData, uint32_t uSrcLength, void* pDstData, uint32_t uDstLength)
|
||||
{
|
||||
assert(uSrcLength % sizeof(Run) == 0);
|
||||
if(uSrcLength % sizeof(Run) != 0)
|
||||
{
|
||||
POLYVOX_THROW(std::length_error, "Source length must be a integer multiple of the Run size");
|
||||
}
|
||||
|
||||
uSrcLength /= sizeof(Run);
|
||||
uDstLength /= sizeof(ValueType);
|
||||
|
Reference in New Issue
Block a user