From 27f6e461c0ecf6c03661999812188ff9346e0084 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 25 Jun 2008 21:13:59 +0000 Subject: [PATCH] Removed boost dependency. --- PolyVoxCore/CMakeLists.txt | 12 +-- PolyVoxCore/include/Block.h | 14 +-- PolyVoxCore/include/Block.inl | 8 +- PolyVoxCore/include/BlockVolume.h | 28 +++--- PolyVoxCore/include/BlockVolume.inl | 26 ++--- PolyVoxCore/include/BlockVolumeIterator.h | 60 ++++++------ PolyVoxCore/include/BlockVolumeIterator.inl | 22 ++--- PolyVoxCore/include/Constants.h | 24 ++--- PolyVoxCore/include/GradientEstimators.h | 4 +- PolyVoxCore/include/GradientEstimators.inl | 6 +- PolyVoxCore/include/IndexedSurfacePatch.h | 24 ++--- PolyVoxCore/include/LinearVolume.h | 16 +-- PolyVoxCore/include/LinearVolume.inl | 10 +- PolyVoxCore/include/PolyVoxCStdInt.h | 37 +++++++ .../include/PolyVoxForwardDeclarations.h | 20 ++-- PolyVoxCore/include/Region.h | 2 +- PolyVoxCore/include/SurfaceAdjusters.h | 4 +- PolyVoxCore/include/SurfaceExtractors.h | 16 +-- .../include/SurfaceExtractorsDecimated.h | 18 ++-- PolyVoxCore/include/Utility.h | 6 +- PolyVoxCore/include/Vector.h | 30 +++--- PolyVoxCore/include/Vector.inl | 98 +++++++++---------- PolyVoxCore/include/VolumeChangeTracker.h | 20 ++-- PolyVoxCore/include/VoxelFilters.h | 2 +- PolyVoxCore/source/GradientEstimators.cpp | 10 +- PolyVoxCore/source/IndexedSurfacePatch.cpp | 8 +- PolyVoxCore/source/Region.cpp | 2 +- PolyVoxCore/source/SurfaceAdjusters.cpp | 6 +- PolyVoxCore/source/SurfaceExtractors.cpp | 50 +++++----- .../source/SurfaceExtractorsDecimated.cpp | 52 +++++----- PolyVoxCore/source/Utility.cpp | 8 +- PolyVoxCore/source/VolumeChangeTracker.cpp | 16 +-- PolyVoxCore/source/VoxelFilters.cpp | 2 +- examples/OpenGL/main.cpp | 2 +- 34 files changed, 346 insertions(+), 317 deletions(-) create mode 100644 PolyVoxCore/include/PolyVoxCStdInt.h diff --git a/PolyVoxCore/CMakeLists.txt b/PolyVoxCore/CMakeLists.txt index e61749e9..e5d887ab 100644 --- a/PolyVoxCore/CMakeLists.txt +++ b/PolyVoxCore/CMakeLists.txt @@ -40,6 +40,7 @@ SET(INC_FILES include/IndexedSurfacePatch.h include/MarchingCubesTables.h include/PolyVoxForwardDeclarations.h + include/PolyVoxCStdInt.h include/Region.h include/RegionGeometry.h include/SurfaceAdjusters.h @@ -54,15 +55,6 @@ SET(INC_FILES include/VoxelFilters.h ) -FIND_PACKAGE(Boost REQUIRED) - -#under windows boost linking is automatic. Under Linux it is specified here. Might need changing for MinGW -#IF(NOT WIN32) -# SET(BOOST_LIBRARIES boost_program_options boost_filesystem) -#ENDIF(NOT WIN32) - - - ADD_DEFINITIONS(-DPOLYVOX_EXPORT) #Export symbols in the .dll #Appends "_d" to the generated library when in debug mode @@ -74,7 +66,7 @@ SOURCE_GROUP("Sources" FILES ${SRC_FILES}) SOURCE_GROUP("Headers" FILES ${INC_FILES}) #Tell CMake the paths -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) #Build ADD_LIBRARY(PolyVoxCore SHARED ${SRC_FILES} ${INC_FILES}) diff --git a/PolyVoxCore/include/Block.h b/PolyVoxCore/include/Block.h index 57dff6f2..e588249b 100644 --- a/PolyVoxCore/include/Block.h +++ b/PolyVoxCore/include/Block.h @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma region Headers #include "PolyVoxForwardDeclarations.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #pragma endregion namespace PolyVox @@ -36,22 +36,22 @@ namespace PolyVox //Make BlockVolumeIterator a friend friend class BlockVolumeIterator; public: - Block(boost::uint8_t uSideLengthPower); + Block(std::uint8_t uSideLengthPower); Block(const Block& rhs); ~Block(); Block& operator=(const Block& rhs); - boost::uint16_t getSideLength(void) const; - VoxelType getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const; + std::uint16_t getSideLength(void) const; + VoxelType getVoxelAt(std::uint16_t uXPos, std::uint16_t uYPos, std::uint16_t uZPos) const; - void setVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos, VoxelType tValue); + void setVoxelAt(std::uint16_t uXPos, std::uint16_t uYPos, std::uint16_t uZPos, VoxelType tValue); void fill(VoxelType tValue); private: - boost::uint8_t m_uSideLengthPower; - boost::uint16_t m_uSideLength; + std::uint8_t m_uSideLengthPower; + std::uint16_t m_uSideLength; VoxelType* m_tData; }; } diff --git a/PolyVoxCore/include/Block.inl b/PolyVoxCore/include/Block.inl index 04269908..497d7c59 100644 --- a/PolyVoxCore/include/Block.inl +++ b/PolyVoxCore/include/Block.inl @@ -29,7 +29,7 @@ namespace PolyVox { #pragma region Constructors/Destructors template - Block::Block(boost::uint8_t uSideLengthPower) + Block::Block(std::uint8_t uSideLengthPower) :m_tData(0) { //Check the block size is sensible. This corresponds to a side length of 256 voxels @@ -76,13 +76,13 @@ namespace PolyVox #pragma region Getters template - boost::uint16_t Block::getSideLength(void) const + std::uint16_t Block::getSideLength(void) const { return m_uSideLength; } template - VoxelType Block::getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const + VoxelType Block::getVoxelAt(std::uint16_t uXPos, std::uint16_t uYPos, std::uint16_t uZPos) const { assert(uXPos < m_uSideLength); assert(uYPos < m_uSideLength); @@ -99,7 +99,7 @@ namespace PolyVox #pragma region Setters template - void Block::setVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos, VoxelType tValue) + void Block::setVoxelAt(std::uint16_t uXPos, std::uint16_t uYPos, std::uint16_t uZPos, VoxelType tValue) { assert(uXPos < m_uSideLength); assert(uYPos < m_uSideLength); diff --git a/PolyVoxCore/include/BlockVolume.h b/PolyVoxCore/include/BlockVolume.h index 6d494b08..a9cba7cf 100644 --- a/PolyVoxCore/include/BlockVolume.h +++ b/PolyVoxCore/include/BlockVolume.h @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma region Headers #include "PolyVoxForwardDeclarations.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #include #pragma endregion @@ -39,21 +39,21 @@ namespace PolyVox friend class BlockVolumeIterator; public: - BlockVolume(boost::uint8_t uSideLengthPower, boost::uint8_t uBlockSideLengthPower = 5); + BlockVolume(std::uint8_t uSideLengthPower, std::uint8_t uBlockSideLengthPower = 5); BlockVolume(const BlockVolume& rhs); ~BlockVolume(); BlockVolume& operator=(const BlockVolume& rhs); Region getEnclosingRegion(void) const; - boost::uint16_t getSideLength(void) const; - VoxelType getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const; + std::uint16_t getSideLength(void) const; + VoxelType getVoxelAt(std::uint16_t uXPos, std::uint16_t uYPos, std::uint16_t uZPos) const; VoxelType getVoxelAt(const Vector3DUint16& v3dPos) const; bool containsPoint(const Vector3DFloat& pos, float boundary) const; - bool containsPoint(const Vector3DInt32& pos, boost::uint16_t boundary) const; + bool containsPoint(const Vector3DInt32& pos, std::uint16_t boundary) const; BlockVolumeIterator firstVoxel(void); - void idle(boost::uint32_t uAmount); + void idle(std::uint32_t uAmount); BlockVolumeIterator lastVoxel(void); private: @@ -65,20 +65,20 @@ namespace PolyVox VoxelType* m_pHomogenousValue; mutable std::map*> m_pHomogenousBlocks; - boost::uint32_t m_uNoOfBlocksInVolume; - boost::uint16_t m_uSideLengthInBlocks; + std::uint32_t m_uNoOfBlocksInVolume; + std::uint16_t m_uSideLengthInBlocks; - boost::uint8_t m_uSideLengthPower; - boost::uint16_t m_uSideLength; + std::uint8_t m_uSideLengthPower; + std::uint16_t m_uSideLength; - boost::uint8_t m_uBlockSideLengthPower; - boost::uint16_t m_uBlockSideLength; + std::uint8_t m_uBlockSideLengthPower; + std::uint16_t m_uBlockSideLength; }; //Some handy typedefs typedef BlockVolume FloatBlockVolume; - typedef BlockVolume UInt8BlockVolume; - typedef BlockVolume UInt16BlockVolume; + typedef BlockVolume UInt8BlockVolume; + typedef BlockVolume UInt16BlockVolume; } #include "BlockVolume.inl" diff --git a/PolyVoxCore/include/BlockVolume.inl b/PolyVoxCore/include/BlockVolume.inl index c43d1920..8a6ed0c0 100644 --- a/PolyVoxCore/include/BlockVolume.inl +++ b/PolyVoxCore/include/BlockVolume.inl @@ -32,7 +32,7 @@ namespace PolyVox { #pragma region Constructors/Destructors template - BlockVolume::BlockVolume(boost::uint8_t uSideLengthPower, boost::uint8_t uBlockSideLengthPower) + BlockVolume::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(uBlockSideLengthPower); m_pIsShared[i] = true; @@ -78,7 +78,7 @@ namespace PolyVox template BlockVolume::~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 - boost::uint16_t BlockVolume::getSideLength(void) const + std::uint16_t BlockVolume::getSideLength(void) const { return m_uSideLength; } template - VoxelType BlockVolume::getVoxelAt(boost::uint16_t uXPos, boost::uint16_t uYPos, boost::uint16_t uZPos) const + VoxelType BlockVolume::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* block = m_pBlocks [ @@ -181,7 +181,7 @@ namespace PolyVox } template - bool BlockVolume::containsPoint(const Vector3DInt32& pos, boost::uint16_t boundary) const + bool BlockVolume::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 - void BlockVolume::idle(boost::uint32_t uAmount) + void BlockVolume::idle(std::uint32_t uAmount) { } diff --git a/PolyVoxCore/include/BlockVolumeIterator.h b/PolyVoxCore/include/BlockVolumeIterator.h index 5bbbb494..ef96a7e8 100644 --- a/PolyVoxCore/include/BlockVolumeIterator.h +++ b/PolyVoxCore/include/BlockVolumeIterator.h @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma region Headers #include "PolyVoxForwardDeclarations.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #pragma endregion namespace PolyVox @@ -43,17 +43,17 @@ namespace PolyVox bool operator<=(const BlockVolumeIterator& rhs); bool operator>=(const BlockVolumeIterator& rhs); - boost::uint16_t getPosX(void) const; - boost::uint16_t getPosY(void) const; - boost::uint16_t getPosZ(void) const; - VoxelType getSubSampledVoxel(boost::uint8_t uLevel) const; + std::uint16_t getPosX(void) const; + std::uint16_t getPosY(void) const; + std::uint16_t getPosZ(void) const; + VoxelType getSubSampledVoxel(std::uint8_t uLevel) const; const BlockVolume& getVolume(void) const; VoxelType getVoxel(void) const; void setPosition(const Vector3DInt16& v3dNewPos); - void setPosition(boost::uint16_t xPos, boost::uint16_t yPos, boost::uint16_t zPos); + void setPosition(std::uint16_t xPos, std::uint16_t yPos, std::uint16_t zPos); void setValidRegion(const Region& region); - void setValidRegion(boost::uint16_t xFirst, boost::uint16_t yFirst, boost::uint16_t zFirst, boost::uint16_t xLast, boost::uint16_t yLast, boost::uint16_t zLast); + void setValidRegion(std::uint16_t xFirst, std::uint16_t yFirst, std::uint16_t zFirst, std::uint16_t xLast, std::uint16_t yLast, std::uint16_t zLast); void setVoxel(VoxelType tValue); bool isValidForRegion(void) const; @@ -96,38 +96,38 @@ namespace PolyVox BlockVolume& mVolume; //The current position in the volume - boost::uint16_t mXPosInVolume; - boost::uint16_t mYPosInVolume; - boost::uint16_t mZPosInVolume; + std::uint16_t mXPosInVolume; + std::uint16_t mYPosInVolume; + std::uint16_t mZPosInVolume; //The position of the current block - boost::uint16_t mXBlock; - boost::uint16_t mYBlock; - boost::uint16_t mZBlock; + std::uint16_t mXBlock; + std::uint16_t mYBlock; + std::uint16_t mZBlock; //The offset into the current block - boost::uint16_t mXPosInBlock; - boost::uint16_t mYPosInBlock; - boost::uint16_t mZPosInBlock; + std::uint16_t mXPosInBlock; + std::uint16_t mYPosInBlock; + std::uint16_t mZPosInBlock; //Other current position information VoxelType* mCurrentVoxel; - boost::uint32_t mBlockIndexInVolume; - boost::uint32_t mVoxelIndexInBlock; + std::uint32_t mBlockIndexInVolume; + std::uint32_t mVoxelIndexInBlock; - boost::uint16_t mXRegionFirst; - boost::uint16_t mYRegionFirst; - boost::uint16_t mZRegionFirst; - boost::uint16_t mXRegionLast; - boost::uint16_t mYRegionLast; - boost::uint16_t mZRegionLast; + std::uint16_t mXRegionFirst; + std::uint16_t mYRegionFirst; + std::uint16_t mZRegionFirst; + std::uint16_t mXRegionLast; + std::uint16_t mYRegionLast; + std::uint16_t mZRegionLast; - boost::uint16_t mXRegionFirstBlock; - boost::uint16_t mYRegionFirstBlock; - boost::uint16_t mZRegionFirstBlock; - boost::uint16_t mXRegionLastBlock; - boost::uint16_t mYRegionLastBlock; - boost::uint16_t mZRegionLastBlock; + std::uint16_t mXRegionFirstBlock; + std::uint16_t mYRegionFirstBlock; + std::uint16_t mZRegionFirstBlock; + std::uint16_t mXRegionLastBlock; + std::uint16_t mYRegionLastBlock; + std::uint16_t mZRegionLastBlock; bool mIsValidForRegion; }; diff --git a/PolyVoxCore/include/BlockVolumeIterator.inl b/PolyVoxCore/include/BlockVolumeIterator.inl index 37789a7f..1d8fd9bf 100644 --- a/PolyVoxCore/include/BlockVolumeIterator.inl +++ b/PolyVoxCore/include/BlockVolumeIterator.inl @@ -105,25 +105,25 @@ namespace PolyVox #pragma region Getters template - boost::uint16_t BlockVolumeIterator::getPosX(void) const + std::uint16_t BlockVolumeIterator::getPosX(void) const { return mXPosInVolume; } template - boost::uint16_t BlockVolumeIterator::getPosY(void) const + std::uint16_t BlockVolumeIterator::getPosY(void) const { return mYPosInVolume; } template - boost::uint16_t BlockVolumeIterator::getPosZ(void) const + std::uint16_t BlockVolumeIterator::getPosZ(void) const { return mZPosInVolume; } template - VoxelType BlockVolumeIterator::getSubSampledVoxel(boost::uint8_t uLevel) const + VoxelType BlockVolumeIterator::getSubSampledVoxel(std::uint8_t uLevel) const { if(uLevel == 0) { @@ -143,14 +143,14 @@ namespace PolyVox } else { - const boost::uint8_t uSize = 1 << uLevel; + const std::uint8_t uSize = 1 << uLevel; VoxelType tValue = 0; - for(boost::uint8_t z = 0; z < uSize; ++z) + for(std::uint8_t z = 0; z < uSize; ++z) { - for(boost::uint8_t y = 0; y < uSize; ++y) + for(std::uint8_t y = 0; y < uSize; ++y) { - for(boost::uint8_t x = 0; x < uSize; ++x) + for(std::uint8_t x = 0; x < uSize; ++x) { tValue = (std::max)(tValue, mVolume.getVoxelAt(mXPosInVolume + x, mYPosInVolume + y, mZPosInVolume + z)); } @@ -181,7 +181,7 @@ namespace PolyVox } template - void BlockVolumeIterator::setPosition(boost::uint16_t xPos, boost::uint16_t yPos, boost::uint16_t zPos) + void BlockVolumeIterator::setPosition(std::uint16_t xPos, std::uint16_t yPos, std::uint16_t zPos) { mXPosInVolume = xPos; mYPosInVolume = yPos; @@ -214,7 +214,7 @@ namespace PolyVox } template - void BlockVolumeIterator::setValidRegion(boost::uint16_t xFirst, boost::uint16_t yFirst, boost::uint16_t zFirst, boost::uint16_t xLast, boost::uint16_t yLast, boost::uint16_t zLast) + void BlockVolumeIterator::setValidRegion(std::uint16_t xFirst, std::uint16_t yFirst, std::uint16_t zFirst, std::uint16_t xLast, std::uint16_t yLast, std::uint16_t zLast) { mXRegionFirst = xFirst; mYRegionFirst = yFirst; @@ -236,7 +236,7 @@ namespace PolyVox template void BlockVolumeIterator::setVoxel(VoxelType tValue) { - const boost::uint32_t uBlockIndex = + const std::uint32_t uBlockIndex = mXBlock + mYBlock * mVolume.m_uSideLengthInBlocks + mZBlock * mVolume.m_uSideLengthInBlocks * mVolume.m_uSideLengthInBlocks; diff --git a/PolyVoxCore/include/Constants.h b/PolyVoxCore/include/Constants.h index a9ae13f5..a4c9fa6a 100644 --- a/PolyVoxCore/include/Constants.h +++ b/PolyVoxCore/include/Constants.h @@ -22,24 +22,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __PolyVox_Constants_H__ #define __PolyVox_Constants_H__ -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" namespace PolyVox { //FIXME - i think we can define mod using a bitmask which flattens the upper bits. Should define that here. - //const boost::uint32_t POLYVOX_BLOCK_SIDE_LENGTH_POWER = 5; - //const boost::uint32_t POLYVOX_BLOCK_SIDE_LENGTH = (0x0001 << POLYVOX_BLOCK_SIDE_LENGTH_POWER); - //const boost::uint32_t POLYVOX_NO_OF_VOXELS_IN_BLOCK = (POLYVOX_BLOCK_SIDE_LENGTH * POLYVOX_BLOCK_SIDE_LENGTH * POLYVOX_BLOCK_SIDE_LENGTH); + //const std::uint32_t POLYVOX_BLOCK_SIDE_LENGTH_POWER = 5; + //const std::uint32_t POLYVOX_BLOCK_SIDE_LENGTH = (0x0001 << POLYVOX_BLOCK_SIDE_LENGTH_POWER); + //const std::uint32_t POLYVOX_NO_OF_VOXELS_IN_BLOCK = (POLYVOX_BLOCK_SIDE_LENGTH * POLYVOX_BLOCK_SIDE_LENGTH * POLYVOX_BLOCK_SIDE_LENGTH); - const boost::uint16_t POLYVOX_VOLUME_SIDE_LENGTH_POWER = 8; - const boost::uint16_t POLYVOX_VOLUME_SIDE_LENGTH = (0x0001 << POLYVOX_VOLUME_SIDE_LENGTH_POWER); - //const boost::uint32_t POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS = (POLYVOX_VOLUME_SIDE_LENGTH >> POLYVOX_BLOCK_SIDE_LENGTH_POWER); - //const boost::uint32_t POLYVOX_NO_OF_BLOCKS_IN_VOLUME = (POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS * POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS * POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS); - //const boost::uint32_t POLYVOX_NO_OF_VOXELS_IN_VOLUME = (POLYVOX_VOLUME_SIDE_LENGTH * POLYVOX_VOLUME_SIDE_LENGTH * POLYVOX_VOLUME_SIDE_LENGTH); + const std::uint16_t POLYVOX_VOLUME_SIDE_LENGTH_POWER = 8; + const std::uint16_t POLYVOX_VOLUME_SIDE_LENGTH = (0x0001 << POLYVOX_VOLUME_SIDE_LENGTH_POWER); + //const std::uint32_t POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS = (POLYVOX_VOLUME_SIDE_LENGTH >> POLYVOX_BLOCK_SIDE_LENGTH_POWER); + //const std::uint32_t POLYVOX_NO_OF_BLOCKS_IN_VOLUME = (POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS * POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS * POLYVOX_VOLUME_SIDE_LENGTH_IN_BLOCKS); + //const std::uint32_t POLYVOX_NO_OF_VOXELS_IN_VOLUME = (POLYVOX_VOLUME_SIDE_LENGTH * POLYVOX_VOLUME_SIDE_LENGTH * POLYVOX_VOLUME_SIDE_LENGTH); - const boost::uint16_t POLYVOX_REGION_SIDE_LENGTH_POWER = 4; - const boost::uint16_t POLYVOX_REGION_SIDE_LENGTH = (0x0001 << POLYVOX_REGION_SIDE_LENGTH_POWER); - const boost::uint16_t POLYVOX_VOLUME_SIDE_LENGTH_IN_REGIONS = (POLYVOX_VOLUME_SIDE_LENGTH >> POLYVOX_REGION_SIDE_LENGTH_POWER); + const std::uint16_t POLYVOX_REGION_SIDE_LENGTH_POWER = 4; + const std::uint16_t POLYVOX_REGION_SIDE_LENGTH = (0x0001 << POLYVOX_REGION_SIDE_LENGTH_POWER); + const std::uint16_t POLYVOX_VOLUME_SIDE_LENGTH_IN_REGIONS = (POLYVOX_VOLUME_SIDE_LENGTH >> POLYVOX_REGION_SIDE_LENGTH_POWER); } #endif diff --git a/PolyVoxCore/include/GradientEstimators.h b/PolyVoxCore/include/GradientEstimators.h index cd4efa1b..bbd23502 100644 --- a/PolyVoxCore/include/GradientEstimators.h +++ b/PolyVoxCore/include/GradientEstimators.h @@ -40,8 +40,8 @@ namespace PolyVox template Vector3DFloat computeSobelGradient(const BlockVolumeIterator& volIter); - POLYVOX_API void computeNormalsForVertices(BlockVolume* volumeData, RegionGeometry& regGeom, NormalGenerationMethod normalGenerationMethod); - POLYVOX_API Vector3DFloat computeNormal(BlockVolume* volumeData, const Vector3DFloat& position, NormalGenerationMethod normalGenerationMethod); + POLYVOX_API void computeNormalsForVertices(BlockVolume* volumeData, RegionGeometry& regGeom, NormalGenerationMethod normalGenerationMethod); + POLYVOX_API Vector3DFloat computeNormal(BlockVolume* volumeData, const Vector3DFloat& position, NormalGenerationMethod normalGenerationMethod); } #include "GradientEstimators.inl" diff --git a/PolyVoxCore/include/GradientEstimators.inl b/PolyVoxCore/include/GradientEstimators.inl index dbe529c9..a568c491 100644 --- a/PolyVoxCore/include/GradientEstimators.inl +++ b/PolyVoxCore/include/GradientEstimators.inl @@ -72,9 +72,9 @@ namespace PolyVox template Vector3DFloat computeSmoothCentralDifferenceGradient(BlockVolumeIterator& volIter) { - boost::uint16_t initialX = volIter.getPosX(); - boost::uint16_t initialY = volIter.getPosY(); - boost::uint16_t initialZ = volIter.getPosZ(); + std::uint16_t initialX = volIter.getPosX(); + std::uint16_t initialY = volIter.getPosY(); + std::uint16_t initialZ = volIter.getPosZ(); //FIXME - bitwise way of doing this? volIter.setPosition(initialX-1, initialY, initialZ); diff --git a/PolyVoxCore/include/IndexedSurfacePatch.h b/PolyVoxCore/include/IndexedSurfacePatch.h index eeb8ac69..42fb0e91 100644 --- a/PolyVoxCore/include/IndexedSurfacePatch.h +++ b/PolyVoxCore/include/IndexedSurfacePatch.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #include "Constants.h" #include "PolyVoxForwardDeclarations.h" @@ -40,29 +40,29 @@ namespace PolyVox ~IndexedSurfacePatch(); void addTriangle(const SurfaceVertex& v0,const SurfaceVertex& v1,const SurfaceVertex& v2); - void fillVertexAndIndexData(std::vector& vecVertices, std::vector& vecIndices); + void fillVertexAndIndexData(std::vector& vecVertices, std::vector& vecIndices); const std::vector& getVertices(void) const; std::vector& getVertices(void); //FIXME - non const version should be removed. - const std::vector& getIndices(void) const; + const std::vector& getIndices(void) const; unsigned short getNoNonUniformTrianges(void); unsigned short getNoUniformTrianges(void); public: - std::vector m_vecTriangleIndices; + std::vector m_vecTriangleIndices; std::vector m_vecVertices; - static boost::int32_t vertexIndicesX[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; - static boost::int32_t vertexIndicesY[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; - static boost::int32_t vertexIndicesZ[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; + static std::int32_t vertexIndicesX[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; + static std::int32_t vertexIndicesY[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; + static std::int32_t vertexIndicesZ[POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1][POLYVOX_REGION_SIDE_LENGTH+1]; - static boost::int32_t noOfVerticesSubmitted; - static boost::int32_t noOfVerticesAccepted; - static boost::int32_t noOfTrianglesSubmitted; + static std::int32_t noOfVerticesSubmitted; + static std::int32_t noOfVerticesAccepted; + static std::int32_t noOfTrianglesSubmitted; - boost::int32_t getIndexFor(const Vector3DFloat& pos); - void setIndexFor(const Vector3DFloat& pos, boost::int32_t newIndex); + std::int32_t getIndexFor(const Vector3DFloat& pos); + void setIndexFor(const Vector3DFloat& pos, std::int32_t newIndex); public: bool m_AllowDuplicateVertices; diff --git a/PolyVoxCore/include/LinearVolume.h b/PolyVoxCore/include/LinearVolume.h index 2509ac69..aed86502 100644 --- a/PolyVoxCore/include/LinearVolume.h +++ b/PolyVoxCore/include/LinearVolume.h @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxForwardDeclarations.h" #include "TypeDef.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #pragma endregion namespace PolyVox @@ -36,7 +36,7 @@ namespace PolyVox class LinearVolume { public: - LinearVolume(boost::uint8_t uSideLengthPower); + LinearVolume(std::uint8_t uSideLengthPower); LinearVolume(const LinearVolume& rhs); ~LinearVolume(); @@ -44,17 +44,17 @@ namespace PolyVox //bool isHomogeneous(void); - boost::uint16_t getSideLength(void); + std::uint16_t getSideLength(void); - VoxelType getVoxelAt(const boost::uint16_t xPosition, const boost::uint16_t yPosition, const boost::uint16_t zPosition) const; - void setVoxelAt(const boost::uint16_t xPosition, const boost::uint16_t yPosition, const boost::uint16_t zPosition, const VoxelType value); + VoxelType getVoxelAt(const std::uint16_t xPosition, const std::uint16_t yPosition, const std::uint16_t zPosition) const; + void setVoxelAt(const std::uint16_t xPosition, const std::uint16_t yPosition, const std::uint16_t zPosition, const VoxelType value); //void fillWithValue(const VoxelType value); private: - boost::uint32_t getNoOfVoxels(void); - boost::uint8_t m_uSideLengthPower; - boost::uint16_t m_uSideLength; + std::uint32_t getNoOfVoxels(void); + std::uint8_t m_uSideLengthPower; + std::uint16_t m_uSideLength; VoxelType* m_tData; }; } diff --git a/PolyVoxCore/include/LinearVolume.inl b/PolyVoxCore/include/LinearVolume.inl index 80537c09..5a0706c9 100644 --- a/PolyVoxCore/include/LinearVolume.inl +++ b/PolyVoxCore/include/LinearVolume.inl @@ -25,7 +25,7 @@ namespace PolyVox { template - LinearVolume::LinearVolume(boost::uint8_t uSideLengthPower) + LinearVolume::LinearVolume(std::uint8_t uSideLengthPower) :m_tData(0) { //Check the block size is sensible. This corresponds to a side length of 256 voxels @@ -67,7 +67,7 @@ namespace PolyVox } template - VoxelType LinearVolume::getVoxelAt(const boost::uint16_t xPosition, const boost::uint16_t yPosition, const boost::uint16_t zPosition) const + VoxelType LinearVolume::getVoxelAt(const std::uint16_t xPosition, const std::uint16_t yPosition, const std::uint16_t zPosition) const { return m_tData [ @@ -78,7 +78,7 @@ namespace PolyVox } template - void LinearVolume::setVoxelAt(const boost::uint16_t xPosition, const boost::uint16_t yPosition, const boost::uint16_t zPosition, const VoxelType value) + void LinearVolume::setVoxelAt(const std::uint16_t xPosition, const std::uint16_t yPosition, const std::uint16_t zPosition, const VoxelType value) { m_tData [ @@ -89,13 +89,13 @@ namespace PolyVox } template - boost::uint16_t LinearVolume::getSideLength(void) + std::uint16_t LinearVolume::getSideLength(void) { return m_uSideLength; } template - boost::uint32_t LinearVolume::getNoOfVoxels(void) + std::uint32_t LinearVolume::getNoOfVoxels(void) { return m_uSideLength * m_uSideLength * m_uSideLength; } diff --git a/PolyVoxCore/include/PolyVoxCStdInt.h b/PolyVoxCore/include/PolyVoxCStdInt.h new file mode 100644 index 00000000..f3b79d4a --- /dev/null +++ b/PolyVoxCore/include/PolyVoxCStdInt.h @@ -0,0 +1,37 @@ +#pragma region License +/****************************************************************************** +This file is part of the PolyVox library +Copyright (C) 2006 David Williams + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +******************************************************************************/ +#pragma endregion + +#ifndef __PolyVox_CStdInt_H__ +#define __PolyVox_CStdInt_H__ + +//Adding things to the std namespace in not actually allowed, but Microsoft +//have still not added to thier standard library. +namespace std +{ + typedef char int8_t; + typedef short int16_t; + typedef long int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned long uint32_t; +} + +#endif \ No newline at end of file diff --git a/PolyVoxCore/include/PolyVoxForwardDeclarations.h b/PolyVoxCore/include/PolyVoxForwardDeclarations.h index 4ddf88f6..2f2b06dc 100644 --- a/PolyVoxCore/include/PolyVoxForwardDeclarations.h +++ b/PolyVoxCore/include/PolyVoxForwardDeclarations.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "Enums.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" namespace PolyVox { @@ -33,8 +33,8 @@ namespace PolyVox //---------- BlockVolume ---------- template class BlockVolume; typedef BlockVolume FloatBlockVolume; - typedef BlockVolume UInt8BlockVolume; - typedef BlockVolume UInt16BlockVolume; + typedef BlockVolume UInt8BlockVolume; + typedef BlockVolume UInt16BlockVolume; //--------------------------------- class IndexedSurfacePatch; @@ -45,15 +45,15 @@ namespace PolyVox class SurfaceVertex; //---------- Vector ---------- - template class Vector; + template class Vector; typedef Vector<3,float> Vector3DFloat; typedef Vector<3,double> Vector3DDouble; - typedef Vector<3,boost::int8_t> Vector3DInt8; - typedef Vector<3,boost::uint8_t> Vector3DUint8; - typedef Vector<3,boost::int16_t> Vector3DInt16; - typedef Vector<3,boost::uint16_t> Vector3DUint16; - typedef Vector<3,boost::int32_t> Vector3DInt32; - typedef Vector<3,boost::uint32_t> Vector3DUint32; + typedef Vector<3,std::int8_t> Vector3DInt8; + typedef Vector<3,std::uint8_t> Vector3DUint8; + typedef Vector<3,std::int16_t> Vector3DInt16; + typedef Vector<3,std::uint16_t> Vector3DUint16; + typedef Vector<3,std::int32_t> Vector3DInt32; + typedef Vector<3,std::uint32_t> Vector3DUint32; //---------------------------- class VolumeChangeTracker; diff --git a/PolyVoxCore/include/Region.h b/PolyVoxCore/include/Region.h index c488ddde..225d8a2c 100644 --- a/PolyVoxCore/include/Region.h +++ b/PolyVoxCore/include/Region.h @@ -42,7 +42,7 @@ namespace PolyVox void setUpperCorner(const Vector3DInt32& v3dUpperCorner); bool containsPoint(const Vector3DFloat& pos, float boundary) const; - bool containsPoint(const Vector3DInt32& pos, boost::uint8_t boundary) const; + bool containsPoint(const Vector3DInt32& pos, std::uint8_t boundary) const; void cropTo(const Region& other); void shift(const Vector3DInt32& amount); diff --git a/PolyVoxCore/include/SurfaceAdjusters.h b/PolyVoxCore/include/SurfaceAdjusters.h index dc96a564..e791af95 100644 --- a/PolyVoxCore/include/SurfaceAdjusters.h +++ b/PolyVoxCore/include/SurfaceAdjusters.h @@ -27,12 +27,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxForwardDeclarations.h" #include "TypeDef.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #pragma endregion namespace PolyVox { - POLYVOX_API void smoothRegionGeometry(BlockVolume* volumeData, RegionGeometry& regGeom); + POLYVOX_API void smoothRegionGeometry(BlockVolume* volumeData, RegionGeometry& regGeom); } #endif \ No newline at end of file diff --git a/PolyVoxCore/include/SurfaceExtractors.h b/PolyVoxCore/include/SurfaceExtractors.h index 18ae76fb..748ad877 100644 --- a/PolyVoxCore/include/SurfaceExtractors.h +++ b/PolyVoxCore/include/SurfaceExtractors.h @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxForwardDeclarations.h" #include "TypeDef.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #include #pragma endregion @@ -36,15 +36,15 @@ namespace PolyVox { POLYVOX_API std::list getChangedRegionGeometry(VolumeChangeTracker& volume); - boost::uint32_t getIndex(boost::uint32_t x, boost::uint32_t y); + std::uint32_t getIndex(std::uint32_t x, std::uint32_t y); - POLYVOX_API void generateRoughMeshDataForRegion(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); - POLYVOX_API boost::uint32_t computeInitialRoughBitmaskForSlice(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, boost::uint8_t *bitmask); - POLYVOX_API boost::uint32_t computeRoughBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, boost::uint8_t *bitmask, boost::uint8_t *previousBitmask); - POLYVOX_API void generateRoughIndicesForSlice(BlockVolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, boost::uint8_t* bitmask0, boost::uint8_t* bitmask1, boost::int32_t vertexIndicesX0[],boost::int32_t vertexIndicesY0[],boost::int32_t vertexIndicesZ0[], boost::int32_t vertexIndicesX1[],boost::int32_t vertexIndicesY1[],boost::int32_t vertexIndicesZ1[]); - POLYVOX_API void generateRoughVerticesForSlice(BlockVolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, boost::uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,boost::int32_t vertexIndicesX[],boost::int32_t vertexIndicesY[],boost::int32_t vertexIndicesZ[]); + POLYVOX_API void generateRoughMeshDataForRegion(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); + POLYVOX_API std::uint32_t computeInitialRoughBitmaskForSlice(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, std::uint8_t *bitmask); + POLYVOX_API std::uint32_t computeRoughBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, std::uint8_t *bitmask, std::uint8_t *previousBitmask); + POLYVOX_API void generateRoughIndicesForSlice(BlockVolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, std::uint8_t* bitmask0, std::uint8_t* bitmask1, std::int32_t vertexIndicesX0[],std::int32_t vertexIndicesY0[],std::int32_t vertexIndicesZ0[], std::int32_t vertexIndicesX1[],std::int32_t vertexIndicesY1[],std::int32_t vertexIndicesZ1[]); + POLYVOX_API void generateRoughVerticesForSlice(BlockVolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, std::uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,std::int32_t vertexIndicesX[],std::int32_t vertexIndicesY[],std::int32_t vertexIndicesZ[]); - POLYVOX_API void generateReferenceMeshDataForRegion(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); + POLYVOX_API void generateReferenceMeshDataForRegion(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); } #endif diff --git a/PolyVoxCore/include/SurfaceExtractorsDecimated.h b/PolyVoxCore/include/SurfaceExtractorsDecimated.h index c2d19f8d..36bd8634 100644 --- a/PolyVoxCore/include/SurfaceExtractorsDecimated.h +++ b/PolyVoxCore/include/SurfaceExtractorsDecimated.h @@ -27,24 +27,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxForwardDeclarations.h" #include "TypeDef.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #include #pragma endregion namespace PolyVox { - boost::uint32_t getDecimatedIndex(boost::uint32_t x, boost::uint32_t y); + std::uint32_t getDecimatedIndex(std::uint32_t x, std::uint32_t y); - POLYVOX_API void generateDecimatedMeshDataForRegion(BlockVolume* volumeData, boost::uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); - POLYVOX_API boost::uint32_t computeInitialDecimatedBitmaskForSlice(BlockVolumeIterator& volIter, boost::uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, boost::uint8_t *bitmask); - POLYVOX_API boost::uint32_t computeDecimatedBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, boost::uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, boost::uint8_t *bitmask, boost::uint8_t *previousBitmask); - POLYVOX_API void generateDecimatedIndicesForSlice(BlockVolumeIterator& volIter, boost::uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, boost::uint8_t* bitmask0, boost::uint8_t* bitmask1, boost::int32_t vertexIndicesX0[],boost::int32_t vertexIndicesY0[],boost::int32_t vertexIndicesZ0[], boost::int32_t vertexIndicesX1[],boost::int32_t vertexIndicesY1[],boost::int32_t vertexIndicesZ1[]); - POLYVOX_API void generateDecimatedVerticesForSlice(BlockVolumeIterator& volIter, boost::uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, boost::uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,boost::int32_t vertexIndicesX[],boost::int32_t vertexIndicesY[],boost::int32_t vertexIndicesZ[]); + POLYVOX_API void generateDecimatedMeshDataForRegion(BlockVolume* volumeData, std::uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); + POLYVOX_API std::uint32_t computeInitialDecimatedBitmaskForSlice(BlockVolumeIterator& volIter, std::uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, std::uint8_t *bitmask); + POLYVOX_API std::uint32_t computeDecimatedBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, std::uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, std::uint8_t *bitmask, std::uint8_t *previousBitmask); + POLYVOX_API void generateDecimatedIndicesForSlice(BlockVolumeIterator& volIter, std::uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, std::uint8_t* bitmask0, std::uint8_t* bitmask1, std::int32_t vertexIndicesX0[],std::int32_t vertexIndicesY0[],std::int32_t vertexIndicesZ0[], std::int32_t vertexIndicesX1[],std::int32_t vertexIndicesY1[],std::int32_t vertexIndicesZ1[]); + POLYVOX_API void generateDecimatedVerticesForSlice(BlockVolumeIterator& volIter, std::uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, std::uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,std::int32_t vertexIndicesX[],std::int32_t vertexIndicesY[],std::int32_t vertexIndicesZ[]); - POLYVOX_API void generateDecimatedMeshDataForRegionSlow(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); + POLYVOX_API void generateDecimatedMeshDataForRegionSlow(BlockVolume* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); - POLYVOX_API Vector3DFloat computeDecimatedNormal(BlockVolume* volumeData, const Vector3DFloat& position, NormalGenerationMethod normalGenerationMethod); + POLYVOX_API Vector3DFloat computeDecimatedNormal(BlockVolume* volumeData, const Vector3DFloat& position, NormalGenerationMethod normalGenerationMethod); } #endif diff --git a/PolyVoxCore/include/Utility.h b/PolyVoxCore/include/Utility.h index 8b9f4399..7971d575 100644 --- a/PolyVoxCore/include/Utility.h +++ b/PolyVoxCore/include/Utility.h @@ -24,12 +24,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "TypeDef.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" namespace PolyVox { - POLYVOX_API boost::uint8_t logBase2(boost::uint32_t uInput); - POLYVOX_API bool isPowerOf2(boost::uint32_t uInput); + POLYVOX_API std::uint8_t logBase2(std::uint32_t uInput); + POLYVOX_API bool isPowerOf2(std::uint32_t uInput); template Type trilinearlyInterpolate( diff --git a/PolyVoxCore/include/Vector.h b/PolyVoxCore/include/Vector.h index 8a90c2e5..9d9fdfe5 100644 --- a/PolyVoxCore/include/Vector.h +++ b/PolyVoxCore/include/Vector.h @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define __PolyVox_Vector_H__ #pragma region Headers -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #include #pragma endregion @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { ///Represents a vector in space. - template + template class Vector { public: @@ -66,7 +66,7 @@ namespace PolyVox Vector& operator/=(const Type& rhs) throw(); ///Element Access - Type getElement(boost::uint32_t index) const throw(); + Type getElement(std::uint32_t index) const throw(); ///Get the x component of the vector. Type getX(void) const throw(); ///Get the y component of the vector. @@ -77,7 +77,7 @@ namespace PolyVox Type getW(void) const throw(); ///Element Access - void setElement(boost::uint32_t index, Type tValue) throw(); + void setElement(std::uint32_t index, Type tValue) throw(); ///Set the x component of the vector. void setX(Type tX) throw(); ///Set the y component of the vector. @@ -107,19 +107,19 @@ namespace PolyVox //Non-member overloaded operators. ///Addition operator. - template + template Vector operator+(const Vector& lhs, const Vector& rhs) throw(); ///Subtraction operator. - template + template Vector operator-(const Vector& lhs, const Vector& rhs) throw(); ///Multiplication operator. - template + template Vector operator*(const Vector& lhs, const Type& rhs) throw(); ///Division operator. - template + template Vector operator/(const Vector& lhs, const Type& rhs) throw(); ///Stream insertion operator. - template + template std::ostream& operator<<(std::ostream& os, const Vector& vector) throw(); //Some handy typedefs @@ -128,17 +128,17 @@ namespace PolyVox ///A 3D Vector of doubles. typedef Vector<3,double> Vector3DDouble; ///A 3D Vector of signed 8-bit values. - typedef Vector<3,boost::int8_t> Vector3DInt8; + typedef Vector<3,std::int8_t> Vector3DInt8; ///A 3D Vector of unsigned 8-bit values. - typedef Vector<3,boost::uint8_t> Vector3DUint8; + typedef Vector<3,std::uint8_t> Vector3DUint8; ///A 3D Vector of signed 16-bit values. - typedef Vector<3,boost::int16_t> Vector3DInt16; + typedef Vector<3,std::int16_t> Vector3DInt16; ///A 3D Vector of unsigned 16-bit values. - typedef Vector<3,boost::uint16_t> Vector3DUint16; + typedef Vector<3,std::uint16_t> Vector3DUint16; ///A 3D Vector of signed 32-bit values. - typedef Vector<3,boost::int32_t> Vector3DInt32; + typedef Vector<3,std::int32_t> Vector3DInt32; ///A 3D Vector of unsigned 32-bit values. - typedef Vector<3,boost::uint32_t> Vector3DUint32; + typedef Vector<3,std::uint32_t> Vector3DUint32; diff --git a/PolyVoxCore/include/Vector.inl b/PolyVoxCore/include/Vector.inl index 5a6366dd..f3ee7dff 100644 --- a/PolyVoxCore/include/Vector.inl +++ b/PolyVoxCore/include/Vector.inl @@ -39,10 +39,10 @@ namespace PolyVox A variety of overloaded operators are also provided for comparison and arithmetic operations. For most of these arithmetic operators only the unary versions are - documented below - however often binary versions are also generated by boost::operators. + documented below - however often binary versions are also generated by std::operators. Lastly, note that for convienience a set of typedefs are included for 2 and 3 dimentionsal - vectors with type float, double, boost::int32_t, and boost::uint32_t. They are used as follows: + vectors with type float, double, std::int32_t, and std::uint32_t. They are used as follows: Vector2DInt4 test(1,2); //Declares a 2 dimensional Vector of type int4. */ @@ -54,7 +54,7 @@ namespace PolyVox \param x x component to set. \param y y component to set. */ - template + template Vector::Vector(Type x, Type y) throw() { m_tElements[0] = x; @@ -68,7 +68,7 @@ namespace PolyVox \param y y component to set. \param z z component to set. */ - template + template Vector::Vector(Type x, Type y, Type z) throw() { m_tElements[0] = x; @@ -84,7 +84,7 @@ namespace PolyVox \param z z component to set. \param w w component to set. */ - template + template Vector::Vector(Type x, Type y, Type z, Type w) throw() { m_tElements[0] = x; @@ -96,7 +96,7 @@ namespace PolyVox /** Creates a Vector object but does not initialise it. */ - template + template Vector::Vector(void) throw() { } @@ -105,7 +105,7 @@ namespace PolyVox Copy constructor builds object based on object passed as parameter. \param vector A reference to the Vector to be copied. */ - template + template Vector::Vector(const Vector& vector) throw() { std::memcpy(m_tElements, vector.m_tElements, sizeof(Type) * Size); @@ -120,11 +120,11 @@ namespace PolyVox \param vector A reference to the Vector to be copied. */ - template + template template Vector::Vector(const Vector& vector) throw() { - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { m_tElements[ct] = static_cast(vector.getElement(ct)); } @@ -133,7 +133,7 @@ namespace PolyVox /** Destroys the Vector. */ - template + template Vector::~Vector(void) throw() { } @@ -145,7 +145,7 @@ namespace PolyVox \param rhs Vector to assign to. \return A reference to the result to allow chaining. */ - template + template Vector& Vector::operator=(const Vector& rhs) throw() { if(this == &rhs) @@ -162,11 +162,11 @@ namespace PolyVox \return true if the Vectors match. \see operator!= */ - template + template inline bool Vector::operator==(const Vector &rhs) const throw() { bool equal = true; - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { if(m_tElements[ct] != rhs(ct)) { @@ -184,7 +184,7 @@ namespace PolyVox \return true if this is less than the parameter \see operator!= */ - template + template inline bool Vector::operator<(const Vector &rhs) const throw() { for(int ct = 0; ct < Size; ++ct) @@ -202,10 +202,10 @@ namespace PolyVox \param rhs Vector to add \return The resulting Vector. */ - template + template inline Vector& Vector::operator+=(const Vector& rhs) throw() { - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { m_tElements[ct] += rhs.m_tElements[ct]; } @@ -218,7 +218,7 @@ namespace PolyVox \param rhs Vector to add. \return The resulting Vector. */ - template + template Vector operator+(const Vector& lhs, const Vector& rhs) throw() { Vector result = lhs; @@ -231,10 +231,10 @@ namespace PolyVox \param rhs Vector to subtract \return The resulting Vector. */ - template + template inline Vector& Vector::operator-=(const Vector& rhs) throw() { - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { m_tElements[ct] -= rhs.m_tElements[ct]; } @@ -247,7 +247,7 @@ namespace PolyVox \param rhs Vector to subtract. \return The resulting Vector. */ - template + template Vector operator-(const Vector& lhs, const Vector& rhs) throw() { Vector result = lhs; @@ -260,10 +260,10 @@ namespace PolyVox \param rhs the number the Vector is multiplied by. \return The resulting Vector. */ - template + template inline Vector& Vector::operator*=(const Type& rhs) throw() { - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { m_tElements[ct] *= rhs; } @@ -276,7 +276,7 @@ namespace PolyVox \param rhs the number the Vector is multiplied by. \return The resulting Vector. */ - template + template Vector operator*(const Vector& lhs, const Type& rhs) throw() { Vector result = lhs; @@ -289,10 +289,10 @@ namespace PolyVox \param rhs the number the Vector is divided by. \return The resulting Vector. */ - template + template inline Vector& Vector::operator/=(const Type& rhs) throw() { - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { m_tElements[ct] /= rhs; } @@ -305,7 +305,7 @@ namespace PolyVox \param rhs the number the Vector is divided by. \return The resulting Vector. */ - template + template Vector operator/(const Vector& lhs, const Type& rhs) throw() { Vector result = lhs; @@ -319,11 +319,11 @@ namespace PolyVox \param vector The Vector to write to the stream. \return A reference to the output stream to allow chaining. */ - template + template std::ostream& operator<<(std::ostream& os, const Vector& vector) throw() { os << "("; - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { os << vector.getElement(ct); if(ct < (Size-1)) @@ -342,8 +342,8 @@ namespace PolyVox \param index The index of the element to return. \return The element. */ - template - inline Type Vector::getElement(boost::uint32_t index) const throw() + template + inline Type Vector::getElement(std::uint32_t index) const throw() { return m_tElements[index]; } @@ -351,7 +351,7 @@ namespace PolyVox /** \return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector. */ - template + template inline Type Vector::getX(void) const throw() { return m_tElements[0]; @@ -360,7 +360,7 @@ namespace PolyVox /** \return A const reference to the Y component of a 2, 3, or 4 dimensional Vector. */ - template + template inline Type Vector::getY(void) const throw() { return m_tElements[1]; @@ -369,7 +369,7 @@ namespace PolyVox /** \return A const reference to the Z component of a 3 or 4 dimensional Vector. */ - template + template inline Type Vector::getZ(void) const throw() { return m_tElements[2]; @@ -378,7 +378,7 @@ namespace PolyVox /** \return A const reference to the W component of a 4 dimensional Vector. */ - template + template inline Type Vector::getW(void) const throw() { return m_tElements[3]; @@ -390,8 +390,8 @@ namespace PolyVox \param index The index of the element to set. \param tValue The new value for the element. */ - template - inline void Vector::setElement(boost::uint32_t index, Type tValue) throw() + template + inline void Vector::setElement(std::uint32_t index, Type tValue) throw() { m_tElements[index] = tValue; } @@ -399,7 +399,7 @@ namespace PolyVox /** \param tX The new value for the X component of a 1, 2, 3, or 4 dimensional Vector. */ - template + template inline void Vector::setX(Type tX) throw() { m_tElements[0] = tX; @@ -408,7 +408,7 @@ namespace PolyVox /** \param tX The new value for the Y component of a 2, 3, or 4 dimensional Vector. */ - template + template inline void Vector::setY(Type tY) throw() { m_tElements[1] = tY; @@ -417,7 +417,7 @@ namespace PolyVox /** \param tX The new value for the Z component of a 3 or 4 dimensional Vector. */ - template + template inline void Vector::setZ(Type tZ) throw() { m_tElements[2] = tZ; @@ -426,7 +426,7 @@ namespace PolyVox /** \param tX The new value for the W component of a 4 dimensional Vector. */ - template + template inline void Vector::setW(Type tW) throw() { m_tElements[3] = tW; @@ -438,7 +438,7 @@ namespace PolyVox NOTE: This function does not make much sense on integer Vectors. \return Length of the Vector. */ - template + template inline double Vector::length(void) const throw() { return sqrt(lengthSquared()); @@ -447,11 +447,11 @@ namespace PolyVox /** \return Squared length of the Vector. */ - template + template inline double Vector::lengthSquared(void) const throw() { double result = 0.0f; - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { result += m_tElements[ct] * m_tElements[ct]; } @@ -467,7 +467,7 @@ namespace PolyVox \param Vector3D The Vector to find the angle to. \return The angle between them in radians. */ - template + template inline double Vector::angleTo(const Vector& vector) const throw() { return acos(dot(vector) / (vector.length() * this->length())); @@ -486,7 +486,7 @@ namespace PolyVox \return The value of the cross product. \see dot() */ - template + template inline Vector Vector::cross(const Vector& vector) const throw() { Type i = vector.getZ() * this->getY() - vector.getY() * this->getZ(); @@ -502,11 +502,11 @@ namespace PolyVox \return The value of the dot product. \see cross() */ - template + template inline Type Vector::dot(const Vector& rhs) const throw() { Type dotProduct = static_cast(0); - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { dotProduct += m_tElements[ct] * rhs.m_tElements[ct]; } @@ -518,7 +518,7 @@ namespace PolyVox NOTE: This function does not make much sense on integer Vectors. */ - template + template inline void Vector::normalise(void) throw() { double length = this->length(); @@ -527,7 +527,7 @@ namespace PolyVox { return; } - for(boost::uint32_t ct = 0; ct < Size; ++ct) + for(std::uint32_t ct = 0; ct < Size; ++ct) { m_tElements[ct] /= static_cast(length); } diff --git a/PolyVoxCore/include/VolumeChangeTracker.h b/PolyVoxCore/include/VolumeChangeTracker.h index f7adb206..9ab7ad32 100644 --- a/PolyVoxCore/include/VolumeChangeTracker.h +++ b/PolyVoxCore/include/VolumeChangeTracker.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" #include "Constants.h" #include "PolyVoxForwardDeclarations.h" @@ -44,26 +44,26 @@ namespace PolyVox //Getters void getChangedRegions(std::list& listToFill) const; Region getEnclosingRegion(void) const; - boost::uint16_t getSideLength(void); - BlockVolume* getVolumeData(void) const; - boost::uint8_t getVoxelAt(const Vector3DUint16& pos); - boost::uint8_t getVoxelAt(boost::uint16_t uX, boost::uint16_t uY, boost::uint16_t uZ); + std::uint16_t getSideLength(void); + BlockVolume* getVolumeData(void) const; + std::uint8_t getVoxelAt(const Vector3DUint16& pos); + std::uint8_t getVoxelAt(std::uint16_t uX, std::uint16_t uY, std::uint16_t uZ); //Setters void setAllRegionsUpToDate(bool newUpToDateValue); - void setLockedVoxelAt(boost::uint16_t x, boost::uint16_t y, boost::uint16_t z, boost::uint8_t value); - void setVolumeData(BlockVolume* volumeDataToSet); - void setVoxelAt(boost::uint16_t x, boost::uint16_t y, boost::uint16_t z, boost::uint8_t value); + void setLockedVoxelAt(std::uint16_t x, std::uint16_t y, std::uint16_t z, std::uint8_t value); + void setVolumeData(BlockVolume* volumeDataToSet); + void setVoxelAt(std::uint16_t x, std::uint16_t y, std::uint16_t z, std::uint8_t value); //Others void lockRegion(const Region& regToLock); void unlockRegion(void); - //void markRegionChanged(boost::uint16_t firstX, boost::uint16_t firstY, boost::uint16_t firstZ, boost::uint16_t lastX, boost::uint16_t lastY, boost::uint16_t lastZ); + //void markRegionChanged(std::uint16_t firstX, std::uint16_t firstY, std::uint16_t firstZ, std::uint16_t lastX, std::uint16_t lastY, std::uint16_t lastZ); private: bool m_bIsLocked; Region m_regLastLocked; - BlockVolume* volumeData; + BlockVolume* volumeData; LinearVolume* volRegionUpToDate; }; } diff --git a/PolyVoxCore/include/VoxelFilters.h b/PolyVoxCore/include/VoxelFilters.h index 2c3d829c..fe731ae7 100644 --- a/PolyVoxCore/include/VoxelFilters.h +++ b/PolyVoxCore/include/VoxelFilters.h @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace PolyVox { - float computeSmoothedVoxel(BlockVolumeIterator& volIter); + float computeSmoothedVoxel(BlockVolumeIterator& volIter); } #endif \ No newline at end of file diff --git a/PolyVoxCore/source/GradientEstimators.cpp b/PolyVoxCore/source/GradientEstimators.cpp index e969c63d..b54372ba 100644 --- a/PolyVoxCore/source/GradientEstimators.cpp +++ b/PolyVoxCore/source/GradientEstimators.cpp @@ -3,13 +3,13 @@ #include "RegionGeometry.h" #include "SurfaceVertex.h" -#include "boost/cstdint.hpp" +#include "PolyVoxCStdInt.h" -using namespace boost; +using namespace std; namespace PolyVox { - POLYVOX_API void computeNormalsForVertices(BlockVolume* volumeData, RegionGeometry& regGeom, NormalGenerationMethod normalGenerationMethod) + POLYVOX_API void computeNormalsForVertices(BlockVolume* volumeData, RegionGeometry& regGeom, NormalGenerationMethod normalGenerationMethod) { std::vector& vecVertices = regGeom.m_patchSingleMaterial->m_vecVertices; std::vector::iterator iterSurfaceVertex = vecVertices.begin(); @@ -18,7 +18,7 @@ namespace PolyVox const Vector3DFloat& v3dPos = iterSurfaceVertex->getPosition() + static_cast(regGeom.m_v3dRegionPosition); const Vector3DInt32 v3dFloor = static_cast(v3dPos); - BlockVolumeIterator volIter(*volumeData); + BlockVolumeIterator volIter(*volumeData); //Check all corners are within the volume, allowing a boundary for gradient estimation bool lowerCornerInside = volumeData->containsPoint(v3dFloor,1); @@ -98,7 +98,7 @@ namespace PolyVox Vector3DFloat result; - BlockVolumeIterator volIter(*volumeData); //FIXME - save this somewhere - could be expensive to create? + BlockVolumeIterator volIter(*volumeData); //FIXME - save this somewhere - could be expensive to create? if(normalGenerationMethod == SOBEL) diff --git a/PolyVoxCore/source/IndexedSurfacePatch.cpp b/PolyVoxCore/source/IndexedSurfacePatch.cpp index 784856f9..747fbde7 100644 --- a/PolyVoxCore/source/IndexedSurfacePatch.cpp +++ b/PolyVoxCore/source/IndexedSurfacePatch.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "IndexedSurfacePatch.h" -using namespace boost; +using namespace std; namespace PolyVox { @@ -120,7 +120,7 @@ namespace PolyVox }*/ } - boost::int32_t IndexedSurfacePatch::getIndexFor(const Vector3DFloat& pos) + std::int32_t IndexedSurfacePatch::getIndexFor(const Vector3DFloat& pos) { assert(pos.getX() >= 0.0f); assert(pos.getY() >= 0.0f); @@ -152,7 +152,7 @@ namespace PolyVox while(true); } - void IndexedSurfacePatch::setIndexFor(const Vector3DFloat& pos, boost::int32_t newIndex) + void IndexedSurfacePatch::setIndexFor(const Vector3DFloat& pos, std::int32_t newIndex) { assert(pos.getX() >= 0.0f); assert(pos.getY() >= 0.0f); @@ -195,7 +195,7 @@ namespace PolyVox return m_vecVertices; } - const std::vector& IndexedSurfacePatch::getIndices(void) const + const std::vector& IndexedSurfacePatch::getIndices(void) const { return m_vecTriangleIndices; } diff --git a/PolyVoxCore/source/Region.cpp b/PolyVoxCore/source/Region.cpp index c3b23663..b3621dc6 100644 --- a/PolyVoxCore/source/Region.cpp +++ b/PolyVoxCore/source/Region.cpp @@ -44,7 +44,7 @@ namespace PolyVox && (pos.getZ() >= m_v3dLowerCorner.getZ() + boundary); } - bool Region::containsPoint(const Vector3DInt32& pos, boost::uint8_t boundary) const + bool Region::containsPoint(const Vector3DInt32& pos, std::uint8_t boundary) const { return (pos.getX() <= m_v3dUpperCorner.getX() - boundary) && (pos.getY() <= m_v3dUpperCorner.getY() - boundary) diff --git a/PolyVoxCore/source/SurfaceAdjusters.cpp b/PolyVoxCore/source/SurfaceAdjusters.cpp index a49ed426..e82caf57 100644 --- a/PolyVoxCore/source/SurfaceAdjusters.cpp +++ b/PolyVoxCore/source/SurfaceAdjusters.cpp @@ -11,12 +11,12 @@ namespace PolyVox { - void smoothRegionGeometry(BlockVolume* volumeData, RegionGeometry& regGeom) + void smoothRegionGeometry(BlockVolume* volumeData, RegionGeometry& regGeom) { - const boost::uint8_t uSmoothingFactor = 2; + const std::uint8_t uSmoothingFactor = 2; const float fThreshold = 0.5f; - BlockVolumeIterator volIter(*volumeData); + BlockVolumeIterator volIter(*volumeData); std::vector& vecVertices = regGeom.m_patchSingleMaterial->m_vecVertices; std::vector::iterator iterSurfaceVertex = vecVertices.begin(); diff --git a/PolyVoxCore/source/SurfaceExtractors.cpp b/PolyVoxCore/source/SurfaceExtractors.cpp index fd5a395c..f8a31ff4 100644 --- a/PolyVoxCore/source/SurfaceExtractors.cpp +++ b/PolyVoxCore/source/SurfaceExtractors.cpp @@ -13,7 +13,7 @@ #include -using namespace boost; +using namespace std; namespace PolyVox { @@ -55,7 +55,7 @@ namespace PolyVox return listChangedRegionGeometry; } - boost::uint32_t getIndex(boost::uint32_t x, boost::uint32_t y) + std::uint32_t getIndex(std::uint32_t x, std::uint32_t y) { return x + (y * (POLYVOX_REGION_SIDE_LENGTH+1)); } @@ -66,16 +66,16 @@ namespace PolyVox singleMaterialPatch->m_vecTriangleIndices.clear(); //For edge indices - boost::int32_t* vertexIndicesX0 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesY0 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesZ0 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesX1 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesY1 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesZ1 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesX0 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesY0 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesZ0 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesX1 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesY1 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesZ1 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; //Cell bitmasks - boost::uint8_t* bitmask0 = new boost::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::uint8_t* bitmask1 = new boost::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::uint8_t* bitmask0 = new std::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::uint8_t* bitmask1 = new std::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; //When generating the mesh for a region we actually look one voxel outside it in the // back, bottom, right direction. Protect against access violations by cropping region here @@ -91,22 +91,22 @@ namespace PolyVox regSlice0.setUpperCorner(Vector3DInt32(regSlice0.getUpperCorner().getX(),regSlice0.getUpperCorner().getY(),regSlice0.getLowerCorner().getZ())); //Iterator to access the volume data - BlockVolumeIterator volIter(*volumeData); + BlockVolumeIterator volIter(*volumeData); //Compute bitmask for initial slice - boost::uint32_t uNoOfNonEmptyCellsForSlice0 = computeInitialRoughBitmaskForSlice(volIter, regSlice0, offset, bitmask0); + std::uint32_t uNoOfNonEmptyCellsForSlice0 = computeInitialRoughBitmaskForSlice(volIter, regSlice0, offset, bitmask0); if(uNoOfNonEmptyCellsForSlice0 != 0) { //If there were some non-empty cells then generate initial slice vertices for them generateRoughVerticesForSlice(volIter,regSlice0, offset, bitmask0, singleMaterialPatch, vertexIndicesX0, vertexIndicesY0, vertexIndicesZ0); } - for(boost::uint32_t uSlice = 0; ((uSlice <= POLYVOX_REGION_SIDE_LENGTH-1) && (uSlice + offset.getZ() < region.getUpperCorner().getZ())); ++uSlice) + for(std::uint32_t uSlice = 0; ((uSlice <= POLYVOX_REGION_SIDE_LENGTH-1) && (uSlice + offset.getZ() < region.getUpperCorner().getZ())); ++uSlice) { Region regSlice1(regSlice0); regSlice1.shift(Vector3DInt32(0,0,1)); - boost::uint32_t uNoOfNonEmptyCellsForSlice1 = computeRoughBitmaskForSliceFromPrevious(volIter, regSlice1, offset, bitmask1, bitmask0); + std::uint32_t uNoOfNonEmptyCellsForSlice1 = computeRoughBitmaskForSliceFromPrevious(volIter, regSlice1, offset, bitmask1, bitmask0); if(uNoOfNonEmptyCellsForSlice1 != 0) { @@ -137,9 +137,9 @@ namespace PolyVox delete[] vertexIndicesZ1; } - boost::uint32_t computeInitialRoughBitmaskForSlice(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask) + std::uint32_t computeInitialRoughBitmaskForSlice(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask) { - boost::uint32_t uNoOfNonEmptyCells = 0; + std::uint32_t uNoOfNonEmptyCells = 0; //Iterate over each cell in the region volIter.setPosition(regSlice.getLowerCorner().getX(),regSlice.getLowerCorner().getY(), regSlice.getLowerCorner().getZ()); @@ -287,9 +287,9 @@ namespace PolyVox return uNoOfNonEmptyCells; } - boost::uint32_t computeRoughBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) + std::uint32_t computeRoughBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) { - boost::uint32_t uNoOfNonEmptyCells = 0; + std::uint32_t uNoOfNonEmptyCells = 0; //Iterate over each cell in the region volIter.setPosition(regSlice.getLowerCorner().getX(),regSlice.getLowerCorner().getY(), regSlice.getLowerCorner().getZ()); @@ -403,7 +403,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void generateRoughVerticesForSlice(BlockVolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,boost::int32_t vertexIndicesX[],boost::int32_t vertexIndicesY[],boost::int32_t vertexIndicesZ[]) + void generateRoughVerticesForSlice(BlockVolumeIterator& volIter, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,std::int32_t vertexIndicesX[],std::int32_t vertexIndicesY[],std::int32_t vertexIndicesZ[]) { //Iterate over each cell in the region volIter.setPosition(regSlice.getLowerCorner().getX(),regSlice.getLowerCorner().getY(), regSlice.getLowerCorner().getZ()); @@ -470,9 +470,9 @@ namespace PolyVox }while(volIter.moveForwardInRegionXYZ());//For each cell } - void generateRoughIndicesForSlice(BlockVolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, boost::int32_t vertexIndicesX0[],boost::int32_t vertexIndicesY0[],boost::int32_t vertexIndicesZ0[], boost::int32_t vertexIndicesX1[],boost::int32_t vertexIndicesY1[],boost::int32_t vertexIndicesZ1[]) + void generateRoughIndicesForSlice(BlockVolumeIterator& volIter, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, std::int32_t vertexIndicesX0[],std::int32_t vertexIndicesY0[],std::int32_t vertexIndicesZ0[], std::int32_t vertexIndicesX1[],std::int32_t vertexIndicesY1[],std::int32_t vertexIndicesZ1[]) { - boost::uint32_t indlist[12]; + std::uint32_t indlist[12]; Region regCroppedSlice(regSlice); regCroppedSlice.setUpperCorner(regCroppedSlice.getUpperCorner() - Vector3DInt32(1,1,0)); @@ -559,9 +559,9 @@ namespace PolyVox for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) { - boost::uint32_t ind0 = indlist[triTable[iCubeIndex][i ]]; - boost::uint32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; - boost::uint32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; + std::uint32_t ind0 = indlist[triTable[iCubeIndex][i ]]; + std::uint32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; + std::uint32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; singleMaterialPatch->m_vecTriangleIndices.push_back(ind0); singleMaterialPatch->m_vecTriangleIndices.push_back(ind1); @@ -584,7 +584,7 @@ namespace PolyVox Vector3DFloat vertlist[12]; uint8_t vertMaterials[12]; - BlockVolumeIterator volIter(*volumeData); + BlockVolumeIterator volIter(*volumeData); volIter.setValidRegion(region); ////////////////////////////////////////////////////////////////////////// diff --git a/PolyVoxCore/source/SurfaceExtractorsDecimated.cpp b/PolyVoxCore/source/SurfaceExtractorsDecimated.cpp index 9c925da4..114611cc 100644 --- a/PolyVoxCore/source/SurfaceExtractorsDecimated.cpp +++ b/PolyVoxCore/source/SurfaceExtractorsDecimated.cpp @@ -11,11 +11,11 @@ #include -using namespace boost; +using namespace std; namespace PolyVox { - boost::uint32_t getDecimatedIndex(boost::uint32_t x, boost::uint32_t y) + std::uint32_t getDecimatedIndex(std::uint32_t x, std::uint32_t y) { return x + (y * (POLYVOX_REGION_SIDE_LENGTH+1)); } @@ -26,16 +26,16 @@ namespace PolyVox singleMaterialPatch->m_vecTriangleIndices.clear(); //For edge indices - boost::int32_t* vertexIndicesX0 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesY0 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesZ0 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesX1 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesY1 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::int32_t* vertexIndicesZ1 = new boost::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesX0 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesY0 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesZ0 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesX1 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesY1 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::int32_t* vertexIndicesZ1 = new std::int32_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; //Cell bitmasks - boost::uint8_t* bitmask0 = new boost::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; - boost::uint8_t* bitmask1 = new boost::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::uint8_t* bitmask0 = new std::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; + std::uint8_t* bitmask1 = new std::uint8_t[(POLYVOX_REGION_SIDE_LENGTH+1) * (POLYVOX_REGION_SIDE_LENGTH+1)]; const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; @@ -55,22 +55,22 @@ namespace PolyVox regSlice0.setUpperCorner(v3dUpperCorner); //Iterator to access the volume data - BlockVolumeIterator volIter(*volumeData); + BlockVolumeIterator volIter(*volumeData); //Compute bitmask for initial slice - boost::uint32_t uNoOfNonEmptyCellsForSlice0 = computeInitialDecimatedBitmaskForSlice(volIter, uLevel, regSlice0, offset, bitmask0); + std::uint32_t uNoOfNonEmptyCellsForSlice0 = computeInitialDecimatedBitmaskForSlice(volIter, uLevel, regSlice0, offset, bitmask0); if(uNoOfNonEmptyCellsForSlice0 != 0) { //If there were some non-empty cells then generate initial slice vertices for them generateDecimatedVerticesForSlice(volIter, uLevel, regSlice0, offset, bitmask0, singleMaterialPatch, vertexIndicesX0, vertexIndicesY0, vertexIndicesZ0); } - for(boost::uint32_t uSlice = 1; ((uSlice <= POLYVOX_REGION_SIDE_LENGTH) && (uSlice + offset.getZ() <= regVolume.getUpperCorner().getZ())); uSlice += uStepSize) + for(std::uint32_t uSlice = 1; ((uSlice <= POLYVOX_REGION_SIDE_LENGTH) && (uSlice + offset.getZ() <= regVolume.getUpperCorner().getZ())); uSlice += uStepSize) { Region regSlice1(regSlice0); regSlice1.shift(Vector3DInt32(0,0,uStepSize)); - boost::uint32_t uNoOfNonEmptyCellsForSlice1 = computeDecimatedBitmaskForSliceFromPrevious(volIter, uLevel, regSlice1, offset, bitmask1, bitmask0); + std::uint32_t uNoOfNonEmptyCellsForSlice1 = computeDecimatedBitmaskForSliceFromPrevious(volIter, uLevel, regSlice1, offset, bitmask1, bitmask0); if(uNoOfNonEmptyCellsForSlice1 != 0) { @@ -110,10 +110,10 @@ namespace PolyVox }*/ } - boost::uint32_t computeInitialDecimatedBitmaskForSlice(BlockVolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask) + std::uint32_t computeInitialDecimatedBitmaskForSlice(BlockVolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; - boost::uint32_t uNoOfNonEmptyCells = 0; + std::uint32_t uNoOfNonEmptyCells = 0; //Iterate over each cell in the region for(uint16_t y = regSlice.getLowerCorner().getY(); y <= regSlice.getUpperCorner().getY(); y += uStepSize) @@ -279,10 +279,10 @@ namespace PolyVox return uNoOfNonEmptyCells; } - boost::uint32_t computeDecimatedBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) + std::uint32_t computeDecimatedBitmaskForSliceFromPrevious(BlockVolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, uint8_t* previousBitmask) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; - boost::uint32_t uNoOfNonEmptyCells = 0; + std::uint32_t uNoOfNonEmptyCells = 0; //Iterate over each cell in the region for(uint16_t y = regSlice.getLowerCorner().getY(); y <= regSlice.getUpperCorner().getY(); y += uStepSize) @@ -405,7 +405,7 @@ namespace PolyVox return uNoOfNonEmptyCells; } - void generateDecimatedVerticesForSlice(BlockVolumeIterator& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,boost::int32_t vertexIndicesX[],boost::int32_t vertexIndicesY[],boost::int32_t vertexIndicesZ[]) + void generateDecimatedVerticesForSlice(BlockVolumeIterator& volIter, uint8_t uLevel, Region& regSlice, const Vector3DFloat& offset, uint8_t* bitmask, IndexedSurfacePatch* singleMaterialPatch,std::int32_t vertexIndicesX[],std::int32_t vertexIndicesY[],std::int32_t vertexIndicesZ[]) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; @@ -476,10 +476,10 @@ namespace PolyVox } } - void generateDecimatedIndicesForSlice(BlockVolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, boost::int32_t vertexIndicesX0[],boost::int32_t vertexIndicesY0[],boost::int32_t vertexIndicesZ0[], boost::int32_t vertexIndicesX1[],boost::int32_t vertexIndicesY1[],boost::int32_t vertexIndicesZ1[]) + void generateDecimatedIndicesForSlice(BlockVolumeIterator& volIter, uint8_t uLevel, const Region& regSlice, IndexedSurfacePatch* singleMaterialPatch, const Vector3DFloat& offset, uint8_t* bitmask0, uint8_t* bitmask1, std::int32_t vertexIndicesX0[],std::int32_t vertexIndicesY0[],std::int32_t vertexIndicesZ0[], std::int32_t vertexIndicesX1[],std::int32_t vertexIndicesY1[],std::int32_t vertexIndicesZ1[]) { const uint8_t uStepSize = uLevel == 0 ? 1 : 1 << uLevel; - boost::uint32_t indlist[12]; + std::uint32_t indlist[12]; for(uint16_t y = regSlice.getLowerCorner().getY() - offset.getY(); y < regSlice.getUpperCorner().getY() - offset.getY(); y += uStepSize) { @@ -561,9 +561,9 @@ namespace PolyVox for (int i=0;triTable[iCubeIndex][i]!=-1;i+=3) { - boost::uint32_t ind0 = indlist[triTable[iCubeIndex][i ]]; - boost::uint32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; - boost::uint32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; + std::uint32_t ind0 = indlist[triTable[iCubeIndex][i ]]; + std::uint32_t ind1 = indlist[triTable[iCubeIndex][i+1]]; + std::uint32_t ind2 = indlist[triTable[iCubeIndex][i+2]]; singleMaterialPatch->m_vecTriangleIndices.push_back(ind0); singleMaterialPatch->m_vecTriangleIndices.push_back(ind1); @@ -588,7 +588,7 @@ namespace PolyVox Vector3DFloat vertlist[12]; Vector3DFloat normlist[12]; uint8_t vertMaterials[12]; - BlockVolumeIterator volIter(*volumeData); + BlockVolumeIterator volIter(*volumeData); volIter.setValidRegion(region); ////////////////////////////////////////////////////////////////////////// @@ -817,7 +817,7 @@ namespace PolyVox Vector3DFloat result; - BlockVolumeIterator volIter(*volumeData); //FIXME - save this somewhere - could be expensive to create? + BlockVolumeIterator volIter(*volumeData); //FIXME - save this somewhere - could be expensive to create? if(normalGenerationMethod == SOBEL) diff --git a/PolyVoxCore/source/Utility.cpp b/PolyVoxCore/source/Utility.cpp index 3a11cbee..27f09de8 100644 --- a/PolyVoxCore/source/Utility.cpp +++ b/PolyVoxCore/source/Utility.cpp @@ -27,21 +27,21 @@ namespace PolyVox { //Note: this function only works for inputs which are a power of two and not zero //If this is not the case then the output is undefined. - boost::uint8_t logBase2(boost::uint32_t uInput) + std::uint8_t logBase2(std::uint32_t uInput) { assert(uInput != 0); assert(isPowerOf2(uInput)); - boost::uint32_t uResult = 0; + std::uint32_t uResult = 0; while( (uInput >> uResult) != 0) { ++uResult; } - return static_cast(uResult-1); + return static_cast(uResult-1); } - bool isPowerOf2(boost::uint32_t uInput) + bool isPowerOf2(std::uint32_t uInput) { if(uInput == 0) return false; diff --git a/PolyVoxCore/source/VolumeChangeTracker.cpp b/PolyVoxCore/source/VolumeChangeTracker.cpp index 6b933d15..6d86bc30 100644 --- a/PolyVoxCore/source/VolumeChangeTracker.cpp +++ b/PolyVoxCore/source/VolumeChangeTracker.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "BlockVolume.h" #include "BlockVolumeIterator.h" -using namespace boost; +using namespace std; namespace PolyVox { @@ -50,7 +50,7 @@ namespace PolyVox { } - void VolumeChangeTracker::setVolumeData(BlockVolume* volumeDataToSet) + void VolumeChangeTracker::setVolumeData(BlockVolume* volumeDataToSet) { volumeData = volumeDataToSet; volRegionUpToDate = new LinearVolume(PolyVox::logBase2(POLYVOX_VOLUME_SIDE_LENGTH_IN_REGIONS)); @@ -124,20 +124,20 @@ namespace PolyVox assert(uY < volumeData->getSideLength()); assert(uZ < volumeData->getSideLength()); - BlockVolumeIterator volIter(*volumeData); + BlockVolumeIterator volIter(*volumeData); volIter.setPosition(uX,uY,uZ); return volIter.getVoxel(); } - BlockVolume* VolumeChangeTracker::getVolumeData(void) const + BlockVolume* VolumeChangeTracker::getVolumeData(void) const { return volumeData; } - void VolumeChangeTracker::setVoxelAt(boost::uint16_t x, boost::uint16_t y, boost::uint16_t z, boost::uint8_t value) + void VolumeChangeTracker::setVoxelAt(std::uint16_t x, std::uint16_t y, std::uint16_t z, std::uint8_t value) { //FIXME - rather than creating a iterator each time we should have one stored - BlockVolumeIterator iterVol(*volumeData); + BlockVolumeIterator iterVol(*volumeData); iterVol.setPosition(x,y,z); iterVol.setVoxel(value); @@ -178,12 +178,12 @@ namespace PolyVox } } - void VolumeChangeTracker::setLockedVoxelAt(boost::uint16_t x, boost::uint16_t y, boost::uint16_t z, boost::uint8_t value) + void VolumeChangeTracker::setLockedVoxelAt(std::uint16_t x, std::uint16_t y, std::uint16_t z, std::uint8_t value) { assert(m_bIsLocked); //FIXME - rather than creating a iterator each time we should have one stored - BlockVolumeIterator iterVol(*volumeData); + BlockVolumeIterator iterVol(*volumeData); iterVol.setPosition(x,y,z); iterVol.setVoxel(value); } diff --git a/PolyVoxCore/source/VoxelFilters.cpp b/PolyVoxCore/source/VoxelFilters.cpp index 783b05e3..cd954dc6 100644 --- a/PolyVoxCore/source/VoxelFilters.cpp +++ b/PolyVoxCore/source/VoxelFilters.cpp @@ -4,7 +4,7 @@ namespace PolyVox { - float computeSmoothedVoxel(BlockVolumeIterator& volIter) + float computeSmoothedVoxel(BlockVolumeIterator& volIter) { assert(volIter.getPosX() >= 1); assert(volIter.getPosY() >= 1); diff --git a/examples/OpenGL/main.cpp b/examples/OpenGL/main.cpp index d56b9d45..4337a6ed 100644 --- a/examples/OpenGL/main.cpp +++ b/examples/OpenGL/main.cpp @@ -9,7 +9,7 @@ #include // The GL Utility Toolkit (Glut) Header //Some namespaces we need -using namespace boost; +using namespace std; using namespace PolyVox; using namespace std;