From 0c7002a1cef8b153b779327d0343204717f3428a Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Mon, 27 May 2013 14:24:52 +0200 Subject: [PATCH] Avoided double bounds check. --- library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl | 4 ++-- library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl | 4 ++-- library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 3c857875..0bc880ef 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -224,14 +224,14 @@ namespace PolyVox uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); //Get the voxel value - return getVoxel(uXPos, uYPos, uZPos); + return getVoxel(uXPos, uYPos, uZPos, BoundsChecks::None); // No bounds checks as we've just validated the position. //No need to break as we've returned } case WrapModes::Border: { if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) { - return getVoxel(uXPos, uYPos, uZPos); + return getVoxel(uXPos, uYPos, uZPos, BoundsChecks::None); // No bounds checks as we've just validated the position. } else { diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl index 2f421724..39e51690 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.inl @@ -182,14 +182,14 @@ namespace PolyVox uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); //Get the voxel value - return getVoxel(uXPos, uYPos, uZPos); + return getVoxel(uXPos, uYPos, uZPos, BoundsChecks::None); // No bounds checks as we've just validated the position. //No need to break as we've returned } case WrapModes::Border: { if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) { - return getVoxel(uXPos, uYPos, uZPos); + return getVoxel(uXPos, uYPos, uZPos, BoundsChecks::None); // No bounds checks as we've just validated the position. } else { diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl index faac1268..b17bf517 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl @@ -182,14 +182,14 @@ namespace PolyVox uZPos = (std::min)(uZPos, this->m_regValidRegion.getUpperZ()); //Get the voxel value - return getVoxel(uXPos, uYPos, uZPos); + return getVoxel(uXPos, uYPos, uZPos, BoundsChecks::None); // No bounds checks as we've just validated the position. //No need to break as we've returned } case WrapModes::Border: { if(this->m_regValidRegion.containsPoint(uXPos, uYPos, uZPos)) { - return getVoxel(uXPos, uYPos, uZPos); + return getVoxel(uXPos, uYPos, uZPos, BoundsChecks::None); // No bounds checks as we've just validated the position. } else {