]> git.mxchange.org Git - simgear.git/commitdiff
change dynamic variance of effect attributes
authorTim Moore <timoore33@gmail.com>
Mon, 6 Aug 2012 08:58:51 +0000 (10:58 +0200)
committerTim Moore <timoore33@gmail.com>
Mon, 6 Aug 2012 09:04:42 +0000 (11:04 +0200)
Previously, any effect attribute that was set via effect parameters i.e., was
not a constant value, was marked with data variance DYNAMIC. Now, only
attributes that get their values from the property tree are so marked.

simgear/scene/material/EffectBuilder.hxx

index 3447024f1b564f8f2abbbb2581f1c0af5246ca6b..949b5f4e12fd8c9cb29e7f84b8fc3e5ef678254a 100644 (file)
@@ -614,10 +614,10 @@ initFromParameters(Effect* effect, const SGPropertyNode* prop, ObjType* obj,
     const SGPropertyNode* valProp = getEffectPropertyNode(effect, prop);
     if (!valProp)
         return;
-    setDynamicVariance(obj);
     if (valProp->nChildren() == 0) {
         setter(obj, valProp->getValue<OSGParamType>());
     } else {
+        setDynamicVariance(obj);
         std::string propName = getGlobalProperty(valProp, options);
         ScalarChangeListener<OSGParamType, ObjType, F>* listener
             = new ScalarChangeListener<OSGParamType, ObjType, F>(obj, setter,
@@ -667,10 +667,10 @@ initFromParameters(Effect* effect, const SGPropertyNode* prop, ObjType* obj,
     const SGPropertyNode* valProp = getEffectPropertyNode(effect, prop);
     if (!valProp)
         return;
-    setDynamicVariance(obj);
     if (valProp->nChildren() == 0) { // Has <use>?
         setter(obj, Bridge<OSGParamType>::get(valProp->getValue<sg_type>()));
     } else {
+        setDynamicVariance(obj);
         std::vector<std::string> paramNames
             = getVectorProperties(valProp, options,numComponents, nameItr);
         if (paramNames.empty())