From d7c6cd9ecea2b563d4bd5dfd9f80376c17d92aaa Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 20 Jun 2013 08:40:08 -0400 Subject: [PATCH] {OBJ} Allow spaces in group names --- code/ObjFileParser.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 5dcdf4b9a..83f25c40a 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -528,18 +528,12 @@ int ObjFileParser::getMaterialIndex( const std::string &strMaterialName ) // Getter for a group name. void ObjFileParser::getGroupName() { - // Get next word from data buffer - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - m_DataIt = getNextWord(m_DataIt, m_DataItEnd); + std::string strGroupName; + + m_DataIt = getName(m_DataIt, m_DataItEnd, strGroupName); if ( isEndOfBuffer( m_DataIt, m_DataItEnd ) ) return; - // Store the group name in the group library - char *pStart = &(*m_DataIt); - while ( m_DataIt != m_DataItEnd && !isSeparator(*m_DataIt) ) - m_DataIt++; - std::string strGroupName( pStart, &(*m_DataIt) ); - // Change active group, if necessary if ( m_pModel->m_strActiveGroup != strGroupName ) {