Browse Source

Update rmodels.c

pull/2002/head
Ray 3 years ago
parent
commit
de173a93c8
1 changed files with 2 additions and 16 deletions
  1. +2
    -16
      src/rmodels.c

+ 2
- 16
src/rmodels.c View File

@ -4382,16 +4382,9 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co
int size = 0;
unsigned char *data = DecodeBase64(image->uri + i + 1, &size);
int width, height;
unsigned char *raw = LoadImageFromMemory(".png", data, size, &width, &height, NULL, 4);
rimage = LoadImageFromMemory(".png", data, size);
RL_FREE(data);
rimage.data = raw;
rimage.width = width;
rimage.height = height;
rimage.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
rimage.mipmaps = 1;
// TODO: Tint shouldn't be applied here!
ImageColorTint(&rimage, tint);
}
@ -4416,16 +4409,9 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co
n += stride;
}
int width, height;
unsigned char *raw = LoadImageFromMemory(".png", data, (int)image->buffer_view->size, &width, &height, NULL, 4);
rimage = LoadImageFromMemory(".png", data, size);
RL_FREE(data);
rimage.data = raw;
rimage.width = width;
rimage.height = height;
rimage.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
rimage.mipmaps = 1;
// TODO: Tint shouldn't be applied here!
ImageColorTint(&rimage, tint);
}

Loading…
Cancel
Save