mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-07 02:16:28 +00:00
Exposing some file access results to user layer #1420
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user