From ffdca3593bbdd291379321269cd5aa1586add42b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 6 Sep 2016 15:41:37 +0200 Subject: [PATCH] ObjImporter: remove unused code. --- code/ObjFileData.h | 2 -- code/ObjFileParser.cpp | 18 ++++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/code/ObjFileData.h b/code/ObjFileData.h index 65d982997..2d282e6a9 100644 --- a/code/ObjFileData.h +++ b/code/ObjFileData.h @@ -285,8 +285,6 @@ struct Model ObjFile::Material *m_pDefaultMaterial; //! Vector with all generated materials std::vector m_MaterialLib; - //! Vector with all generated group - std::vector m_GroupLib; //! Vector with all generated vertices std::vector m_Vertices; //! vector with all generated normals diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 5314826c3..4c3232fa7 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -692,38 +692,36 @@ int ObjFileParser::getMaterialIndex( const std::string &strMaterialName ) // ------------------------------------------------------------------- // Getter for a group name. -void ObjFileParser::getGroupName() -{ - std::string strGroupName; +void ObjFileParser::getGroupName() { + std::string groupName; // here we skip 'g ' from line m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - m_DataIt = getName(m_DataIt, m_DataItEnd, strGroupName); + m_DataIt = getName(m_DataIt, m_DataItEnd, groupName); if( isEndOfBuffer( m_DataIt, m_DataItEnd ) ) { return; } // Change active group, if necessary - if ( m_pModel->m_strActiveGroup != strGroupName ) - { + if ( m_pModel->m_strActiveGroup != groupName ) { // Search for already existing entry - ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(strGroupName); + ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(groupName); // We are mapping groups into the object structure - createObject( strGroupName ); + createObject( groupName ); // New group name, creating a new entry if (it == m_pModel->m_Groups.end()) { std::vector *pFaceIDArray = new std::vector; - m_pModel->m_Groups[ strGroupName ] = pFaceIDArray; + m_pModel->m_Groups[ groupName ] = pFaceIDArray; m_pModel->m_pGroupFaceIDs = (pFaceIDArray); } else { m_pModel->m_pGroupFaceIDs = (*it).second; } - m_pModel->m_strActiveGroup = strGroupName; + m_pModel->m_strActiveGroup = groupName; } m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); }