Browse Source

Update rmodels.c

pull/3394/head
Ray 1 year ago
parent
commit
33c84b3c00
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      src/rmodels.c

+ 6
- 4
src/rmodels.c View File

@ -5614,12 +5614,13 @@ static Model LoadM3D(const char *fileName)
// We always need a default material, so we add +1 // We always need a default material, so we add +1
model.materialCount++; model.materialCount++;
// Faces must be in non-decreasing materialid order
// Verify that quickly, sorting them otherwise.
// Faces must be in non-decreasing materialid order. Verify that quickly, sorting them otherwise.
// WARNING: Sorting is not needed, valid M3D model files should already be sorted
// Just keeping the sorting function for reference (Check PR #3363 #3385)
/*
for (i = 1; i < m3d->numface; i++) for (i = 1; i < m3d->numface; i++)
{ {
if ( m3d->face[i-1].materialid <= m3d->face[i].materialid )
continue;
if (m3d->face[i-1].materialid <= m3d->face[i].materialid) continue;
// face[i-1] > face[i]. slide face[i] lower. // face[i-1] > face[i]. slide face[i] lower.
m3df_t slider = m3d->face[i]; m3df_t slider = m3d->face[i];
@ -5634,6 +5635,7 @@ static Model LoadM3D(const char *fileName)
m3d->face[j+1] = slider; m3d->face[j+1] = slider;
} }
*/
model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh)); model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh));
model.meshMaterial = (int *)RL_CALLOC(model.meshCount, sizeof(int)); model.meshMaterial = (int *)RL_CALLOC(model.meshCount, sizeof(int));

Loading…
Cancel
Save