Added ResourceRef (Automatic resource reference)

Former-commit-id: 97a0b2732f4dc443b8e1676e68b33b1b53ddf4fb
This commit is contained in:
Lynix
2013-03-15 03:09:58 +01:00
parent 4ee6ca05ed
commit 6c2fb1eb89
29 changed files with 344 additions and 299 deletions

View File

@@ -52,7 +52,7 @@ namespace
}
protected:
NzSubMesh* m_subMesh;
NzSubMeshRef m_subMesh;
};
class SkeletalMeshVertexMapper : public SubMeshVertexMapper
@@ -63,13 +63,10 @@ namespace
m_mesh(subMesh)
{
m_vertices = reinterpret_cast<NzMeshVertex*>(m_mesh->GetBindPoseBuffer());
m_mesh->AddResourceReference();
}
virtual ~SkeletalMeshVertexMapper() noexcept
{
m_mesh->RemoveResourceReference();
}
NzVector3f GetNormal(unsigned int i) const