Skip to content

Commit 02e283d

Browse files
authored
Remove invalid "warn" argument passed to tinyobj::loadObject(...) (#406)
* Update 28_model_loading.cpp Removed "warn" argument passed to tinyobj::LoadObj(...). * Update 29_mipmapping.cpp Removed "warn" argument passed to tinyobj::LoadObj(...). * Update 30_multisampling.cpp Removed "warn" argument passed to tinyobj::LoadObj(...). * Update 08_Loading_models.md Removed "warn" argument passed to tinyobj::LoadObj(...) from e-book. * Update 08_Charger_des_modèles.md Removed "warn" argument passed to tinyobj::LoadObj(...).
1 parent d61a0f1 commit 02e283d

5 files changed

+15
-15
lines changed

code/28_model_loading.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -995,10 +995,10 @@ class HelloTriangleApplication {
995995
tinyobj::attrib_t attrib;
996996
std::vector<tinyobj::shape_t> shapes;
997997
std::vector<tinyobj::material_t> materials;
998-
std::string warn, err;
998+
std::string err;
999999

1000-
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, MODEL_PATH.c_str())) {
1001-
throw std::runtime_error(warn + err);
1000+
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &err, MODEL_PATH.c_str())) {
1001+
throw std::runtime_error(err);
10021002
}
10031003

10041004
std::unordered_map<Vertex, uint32_t> uniqueVertices{};

code/29_mipmapping.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1089,10 +1089,10 @@ class HelloTriangleApplication {
10891089
tinyobj::attrib_t attrib;
10901090
std::vector<tinyobj::shape_t> shapes;
10911091
std::vector<tinyobj::material_t> materials;
1092-
std::string warn, err;
1092+
std::string err;
10931093

1094-
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, MODEL_PATH.c_str())) {
1095-
throw std::runtime_error(warn + err);
1094+
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &err, MODEL_PATH.c_str())) {
1095+
throw std::runtime_error(err);
10961096
}
10971097

10981098
std::unordered_map<Vertex, uint32_t> uniqueVertices{};

code/30_multisampling.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1139,10 +1139,10 @@ class HelloTriangleApplication {
11391139
tinyobj::attrib_t attrib;
11401140
std::vector<tinyobj::shape_t> shapes;
11411141
std::vector<tinyobj::material_t> materials;
1142-
std::string warn, err;
1142+
std::string err;
11431143

1144-
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, MODEL_PATH.c_str())) {
1145-
throw std::runtime_error(warn + err);
1144+
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &err, MODEL_PATH.c_str())) {
1145+
throw std::runtime_error(err);
11461146
}
11471147

11481148
std::unordered_map<Vertex, uint32_t> uniqueVertices{};

en/08_Loading_models.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ void loadModel() {
138138
tinyobj::attrib_t attrib;
139139
std::vector<tinyobj::shape_t> shapes;
140140
std::vector<tinyobj::material_t> materials;
141-
std::string warn, err;
141+
std::string err;
142142

143-
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, MODEL_PATH.c_str())) {
144-
throw std::runtime_error(warn + err);
143+
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &err, MODEL_PATH.c_str())) {
144+
throw std::runtime_error(err);
145145
}
146146
}
147147
```

fr/08_Charger_des_modèles.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ void loadModel() {
120120
tinyobj::attrib_t attrib;
121121
std::vector<tinyobj::shape_t> shapes;
122122
std::vector<tinyobj::material_t> materials;
123-
std::string warn, err;
123+
std::string err;
124124

125-
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, MODEL_PATH.c_str())) {
126-
throw std::runtime_error(warn + err);
125+
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &err, MODEL_PATH.c_str())) {
126+
throw std::runtime_error(err);
127127
}
128128
}
129129
```

0 commit comments

Comments
 (0)