Fix compilation when the SUPPORT_MESH_GENERATION feature is not supported (previously, the loadModel function was using the GenMeshCube texture, if no model founded, to generate a default cube mesh (#1075)
This commit is contained in:
parent
7e77dc7a21
commit
6a46dcb374
1 changed files with 5 additions and 2 deletions
|
@ -664,11 +664,14 @@ Model LoadModel(const char *fileName)
|
||||||
|
|
||||||
if (model.meshCount == 0)
|
if (model.meshCount == 0)
|
||||||
{
|
{
|
||||||
TraceLog(LOG_WARNING, "[%s] No meshes can be loaded, default to cube mesh", fileName);
|
|
||||||
|
|
||||||
model.meshCount = 1;
|
model.meshCount = 1;
|
||||||
model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh));
|
model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh));
|
||||||
|
#if defined(SUPPORT_MESH_GENERATION)
|
||||||
|
TraceLog(LOG_WARNING, "[%s] No meshes can be loaded, default to cube mesh", fileName);
|
||||||
model.meshes[0] = GenMeshCube(1.0f, 1.0f, 1.0f);
|
model.meshes[0] = GenMeshCube(1.0f, 1.0f, 1.0f);
|
||||||
|
#else
|
||||||
|
TraceLog(LOG_WARNING, "[%s] No meshes can be loaded, and can't create a default mesh. The raylib mesh generation is not supported (SUPPORT_MESH_GENERATION).", fileName);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue