diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h index 24499451..572cb0f1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h @@ -30,6 +30,7 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Array.h" #include +#include //For runtime_error namespace PolyVox { diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index dac1004e..ba6e5523 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -163,7 +163,7 @@ namespace PolyVox #if defined(_MSC_VER) class Sampler : public Volume::Sampler< LargeVolume > //This line works on VS2010 #else - class Sampler : public Volume::Sampler Nested< LargeVolume > //This line works on GCC + class Sampler : public Volume::template Sampler< LargeVolume > //This line works on GCC #endif { public: diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 75486746..721488e0 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -103,6 +103,7 @@ namespace PolyVox LargeVolume::~LargeVolume() { flushAll(); + delete[] m_pUncompressedBorderData; } //////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl b/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl index 367c5379..211e281b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl @@ -259,9 +259,9 @@ namespace PolyVox bool MeshDecimator::collapseChangesFaceNormals(uint32_t uSrc, uint32_t uDst, float fThreshold) { bool faceFlipped = false; - vector& triangles = trianglesUsingVertex[uSrc]; + std::vector& triangles = trianglesUsingVertex[uSrc]; - for(vector::iterator triIter = triangles.begin(); triIter != triangles.end(); triIter++) + for(std::vector::iterator triIter = triangles.begin(); triIter != triangles.end(); triIter++) { uint32_t tri = *triIter; diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index de56e31e..f5106e7d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -52,7 +52,7 @@ namespace PolyVox #if defined(_MSC_VER) class Sampler : public Volume::Sampler< RawVolume > //This line works on VS2010 #else - class Sampler : public Volume::Sampler Nested< RawVolume > //This line works on GCC + class Sampler : public Volume::template Sampler< RawVolume > //This line works on GCC #endif { public: diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl index 43da1dc9..c5ec65b3 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl @@ -145,6 +145,7 @@ namespace PolyVox return; } m_result.previousVoxel = Vector3DInt32(i,j,k); + if(tx <= ty && tx <= tz) { if(i == iend) break; diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index 58efadc6..0a45eb0b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -49,6 +49,7 @@ namespace PolyVox { public: Block(uint16_t uSideLength = 0); + ~Block(); uint16_t getSideLength(void) const; VoxelType getVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const; @@ -77,7 +78,7 @@ namespace PolyVox #if defined(_MSC_VER) class Sampler : public Volume::Sampler< SimpleVolume > //This line works on VS2010 #else - class Sampler : public Volume::Sampler Nested< SimpleVolume > //This line works on GCC + class Sampler : public Volume::template Sampler< SimpleVolume > //This line works on GCC #endif { public: diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl index ace3929e..21f960a9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl @@ -71,7 +71,7 @@ namespace PolyVox SimpleVolume::~SimpleVolume() { delete[] m_pBlocks; - m_pBlocks = 0; + delete[] m_pUncompressedBorderData; } //////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl index 9b2d0c85..03e8c687 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl @@ -35,6 +35,12 @@ namespace PolyVox } } + template + SimpleVolume::Block::~Block() + { + delete[] m_tUncompressedData; + } + template uint16_t SimpleVolume::Block::getSideLength(void) const { diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h index 1e0fa526..f223f41b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.h @@ -24,6 +24,8 @@ freely, subject to the following restrictions: #ifndef __PolyVox_VolumeResampler_H__ #define __PolyVox_VolumeResampler_H__ +#include + namespace PolyVox { template< template class SrcVolumeType, template class DestVolumeType, typename VoxelType> diff --git a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl index 6842c78f..9a5ffdeb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/VolumeResampler.inl @@ -119,7 +119,8 @@ namespace PolyVox uint8_t voxel110Den = voxel110.getDensity(); uint8_t voxel111Den = voxel111.getDensity(); - float dummy; + //FIXME - should accept all float parameters, but GCC complains? + double dummy; sx = modf(sx, &dummy); sy = modf(sy, &dummy); sz = modf(sz, &dummy);