Merge pull request #199 from jdduke/obj_mg_parse
Properly parse 'mg' keyword in .obj filespull/204/head
commit
ccd5b30a56
|
@ -149,9 +149,12 @@ void ObjFileParser::parseFile()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'm': // Parse a material library
|
case 'm': // Parse a material library or merging group ('mg')
|
||||||
{
|
{
|
||||||
getMaterialLib();
|
if (*(m_DataIt + 1) == 'g')
|
||||||
|
getGroupNumberAndResolution();
|
||||||
|
else
|
||||||
|
getMaterialLib();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -609,6 +612,15 @@ void ObjFileParser::getGroupNumber()
|
||||||
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
|
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Not supported
|
||||||
|
void ObjFileParser::getGroupNumberAndResolution()
|
||||||
|
{
|
||||||
|
// Not used
|
||||||
|
|
||||||
|
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Stores values for a new object instance, name will be used to
|
// Stores values for a new object instance, name will be used to
|
||||||
// identify it.
|
// identify it.
|
||||||
|
|
|
@ -102,6 +102,8 @@ private:
|
||||||
void getGroupName();
|
void getGroupName();
|
||||||
/// Gets the group number from file.
|
/// Gets the group number from file.
|
||||||
void getGroupNumber();
|
void getGroupNumber();
|
||||||
|
/// Gets the group number and resolution from file.
|
||||||
|
void getGroupNumberAndResolution();
|
||||||
/// Returns the index of the material. Is -1 if not material was found.
|
/// Returns the index of the material. Is -1 if not material was found.
|
||||||
int getMaterialIndex( const std::string &strMaterialName );
|
int getMaterialIndex( const std::string &strMaterialName );
|
||||||
/// Parse object name
|
/// Parse object name
|
||||||
|
|
Loading…
Reference in New Issue