Sfoglia il codice sorgente

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 anni fa
parent
commit
09db8330c4
2 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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();
     Pass* pass = new Pass(getId(), technique, effect);
     RenderState::cloneInto(pass, context);
+    pass->_parent = technique;
     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);
     }
     RenderState::cloneInto(technique, context);
+    technique->_parent = material;
     return technique;
 }