diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-02-29 03:05:36 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-18 15:22:10 +0100 |
commit | 12c36c61c3f8d19c44cb2e5ffdf3ed812a0390d2 (patch) | |
tree | 5c45ed12702335ba5a30706ba413daab95995af9 /src/model_loader | |
parent | c3453fedbd270afe8d9dfc7f288ea7205f029b86 (diff) |
Implement .a3d model loader (amalgine specific format)
Diffstat (limited to 'src/model_loader')
-rw-r--r-- | src/model_loader/ObjModelLoader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/model_loader/ObjModelLoader.cpp b/src/model_loader/ObjModelLoader.cpp index 7976bc9..7c4ee5c 100644 --- a/src/model_loader/ObjModelLoader.cpp +++ b/src/model_loader/ObjModelLoader.cpp @@ -101,7 +101,7 @@ namespace amalgine { static Result<Material> load_material_from_file(const char *filepath); - void ObjModelLoader::load_from_file(const char *filepath, std::vector<Triangle3D> &triangles, std::vector<vec2f> &texture_coords, Image **image) { + bool ObjModelLoader::load_from_file(const char *filepath, std::vector<Triangle3D> &triangles, std::vector<vec2f> &texture_coords, Image **image) { triangles.clear(); texture_coords.clear(); *image = nullptr; @@ -109,7 +109,7 @@ namespace amalgine { size_t file_size; char *file_data = file_get_content(filepath, &file_size); if(!file_data) - return; + return false; std::string dir_path = filepath; dirname(&dir_path[0]); @@ -238,6 +238,7 @@ namespace amalgine { cleanup: free(file_data); + return true; } Result<Material> load_material_from_file(const char *filepath) { |