summaryrefslogtreecommitdiffhomepage
path: root/src/models.c
diff options
context:
space:
mode:
authorRay <[email protected]>2020-11-22 00:10:16 +0100
committerRay <[email protected]>2020-11-22 00:10:16 +0100
commitbb9d734f69f70be641b7db9c8a573fb4fb5b8ee8 (patch)
tree2af4f7faf367999c71c7e612a60537604a37c6fd /src/models.c
parent36dc302c25fc8143f2c8c45d6d101c7043e15872 (diff)
downloadraylib-bb9d734f69f70be641b7db9c8a573fb4fb5b8ee8.tar.gz
raylib-bb9d734f69f70be641b7db9c8a573fb4fb5b8ee8.zip
Exposing some file access results to user layer #1420
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c
index 68de0504..ab3ea7f7 100644
--- a/src/models.c
+++ b/src/models.c
@@ -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