summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorVictor Gallet <[email protected]>2020-01-17 23:06:46 +0100
committerRay <[email protected]>2020-01-17 23:06:46 +0100
commit6a46dcb374a31eab225f8be9f8ed935a2530b44e (patch)
tree4c9ed479abdd3ef9a3bdd1b2711e8ef074be9b22 /src
parent7e77dc7a21ae9113ee7f1cccb3813019cf46bcc0 (diff)
downloadraylib-6a46dcb374a31eab225f8be9f8ed935a2530b44e.tar.gz
raylib-6a46dcb374a31eab225f8be9f8ed935a2530b44e.zip
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)
Diffstat (limited to 'src')
-rw-r--r--src/models.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c
index da7cde78..ba913e05 100644
--- a/src/models.c
+++ b/src/models.c
@@ -664,11 +664,14 @@ Model LoadModel(const char *fileName)
if (model.meshCount == 0)
{
- TraceLog(LOG_WARNING, "[%s] No meshes can be loaded, default to cube mesh", fileName);
-
model.meshCount = 1;
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);
+#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
{