Merge pull request #13760 from super626/materialfix2

fix material clone
This commit is contained in:
pandamicro 2015-09-11 18:24:05 +08:00
commit 4022fb65e1
2 changed files with 2 additions and 0 deletions

View File

@ -442,6 +442,7 @@ Material* Material::clone() const
for (const auto& technique: _techniques) for (const auto& technique: _techniques)
{ {
auto t = technique->clone(); auto t = technique->clone();
t->_parent = material;
material->_techniques.pushBack(t); material->_techniques.pushBack(t);
} }

View File

@ -86,6 +86,7 @@ Technique* Technique::clone() const
for (const auto pass: _passes) for (const auto pass: _passes)
{ {
auto p = pass->clone(); auto p = pass->clone();
p->_parent = technique;
technique->_passes.pushBack(p); technique->_passes.pushBack(p);
} }