Adding some additional check to avoid viewer crashes when the user changes the asset too fast.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@404 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2009-04-24 21:43:48 +00:00
parent 9abcba4bc2
commit 807e2de3f4
1 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,9 @@ int CMeshRenderer::DrawSorted(unsigned int iIndex,const aiMatrix4x4& mWorld)
AssetHelper::MeshHelper* pcHelper = g_pcAsset->apcMeshes[iIndex]; AssetHelper::MeshHelper* pcHelper = g_pcAsset->apcMeshes[iIndex];
const aiMesh* pcMesh = g_pcAsset->pcScene->mMeshes[iIndex]; const aiMesh* pcMesh = g_pcAsset->pcScene->mMeshes[iIndex];
if (!pcHelper || !pcMesh || !pcHelper->piIB)
return -5;
if (pcMesh->mPrimitiveTypes != aiPrimitiveType_TRIANGLE) if (pcMesh->mPrimitiveTypes != aiPrimitiveType_TRIANGLE)
return DrawUnsorted(iIndex); return DrawUnsorted(iIndex);
if (pcMesh->HasBones()) if (pcMesh->HasBones())