Minor fixes

This commit is contained in:
Jérôme Leclercq
2021-11-28 20:19:37 +01:00
parent 0c3bcf6c86
commit 01cd4986cc
20 changed files with 112 additions and 88 deletions

View File

@@ -16,9 +16,15 @@ namespace Nz
inline void Model::SetMaterial(std::size_t subMeshIndex, std::shared_ptr<Material> material)
{
assert(subMeshIndex < m_submeshes.size());
assert(material);
OnMaterialInvalidated(this, subMeshIndex, material);
m_submeshes[subMeshIndex].material = std::move(material);
if (m_submeshes[subMeshIndex].material != material)
{
OnMaterialInvalidated(this, 0, material);
m_submeshes[subMeshIndex].material = std::move(material);
OnElementInvalidated(this);
}
}
}