Implemented default mesh
In case mesh loading fails, a cube is generated instead!
This commit is contained in:
parent
76a6bf6c52
commit
847bdaf682
1 changed files with 5 additions and 3 deletions
|
@ -631,11 +631,13 @@ Mesh LoadMesh(const char *fileName)
|
||||||
TraceLog(LOG_WARNING, "[%s] Mesh fileformat not supported, it can't be loaded", fileName);
|
TraceLog(LOG_WARNING, "[%s] Mesh fileformat not supported, it can't be loaded", fileName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mesh.vertexCount == 0) TraceLog(LOG_WARNING, "Mesh could not be loaded");
|
if (mesh.vertexCount == 0)
|
||||||
|
{
|
||||||
|
TraceLog(LOG_WARNING, "Mesh could not be loaded! Let's load a cube to replace it!");
|
||||||
|
mesh = GenMeshCube(1.0f, 1.0f, 1.0f);
|
||||||
|
}
|
||||||
else rlLoadMesh(&mesh, false); // Upload vertex data to GPU (static mesh)
|
else rlLoadMesh(&mesh, false); // Upload vertex data to GPU (static mesh)
|
||||||
|
|
||||||
// TODO: Initialize default mesh data in case loading fails, maybe a cube?
|
|
||||||
|
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue