Added IsFileExtension()

Replaced old GetExtension() function
Make IsFileExtension() public to the API
This commit is contained in:
Ray 2017-03-29 00:35:42 +02:00
parent 2f65975c5e
commit 080a79f0b0
9 changed files with 83 additions and 77 deletions

View file

@ -593,7 +593,7 @@ Mesh LoadMesh(const char *fileName)
Mesh mesh = { 0 };
#if defined(SUPPORT_FILEFORMAT_OBJ)
if (strcmp(GetExtension(fileName), "obj") == 0) mesh = LoadOBJ(fileName);
if (IsFileExtension(fileName, ".obj")) mesh = LoadOBJ(fileName);
#else
TraceLog(WARNING, "[%s] Mesh fileformat not supported, it can't be loaded", fileName);
#endif
@ -706,7 +706,7 @@ Material LoadMaterial(const char *fileName)
Material material = { 0 };
#if defined(SUPPORT_FILEFORMAT_MTL)
if (strcmp(GetExtension(fileName), "mtl") == 0) material = LoadMTL(fileName);
if (IsFileExtension(fileName, ".mtl")) material = LoadMTL(fileName);
#else
TraceLog(WARNING, "[%s] Material fileformat not supported, it can't be loaded", fileName);
#endif