From 4b15dfd9af414ccf7a0a63a6111417ab205a182f Mon Sep 17 00:00:00 2001 From: John Senneker Date: Mon, 17 Oct 2016 18:48:04 -0400 Subject: [PATCH] Fix OBJ parser mtllib statement parsing bug. Since `getName` returns the whole line (including spaces) parse out the first word for comparison. --- code/ObjFileParser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 9b13eea..7859563 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -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") -- 2.7.4