Added setVoxel() funtion to volume iterators.
Fixed bugs with RawVolume iterator movement funtions. Proper implementation of RawVolume peek...() functions.
This commit is contained in:
@ -143,7 +143,7 @@ namespace PolyVox
|
||||
{
|
||||
/*Block<VoxelType>* pUncompressedBorderBlock = getUncompressedBlock(&m_pBorderBlock);
|
||||
return pUncompressedBorderBlock->fill(tBorder);*/
|
||||
std::fill(m_pUncompressedBorderData, m_pUncompressedBorderData + m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength, tBorder);
|
||||
std::fill(m_pUncompressedBorderData, m_pUncompressedBorderData + m_uNoOfVoxelsPerBlock, tBorder);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -205,6 +205,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
m_uBlockSideLength = uBlockSideLength;
|
||||
m_uNoOfVoxelsPerBlock = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength;
|
||||
m_pUncompressedBorderData = 0;
|
||||
|
||||
this->m_regValidRegion = regValidRegion;
|
||||
@ -230,8 +231,8 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
//Create the border block
|
||||
m_pUncompressedBorderData = new VoxelType[m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength];
|
||||
std::fill(m_pUncompressedBorderData, m_pUncompressedBorderData + m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength, VoxelType());
|
||||
m_pUncompressedBorderData = new VoxelType[m_uNoOfVoxelsPerBlock];
|
||||
std::fill(m_pUncompressedBorderData, m_pUncompressedBorderData + m_uNoOfVoxelsPerBlock, VoxelType());
|
||||
|
||||
//Other properties we might find useful later
|
||||
this->m_uLongestSideLength = (std::max)((std::max)(this->getWidth(),this->getHeight()),this->getDepth());
|
||||
@ -266,7 +267,7 @@ namespace PolyVox
|
||||
{
|
||||
uint32_t uSizeInBytes = sizeof(SimpleVolume);
|
||||
|
||||
uint32_t uSizeOfBlockInBytes = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength * sizeof(VoxelType);
|
||||
uint32_t uSizeOfBlockInBytes = m_uNoOfVoxelsPerBlock * sizeof(VoxelType);
|
||||
|
||||
//Memory used by the blocks ( + 1 is for border)
|
||||
uSizeInBytes += uSizeOfBlockInBytes * (m_uNoOfBlocksInVolume + 1);
|
||||
|
Reference in New Issue
Block a user