From 136ef7609dd5c321b8cc8e9b38054a062de61764 Mon Sep 17 00:00:00 2001 From: ulfjorensen Date: Mon, 4 Oct 2010 18:12:35 +0000 Subject: [PATCH] Bugfix: removed unnecessary windows.h include from Quake3BSP loader Bugfix: added workaround to allow reading invalid Collada files sporting negative indices into data arrays git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@824 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ColladaParser.cpp | 5 +++-- code/Q3BSPFileImporter.cpp | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index bdc80ff3b..aced44841 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -2005,8 +2005,9 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector& pPer const char* content = GetTextContent(); while( *content != 0) { - // read a value - unsigned int value = strtol10( content, &content); + // read a value. + // Hack: (thom) Some exporters put negative indices sometimes. We just try to carry on anyways. + int value = std::max( 0, strtol10s( content, &content)); indices.push_back( size_t( value)); // skip whitespace after it SkipSpacesAndLineEnd( &content); diff --git a/code/Q3BSPFileImporter.cpp b/code/Q3BSPFileImporter.cpp index 7b626c987..19ae2ae21 100644 --- a/code/Q3BSPFileImporter.cpp +++ b/code/Q3BSPFileImporter.cpp @@ -40,7 +40,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "AssimpPCH.h" #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER -#include #include "DefaultIOSystem.h" #include "Q3BSPFileImporter.h" #include "Q3BSPZipArchive.h"