diff options
author | Stijn Buys <ingar@osirion.org> | 2011-08-25 22:57:16 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-08-25 22:57:16 +0000 |
commit | 8b9b47e71cfd3ca1a9c3b8f9574ab460c9a8f437 (patch) | |
tree | 6f79d09068f63bab3d76e9b9e0ed9374d035aef2 /src | |
parent | 431421c7e626b50186fc54542db3967cde844a66 (diff) |
Improved OBJ reader warning messages, by Thorn
Diffstat (limited to 'src')
-rw-r--r-- | src/model/objfile.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/model/objfile.cc b/src/model/objfile.cc index aa6b6cf..56d3692 100644 --- a/src/model/objfile.cc +++ b/src/model/objfile.cc @@ -75,6 +75,7 @@ bool OBJFile::read() math::Vector3f zero; size_t current_m = 0; + size_t index_line = 0; Fragment *fragment = 0; Material *material = 0; @@ -82,6 +83,8 @@ bool OBJFile::read() while (objfile_ifs.getline(data, sizeof(data) - 1)) { std::istringstream line(data); + index_line++; + std::string word; line >> word; @@ -115,7 +118,7 @@ bool OBJFile::read() } } else - con_warn << "Invalid material definition" << std::endl; + con_warn << objfile_name << " invalid material definition at line " << index_line << std::endl; } else if( word.compare("v") == 0) { /* New wertex */ @@ -197,7 +200,7 @@ bool OBJFile::read() } if(points.size() != 4 && points.size() != 3) { - con_warn << "Warning! " << objfile_name << ": Faces without 3 or 4 vertices will be ignored!" << std::endl; + con_warn << objfile_name << " face with " << points.size() << " vertices at line " << index_line << std::endl; points.clear(); continue; } @@ -219,7 +222,7 @@ bool OBJFile::read() if(points.size() == 3) { if(!v0 || !v1 || !v2) { - con_warn << "Warning! " << objfile_name << ": Invalid vertex!" << std::endl; + con_warn << objfile_name << " invalid vertex called from line " << index_line << std::endl; continue; } @@ -243,7 +246,7 @@ bool OBJFile::read() } else if(points.size() == 4) { if(!v0 || !v1 || !v2 || !v3) { - con_warn << "Warning! " << objfile_name << ": Invalid vertex!" << std::endl; + con_warn << objfile_name << " invalid vertex called from line " << index_line << std::endl; continue; } |