Work on Volume class.
This commit is contained in:
@ -30,11 +30,11 @@ namespace PolyVox
|
||||
//If this is not the case then the output is undefined.
|
||||
uint8 logBase2(uint32 uInput)
|
||||
{
|
||||
//Debug mode error handling
|
||||
//Debug mode validation
|
||||
assert(uInput != 0);
|
||||
assert(isPowerOf2(uInput));
|
||||
|
||||
//Release mode error handling
|
||||
//Release mode validation
|
||||
if(uInput == 0)
|
||||
{
|
||||
throw std::invalid_argument("Cannot compute the log of zero.");
|
||||
|
@ -19,14 +19,14 @@ namespace PolyVox
|
||||
stream.read(reinterpret_cast<char*>(&volumeWidthPower), sizeof(volumeWidthPower));
|
||||
stream.read(reinterpret_cast<char*>(&volumeHeightPower), sizeof(volumeHeightPower));
|
||||
stream.read(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//FIXME - need to support non cubic volumes
|
||||
Volume<uint8>* volume = new Volume<uint8>(volumeWidthPower);
|
||||
|
||||
uint16 volumeWidth = 0x0001 << volumeWidthPower;
|
||||
uint16 volumeHeight = 0x0001 << volumeHeightPower;
|
||||
uint16 volumeDepth = 0x0001 << volumeDepthPower;
|
||||
|
||||
//FIXME - need to support non cubic volumes
|
||||
Volume<uint8>* volume = new Volume<uint8>(volumeWidth);
|
||||
|
||||
//Read data
|
||||
for(uint16 z = 0; z < volumeDepth; ++z)
|
||||
{
|
||||
@ -87,14 +87,14 @@ namespace PolyVox
|
||||
stream.read(reinterpret_cast<char*>(&volumeWidthPower), sizeof(volumeWidthPower));
|
||||
stream.read(reinterpret_cast<char*>(&volumeHeightPower), sizeof(volumeHeightPower));
|
||||
stream.read(reinterpret_cast<char*>(&volumeDepthPower), sizeof(volumeDepthPower));
|
||||
|
||||
//FIXME - need to support non cubic volumes
|
||||
Volume<uint8>* volume = new Volume<uint8>(volumeWidthPower);
|
||||
|
||||
uint16 volumeWidth = 0x0001 << volumeWidthPower;
|
||||
uint16 volumeHeight = 0x0001 << volumeHeightPower;
|
||||
uint16 volumeDepth = 0x0001 << volumeDepthPower;
|
||||
|
||||
//FIXME - need to support non cubic volumes
|
||||
Volume<uint8>* volume = new Volume<uint8>(volumeWidth);
|
||||
|
||||
//Read data
|
||||
bool firstTime = true;
|
||||
uint32 runLength = 0;
|
||||
|
Reference in New Issue
Block a user