Fix OBJ parser mtllib statement parsing bug.

Since `getName` returns the whole line (including spaces) parse out the
first word for comparison.
pull/1040/head
John Senneker 2016-10-17 18:48:04 -04:00
parent 5cd16a0aa6
commit 4b15dfd9af
1 changed files with 3 additions and 2 deletions

View File

@ -182,9 +182,10 @@ void ObjFileParser::parseFile()
case 'm': // Parse a material library or merging group ('mg')
{
std::string name;
std::string name;
getName(m_DataIt, m_DataItEnd, name);
getName(m_DataIt, m_DataItEnd, name);
name = name.substr(0, name.find(" "));
if (name == "mg")
getGroupNumberAndResolution();
else if(name == "mtllib")