瀏覽代碼

[models] file open error check

pull/12/head
raysan5 10 年之前
父節點
當前提交
db1ad74ef2
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. +6
    -0
      src/models.c

+ 6
- 0
src/models.c 查看文件

@ -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…
取消
儲存