From 12c36c61c3f8d19c44cb2e5ffdf3ed812a0390d2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 29 Feb 2020 03:05:36 +0100 Subject: Implement .a3d model loader (amalgine specific format) --- src/model_loader/ObjModelLoader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/model_loader') 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 load_material_from_file(const char *filepath); - void ObjModelLoader::load_from_file(const char *filepath, std::vector &triangles, std::vector &texture_coords, Image **image) { + bool ObjModelLoader::load_from_file(const char *filepath, std::vector &triangles, std::vector &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 load_material_from_file(const char *filepath) { -- cgit v1.2.3