summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2024-03-07 12:10:26 +0100
committerRay <[email protected]>2024-03-07 12:10:26 +0100
commitc1c9b69290be83c7f6400fe4bd0dd7f0e1c20d98 (patch)
treef0f54df7181a86e2e6686b2c9564423179aaf130 /src
parent190487383860c54d1746444f17b59c36decfca1e (diff)
downloadraylib-c1c9b69290be83c7f6400fe4bd0dd7f0e1c20d98.tar.gz
raylib-c1c9b69290be83c7f6400fe4bd0dd7f0e1c20d98.zip
Implemented fix for #3859
Diffstat (limited to 'src')
-rw-r--r--src/rmodels.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rmodels.c b/src/rmodels.c
index 5be06b37..29b05ce3 100644
--- a/src/rmodels.c
+++ b/src/rmodels.c
@@ -5810,6 +5810,12 @@ static Model LoadM3D(const char *fileName)
// If no map is provided, or we have colors defined, we allocate storage for vertex colors
// M3D specs only consider vertex colors if no material is provided, however raylib uses both and mixes the colors
if ((mi == M3D_UNDEF) || vcolor) model.meshes[k].colors = RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char));
+
+ // If no map is provided and we allocated vertex colors, set them to white
+ if ((mi == M3D_UNDEF) && (model.meshes[k].colors != NULL))
+ {
+ for (int c = 0; c < model.meshes[k].vertexCount*4; c++) model.meshes[k].colors[c] = 255;
+ }
if (m3d->numbone && m3d->numskin)
{