From 87973523ad1e0b611e8784d1611ac310c839ba7a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 21 Jan 2003 16:02:29 +0000 Subject: [PATCH] Added gaurds around alpha function value to catch erroneous values before they are passed on to the OSG. --- src/osgPlugins/txp/TrPageArchive.cpp | 2 +- src/osgPlugins/txp/TrPageParser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/txp/TrPageArchive.cpp b/src/osgPlugins/txp/TrPageArchive.cpp index 6dfb147d4..42996e1f5 100644 --- a/src/osgPlugins/txp/TrPageArchive.cpp +++ b/src/osgPlugins/txp/TrPageArchive.cpp @@ -233,7 +233,7 @@ void TrPageArchive::LoadMaterials() int alphaFunc; mat->GetAlphaFunc(alphaFunc); - if( alphaFunc != trpgMaterial::None) + if( alphaFunc>=GL_NEVER && alphaFunc<=GL_ALWAYS) { float64 ref; mat->GetAlphaRef(ref); diff --git a/src/osgPlugins/txp/TrPageParser.cpp b/src/osgPlugins/txp/TrPageParser.cpp index f75f33ec9..b20ffde41 100644 --- a/src/osgPlugins/txp/TrPageParser.cpp +++ b/src/osgPlugins/txp/TrPageParser.cpp @@ -761,7 +761,7 @@ void TrPageParser::LoadLocalMaterials() */ int alphaFunc; mat->GetAlphaFunc(alphaFunc); - if( alphaFunc != trpgMaterial::None) + if( alphaFunc>=GL_NEVER && alphaFunc<=GL_ALWAYS) { float64 ref; mat->GetAlphaRef(ref);