From fd9063628aeaf0ff30d1b2e99bf47282525fd69f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 8 Nov 2004 16:39:10 +0000 Subject: [PATCH] Added guard to testing _internalFormat in compareTexture(..) so that a comparison would only be done if both the lhs and rhs had already been set to a non zero value. --- src/osg/Texture.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 760925174..00cfa5ce5 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -384,9 +384,13 @@ int Texture::compareTexture(const Texture& rhs) const COMPARE_StateAttribute_Parameter(_maxAnisotropy) COMPARE_StateAttribute_Parameter(_useHardwareMipMapGeneration) COMPARE_StateAttribute_Parameter(_internalFormatMode) -#if 1 - COMPARE_StateAttribute_Parameter(_internalFormat) -#endif + + // only compare _internalFomat is it has alrady been set in both lhs, and rhs + if (_internalFormat!=0 && rhs._internalFormat!=0) + { + COMPARE_StateAttribute_Parameter(_internalFormat) + } + COMPARE_StateAttribute_Parameter(_use_shadow_comparison) COMPARE_StateAttribute_Parameter(_shadow_compare_func) COMPARE_StateAttribute_Parameter(_shadow_texture_mode)