Exposing some file access results to user layer #1420

This commit is contained in:
Ray 2020-11-22 00:10:16 +01:00
parent 36dc302c25
commit bb9d734f69
6 changed files with 70 additions and 39 deletions

View file

@ -823,8 +823,10 @@ void UnloadMesh(Mesh mesh)
}
// Export mesh data to file
void ExportMesh(Mesh mesh, const char *fileName)
bool ExportMesh(Mesh mesh, const char *fileName)
{
bool success = false;
if (IsFileExtension(fileName, ".obj"))
{
// Estimated data size, it should be enough...
@ -875,7 +877,7 @@ void ExportMesh(Mesh mesh, const char *fileName)
bytesCount += sprintf(txtData + bytesCount, "\n");
// NOTE: Text data length exported is determined by '\0' (NULL) character
SaveFileText(fileName, txtData);
success = SaveFileText(fileName, txtData);
RL_FREE(txtData);
}
@ -883,6 +885,8 @@ void ExportMesh(Mesh mesh, const char *fileName)
{
// TODO: Support additional file formats to export mesh vertex data
}
return success;
}
// Load materials from model file