fixed obj parsing bug

This commit is contained in:
h4570
2020-11-20 22:34:13 +01:00
parent 6b821afd86
commit 3d755e9983
+3
View File
@@ -147,7 +147,10 @@ void ObjLoader::allocateObjMemory(FILE *t_file, MeshFrame *o_result)
if (strcmp(lineHeader, "usemtl") == 0) if (strcmp(lineHeader, "usemtl") == 0)
{ {
if (currentMatI >= 0) // Skip -1 if (currentMatI >= 0) // Skip -1
{
o_result->getMaterial(currentMatI).allocateFaces(facesCounter); o_result->getMaterial(currentMatI).allocateFaces(facesCounter);
facesCounter = 0;
}
currentMatI++; currentMatI++;
} }
else if (strcmp(lineHeader, "f") == 0) else if (strcmp(lineHeader, "f") == 0)