From 745f24eab83cfc6910b0dadcab4403222f5b3151 Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Thu, 6 Jun 2013 16:39:49 +0200 Subject: [PATCH] More work on wrap modes. --- .../include/PolyVoxCore/RawVolume.h | 10 +++---- .../include/PolyVoxCore/RawVolume.inl | 28 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index 9da7c5d1..6c4c7605 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -155,11 +155,11 @@ namespace PolyVox void initialise(const Region& regValidRegion); template - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const; - VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; + VoxelType getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const; //The block data VoxelType* m_pData; diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl index 5397732f..cc381832 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl @@ -87,7 +87,7 @@ namespace PolyVox VoxelType RawVolume::getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder) const { // Simply call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); } //////////////////////////////////////////////////////////////////////////////// @@ -107,22 +107,22 @@ namespace PolyVox if(eWrapMode == WrapModes::None) { // Call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); } else if(eWrapMode == WrapModes::Clamp) { // Call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); } else if(eWrapMode == WrapModes::Border) { // Call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); } else { // Call through to the real implementation - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); } } @@ -367,24 +367,24 @@ namespace PolyVox template template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const { - POLYVOX_THROW(not_implemented, "This function is not implemented and should never be called!"); + POLYVOX_ASSERT(false, "This function is not implemented and should never be called!"); } template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const { if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)) == false) { POLYVOX_THROW(std::out_of_range, "Position is outside valid region"); } - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); } template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const { //Perform clamping uXPos = (std::max)(uXPos, this->m_regValidRegion.getLowerX()); @@ -394,15 +394,15 @@ namespace PolyVox uYPos = (std::min)(uYPos, this->m_regValidRegion.getUpperY()); uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); } template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const { if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) { - return getVoxelImpl(uXPos, uYPos, uZPos, tBorder, WrapModeType()); // No bounds checks as we've just validated the position. + return getVoxelImpl(uXPos, uYPos, uZPos, WrapModeType(), tBorder); // No bounds checks as we've just validated the position. } else { @@ -411,7 +411,7 @@ namespace PolyVox } template - VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder, WrapModeType) const + VoxelType RawVolume::getVoxelImpl(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapModeType, VoxelType tBorder) const { const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner(); int32_t iLocalXPos = uXPos - v3dLowerCorner.getX();