diff --git a/include/osg/Material b/include/osg/Material index 71552ef38..b2552596e 100644 --- a/include/osg/Material +++ b/include/osg/Material @@ -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) diff --git a/include/osgFX/Validator b/include/osgFX/Validator index f7ed60bac..c5fc47909 100644 --- a/include/osgFX/Validator +++ b/include/osgFX/Validator @@ -63,11 +63,12 @@ namespace osgFX inline int Validator::compare(const osg::StateAttribute &sa) const { - const Validator *v = dynamic_cast(&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; }