Fixed model using last mesh materials for new mesh

Former-commit-id: 91bd231b45b701b18d6e86eab74afbd141a51ded
This commit is contained in:
Lynix 2013-06-25 14:50:38 +02:00
parent 9a3616f538
commit f3603a0b31
1 changed files with 2 additions and 1 deletions

View File

@ -490,6 +490,7 @@ void NzModel::SetMesh(NzMesh* mesh)
}
m_matCount = mesh->GetMaterialCount();
m_materials.clear();
m_materials.resize(m_matCount, NzMaterial::GetDefault());
m_skinCount = 1;
}
@ -498,8 +499,8 @@ void NzModel::SetMesh(NzMesh* mesh)
m_boundingVolume.MakeNull();
m_boundingVolumeUpdated = true;
m_matCount = 0;
m_skinCount = 0;
m_materials.clear();
m_skinCount = 0;
SetAnimation(nullptr);
}