From 7bfc2ccdde969fe97214956c7cdc5e91c0bb8502 Mon Sep 17 00:00:00 2001 From: Eugene Golushkov Date: Fri, 20 Sep 2024 23:37:12 +0200 Subject: [PATCH] hide calculation of the variables used only in assert under #if !defined( NDEBUG ) --- OgreMain/include/OgreDescriptorSetSampler.h | 2 +- OgreMain/src/Animation/OgreSkeletonAnimManager.cpp | 2 +- OgreMain/src/OgreDescriptorSetTexture.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OgreMain/include/OgreDescriptorSetSampler.h b/OgreMain/include/OgreDescriptorSetSampler.h index 7e6a270be14..e2037ee6614 100644 --- a/OgreMain/include/OgreDescriptorSetSampler.h +++ b/OgreMain/include/OgreDescriptorSetSampler.h @@ -108,7 +108,7 @@ namespace Ogre void checkValidity() const { -#if OGRE_DEBUG_MODE +#if OGRE_DEBUG_MODE && !defined( NDEBUG ) size_t totalSamplersUsed = 0u; for( size_t i = 0; i < NumShaderTypes; ++i ) diff --git a/OgreMain/src/Animation/OgreSkeletonAnimManager.cpp b/OgreMain/src/Animation/OgreSkeletonAnimManager.cpp index ba8f882da04..127e261b4ef 100644 --- a/OgreMain/src/Animation/OgreSkeletonAnimManager.cpp +++ b/OgreMain/src/Animation/OgreSkeletonAnimManager.cpp @@ -112,7 +112,7 @@ namespace Ogre skeletonsArray.insert( it, newInstance ); -#if OGRE_DEBUG_MODE +#if OGRE_DEBUG_MODE && !defined( NDEBUG ) { // Check all depth levels respect the same ordering FastArray::const_iterator itSkel = skeletonsArray.begin(); diff --git a/OgreMain/src/OgreDescriptorSetTexture.cpp b/OgreMain/src/OgreDescriptorSetTexture.cpp index 6e64fccbf50..c83750cb945 100644 --- a/OgreMain/src/OgreDescriptorSetTexture.cpp +++ b/OgreMain/src/OgreDescriptorSetTexture.cpp @@ -39,7 +39,7 @@ namespace Ogre { void DescriptorSetTexture::checkValidity() const { -#if OGRE_DEBUG_MODE +#if OGRE_DEBUG_MODE && !defined( NDEBUG ) size_t totalTexturesUsed = 0u; for( size_t i = 0; i < NumShaderTypes; ++i ) @@ -72,7 +72,7 @@ namespace Ogre "This DescriptorSetTexture2 doesn't use any texture/buffer! " "Perhaps incorrectly setup?" ); -#if OGRE_DEBUG_MODE +#if OGRE_DEBUG_MODE && !defined( NDEBUG ) size_t totalTexturesUsed = 0u; for( size_t i = 0; i < NumShaderTypes; ++i )