Fix obj .mtl file loading

Fix the obj file loader by adding a new method which allows
a name to be read considering the space in the middle between two
words and use that for parsing the "mtlib" line in the .obj file
parsing method.

Before, the method used in the obj parsing function would have
returned the string "mtlib NAME_OF_MTL" instead of "mtlib" only,
which resulted in the .mtl file being never parsed.
This commit is contained in:
Alberto Taiuti
2016-11-10 23:12:36 +00:00
parent 7a578aae46
commit cf7059f074
2 changed files with 42 additions and 1 deletions

View File

@@ -178,7 +178,7 @@ void ObjFileParser::parseFile( IOStreamBuffer<char> &streamBuffer ) {
{
std::string name;
getName(m_DataIt, m_DataItEnd, name);
getNameNoSpace(m_DataIt, m_DataItEnd, name);
size_t nextSpace = name.find(" ");
if (nextSpace != std::string::npos)