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:
parent
ad97db86a2
commit
d25b682269
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user