FIX: ObjLoader failed to locate material files if the input path contained 'wrong' path delimiters.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@471 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2009-08-24 08:46:04 +00:00
parent 3435623463
commit 64168ba975
3 changed files with 10 additions and 18 deletions

View File

@@ -104,11 +104,9 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
TextFileToBuffer(file.get(),m_Buffer);
//
std::string strDirectory( 1, io.getOsSeparator() ), strModelName;
std::string::size_type pos = pFile.find_last_of( io.getOsSeparator() );
if ( pos != std::string::npos )
{
strDirectory = pFile.substr(0, pos);
std::string strModelName;
std::string::size_type pos = pFile.find_last_of( "\\/" );
if ( pos != std::string::npos ) {
strModelName = pFile.substr(pos+1, pFile.size() - pos - 1);
}
else
@@ -117,7 +115,7 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
}
// parse the file into a temporary representation
ObjFileParser parser(m_Buffer, strDirectory, strModelName, pIOHandler);
ObjFileParser parser(m_Buffer, strModelName, pIOHandler);
// And create the proper return structures out of it
CreateDataFromImport(parser.GetModel(), pScene);