Set mNumUVComponents to 0 when deleting texture coordinate sets

pull/1524/head
Daniel Hritzkiv 2017-10-31 15:14:21 -04:00
parent 938c02a358
commit cc4531459f
No known key found for this signature in database
GPG Key ID: D1D19875679D5CBF
1 changed files with 5 additions and 2 deletions

View File

@ -360,10 +360,13 @@ int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh)
// process texture coordinates // process texture coordinates
for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS && pMesh->mTextureCoords[i];++i) { for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS && pMesh->mTextureCoords[i];++i) {
if (ProcessArray(pMesh->mTextureCoords[i],pMesh->mNumVertices,"uvcoords",dirtyMask)) { if (ProcessArray(pMesh->mTextureCoords[i],pMesh->mNumVertices,"uvcoords",dirtyMask)) {
pMesh->mNumUVComponents[i] = 0;
// delete all subsequent texture coordinate sets. // delete all subsequent texture coordinate sets.
for (unsigned int a = i+1; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;++a) { for (unsigned int a = i + 1; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) {
delete[] pMesh->mTextureCoords[a]; pMesh->mTextureCoords[a] = NULL; delete[] pMesh->mTextureCoords[a];
pMesh->mTextureCoords[a] = NULL;
pMesh->mNumUVComponents[a] = 0;
} }
ret = true; ret = true;
} }