From 8f43fb144ac07a4dec9ae1e376bed37426951cee Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Mon, 24 Jun 2019 14:55:48 +0100 Subject: [PATCH 1/2] Add "importerIndex" Importer property This indicates the index of the Importer that was selected, or -1 if did not find one at all. --- code/Common/Importer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/Common/Importer.cpp b/code/Common/Importer.cpp index 8931bfa03..91b50859a 100644 --- a/code/Common/Importer.cpp +++ b/code/Common/Importer.cpp @@ -590,10 +590,12 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) // Find an worker class which can handle the file BaseImporter* imp = NULL; + SetPropertyInteger("importerIndex", -1); for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) { if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, false)) { imp = pimpl->mImporter[a]; + SetPropertyInteger("importerIndex", a); break; } } @@ -606,6 +608,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) { if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, true)) { imp = pimpl->mImporter[a]; + SetPropertyInteger("importerIndex", a); break; } } From f5ece83f315e9f229c0892ad0ce4348ac15508fa Mon Sep 17 00:00:00 2001 From: Rob Conde Date: Fri, 28 Jun 2019 16:12:58 -0400 Subject: [PATCH 2/2] initial unnamed node uniqueness index outside of loop --- code/LWO/LWOLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/LWO/LWOLoader.cpp b/code/LWO/LWOLoader.cpp index d3c3b5ca0..1e5b92c32 100644 --- a/code/LWO/LWOLoader.cpp +++ b/code/LWO/LWOLoader.cpp @@ -1328,6 +1328,7 @@ void LWOImporter::LoadLWO2File() bool skip = false; LE_NCONST uint8_t* const end = mFileBuffer + fileSize; + unsigned int iUnnamed = 0; while (true) { if (mFileBuffer + sizeof(IFF::ChunkHeader) > end)break; @@ -1339,7 +1340,6 @@ void LWOImporter::LoadLWO2File() break; } uint8_t* const next = mFileBuffer+head.length; - unsigned int iUnnamed = 0; if(!head.length) { mFileBuffer = next;