some work on assetmgr

This commit is contained in:
2026-03-04 14:45:34 +02:00
parent 9884006888
commit ddbdef713b
20 changed files with 282 additions and 153 deletions

View File

@@ -26,12 +26,15 @@ void C_BaseModelEntity::SetModel( const char *szName )
}
m_uModelIndex = g_pAssetManager->LoadModel(szName);
m_pModel = g_pAssetManager->GetModelByIndex(m_uModelIndex);
m_pInstance = g_pWorldRenderer->CreateInstance(m_pModel->m_pMesh);
FunnyMesh_t *pMesh = g_pAssetManager->GetMeshByIndex(m_pModel->m_hMesh);
m_pInstance = g_pWorldRenderer->CreateInstance(pMesh->m_pMesh);
}
C_BaseModelEntity::~C_BaseModelEntity()
{
g_pWorldRenderer->DestroyMeshInstance(m_pModel->m_pMesh, m_pInstance);
FunnyMesh_t *pMesh = g_pAssetManager->GetMeshByIndex(m_pModel->m_hMesh);
g_pWorldRenderer->DestroyMeshInstance(pMesh->m_pMesh, m_pInstance);
g_pAssetManager->UnrefModel(m_uModelIndex);
}