Przeglądaj źródła

Bugfix: Bugfixes fror VS 2010 with CMake ( thanks to Jonathan Klein ).

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1124 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
kimmi 13 lat temu
rodzic
commit
16a5bef3ba
3 zmienionych plików z 14 dodań i 3 usunięć
  1. 1 1
      CREDITS
  2. 7 0
      code/CMakeLists.txt
  3. 6 2
      code/M3Importer.cpp

+ 1 - 1
CREDITS

@@ -26,7 +26,7 @@ Visual Studio 9 support, bugfixes.
 B3D-Loader, Assimp testing
 
 - Jonathan Klein
-Ogre Loader
+Ogre Loader, VC2010 fixes and CMake fixes.
 
 - Sebastian Hempel,
 PyAssimp (first version)

+ 7 - 0
code/CMakeLists.txt

@@ -553,6 +553,13 @@ SET( unzip_SRCS
 )
 SOURCE_GROUP( unzip FILES ${unzip_SRCS})
 
+
+# VC2010 fixes
+OPTION( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF )
+if( VC10_STDINT_FIX )
+	ADD_DEFINITIONS( -D_STDINT )
+endif( VC10_STDINT_FIX )
+
 ADD_DEFINITIONS( -DASSIMP_BUILD_DLL_EXPORT )
 
 if ( MSVC80 OR MSVC90 OR MSVC10 )

+ 6 - 2
code/M3Importer.cpp

@@ -55,7 +55,7 @@ M3Importer::M3Importer() :
 	m_pHead( NULL ),
 	m_pRefs( NULL )
 {
-
+	// empty
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -263,8 +263,11 @@ void M3Importer::convertToAssimp( const std::string& pFile, aiScene* pScene, DIV
 		pRootNode->mChildren[ i ] = pCurrentNode;
 		
 		// Loop over the faces of the nodes
+//		 = regions[i].ofsIndices; j < (regions[i].ofsIndices + regions[i].nIndices); j +=3)
+
 		unsigned int numFaces = ( pRegions[ i ].ofsIndices + pRegions[ i ].nIndices ) -  pRegions[ i ].ofsIndices;
 		aiMesh *pMesh = new aiMesh;
+		pMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
 		MeshArray.push_back( pMesh );
 
 		pMesh->mNumFaces = numFaces;
@@ -316,13 +319,14 @@ void M3Importer::createVertexData( aiMesh *pMesh, const std::vector<aiVector3D>
 		aiFace *pFace = &( pMesh->mFaces[ currentFace ] );
 		for ( unsigned int currentIdx=0; currentIdx<pFace->mNumIndices; currentIdx++ )
 		{
-			unsigned int idx = pFace->mIndices[ currentIdx ];
+			const unsigned int idx = pFace->mIndices[ currentIdx ];
 			if ( vertices.size() > idx )
 			{
 				pMesh->mVertices[ pos ] = vertices[ idx ];
 				pMesh->mNormals[ pos ] = normals[ idx ];
 
 				pFace->mIndices[ currentIdx ] = pos;
+				pFace->mIndices[ pos ];
 				pos++;
 			}
 		}