[models] file open error check
This commit is contained in:
parent
2e5f58255a
commit
db1ad74ef2
1 changed files with 6 additions and 0 deletions
|
@ -1290,6 +1290,12 @@ static VertexData LoadOBJ(const char *fileName)
|
||||||
FILE *objFile;
|
FILE *objFile;
|
||||||
|
|
||||||
objFile = fopen(fileName, "rt");
|
objFile = fopen(fileName, "rt");
|
||||||
|
|
||||||
|
if (objFile == NULL)
|
||||||
|
{
|
||||||
|
TraceLog(WARNING, "[%s] OBJ file could not be opened", fileName);
|
||||||
|
return vData;
|
||||||
|
}
|
||||||
|
|
||||||
// First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles
|
// First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles
|
||||||
// NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition)
|
// NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue