aboutsummaryrefslogtreecommitdiff
path: root/src/ModelLoader.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-03-11 01:52:27 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-18 15:22:10 +0100
commit1156c0f58b01ff080b9d9ede15b449a845df6654 (patch)
tree426c14ffd9e6aac2d37af58211e78b1fae8d6fe6 /src/ModelLoader.cpp
parent12c36c61c3f8d19c44cb2e5ffdf3ed812a0390d2 (diff)
Starting on entity system...HEADmaster
Diffstat (limited to 'src/ModelLoader.cpp')
-rw-r--r--src/ModelLoader.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ModelLoader.cpp b/src/ModelLoader.cpp
index 60626f1..099349c 100644
--- a/src/ModelLoader.cpp
+++ b/src/ModelLoader.cpp
@@ -171,13 +171,18 @@ namespace amalgine {
for(unsigned int j = 0; j < num_textures; ++j) {
std::string texture_name = model_loader.extract_null_terminated_string();
+ if(texture_name.empty())
+ continue;
+
fprintf(stderr, "texture name: %s\n", texture_name.c_str());
std::string texture_path = dir_path + "/" + texture_name;
- assert(!*image); // TODO: Support multiple images
+ //assert(!*image); // TODO: Support multiple images
+ if(*image)
+ continue;
Result<Image*> image_result = Image::loadFromFile(texture_path.c_str());
if(!image_result) {
- fprintf(stderr, "%s\n", image_result.getErrorMsg().c_str());
- return false;
+ fprintf(stderr, "Warning: %s\n", image_result.getErrorMsg().c_str());
+ continue;
}
*image = image_result.unwrap();
}