Browse Source

Use internal default allocators, instead of user-exposed ones

pull/3284/head
Ray 1 year ago
parent
commit
75e5cd86d7
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      src/rmodels.c
  2. +1
    -1
      src/rtext.c

+ 2
- 2
src/rmodels.c View File

@ -1904,7 +1904,7 @@ Material *LoadMaterials(const char *fileName, int *materialCount)
int result = tinyobj_parse_mtl_file(&mats, &count, fileName); int result = tinyobj_parse_mtl_file(&mats, &count, fileName);
if (result != TINYOBJ_SUCCESS) TRACELOG(LOG_WARNING, "MATERIAL: [%s] Failed to parse materials file", fileName); if (result != TINYOBJ_SUCCESS) TRACELOG(LOG_WARNING, "MATERIAL: [%s] Failed to parse materials file", fileName);
materials = MemAlloc(count*sizeof(Material));
materials = RL_MALLOC(count*sizeof(Material));
ProcessMaterialsOBJ(materials, mats, count); ProcessMaterialsOBJ(materials, mats, count);
tinyobj_materials_free(mats, count); tinyobj_materials_free(mats, count);
@ -4704,7 +4704,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
if (result == cgltf_result_success) if (result == cgltf_result_success)
{ {
image = LoadImageFromMemory(".png", (unsigned char *)data, outSize); image = LoadImageFromMemory(".png", (unsigned char *)data, outSize);
MemFree(data);
RL_FREE(data);
} }
} }
} }

+ 1
- 1
src/rtext.c View File

@ -975,7 +975,7 @@ bool ExportFontAsCode(Font font, const char *fileName)
byteCount += sprintf(txtData + byteCount, "static unsigned char fontData_%s[COMPRESSED_DATA_SIZE_FONT_%s] = { ", fileNamePascal, TextToUpper(fileNamePascal)); byteCount += sprintf(txtData + byteCount, "static unsigned char fontData_%s[COMPRESSED_DATA_SIZE_FONT_%s] = { ", fileNamePascal, TextToUpper(fileNamePascal));
for (int i = 0; i < compDataSize - 1; i++) byteCount += sprintf(txtData + byteCount, ((i%TEXT_BYTES_PER_LINE == 0)? "0x%02x,\n " : "0x%02x, "), compData[i]); for (int i = 0; i < compDataSize - 1; i++) byteCount += sprintf(txtData + byteCount, ((i%TEXT_BYTES_PER_LINE == 0)? "0x%02x,\n " : "0x%02x, "), compData[i]);
byteCount += sprintf(txtData + byteCount, "0x%02x };\n\n", compData[compDataSize - 1]); byteCount += sprintf(txtData + byteCount, "0x%02x };\n\n", compData[compDataSize - 1]);
MemFree(compData);
RL_FREE(compData);
#else #else
// Save font image data (uncompressed) // Save font image data (uncompressed)
byteCount += sprintf(txtData + byteCount, "// Font image pixels data\n"); byteCount += sprintf(txtData + byteCount, "// Font image pixels data\n");

Loading…
Cancel
Save