- REFACTORING : Removing deprecated code from obj-loader.

- BUGFIX      : Fix memory leak in obj-loader, when an empty mesh was detected and ignored.
- BUGFIX      : Fix invalid material assignment in obj-loader, when groups are used instead of objects. 


git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@534 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
kimmi
2010-01-31 16:53:08 +00:00
parent c55be8ada3
commit 5c0432057a
3 changed files with 23 additions and 46 deletions

View File

@@ -385,19 +385,11 @@ void ObjFileParser::getMaterialDesc()
{
// Not found, use default material
m_pModel->m_pCurrentMaterial = m_pModel->m_pDefaultMaterial;
//m_pModel->m_pCurrentMesh = new ObjFile::Mesh();
//m_pModel->m_Meshes.push_back( m_pModel->m_pCurrentMesh );
//m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( DEFAULT_MATERIAL );
}
else
{
// Found, using detected material
m_pModel->m_pCurrentMaterial = (*it).second;
// Create a new mesh for a new material
//m_pModel->m_pCurrentMesh = new ObjFile::Mesh();
//m_pModel->m_Meshes.push_back( m_pModel->m_pCurrentMesh );
//m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strName );
}
// Skip rest of line
@@ -525,8 +517,11 @@ void ObjFileParser::getGroupName()
// Search for already existing entry
ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(&strGroupName);
// We are mapping groups into the object structure
/// TODO: Is this the right way to do it????
createObject( strGroupName );
// New group name, creating a new entry
//ObjFile::Object *pObject = m_pModel->m_pCurrent;
if (it == m_pModel->m_Groups.end())
{
std::vector<unsigned int> *pFaceIDArray = new std::vector<unsigned int>;