obj loader: added multiline support

collada loaded: bug fixed when importing several files, whith one containing animation
pull/297/head
Gregory Jaegy 2014-06-13 10:56:10 +02:00
parent e09d88fa59
commit 16ae05eeeb
2 changed files with 20 additions and 1 deletions

View File

@ -133,6 +133,7 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
mLights.clear();
mCameras.clear();
mTextures.clear();
mAnims.clear();
// parse the input file
ColladaParser parser( pIOHandler, pFile);
@ -904,6 +905,8 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars
pScene->mAnimations = new aiAnimation*[mAnims.size()];
std::copy( mAnims.begin(), mAnims.end(), pScene->mAnimations);
}
mAnims.clear();
}
// ------------------------------------------------------------------------------------------------

View File

@ -139,7 +139,23 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
{
strModelName = pFile;
}
// process all '\'
std::vector<char> ::iterator iter = m_Buffer.begin();
while (iter != m_Buffer.end())
{
if (*iter == '\\')
{
// remove '\'
iter = m_Buffer.erase(iter);
// remove next character
while (*iter == '\r' || *iter == '\n')
iter = m_Buffer.erase(iter);
}
else
++iter;
}
// parse the file into a temporary representation
ObjFileParser parser(m_Buffer, strModelName, pIOHandler);