aboutsummaryrefslogtreecommitdiff
path: root/src/model_loader/ObjModelLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/model_loader/ObjModelLoader.cpp')
-rw-r--r--src/model_loader/ObjModelLoader.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/model_loader/ObjModelLoader.cpp b/src/model_loader/ObjModelLoader.cpp
index 51d8a74..a42f8d7 100644
--- a/src/model_loader/ObjModelLoader.cpp
+++ b/src/model_loader/ObjModelLoader.cpp
@@ -160,16 +160,16 @@ namespace amalgine {
texture_coords.push_back(temp_texture_coords[texture_coord_indices[1]]);
texture_coords.push_back(temp_texture_coords[texture_coord_indices[2]]);
} else if(num_columns == 4) { // Quad, convert to triangle. TODO: Support rendering quads instead of converting to triangles
- triangles.push_back({ vertices[vertex_indices[0]], vertices[vertex_indices[1]], vertices[vertex_indices[3]] });
- triangles.push_back({ vertices[vertex_indices[3]], vertices[vertex_indices[2]], vertices[vertex_indices[1]] });
+ triangles.push_back({ vertices[vertex_indices[0]], vertices[vertex_indices[1]], vertices[vertex_indices[2]] });
+ triangles.push_back({ vertices[vertex_indices[2]], vertices[vertex_indices[3]], vertices[vertex_indices[0]] });
texture_coords.push_back(temp_texture_coords[texture_coord_indices[0]]);
texture_coords.push_back(temp_texture_coords[texture_coord_indices[1]]);
- texture_coords.push_back(temp_texture_coords[texture_coord_indices[3]]);
+ texture_coords.push_back(temp_texture_coords[texture_coord_indices[2]]);
- texture_coords.push_back(temp_texture_coords[texture_coord_indices[3]]);
texture_coords.push_back(temp_texture_coords[texture_coord_indices[2]]);
- texture_coords.push_back(temp_texture_coords[texture_coord_indices[1]]);
+ texture_coords.push_back(temp_texture_coords[texture_coord_indices[3]]);
+ texture_coords.push_back(temp_texture_coords[texture_coord_indices[0]]);
}
}
}
@@ -245,7 +245,7 @@ namespace amalgine {
Result<Image*> image_result = Image::loadFromFile(texture_path.c_str());
if(!image_result)
- return Result<Material>::Err("Failed to load texture: " + texture_path);
+ return Result<Material>::Err(image_result.getErrorMsg(), image_result.getErrorCode());
image = image_result.unwrap();
break;