aboutsummaryrefslogtreecommitdiff
path: root/src/ModelLoader.cpp
diff options
context:
space:
mode:
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();
}