Fixed osgFX::Validator::compare(..) so that it checked for the correct

StateAttribute type before comparing member variables.

Fixed docs typo in Material
This commit is contained in:
Robert Osfield 2004-01-04 12:37:18 +00:00
parent ad97db86a2
commit d25b682269
2 changed files with 7 additions and 6 deletions

View File

@ -56,7 +56,7 @@ class SG_EXPORT Material : public StateAttribute
// used by the COMPARE_StateAttribute_Paramter macro's below.
COMPARE_StateAttribute_Types(Material,sa)
// compare each paramter in turn against the rhs.
// compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_colorMode)
COMPARE_StateAttribute_Parameter(_ambientFrontAndBack)
COMPARE_StateAttribute_Parameter(_ambientFront)

View File

@ -63,11 +63,12 @@ namespace osgFX
inline int Validator::compare(const osg::StateAttribute &sa) const
{
const Validator *v = dynamic_cast<const Validator *>(&sa);
if (!v) return -1;
if (effect_ < v->effect_) return -1;
if (effect_ > v->effect_) return 1;
// check the types are equal and then create the rhs variable
//used by the COMPARE_StateAttribute_Paramter macro's below.
COMPARE_StateAttribute_Types(Validator,sa)
// compare parameters
COMPARE_StateAttribute_Parameter(effect_)
return 0;
}