From 256e289c8f7aea9988fc1d852142a5d656e4eca3 Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Fri, 30 Nov 2012 15:56:45 +0100 Subject: [PATCH] Removed old code. --- .../include/PolyVoxCore/RawVolume.h | 7 ------ .../include/PolyVoxCore/RawVolumeSampler.inl | 24 ++----------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index e3b3d868..fcd3e6e5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -113,7 +113,6 @@ namespace PolyVox private: VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const; - bool isCurrentPositionValid(void) const; bool checkValidFlags(uint8_t uFlagsToCheck) const; void updateValidFlagsState(void); @@ -121,12 +120,6 @@ namespace PolyVox VoxelType* mCurrentVoxel; uint8_t m_uValidFlags; - - //Whether the current position is inside the volume - //FIXME - Replace these with flags - bool m_bIsCurrentPositionValidInX; - bool m_bIsCurrentPositionValidInY; - bool m_bIsCurrentPositionValidInZ; }; #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl index ca7e33c5..41b8995a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl @@ -30,9 +30,6 @@ namespace PolyVox :BaseVolume::template Sampler< RawVolume >(volume) ,mCurrentVoxel(0) ,m_uValidFlags(0) - ,m_bIsCurrentPositionValidInX(false) - ,m_bIsCurrentPositionValidInY(false) - ,m_bIsCurrentPositionValidInZ(false) { } @@ -44,7 +41,7 @@ namespace PolyVox template VoxelType RawVolume::Sampler::getVoxel(void) const { - if(isCurrentPositionValid()) + if(checkValidFlags(Current)) { return *mCurrentVoxel; } @@ -78,18 +75,13 @@ namespace PolyVox mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex; - m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(xPos); - m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(yPos); - m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(zPos); - updateValidFlagsState(); } template bool RawVolume::Sampler::setVoxel(VoxelType tValue) { - //return m_bIsCurrentPositionValid ? *mCurrentVoxel : this->mVolume->getBorderValue(); - if(m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ) + if(checkValidFlags(Current)) { *mCurrentVoxel = tValue; return true; @@ -105,7 +97,6 @@ namespace PolyVox { this->mXPosInVolume++; ++mCurrentVoxel; - m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(this->mXPosInVolume); //FIXME - Can be faster by just 'shifting' the flags. updateValidFlagsState(); @@ -116,7 +107,6 @@ namespace PolyVox { this->mYPosInVolume++; mCurrentVoxel += this->mVolume->getWidth(); - m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(this->mYPosInVolume); //FIXME - Can be faster by just 'shifting' the flags. updateValidFlagsState(); @@ -127,7 +117,6 @@ namespace PolyVox { this->mZPosInVolume++; mCurrentVoxel += this->mVolume->getWidth() * this->mVolume->getHeight(); - m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(this->mZPosInVolume); //FIXME - Can be faster by just 'shifting' the flags. updateValidFlagsState(); @@ -138,7 +127,6 @@ namespace PolyVox { this->mXPosInVolume--; --mCurrentVoxel; - m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(this->mXPosInVolume); //FIXME - Can be faster by just 'shifting' the flags. updateValidFlagsState(); @@ -149,7 +137,6 @@ namespace PolyVox { this->mYPosInVolume--; mCurrentVoxel -= this->mVolume->getWidth(); - m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(this->mYPosInVolume); //FIXME - Can be faster by just 'shifting' the flags. updateValidFlagsState(); @@ -160,7 +147,6 @@ namespace PolyVox { this->mZPosInVolume--; mCurrentVoxel -= this->mVolume->getWidth() * this->mVolume->getHeight(); - m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(this->mZPosInVolume); //FIXME - Can be faster by just 'shifting' the flags. updateValidFlagsState(); @@ -478,12 +464,6 @@ namespace PolyVox } } - template - bool RawVolume::Sampler::isCurrentPositionValid(void) const - { - return m_bIsCurrentPositionValidInX && m_bIsCurrentPositionValidInY && m_bIsCurrentPositionValidInZ; - } - template inline bool RawVolume::Sampler::checkValidFlags(uint8_t uFlagsToCheck) const {