- Bugfix: XFileImporter now throws an error if the file is ill-formatted and thus perceived as empty

- documented data structure updated
- added WIN32 define to all project configurations to fix Win32Logger compilation error.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@14 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
ulfjorensen
2008-05-11 12:54:16 +00:00
parent d499823c67
commit 47d16d33b4
3 changed files with 45 additions and 23 deletions

View File

@@ -103,6 +103,10 @@ void XFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, I
// and create the proper return structures out of it
CreateDataRepresentationFromImport( pScene, parser.GetImportedData());
// if nothing came from it, report it as error
if( !pScene->mRootNode)
throw new ImportErrorException( "XFile is ill-formatted - no content imported.");
}
// ------------------------------------------------------------------------------------------------
@@ -136,7 +140,8 @@ void XFileImporter::CreateDataRepresentationFromImport( aiScene* pScene, const X
}
// convert the root node's transformation to OGL coords
ConvertToLHProcess::ConvertToOGL( pScene->mRootNode->mTransformation);
if( pScene->mRootNode)
ConvertToLHProcess::ConvertToOGL( pScene->mRootNode->mTransformation);
// finally: create a dummy material if not material was imported
if( pScene->mNumMaterials == 0)