diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 1aa9f50f..9f05e7d5 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -49,6 +49,7 @@ SET(IMPL_SRC_FILES ) SET(IMPL_INC_FILES + include/PolyVoxCore/PolyVoxImpl/CPlusPlusZeroXSupport.h include/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h include/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h include/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.h @@ -101,7 +102,8 @@ INSTALL(TARGETS PolyVoxCore COMPONENT library ) -INSTALL(FILES ${CORE_INC_FILES} DESTINATION include/PolyVoxCore COMPONENT development) +#Install the core header files, including the ones in the PolyVoxImpl subfolder. +INSTALL(DIRECTORY include/PolyVoxCore DESTINATION include COMPONENT development PATTERN "*.svn*" EXCLUDE) #Util #Build @@ -120,10 +122,11 @@ INSTALL(TARGETS PolyVoxUtil COMPONENT library ) -INSTALL(FILES ${UTIL_INC_FILES} DESTINATION include/PolyVoxUtil COMPONENT development) +#Install the util header files. +INSTALL(DIRECTORY include/PolyVoxUtil DESTINATION include COMPONENT development PATTERN "*.svn*" EXCLUDE) #Copy the boost files which we a re using to mimic C++0x -INSTALL(DIRECTORY include/boost DESTINATION include COMPONENT development) +INSTALL(DIRECTORY include/boost DESTINATION include COMPONENT development PATTERN "*.svn*" EXCLUDE) #Set up PolyVoxConfig.cmake if(WIN32) diff --git a/library/include/PolyVoxCore/PolyVoxImpl/CPlusPlusZeroXSupport.h b/library/include/PolyVoxCore/PolyVoxImpl/CPlusPlusZeroXSupport.h new file mode 100644 index 00000000..3749fd14 --- /dev/null +++ b/library/include/PolyVoxCore/PolyVoxImpl/CPlusPlusZeroXSupport.h @@ -0,0 +1,16 @@ +#ifndef __PolyVox_CPlusPlusZeroXSupport_H__ +#define __PolyVox_CPlusPlusZeroXSupport_H__ + +#ifdef C_PLUS_PLUS_ZERO_X_SUPPORTED + #include //Just a guess at what the standard name will be. + #include //These includes may need changing + #define POLYVOX_SHARED_PTR std::shared_ptr + #define POLYVOX_WEAK_PTR std::weak_ptr +#else + #include "boost/shared_ptr.hpp" + #include "boost/weak_ptr.hpp" + #define POLYVOX_SHARED_PTR boost::shared_ptr + #define POLYVOX_WEAK_PTR boost::weak_ptr +#endif + +#endif \ No newline at end of file diff --git a/library/include/PolyVoxCore/Vector.inl b/library/include/PolyVoxCore/Vector.inl index 93d3dca9..8d64ea5d 100644 --- a/library/include/PolyVoxCore/Vector.inl +++ b/library/include/PolyVoxCore/Vector.inl @@ -169,7 +169,7 @@ namespace PolyVox bool equal = true; for(uint32 ct = 0; ct < Size; ++ct) { - if(m_tElements[ct] != rhs.getElement(ct)) + if(m_tElements[ct] != rhs.m_tElements[ct]) { equal = false; break; diff --git a/library/include/PolyVoxCore/Volume.h b/library/include/PolyVoxCore/Volume.h index e63214e3..0cd0b2c3 100644 --- a/library/include/PolyVoxCore/Volume.h +++ b/library/include/PolyVoxCore/Volume.h @@ -27,8 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "PolyVoxCStdInt.h" -#include "boost/shared_ptr.hpp" -#include "boost/weak_ptr.hpp" +#include "PolyVoxImpl/CPlusPlusZeroXSupport.h" #include #pragma endregion @@ -39,7 +38,7 @@ namespace PolyVox class Block { public: - boost::shared_ptr< BlockData > m_pBlockData; + POLYVOX_SHARED_PTR< BlockData > m_pBlockData; VoxelType m_pHomogenousValue; bool m_bIsShared; bool m_bIsPotentiallySharable; @@ -72,10 +71,10 @@ namespace PolyVox VolumeIterator lastVoxel(void); private: - boost::shared_ptr< BlockData > getHomogenousBlockData(VoxelType tHomogenousValue) const; + POLYVOX_SHARED_PTR< BlockData > getHomogenousBlockData(VoxelType tHomogenousValue) const; Block* m_pBlocks; - mutable std::map > > m_pHomogenousBlockData; + mutable std::map > > m_pHomogenousBlockData; uint32 m_uNoOfBlocksInVolume; uint16 m_uSideLengthInBlocks; diff --git a/library/include/PolyVoxCore/Volume.inl b/library/include/PolyVoxCore/Volume.inl index 48ce5d49..05698bb6 100644 --- a/library/include/PolyVoxCore/Volume.inl +++ b/library/include/PolyVoxCore/Volume.inl @@ -153,7 +153,7 @@ namespace PolyVox const uint16 yOffset = uYPos - (blockY << m_uBlockSideLengthPower); const uint16 zOffset = uZPos - (blockZ << m_uBlockSideLengthPower); - const boost::shared_ptr< BlockData > block = m_pBlocks + const POLYVOX_SHARED_PTR< BlockData > block = m_pBlocks [ blockX + blockY * m_uSideLengthInBlocks + @@ -197,7 +197,7 @@ namespace PolyVox const VoxelType tHomogenousValue = m_pBlocks[uBlockIndex].m_pHomogenousValue; if(tHomogenousValue != tValue) { - boost::shared_ptr< BlockData > temp(new BlockData(m_uBlockSideLength)); + POLYVOX_SHARED_PTR< BlockData > temp(new BlockData(m_uBlockSideLength)); m_pBlocks[uBlockIndex].m_pBlockData = temp; m_pBlocks[uBlockIndex].m_bIsShared = false; m_pBlocks[uBlockIndex].m_pBlockData->fill(tHomogenousValue); @@ -295,13 +295,13 @@ namespace PolyVox #pragma region Private Implementation template - boost::shared_ptr< BlockData > Volume::getHomogenousBlockData(VoxelType tHomogenousValue) const + POLYVOX_SHARED_PTR< BlockData > Volume::getHomogenousBlockData(VoxelType tHomogenousValue) const { - typename std::map > >::iterator iterResult = m_pHomogenousBlockData.find(tHomogenousValue); + typename std::map > >::iterator iterResult = m_pHomogenousBlockData.find(tHomogenousValue); if(iterResult == m_pHomogenousBlockData.end()) { Block block; - boost::shared_ptr< BlockData > temp(new BlockData(m_uBlockSideLength)); + POLYVOX_SHARED_PTR< BlockData > temp(new BlockData(m_uBlockSideLength)); block.m_pBlockData = temp; //block.m_uReferenceCount++; block.m_pBlockData->fill(tHomogenousValue); @@ -311,7 +311,7 @@ namespace PolyVox else { //iterResult->second.m_uReferenceCount++; - boost::shared_ptr< BlockData > result(iterResult->second); + POLYVOX_SHARED_PTR< BlockData > result(iterResult->second); return result; } }