ソースを参照

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

ulfjorensen 15 年 前
コミット
136ef7609d
2 ファイル変更3 行追加3 行削除
  1. 3 2
      code/ColladaParser.cpp
  2. 0 1
      code/Q3BSPFileImporter.cpp

+ 3 - 2
code/ColladaParser.cpp

@@ -2005,8 +2005,9 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pPer
 	const char* content = GetTextContent();
 	const char* content = GetTextContent();
 	while( *content != 0)
 	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));
 		indices.push_back( size_t( value));
 		// skip whitespace after it
 		// skip whitespace after it
 		SkipSpacesAndLineEnd( &content);
 		SkipSpacesAndLineEnd( &content);

+ 0 - 1
code/Q3BSPFileImporter.cpp

@@ -40,7 +40,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "AssimpPCH.h"
 #include "AssimpPCH.h"
 #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
 #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
 
 
-#include <windows.h>
 #include "DefaultIOSystem.h"
 #include "DefaultIOSystem.h"
 #include "Q3BSPFileImporter.h"
 #include "Q3BSPFileImporter.h"
 #include "Q3BSPZipArchive.h"
 #include "Q3BSPZipArchive.h"