Răsfoiți Sursa

Fixes parent relationship for cloned pass and techniques

traversing the render states produced unintended results as the parent relationship of the original object was followed.
Wolfgang Damm 12 ani în urmă
părinte
comite
09db8330c4
2 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 1 0
      gameplay/src/Pass.cpp
  2. 1 0
      gameplay/src/Technique.cpp

+ 1 - 0
gameplay/src/Pass.cpp

@@ -92,6 +92,7 @@ Pass* Pass::clone(Technique* technique, NodeCloneContext &context) const
     effect->addRef();
     effect->addRef();
     Pass* pass = new Pass(getId(), technique, effect);
     Pass* pass = new Pass(getId(), technique, effect);
     RenderState::cloneInto(pass, context);
     RenderState::cloneInto(pass, context);
+    pass->_parent = technique;
     return pass;
     return pass;
 }
 }
 
 

+ 1 - 0
gameplay/src/Technique.cpp

@@ -65,6 +65,7 @@ Technique* Technique::clone(Material* material, NodeCloneContext &context) const
         technique->_passes.push_back(passCopy);
         technique->_passes.push_back(passCopy);
     }
     }
     RenderState::cloneInto(technique, context);
     RenderState::cloneInto(technique, context);
+    technique->_parent = material;
     return technique;
     return technique;
 }
 }