Only load vertex colors when color map and/or materials are present

This commit is contained in:
Uneven Prankster 2023-01-28 18:08:13 -03:00
parent c0757621ea
commit 52c87d74ad

View File

@ -5632,7 +5632,11 @@ static Model LoadM3D(const char *fileName)
model.meshes[k].vertices = (float *)RL_CALLOC(model.meshes[k].vertexCount*3, sizeof(float));
model.meshes[k].texcoords = (float *)RL_CALLOC(model.meshes[k].vertexCount*2, sizeof(float));
model.meshes[k].normals = (float *)RL_CALLOC(model.meshes[k].vertexCount*3, sizeof(float));
if(m3d->cmap != NULL || mi != M3D_UNDEF)
{
model.meshes[k].colors = RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char));
}
if (m3d->numbone && m3d->numskin)
{