Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-22 21:04:15 +0000
committerStijn Buys <ingar@osirion.org>2012-11-22 21:04:15 +0000
commitedc5ddce817244111b302e449c28a052f2746cc4 (patch)
treefb58a102cdae3c5729245c6671b1f2b3c3c76088
parent43b435c8488501d62fb15940eb551db30db3b898 (diff)
Corrected a bug in the OBJ file reader that prevented it from reading certain OBJ files, thanks to Karvajalka.
-rw-r--r--src/model/objfile.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/model/objfile.cc b/src/model/objfile.cc
index 56d3692..489da2c 100644
--- a/src/model/objfile.cc
+++ b/src/model/objfile.cc
@@ -121,7 +121,7 @@ bool OBJFile::read()
con_warn << objfile_name << " invalid material definition at line " << index_line << std::endl;
- } else if( word.compare("v") == 0) { /* New wertex */
+ } else if( word.compare("v") == 0) { /* new wertex */
float x, y, z;
line >> x >> y >> z;
@@ -145,7 +145,7 @@ bool OBJFile::read()
obj_normallist[obj_normalcount] = nm;
obj_normalcount++;
- } else if( word.compare("f") == 0) { /* Face/Polygon */
+ } else if( word.compare("f") == 0) { /* face/polygon */
size_t v[4];
size_t uv[4];
size_t vn[4];
@@ -167,9 +167,7 @@ bool OBJFile::read()
have_uv[i] = 0;
std::string point;
- tmp >> point;
-
- if(point.compare(" ") == 0) //bordercase for space at end of face definition
+ if (!(tmp >> point)) // bordercase for space at end of face definition
continue;
for(size_t c=0; c<point.length(); c++) {