Removed boost dependency.

This commit is contained in:
David Williams
2008-06-25 21:13:59 +00:00
parent 9a58b83b6d
commit 27f6e461c0
34 changed files with 346 additions and 317 deletions

View File

@@ -32,7 +32,7 @@ namespace PolyVox
{
#pragma region Constructors/Destructors
template <typename VoxelType>
BlockVolume<VoxelType>::BlockVolume(boost::uint8_t uSideLengthPower, boost::uint8_t uBlockSideLengthPower)
BlockVolume<VoxelType>::BlockVolume(std::uint8_t uSideLengthPower, std::uint8_t uBlockSideLengthPower)
:m_pBlocks(0)
{
//Check the volume size is sensible. This corresponds to a side length of 65536 voxels
@@ -60,7 +60,7 @@ namespace PolyVox
m_pIsShared = new bool[m_uNoOfBlocksInVolume];
m_pIsPotentiallySharable = new bool[m_uNoOfBlocksInVolume];
m_pHomogenousValue = new VoxelType[m_uNoOfBlocksInVolume];
for(boost::uint32_t i = 0; i < m_uNoOfBlocksInVolume; ++i)
for(std::uint32_t i = 0; i < m_uNoOfBlocksInVolume; ++i)
{
m_pBlocks[i] = getHomogenousBlock(0); //new Block<VoxelType>(uBlockSideLengthPower);
m_pIsShared[i] = true;
@@ -78,7 +78,7 @@ namespace PolyVox
template <typename VoxelType>
BlockVolume<VoxelType>::~BlockVolume()
{
for(boost::uint32_t i = 0; i < m_uNoOfBlocksInVolume; ++i)
for(std::uint32_t i = 0; i < m_uNoOfBlocksInVolume; ++i)
{
delete m_pBlocks[i];
}
@@ -127,25 +127,25 @@ namespace PolyVox
}
template <typename VoxelType>
boost::uint16_t BlockVolume<VoxelType>::getSideLength(void) const
std::uint16_t BlockVolume<VoxelType>::getSideLength(void) const
{
return m_uSideLength;
}
template <typename VoxelType>
VoxelType BlockVolume<VoxelType>::getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const
VoxelType BlockVolume<VoxelType>::getVoxelAt(std::uint16_t uXPos, std::uint16_t uYPos, std::uint16_t uZPos) const
{
assert(uXPos < getSideLength());
assert(uYPos < getSideLength());
assert(uZPos < getSideLength());
const boost::uint16_t blockX = uXPos >> m_uBlockSideLengthPower;
const boost::uint16_t blockY = uYPos >> m_uBlockSideLengthPower;
const boost::uint16_t blockZ = uZPos >> m_uBlockSideLengthPower;
const std::uint16_t blockX = uXPos >> m_uBlockSideLengthPower;
const std::uint16_t blockY = uYPos >> m_uBlockSideLengthPower;
const std::uint16_t blockZ = uZPos >> m_uBlockSideLengthPower;
const boost::uint16_t xOffset = uXPos - (blockX << m_uBlockSideLengthPower);
const boost::uint16_t yOffset = uYPos - (blockY << m_uBlockSideLengthPower);
const boost::uint16_t zOffset = uZPos - (blockZ << m_uBlockSideLengthPower);
const std::uint16_t xOffset = uXPos - (blockX << m_uBlockSideLengthPower);
const std::uint16_t yOffset = uYPos - (blockY << m_uBlockSideLengthPower);
const std::uint16_t zOffset = uZPos - (blockZ << m_uBlockSideLengthPower);
const Block<VoxelType>* block = m_pBlocks
[
@@ -181,7 +181,7 @@ namespace PolyVox
}
template <typename VoxelType>
bool BlockVolume<VoxelType>::containsPoint(const Vector3DInt32& pos, boost::uint16_t boundary) const
bool BlockVolume<VoxelType>::containsPoint(const Vector3DInt32& pos, std::uint16_t boundary) const
{
return (pos.getX() <= m_uSideLength - 1 - boundary)
&& (pos.getY() <= m_uSideLength - 1 - boundary)
@@ -200,7 +200,7 @@ namespace PolyVox
}
template <typename VoxelType>
void BlockVolume<VoxelType>::idle(boost::uint32_t uAmount)
void BlockVolume<VoxelType>::idle(std::uint32_t uAmount)
{
}