From 639eb6620f5ae434f2966d231e971ee02d895c64 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Sun, 8 Mar 2015 12:51:00 +0000 Subject: [PATCH 1/2] Add 'this' pointer disambiguation. I guess this didn't fail on MSVC due to the different name lookup rules the use. Fixes issue 56. --- include/PolyVox/BaseVolume.inl | 2 +- include/PolyVox/RawVolumeSampler.inl | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/PolyVox/BaseVolume.inl b/include/PolyVox/BaseVolume.inl index f3fcfd06..14e88be4 100644 --- a/include/PolyVox/BaseVolume.inl +++ b/include/PolyVox/BaseVolume.inl @@ -123,7 +123,7 @@ namespace PolyVox template uint32_t BaseVolume::calculateSizeInBytes(void) { - return getWidth() * getHeight() * getDepth() * sizeof(VoxelType); + return this->getWidth() * this->getHeight() * this->getDepth() * sizeof(VoxelType); } } diff --git a/include/PolyVox/RawVolumeSampler.inl b/include/PolyVox/RawVolumeSampler.inl index 16766c2f..0f7acf77 100644 --- a/include/PolyVox/RawVolumeSampler.inl +++ b/include/PolyVox/RawVolumeSampler.inl @@ -76,9 +76,9 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< RawVolume >::setPosition(xPos, yPos, zPos); - m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(xPos); - m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(yPos); - m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(zPos); + m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(xPos); + m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(yPos); + m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(zPos); // Then we update the voxel pointer if(this->isCurrentPositionValid()) @@ -124,7 +124,7 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< RawVolume >::movePositiveX(); - m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(mXPosInVolume); + m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(this->mXPosInVolume); // Then we update the voxel pointer if(this->isCurrentPositionValid() && bIsOldPositionValid ) @@ -146,7 +146,7 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< RawVolume >::movePositiveY(); - m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(mYPosInVolume); + m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(this->mYPosInVolume); // Then we update the voxel pointer if(this->isCurrentPositionValid() && bIsOldPositionValid ) @@ -168,7 +168,7 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< RawVolume >::movePositiveZ(); - m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(mZPosInVolume); + m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(this->mZPosInVolume); // Then we update the voxel pointer if(this->isCurrentPositionValid() && bIsOldPositionValid ) @@ -190,7 +190,7 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< RawVolume >::moveNegativeX(); - m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(mXPosInVolume); + m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(this->mXPosInVolume); // Then we update the voxel pointer if(this->isCurrentPositionValid() && bIsOldPositionValid ) @@ -212,7 +212,7 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< RawVolume >::moveNegativeY(); - m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(mYPosInVolume); + m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(this->mYPosInVolume); // Then we update the voxel pointer if(this->isCurrentPositionValid() && bIsOldPositionValid ) @@ -234,7 +234,7 @@ namespace PolyVox // Base version updates position and validity flags. BaseVolume::template Sampler< RawVolume >::moveNegativeZ(); - m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(mZPosInVolume); + m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(this->mZPosInVolume); // Then we update the voxel pointer if(this->isCurrentPositionValid() && bIsOldPositionValid ) From cd48c6f611f53d2a86cbb8f75875118d1474f6c0 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 19 Mar 2015 23:08:35 +0100 Subject: [PATCH 2/2] Made method const. --- include/PolyVox/Mesh.h | 2 +- include/PolyVox/Mesh.inl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/PolyVox/Mesh.h b/include/PolyVox/Mesh.h index 08bc0d07..64dbd11b 100644 --- a/include/PolyVox/Mesh.h +++ b/include/PolyVox/Mesh.h @@ -57,7 +57,7 @@ namespace PolyVox uint32_t getNoOfIndices(void) const; IndexType getIndex(uint32_t index) const; - const IndexType* getRawIndexData(void); + const IndexType* getRawIndexData(void) const; POLYVOX_DEPRECATED const std::vector& getIndices(void) const; const Vector3DInt32& getOffset(void) const; diff --git a/include/PolyVox/Mesh.inl b/include/PolyVox/Mesh.inl index c574687f..8a3d9312 100644 --- a/include/PolyVox/Mesh.inl +++ b/include/PolyVox/Mesh.inl @@ -70,7 +70,7 @@ namespace PolyVox } template - const IndexType* Mesh::getRawIndexData(void) + const IndexType* Mesh::getRawIndexData(void) const { return &(m_vecIndices[0]); }