Bladeren bron

Fixes for build with mingw (no warnings in 32 Bit build, even with -wall).
SMD bugfix.
Makefile is up to date now.
Added pack-attribute for aiVector3D and aiVector2D.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@132 67173fc5-114c-0410-ac8e-9d2fd5bffc1f

aramis_acg 17 jaren geleden
bovenliggende
commit
8991496cf5
90 gewijzigde bestanden met toevoegingen van 421 en 415 verwijderingen
  1. 6 6
      code/3DSHelper.h
  2. 2 4
      code/3DSLoader.cpp
  3. 2 3
      code/ASELoader.cpp
  4. 1 2
      code/ASEParser.cpp
  5. 3 3
      code/ASEParser.h
  6. 1 1
      code/BaseProcess.h
  7. 1 1
      code/CalcTangentsProcess.h
  8. 1 1
      code/ConvertToLHProcess.h
  9. 1 1
      code/DXFLoader.h
  10. 1 0
      code/DefaultIOStream.h
  11. 3 3
      code/FileLogStream.h
  12. 1 1
      code/FixNormalsStep.cpp
  13. 1 1
      code/FixNormalsStep.h
  14. 1 1
      code/GenFaceNormalsProcess.cpp
  15. 1 1
      code/GenFaceNormalsProcess.h
  16. 1 1
      code/GenVertexNormalsProcess.cpp
  17. 1 0
      code/GenVertexNormalsProcess.h
  18. 3 3
      code/GenericProperty.h
  19. 12 9
      code/HMPFileData.h
  20. 0 1
      code/HMPLoader.cpp
  21. 1 0
      code/HMPLoader.h
  22. 8 6
      code/HalfLifeFileData.h
  23. 1 1
      code/Hash.h
  24. 1 1
      code/IFF.h
  25. 2 2
      code/ImproveCacheLocality.cpp
  26. 1 1
      code/ImproveCacheLocality.h
  27. 2 2
      code/JoinVerticesProcess.cpp
  28. 1 1
      code/JoinVerticesProcess.h
  29. 1 1
      code/KillNormalsProcess.cpp
  30. 1 2
      code/LWOBLoader.cpp
  31. 4 4
      code/LWOFileData.h
  32. 4 4
      code/LWOLoader.cpp
  33. 1 1
      code/LWOLoader.h
  34. 5 5
      code/LWOMaterial.cpp
  35. 8 4
      code/MD2FileData.h
  36. 1 1
      code/MD2Loader.cpp
  37. 1 1
      code/MD2Loader.h
  38. 8 4
      code/MD3FileData.h
  39. 1 1
      code/MD3Loader.h
  40. 5 5
      code/MD5Loader.cpp
  41. 1 1
      code/MD5Loader.h
  42. 5 5
      code/MD5Parser.cpp
  43. 1 1
      code/MD5Parser.h
  44. 9 5
      code/MDCFileData.h
  45. 1 0
      code/MDCLoader.h
  46. 1 1
      code/MDCNormalTable.h
  47. 28 26
      code/MDLFileData.h
  48. 2 10
      code/MDLLoader.cpp
  49. 8 18
      code/MDRFileData.h
  50. 12 12
      code/NFFLoader.cpp
  51. 1 1
      code/NFFLoader.h
  52. 2 2
      code/ObjFileMtlImporter.cpp
  53. 2 2
      code/ObjFileParser.cpp
  54. 6 5
      code/OptimizeGraphProcess.cpp
  55. 1 1
      code/ParsingUtils.h
  56. 2 1
      code/PlyLoader.cpp
  57. 1 1
      code/PlyLoader.h
  58. 21 61
      code/PlyParser.cpp
  59. 3 1
      code/PlyParser.h
  60. 1 1
      code/PretransformVertices.h
  61. 2 1
      code/RemoveComments.cpp
  62. 1 0
      code/SGSpatialSort.cpp
  63. 28 28
      code/SMDLoader.cpp
  64. 6 6
      code/STLLoader.cpp
  65. 1 1
      code/STLLoader.h
  66. 2 2
      code/SmoothingGroups.inl
  67. 1 0
      code/SpatialSort.cpp
  68. 4 5
      code/SplitLargeMeshes.cpp
  69. 1 1
      code/SplitLargeMeshes.h
  70. BIN
      code/StandardShapes.cpp
  71. 50 2
      code/StandardShapes.h
  72. 2 2
      code/TextureTransform.cpp
  73. 1 1
      code/TriangulateProcess.h
  74. 5 4
      code/ValidateDataStructure.cpp
  75. 1 1
      code/ValidateDataStructure.h
  76. 1 1
      code/VertexTriangleAdjacency.cpp
  77. 1 1
      code/VertexTriangleAdjacency.h
  78. 1 1
      code/XFileHelper.h
  79. 12 27
      code/XFileImporter.cpp
  80. 1 1
      code/XFileImporter.h
  81. 4 4
      code/XFileParser.cpp
  82. 1 1
      code/XFileParser.h
  83. 1 1
      code/aiAssert.cpp
  84. 1 1
      code/extra/MakeVerboseFormat.cpp
  85. 71 72
      code/makefile
  86. 1 1
      include/Compiler/poppack1.h
  87. 0 0
      include/Compiler/pushpack1.h
  88. 7 3
      include/aiTypes.h
  89. 5 1
      include/aiVector3D.h
  90. 1 1
      include/assimp.h

+ 6 - 6
code/3DSHelper.h

@@ -60,7 +60,7 @@ http://www.jalix.org/ressources/graphics/3DS/_unofficials/3ds-unofficial.txt */
 namespace Assimp	{
 namespace Dot3DS	{
 
-#include "./Compiler/pushpack1.h"
+#include "./../include/Compiler/pushpack1.h"
 
 // ---------------------------------------------------------------------------
 /** Dot3DSFile class: Helper class for loading 3ds files. Defines chunks
@@ -75,8 +75,8 @@ public:
 	//! data structure for a single chunk in a .3ds file
 	struct Chunk
 	{
-		unsigned short	Flag;
-		long			Size;
+		uint16_t	Flag;
+		uint32_t	Size;
 	} PACK_STRUCT;
 
 	//! source for this used own structures,
@@ -305,7 +305,7 @@ public:
 	};
 };
 
-#include "./Compiler/poppack1.h"
+#include "./../include/Compiler/poppack1.h"
 
 // ---------------------------------------------------------------------------
 /** Helper structure representing a 3ds mesh face */
@@ -360,12 +360,12 @@ struct Material
 	Material()
 		: 
 	mSpecularExponent	(0.0f),
+	mShininessStrength	(1.0f),
 	mShading(Dot3DSFile::Gouraud),
 	mTransparency		(1.0f),
 	mBumpHeight			(1.0f),
-	iBakeUVTransform	(0),
-	mShininessStrength	(1.0f),
 	mTwoSided			(false),
+	iBakeUVTransform	(0),
 	pcSingleTexture		(NULL)
 	{
 		static int iCnt = 0;

+ 2 - 4
code/3DSLoader.cpp

@@ -490,7 +490,7 @@ void Dot3DSImporter::ParseHierarchyChunk(int& piRemaining)
 
 		// pivot = origin of rotation and scaling
 		this->mCurrentNode->vPivot = *((const aiVector3D*)this->mCurrent);
-		std::swap(this->mCurrentNode->vPivot.y,this->mCurrentNode->vPivot.z);
+		std::swap((float&)mCurrentNode->vPivot.y,(float&)mCurrentNode->vPivot.z);
 		this->mCurrent += sizeof(aiVector3D);
 		break;
 
@@ -734,8 +734,6 @@ void Dot3DSImporter::ParseMeshChunk(int& piRemaining)
 	Dot3DS::Mesh& mMesh = this->mScene->mMeshes.back();
 
 	// get chunk type
-	const unsigned char* sz = this->mCurrent;
-	unsigned int iCnt = 0;
 	int iRemaining;
 	uint16_t iNum = 0;
 	float* pf;
@@ -749,7 +747,7 @@ void Dot3DSImporter::ParseMeshChunk(int& piRemaining)
 		{
 			mMesh.mPositions.push_back(*((aiVector3D*)this->mCurrent));
 			aiVector3D& v = mMesh.mPositions.back();
-			std::swap( v.y, v.z);
+			std::swap( (float&)v.y, (float&)v.z);
 			//v.y *= -1.0f;
 			this->mCurrent += sizeof(aiVector3D);
 		}

+ 2 - 3
code/ASELoader.cpp

@@ -525,7 +525,7 @@ void ASEImporter::BuildUniqueRepresentation(ASE::Mesh& mesh)
 		for (unsigned int n = 0; n < 3;++n,++iCurrent)
 		{
 			mPositions[iCurrent] = mesh.mPositions[(*i).mIndices[n]];
-			std::swap(mPositions[iCurrent].z,mPositions[iCurrent].y); // DX-to-OGL
+			std::swap((float&)mPositions[iCurrent].z,(float&)mPositions[iCurrent].y); // DX-to-OGL
 
 			// add texture coordinates
 			for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
@@ -545,7 +545,7 @@ void ASEImporter::BuildUniqueRepresentation(ASE::Mesh& mesh)
 			if (!mesh.mNormals.empty())
 			{
 				mNormals[iCurrent] = mesh.mNormals[(*i).mIndices[n]];
-				std::swap(mNormals[iCurrent].z,mNormals[iCurrent].y); // DX-to-OGL
+				std::swap((float&)mNormals[iCurrent].z,(float&)mNormals[iCurrent].y); // DX-to-OGL
 			}
 
 			// handle bone vertices
@@ -743,7 +743,6 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
 			vSubMaterials.size()];
 
 		// build a list of all faces per submaterial
-		unsigned int iNum = 0;
 		for (unsigned int i = 0; i < mesh.mFaces.size();++i)
 		{
 			// check range

+ 1 - 2
code/ASEParser.cpp

@@ -633,7 +633,6 @@ void Parser::ParseLV2MaterialBlock(ASE::Material& mat)
 void Parser::ParseLV3MapBlock(Texture& map)
 {
 	int iDepth = 0;
-	unsigned int iNumSubMaterials = 0;
 	while (true)
 	{
 		if ('*' == *this->m_szFile)
@@ -1740,4 +1739,4 @@ void Parser::ParseLV4MeshLong(unsigned int& iOut)
 	}
 	// parse the value
 	iOut = strtol10(this->m_szFile,&this->m_szFile);
-}
+}

+ 3 - 3
code/ASEParser.h

@@ -194,9 +194,9 @@ struct InheritanceInfo
 struct DecompTransform
 {
 	//! Construction from a reference to an existing matrix
-	DecompTransform(aiMatrix4x4& ref) 
-		: vScaling(1.0f,1.0f,1.0f)
-		, vPosition(std::numeric_limits<float>::quiet_NaN(),0.0f,0.0f)
+	DecompTransform(aiMatrix4x4& ref)
+		: vPosition(std::numeric_limits<float>::quiet_NaN(),0.0f,0.0f)
+		, vScaling(1.0f,1.0f,1.0f)
 		, mMatrix(ref)
 	{}
 

+ 1 - 1
code/BaseProcess.h

@@ -112,4 +112,4 @@ public:
 
 } // end of namespace Assimp
 
-#endif // AI_BASEPROCESS_H_INC
+#endif // AI_BASEPROCESS_H_INC

+ 1 - 1
code/CalcTangentsProcess.h

@@ -114,4 +114,4 @@ private:
 
 } // end of namespace Assimp
 
-#endif // AI_CALCTANGENTSPROCESS_H_INC
+#endif // AI_CALCTANGENTSPROCESS_H_INC

+ 1 - 1
code/ConvertToLHProcess.h

@@ -129,4 +129,4 @@ public:
 
 } // end of namespace Assimp
 
-#endif // AI_CONVERTTOLHPROCESS_H_INC
+#endif // AI_CONVERTTOLHPROCESS_H_INC

+ 1 - 1
code/DXFLoader.h

@@ -144,4 +144,4 @@ private:
 
 } // end of namespace Assimp
 
-#endif // AI_3DSIMPORTER_H_INC
+#endif // AI_3DSIMPORTER_H_INC

+ 1 - 0
code/DefaultIOStream.h

@@ -120,3 +120,4 @@ inline DefaultIOStream::DefaultIOStream (FILE* pFile,
 } // ns assimp
 
 #endif //!!AI_DEFAULTIOSTREAM_H_INC
+

+ 3 - 3
code/FileLogStream.h

@@ -52,10 +52,10 @@ inline void FileLogStream::write( const std::string &message )
 {
 	if (m_pStream != NULL)
 	{
-		size_t size = m_pStream->Write(message.c_str(), sizeof(char), 
+		m_pStream->Write(message.c_str(), sizeof(char), 
 			message.size());
-		int i=0;
-		i++;
+		/*int i=0;
+		i++;*/
 	}
 }
 

+ 1 - 1
code/FixNormalsStep.cpp

@@ -177,4 +177,4 @@ bool FixInfacingNormalsProcess::ProcessMesh( aiMesh* pcMesh, unsigned int index)
 		return true;
 	}
 	return false;
-}
+}

+ 1 - 1
code/FixNormalsStep.h

@@ -93,4 +93,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_FIXNORMALSPROCESS_H_INC
+#endif // AI_FIXNORMALSPROCESS_H_INC

+ 1 - 1
code/GenFaceNormalsProcess.cpp

@@ -122,4 +122,4 @@ bool GenFaceNormalsProcess::GenMeshFaceNormals (aiMesh* pMesh)
 		}
 	}
 	return true;
-}
+}

+ 1 - 1
code/GenFaceNormalsProcess.h

@@ -85,4 +85,4 @@ private:
 
 } // end of namespace Assimp
 
-#endif // !!AI_GENFACENORMALPROCESS_H_INC
+#endif // !!AI_GENFACENORMALPROCESS_H_INC

+ 1 - 1
code/GenVertexNormalsProcess.cpp

@@ -176,4 +176,4 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh)
 	pMesh->mNormals = pcNew;
 
 	return true;
-}
+}

+ 1 - 0
code/GenVertexNormalsProcess.h

@@ -114,3 +114,4 @@ private:
 } // end of namespace Assimp
 
 #endif // !!AI_GENVERTEXNORMALPROCESS_H_INC
+

+ 3 - 3
code/GenericProperty.h

@@ -56,7 +56,7 @@ inline void SetGenericProperty(std::map< uint32_t, T >& list,
 
 	uint32_t hash = SuperFastHash(szName);
 
-	GenericPropertyMap::iterator it = list.find(hash);
+	typename GenericPropertyMap::iterator it = list.find(hash);
 	if (it == list.end())
 	{
 		if (bWasExisting)*bWasExisting = false;
@@ -80,9 +80,9 @@ inline T GetGenericProperty(const std::map< uint32_t, T >& list,
 
 	uint32_t hash = SuperFastHash(szName);
 
-	GenericPropertyMap::const_iterator it = list.find(hash);
+	typename GenericPropertyMap::const_iterator it = list.find(hash);
 	if (it == list.end())return errorReturn;
 	return (*it).second;
 }
 
-#endif // !! AI_GENERIC_PROPERTY_H_INCLUDED
+#endif // !! AI_GENERIC_PROPERTY_H_INCLUDED

+ 12 - 9
code/HMPFileData.h

@@ -44,16 +44,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 namespace Assimp	{
 namespace HMP	{
 
-#include "./Compiler/pushpack1.h"
+#include "./../include/Compiler/pushpack1.h"
 
-#define AI_HMP_MAGIC_NUMBER_BE_4	'HMP4'
-#define AI_HMP_MAGIC_NUMBER_LE_4	'4PMH'
+// to make it easier for ourselfes, we test the magic word against both "endianesses"
+#define HMP_MAKE(string) ((uint32_t)((string[0] << 24) + (string[1] << 16) + (string[2] << 8) + string[3]))
 
-#define AI_HMP_MAGIC_NUMBER_BE_5	'HMP5'
-#define AI_HMP_MAGIC_NUMBER_LE_5	'5PMH'
+#define AI_HMP_MAGIC_NUMBER_BE_4	HMP_MAKE("HMP4")
+#define AI_HMP_MAGIC_NUMBER_LE_4	HMP_MAKE("4PMH")
 
-#define AI_HMP_MAGIC_NUMBER_BE_7	'HMP7'
-#define AI_HMP_MAGIC_NUMBER_LE_7	'7PMH'
+#define AI_HMP_MAGIC_NUMBER_BE_5	HMP_MAKE("HMP5")
+#define AI_HMP_MAGIC_NUMBER_LE_5	HMP_MAKE("5PMH")
+
+#define AI_HMP_MAGIC_NUMBER_BE_7	HMP_MAKE("HMP7")
+#define AI_HMP_MAGIC_NUMBER_LE_7	HMP_MAKE("7PMH")
 
 // ---------------------------------------------------------------------------
 /** Data structure for the header of a HMP5 file.
@@ -127,7 +130,7 @@ struct Vertex_HMP7
 	int8_t normal_x,normal_y;
 } PACK_STRUCT;
 
-#include "./Compiler/poppack1.h"
+#include "./../include/Compiler/poppack1.h"
 
 } //! namespace HMP
-} //! namespace Assimp
+} //! namespace Assimp

+ 0 - 1
code/HMPLoader.cpp

@@ -50,7 +50,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "../include/DefaultLogger.h"
 #include "../include/IOStream.h"
 #include "../include/IOSystem.h"
-#include "../include/aiMesh.h"
 #include "../include/aiScene.h"
 #include "../include/aiAssert.h"
 

+ 1 - 0
code/HMPLoader.h

@@ -157,3 +157,4 @@ private:
 } // end of namespace Assimp
 
 #endif // AI_HMPIMPORTER_H_INC
+

+ 8 - 6
code/HalfLifeFileData.h

@@ -49,16 +49,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_MDLFILEHELPER2_H_INC
 #define AI_MDLFILEHELPER2_H_INC
 
-#include "./Compiler/pushpack1.h"
+#include "./../include/Compiler/pushpack1.h"
+
+#include "MDLFileData.h"
 
 namespace Assimp	{
 namespace MDL	{
 
 // magic bytes used in Half Life 2 MDL models
-#define AI_MDL_MAGIC_NUMBER_BE_HL2a	'IDST'
-#define AI_MDL_MAGIC_NUMBER_LE_HL2a	'TSDI'
-#define AI_MDL_MAGIC_NUMBER_BE_HL2b	'IDSQ'
-#define AI_MDL_MAGIC_NUMBER_LE_HL2b	'QSDI'
+#define AI_MDL_MAGIC_NUMBER_BE_HL2a	MDL_MAKE("IDST")
+#define AI_MDL_MAGIC_NUMBER_LE_HL2a	MDL_MAKE("TSDI")
+#define AI_MDL_MAGIC_NUMBER_BE_HL2b	MDL_MAKE("IDSQ")
+#define AI_MDL_MAGIC_NUMBER_LE_HL2b	MDL_MAKE("QSDI")
 
 // ---------------------------------------------------------------------------
 /** \struct Header_HL2
@@ -140,7 +142,7 @@ struct Header_HL2
 	int32_t			transitionindex;
 } PACK_STRUCT;
 
-#include "./Compiler/poppack1.h"
+#include "./../include/Compiler/poppack1.h"
 
 }
 } // end namespaces

+ 1 - 1
code/Hash.h

@@ -104,4 +104,4 @@ int rem;
     return hash;
 }
 
-#endif // !! AI_HASH_H_INCLUDED
+#endif // !! AI_HASH_H_INCLUDED

+ 1 - 1
code/IFF.h

@@ -54,4 +54,4 @@ inline const char* ReadHeader(const uint8_t* outFile,uint32_t& fileType)
 
 }}
 
-#endif // !! AI_IFF_H_INCLUDED
+#endif // !! AI_IFF_H_INCLUDED

+ 2 - 2
code/ImproveCacheLocality.cpp

@@ -271,7 +271,7 @@ void ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshN
 					const unsigned int dp = *p;
 
 					// the current vertex won't have any free triangles after this step
-					if (ivdx != dp)
+					if (ivdx != (int)dp)
 					{
 						// append the vertex to the dead-end stack
 						sDeadEndVStack.push(dp);
@@ -381,4 +381,4 @@ void ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshN
 	delete[] piIBOutput;
 	delete[] piCandidates;
 	delete[] piNumTriPtrNoModify;
-}
+}

+ 1 - 1
code/ImproveCacheLocality.h

@@ -101,4 +101,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_IMPROVECACHELOCALITY_H_INC
+#endif // AI_IMPROVECACHELOCALITY_H_INC

+ 2 - 2
code/JoinVerticesProcess.cpp

@@ -134,7 +134,7 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
 	std::vector<Vertex> uniqueVertices;
 	uniqueVertices.reserve( pMesh->mNumVertices);
 
-	unsigned int iOldVerts = pMesh->mNumVertices;
+	//unsigned int iOldVerts = pMesh->mNumVertices;
 
 	// For each vertex the index of the vertex it was replaced by. 
 	std::vector<unsigned int> replaceIndex( pMesh->mNumVertices, 0xffffffff);
@@ -314,7 +314,7 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
 		for( unsigned int b = 0; b < face.mNumIndices; b++)
 		{
 			const size_t index = face.mIndices[b];
-			face.mIndices[b] = replaceIndex[face.mIndices[b]];
+			face.mIndices[b] = replaceIndex[index];
 		}
 	}
 

+ 1 - 1
code/JoinVerticesProcess.h

@@ -113,4 +113,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_CALCTANGENTSPROCESS_H_INC
+#endif // AI_CALCTANGENTSPROCESS_H_INC

+ 1 - 1
code/KillNormalsProcess.cpp

@@ -91,4 +91,4 @@ bool KillNormalsProcess::KillMeshNormals(aiMesh* pMesh)
 	delete[] pMesh->mNormals;
 	pMesh->mNormals = NULL;
 	return true;
-}
+}

+ 1 - 2
code/LWOBLoader.cpp

@@ -175,7 +175,6 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
 {
 	LE_NCONST uint8_t* const end = mFileBuffer + size;
 
-	uint32_t iCursor = 0;
 	mSurfaces->push_back( LWO::Surface () );
 	LWO::Surface& surf = mSurfaces->back();
 	LWO::Texture* pTex = NULL;
@@ -305,4 +304,4 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
 		}
 		mFileBuffer = next;
 	}
-}
+}

+ 4 - 4
code/LWOFileData.h

@@ -331,9 +331,9 @@ struct WeightChannel : public VMapEntry
 struct Texture
 {
 	Texture()
-		: mStrength			(1.0f)
+		: mClipIdx(0xffffffff)
+		, mStrength			(1.0f)
 		, mUVChannelIndex	("unknown")
-		, mClipIdx(0xffffffff)
 	{}
 
 	//! File name of the texture
@@ -425,9 +425,9 @@ typedef std::vector	<	Clip			>	ClipList;
 struct Layer
 {
 	Layer()
-		: mParent (0xffff)
-		, mFaceIDXOfs(0)
+		: mFaceIDXOfs(0)
 		, mPointIDXOfs(0)
+		, mParent (0xffff)
 	{}
 
 	/** Temporary point list from the file */

+ 4 - 4
code/LWOLoader.cpp

@@ -321,7 +321,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
 
 					pf->mIndices = face.mIndices;
 					pf->mNumIndices = face.mNumIndices;
-					const_cast<unsigned int*>(face.mIndices) = NULL; // make sure it won't be deleted
+					unsigned int** p = (unsigned int**)&face.mIndices;*p = NULL; // make sure it won't be deleted
 					pf++;
 				}
 				++p;
@@ -365,7 +365,7 @@ void LWOImporter::GenerateNodeGraph(std::vector<aiNode*>& apcNodes)
 		for (unsigned int i = 0; i < apcNodes.size();++i)
 		{
 			if (i == iCurParent)continue;
-			if ( reinterpret_cast<uint16_t>(apcNodes[i]->mParent) == iCurParent)++numChilds;
+			if ( (uint16_t)(uintptr_t)apcNodes[i]->mParent == iCurParent)++numChilds;
 		}
 		if (numChilds)
 		{
@@ -377,7 +377,7 @@ void LWOImporter::GenerateNodeGraph(std::vector<aiNode*>& apcNodes)
 			for (unsigned int i = 0, p = 0; i < apcNodes.size();++i)
 			{
 				if (i == iCurParent)continue;
-				uint16_t parent = reinterpret_cast<uint16_t>(apcNodes[i]->mParent);
+				uint16_t parent = (uint16_t)(uintptr_t)(apcNodes[i]->mParent);
 				if (parent == iCurParent)
 				{
 					node->mChildren[p++] = apcNodes[i];
@@ -816,4 +816,4 @@ void LWOImporter::LoadLWO2File()
 		}
 		mFileBuffer = next;
 	}
-}
+}

+ 1 - 1
code/LWOLoader.h

@@ -298,4 +298,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_LWOIMPORTER_H_INCLUDED
+#endif // AI_LWOIMPORTER_H_INCLUDED

+ 5 - 5
code/LWOMaterial.cpp

@@ -129,7 +129,7 @@ void LWOImporter::FindVCChannels(const LWO::Surface& surf, const LWO::Layer& lay
 // ------------------------------------------------------------------------------------------------
 void LWOImporter::LoadLWO2ImageMap(unsigned int size, LWO::Texture& tex )
 {
-	LE_NCONST uint8_t* const end = mFileBuffer + size;
+	//LE_NCONST uint8_t* const end = mFileBuffer + size;
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -147,16 +147,16 @@ void LWOImporter::LoadLWO2Gradient(unsigned int size, LWO::Texture& tex  )
 // ------------------------------------------------------------------------------------------------
 void LWOImporter::LoadLWO2TextureHeader(unsigned int size, LWO::Texture& tex )
 {
-	LE_NCONST uint8_t* const end = mFileBuffer + size;
+	//LE_NCONST uint8_t* const end = mFileBuffer + size;
 }
 
 // ------------------------------------------------------------------------------------------------
 void LWOImporter::LoadLWO2TextureBlock(uint32_t type, unsigned int size )
 {
-	LE_NCONST uint8_t* const end = mFileBuffer + size;
+	//LE_NCONST uint8_t* const end = mFileBuffer + size;
 
-	LWO::Surface& surf = mSurfaces->back();
-	LWO::Texture tex;
+	//LWO::Surface& surf = mSurfaces->back();
+	//LWO::Texture tex;
 
 	// now get the exact type of the texture
 }

+ 8 - 4
code/MD2FileData.h

@@ -57,13 +57,16 @@ File format specification:
 #include "../include/aiMesh.h"
 #include "../include/aiAnim.h"
 
-#include "./Compiler/pushpack1.h"
+#include "./../include/Compiler/pushpack1.h"
 
 namespace Assimp	{
 namespace MD2	{
 
-#define AI_MD2_MAGIC_NUMBER_BE	'IDP2'
-#define AI_MD2_MAGIC_NUMBER_LE	'2PDI'
+// to make it easier for ourselfes, we test the magic word against both "endianesses"
+#define MD2_MAKE(string) ((uint32_t)((string[0] << 24) + (string[1] << 16) + (string[2] << 8) + string[3]))
+
+#define AI_MD2_MAGIC_NUMBER_BE	MD2_MAKE("IDP2")
+#define AI_MD2_MAGIC_NUMBER_LE	MD2_MAKE("2PDI")
 
 // common limitations
 #define AI_MD2_VERSION			15
@@ -153,7 +156,7 @@ struct Skin
 	char name[AI_MD2_MAXQPATH];              /* texture file name */
 } PACK_STRUCT;
 
-#include "./Compiler/poppack1.h"
+#include "./../include/Compiler/poppack1.h"
 
 
 // ---------------------------------------------------------------------------
@@ -167,3 +170,4 @@ void LookupNormalIndex(uint8_t index,aiVector3D& vOut);
 }
 
 #endif // !! include guard
+

+ 1 - 1
code/MD2Loader.cpp

@@ -151,7 +151,7 @@ void MD2Importer::ValidateHeader( )
 	if (0 == this->m_pcHeader->numFrames)
 		throw new ImportErrorException( "Invalid md2 file: NUM_FRAMES is 0");
 
-	if (this->m_pcHeader->offsetEnd > (int32_t)fileSize)
+	if (this->m_pcHeader->offsetEnd > (uint32_t)fileSize)
 		throw new ImportErrorException( "Invalid md2 file: File is too small");
 
 	if (this->m_pcHeader->offsetSkins		+ this->m_pcHeader->numSkins * sizeof (MD2::Skin)			>= this->fileSize ||

+ 1 - 1
code/MD2Loader.h

@@ -124,4 +124,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_3DSIMPORTER_H_INC
+#endif // AI_3DSIMPORTER_H_INC

+ 8 - 4
code/MD3FileData.h

@@ -52,13 +52,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "../include/aiMesh.h"
 #include "../include/aiAnim.h"
 
-#include "./Compiler/pushpack1.h"
+#include "./../include/Compiler/pushpack1.h"
 
 namespace Assimp	{
 namespace MD3	{
 
-#define AI_MD3_MAGIC_NUMBER_BE	'IDP3'
-#define AI_MD3_MAGIC_NUMBER_LE	'3PDI'
+// to make it easier for ourselfes, we test the magic word against both "endianesses"
+#define MD3_MAKE(string) ((uint32_t)((string[0] << 24) + (string[1] << 16) + (string[2] << 8) + string[3]))
+
+#define AI_MD3_MAGIC_NUMBER_BE	MD3_MAKE("IDP3")
+#define AI_MD3_MAGIC_NUMBER_LE	MD3_MAKE("3PDI")
 
 // common limitations
 #define AI_MD3_VERSION			15
@@ -230,7 +233,7 @@ struct Vertex
 	uint16_t  NORMAL;
 } PACK_STRUCT;
 
-#include "./Compiler/poppack1.h"
+#include "./../include/Compiler/poppack1.h"
 
 // ---------------------------------------------------------------------------
 /**	\brief Unpack a Q3 16 bit vector to its full float3 representation
@@ -298,3 +301,4 @@ inline void Vec3NormalToLatLng( const aiVector3D& p_vIn, uint16_t& p_iOut )
 }
 
 #endif // !! AI_MD3FILEHELPER_H_INC
+

+ 1 - 1
code/MD3Loader.h

@@ -126,4 +126,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_3DSIMPORTER_H_INC
+#endif // AI_3DSIMPORTER_H_INC

+ 5 - 5
code/MD5Loader.cpp

@@ -195,7 +195,7 @@ void MakeDataUnique (MD5::MeshDesc& meshSrc)
 void AttachChilds(int iParentID,aiNode* piParent,BoneList& bones)
 {
 	ai_assert(NULL != piParent && !piParent->mNumChildren);
-	for (unsigned int i = 0; i < bones.size();++i)
+	for (int i = 0; i < (int)bones.size();++i)
 	{
 		// (avoid infinite recursion)
 		if (iParentID != i && bones[i].mParentIndex == iParentID)
@@ -207,7 +207,7 @@ void AttachChilds(int iParentID,aiNode* piParent,BoneList& bones)
 	if (piParent->mNumChildren)
 	{
 		piParent->mChildren = new aiNode*[piParent->mNumChildren];
-		for (unsigned int i = 0; i < bones.size();++i)
+		for (int i = 0; i < (int)bones.size();++i)
 		{
 			// (avoid infinite recursion)
 			if (iParentID != i && bones[i].mParentIndex == iParentID)
@@ -372,7 +372,7 @@ void MD5Importer::LoadMD5MeshFile ()
 				meshParser.mJoints[q].mMap = h++;
 			}
 	
-			unsigned int g = 0;
+			//unsigned int g = 0;
 			pv = mesh->mVertices;
 			for (MD5::VertexList::const_iterator
 				iter =  meshSrc.mVertices.begin();
@@ -410,7 +410,7 @@ void MD5Importer::LoadMD5MeshFile ()
 					*bone->mWeights++ = aiVertexWeight((unsigned int)(pv-mesh->mVertices),fNewWeight);
 				}
 				// convert from DOOM coordinate system to OGL
-				std::swap(pv->z,pv->y);
+				std::swap((float&)pv->z,(float&)pv->y);
 			}
 
 			// undo our nice offset tricks ...
@@ -567,4 +567,4 @@ void MD5Importer::LoadMD5AnimFile ()
 
 	// delete the file again
 	this->UnloadFileFromMemory();
-}
+}

+ 1 - 1
code/MD5Loader.h

@@ -151,4 +151,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_3DSIMPORTER_H_INC
+#endif // AI_3DSIMPORTER_H_INC

+ 5 - 5
code/MD5Parser.cpp

@@ -205,11 +205,11 @@ bool MD5Parser::ParseSection(Section& out)
 	if ('(' != *sz++) \
 		MD5Parser::ReportWarning("Unexpected token: ( was expected",(*eit).iLineNumber); \
 	AI_MD5_SKIP_SPACES(); \
-	sz = fast_atof_move(sz,vec.x); \
+	sz = fast_atof_move(sz,(float&)vec.x); \
 	AI_MD5_SKIP_SPACES(); \
-	sz = fast_atof_move(sz,vec.y); \
+	sz = fast_atof_move(sz,(float&)vec.y); \
 	AI_MD5_SKIP_SPACES(); \
-	sz = fast_atof_move(sz,vec.z); \
+	sz = fast_atof_move(sz,(float&)vec.z); \
 	AI_MD5_SKIP_SPACES(); \
 	if (')' != *sz++) \
 		MD5Parser::ReportWarning("Unexpected token: ) was expected",(*eit).iLineNumber);
@@ -354,9 +354,9 @@ MD5MeshParser::MD5MeshParser(SectionList& mSections)
 					if ('(' != *sz++)
 						MD5Parser::ReportWarning("Unexpected token: ( was expected",(*eit).iLineNumber);
 					AI_MD5_SKIP_SPACES();
-					sz = fast_atof_move(sz,vert.mUV.x);
+					sz = fast_atof_move(sz,(float&)vert.mUV.x);
 					AI_MD5_SKIP_SPACES();
-					sz = fast_atof_move(sz,vert.mUV.y);
+					sz = fast_atof_move(sz,(float&)vert.mUV.y);
 					AI_MD5_SKIP_SPACES();
 					if (')' != *sz++)
 						MD5Parser::ReportWarning("Unexpected token: ) was expected",(*eit).iLineNumber);

+ 1 - 1
code/MD5Parser.h

@@ -416,4 +416,4 @@ private:
 };
 }}
 
-#endif // AI_MD5PARSER_H_INCLUDED
+#endif // AI_MD5PARSER_H_INCLUDED

+ 9 - 5
code/MDCFileData.h

@@ -53,14 +53,18 @@ http://themdcfile.planetwolfenstein.gamespy.com/MDC_File_Format.pdf
 #include "../include/aiMesh.h"
 #include "../include/aiAnim.h"
 
-#include "./Compiler/pushpack1.h"
+#include "./../include/Compiler/pushpack1.h"
 
 
 namespace Assimp {
 namespace MDC {
 
-#define AI_MDC_MAGIC_NUMBER_BE	'CPDI'
-#define AI_MDC_MAGIC_NUMBER_LE	'IDPC'
+
+// to make it easier for ourselfes, we test the magic word against both "endianesses"
+#define MDC_MAKE(string) ((uint32_t)((string[0] << 24) + (string[1] << 16) + (string[2] << 8) + string[3]))
+
+#define AI_MDC_MAGIC_NUMBER_BE	MDC_MAKE("CPDI")
+#define AI_MDC_MAGIC_NUMBER_LE	MDC_MAKE("IDPC")
 
 // common limitations
 #define AI_MDC_VERSION			2
@@ -181,7 +185,7 @@ struct Shader
 
 } PACK_STRUCT;
 
-#include "./Compiler/poppack1.h"
+#include "./../include/Compiler/poppack1.h"
 
 
 // ---------------------------------------------------------------------------
@@ -194,4 +198,4 @@ void BuildVertex(const Frame& frame,
 	aiVector3D& vNorOut);
 }}
 
-#endif // !! AI_MDCFILEHELPER_H_INC
+#endif // !! AI_MDCFILEHELPER_H_INC

+ 1 - 0
code/MDCLoader.h

@@ -130,3 +130,4 @@ protected:
 } // end of namespace Assimp
 
 #endif // AI_3DSIMPORTER_H_INC
+

+ 1 - 1
code/MDCNormalTable.h

@@ -296,4 +296,4 @@ float mdcNormals[ 256 ][ 3 ] =
 	{ 0.000000f, -0.195090f, 0.980785f }
 };
 
-#endif // !! MDC_NORMAL_TABLE_INCLUDED
+#endif // !! MDC_NORMAL_TABLE_INCLUDED

+ 28 - 26
code/MDLFileData.h

@@ -58,36 +58,35 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "../include/aiAnim.h"
 #include "../include/aiMaterial.h"
 
-#include "./Compiler/pushpack1.h"
+#include "./../include/Compiler/pushpack1.h"
 
 namespace Assimp	{
 namespace MDL	{
 
+// to make it easier for ourselfes, we test the magic word against both "endianesses"
+#define MDL_MAKE(string) ((uint32_t)((string[0] << 24) + (string[1] << 16) + (string[2] << 8) + string[3]))
+
 // magic bytes used in Quake 1 MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE	'IDPO'
-#define AI_MDL_MAGIC_NUMBER_LE	'OPDI'
+#define AI_MDL_MAGIC_NUMBER_BE	MDL_MAKE("IDPO")
+#define AI_MDL_MAGIC_NUMBER_LE	MDL_MAKE("OPDI")
 
 // magic bytes used in GameStudio A<very  low> MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS3	'MDL2'
-#define AI_MDL_MAGIC_NUMBER_LE_GS3	'2LDM'
+#define AI_MDL_MAGIC_NUMBER_BE_GS3	MDL_MAKE("MDL2")
+#define AI_MDL_MAGIC_NUMBER_LE_GS3	MDL_MAKE("2LDM")
 
 // magic bytes used in GameStudio A4 MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS4	'MDL3'
-#define AI_MDL_MAGIC_NUMBER_LE_GS4	'3LDM'
+#define AI_MDL_MAGIC_NUMBER_BE_GS4	MDL_MAKE("MDL3")
+#define AI_MDL_MAGIC_NUMBER_LE_GS4	MDL_MAKE("3LDM")
 
 // magic bytes used in GameStudio A5+ MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS5a	'MDL4'
-#define AI_MDL_MAGIC_NUMBER_LE_GS5a	'4LDM'
-#define AI_MDL_MAGIC_NUMBER_BE_GS5b	'MDL5'
-#define AI_MDL_MAGIC_NUMBER_LE_GS5b	'5LDM'
-
-// magic bytes used in GameStudio A6+ MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS6	'MDL6'
-#define AI_MDL_MAGIC_NUMBER_LE_GS6	'6LDM'
+#define AI_MDL_MAGIC_NUMBER_BE_GS5a	MDL_MAKE("MDL4")
+#define AI_MDL_MAGIC_NUMBER_LE_GS5a	MDL_MAKE("4LDM")
+#define AI_MDL_MAGIC_NUMBER_BE_GS5b	MDL_MAKE("MDL5")
+#define AI_MDL_MAGIC_NUMBER_LE_GS5b	MDL_MAKE("5LDM")
 
 // magic bytes used in GameStudio A7+ MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS7	'MDL7'
-#define AI_MDL_MAGIC_NUMBER_LE_GS7	'7LDM'
+#define AI_MDL_MAGIC_NUMBER_BE_GS7	MDL_MAKE("MDL7")
+#define AI_MDL_MAGIC_NUMBER_LE_GS7	MDL_MAKE("7LDM")
 
 
 // common limitations for Quake1 meshes. The loader does not check them,
@@ -121,7 +120,7 @@ namespace MDL	{
 struct Header
 {
 	//! magic number: "IDPO"
-	int32_t ident;          
+	uint32_t ident;          
 
 	//! version number: 6
 	int32_t version;          
@@ -730,7 +729,7 @@ struct GroupFrame
 	SimpleFrame *frames; 
 } PACK_STRUCT;
 
-#include "./Compiler/poppack1.h"
+#include "./../include/Compiler/poppack1.h"
 
 
 // ---------------------------------------------------------------------------
@@ -815,7 +814,8 @@ struct IntFrameInfo_MDL7
 {
 	//! Construction from an existing frame header
 	IntFrameInfo_MDL7(const MDL::Frame_MDL7* _pcFrame,unsigned int _iIndex) 
-		: pcFrame(_pcFrame), iIndex(_iIndex)
+		: iIndex(_iIndex)
+		, pcFrame(_pcFrame)
 	{}
 
 	//! Index of the frame
@@ -830,16 +830,18 @@ struct IntFrameInfo_MDL7
 struct IntGroupInfo_MDL7
 {
 	//! Default constructor
-	IntGroupInfo_MDL7()		:	
-		iIndex(0),
-		pcGroup(NULL),		pcGroupUVs(NULL),
-		pcGroupTris(NULL),	pcGroupVerts(NULL)
+	IntGroupInfo_MDL7()		
+		:	iIndex(0)
+		,	pcGroup(NULL)
+		,	pcGroupUVs(NULL)
+		,	pcGroupTris(NULL)
+		,	pcGroupVerts(NULL)
 		{}
 
 	//! Construction from an existing group header
 	IntGroupInfo_MDL7(const MDL::Group_MDL7* _pcGroup,unsigned int _iIndex)
-		:
-		pcGroup(_pcGroup),iIndex(_iIndex)
+		:	iIndex(_iIndex)
+		,	pcGroup(_pcGroup)
 	{}
 
 	//! Index of the group

+ 2 - 10
code/MDLLoader.cpp

@@ -198,14 +198,6 @@ void MDLImporter::InternReadFile( const std::string& pFile,
 			this->iGSFileVersion = 5;
 			this->InternReadFile_3DGS_MDL345();
 		}
-		// GameStudio A6+ MDL6 format (not sure whether it is really existing ... )
-		else if (AI_MDL_MAGIC_NUMBER_BE_GS6 == iMagicWord ||
-			AI_MDL_MAGIC_NUMBER_LE_GS6 == iMagicWord)
-		{
-			DefaultLogger::get()->debug("MDL subtype: 3D GameStudio A6, magic word is MDL6");
-			this->iGSFileVersion = 6;
-			this->InternReadFile_3DGS_MDL345();
-		}
 		// GameStudio A7 MDL7 format
 		else if (AI_MDL_MAGIC_NUMBER_BE_GS7 == iMagicWord ||
 			AI_MDL_MAGIC_NUMBER_LE_GS7 == iMagicWord)
@@ -1990,5 +1982,5 @@ void MDLImporter::JoinSkins_3DGS_MDL7(
 // ------------------------------------------------------------------------------------------------
 void MDLImporter::InternReadFile_HL2( )
 {
-	const MDL::Header_HL2* pcHeader = (const MDL::Header_HL2*)this->mBuffer;
-}
+	//const MDL::Header_HL2* pcHeader = (const MDL::Header_HL2*)this->mBuffer;
+}

+ 8 - 18
code/MDRFileData.h

@@ -46,21 +46,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "../include/aiMesh.h"
 #include "../include/aiAnim.h"
 
-#if defined(_MSC_VER) ||  defined(__BORLANDC__) ||	defined (__BCPLUSPLUS__)
-#	pragma pack(push,1)
-#	define PACK_STRUCT
-#elif defined( __GNUC__ )
-#	define PACK_STRUCT	__attribute__((packed))
-#else
-#	error Compiler not supported
-#endif
-
+#include "./../include/Compiler/pushpack1.h"
 
 namespace Assimp {
 namespace MDR {
 
-#define AI_MDR_MAGIC_NUMBER_BE	'RDM5'
-#define AI_MDR_MAGIC_NUMBER_LE	'5MDR'
+// to make it easier for ourselfes, we test the magic word against both "endianesses"
+#define MDR_MAKE(string) ((uint32_t)((string[0] << 24) + (string[1] << 16) + (string[2] << 8) + string[3]))
+
+#define AI_MDR_MAGIC_NUMBER_BE	MDR_MAKE("RDM5")
+#define AI_MDR_MAGIC_NUMBER_LE	MDR_MAKE("5MDR")
 
 // common limitations
 #define AI_MDR_VERSION			2
@@ -224,14 +219,9 @@ struct Header
 } PACK_STRUCT;
 
 
-// reset packing to the original value
-#if defined(_MSC_VER) ||  defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
-#	pragma pack( pop )
-#endif
-#undef PACK_STRUCT
-
+#include "./../include/Compiler/poppack1.h"
 
 };
 };
 
-#endif // !! AI_MDRFILEHELPER_H_INC
+#endif // !! AI_MDRFILEHELPER_H_INC

+ 12 - 12
code/NFFLoader.cpp

@@ -106,7 +106,7 @@ bool GetNextLine(const char*& buffer, char out[4096])
 // ------------------------------------------------------------------------------------------------
 #define AI_NFF_PARSE_FLOAT(f) \
 	SkipSpaces(&sz); \
-	if (!::IsLineEnd(*sz))sz = fast_atof_move(sz, f); 
+	if (!::IsLineEnd(*sz))sz = fast_atof_move(sz, (float&)f); 
 
 // ------------------------------------------------------------------------------------------------
 #define AI_NFF_PARSE_TRIPLE(v) \
@@ -160,7 +160,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 	char line[4096];
 	const char* sz;
 	unsigned int sphere = 0,cylinder = 0,cone = 0,numNamed = 0,
-		dodecahedron = 0,octecahedron = 0,octahedron = 0,tetrahedron = 0, hexahedron = 0;
+		dodecahedron = 0,octahedron = 0,tetrahedron = 0, hexahedron = 0;
 
 	while (GetNextLine(buffer,line))
 	{
@@ -223,11 +223,11 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 			SkipSpaces(&line[1],&sz);
 
 			// read just the RGB colors, the rest is ignored for the moment
-			sz = fast_atof_move(sz, s.color.r);
+			sz = fast_atof_move(sz, (float&)s.color.r);
 			SkipSpaces(&sz);
-			sz = fast_atof_move(sz, s.color.g);
+			sz = fast_atof_move(sz, (float&)s.color.g);
 			SkipSpaces(&sz);
-			sz = fast_atof_move(sz, s.color.b);
+			sz = fast_atof_move(sz, (float&)s.color.b);
 
 			// check whether we have this material already -
 			// although we have the RRM-Step, this is necessary here.
@@ -270,7 +270,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 			AI_NFF_PARSE_SHAPE_INFORMATION();
 
 			// we don't need scaling or translation here - we do it in the node's transform
-			StandardShapes::MakeSphere(aiVector3D(), 1.0f, iTesselation, currentMesh.vertices);
+			StandardShapes::MakeSphere(iTesselation, currentMesh.vertices);
 			currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
 
 			// generate a name for the mesh
@@ -287,7 +287,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 			AI_NFF_PARSE_SHAPE_INFORMATION();
 
 			// we don't need scaling or translation here - we do it in the node's transform
-			StandardShapes::MakeDodecahedron(aiVector3D(), 1.0f, currentMesh.vertices);
+			StandardShapes::MakeDodecahedron(currentMesh.vertices);
 			currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
 
 			// generate a name for the mesh
@@ -305,11 +305,11 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 			AI_NFF_PARSE_SHAPE_INFORMATION();
 
 			// we don't need scaling or translation here - we do it in the node's transform
-			StandardShapes::MakeOctahedron(aiVector3D(), 1.0f, currentMesh.vertices);
+			StandardShapes::MakeOctahedron(currentMesh.vertices);
 			currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
 
 			// generate a name for the mesh
-			::sprintf(currentMesh.name,"octecahedron_%i",octecahedron++);
+			::sprintf(currentMesh.name,"octahedron_%i",octahedron++);
 		}
 
 		// 'tet' - tetrahedron
@@ -323,7 +323,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 			AI_NFF_PARSE_SHAPE_INFORMATION();
 
 			// we don't need scaling or translation here - we do it in the node's transform
-			StandardShapes::MakeTetrahedron(aiVector3D(), 1.0f, currentMesh.vertices);
+			StandardShapes::MakeTetrahedron(currentMesh.vertices);
 			currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
 
 			// generate a name for the mesh
@@ -341,7 +341,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 			AI_NFF_PARSE_SHAPE_INFORMATION();
 
 			// we don't need scaling or translation here - we do it in the node's transform
-			StandardShapes::MakeHexahedron(aiVector3D(),1.0f, currentMesh.vertices);
+			StandardShapes::MakeHexahedron(currentMesh.vertices);
 			currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
 
 			// generate a name for the mesh
@@ -495,4 +495,4 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 		pcMat->AddProperty(&src.shader.color,1,AI_MATKEY_COLOR_SPECULAR);
 	}
 	pScene->mRootNode = root;
-}
+}

+ 1 - 1
code/NFFLoader.h

@@ -130,4 +130,4 @@ private:
 
 } // end of namespace Assimp
 
-#endif // AI_NFFIMPORTER_H_IN
+#endif // AI_NFFIMPORTER_H_IN

+ 2 - 2
code/ObjFileMtlImporter.cpp

@@ -56,8 +56,8 @@ ObjFileMtlImporter::ObjFileMtlImporter( std::vector<char> &buffer,
 									   ObjFile::Model *pModel ) :
 	m_DataIt( buffer.begin() ),
 	m_DataItEnd( buffer.end() ),
-	m_uiLine( 0 ),
-	m_pModel( pModel )
+	m_pModel( pModel ),
+	m_uiLine( 0 )
 {
 	ai_assert ( NULL != m_pModel );
 	if ( NULL == m_pModel->m_pDefaultMaterial )

+ 2 - 2
code/ObjFileParser.cpp

@@ -411,7 +411,7 @@ void ObjFileParser::getMaterialLib()
 		size_t size = pFile->FileSize();
 		std::vector<char> buffer;
 		buffer.resize( size );
-		size_t read_size = pFile->Read( &buffer[ 0 ], sizeof( char ), size );
+		pFile->Read( &buffer[ 0 ], sizeof( char ), size );
 		FileSystem.Close( pFile );
 
 		// Importing the material library 
@@ -494,7 +494,7 @@ void ObjFileParser::getGroupName()
 		ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(&strGroupName);
 		
 		// New group name, creating a new entry
-		ObjFile::Object *pObject = m_pModel->m_pCurrent;
+		//ObjFile::Object *pObject = m_pModel->m_pCurrent;
 		if (it == m_pModel->m_Groups.end())
 		{
 			std::vector<unsigned int> *pFaceIDArray = new std::vector<unsigned int>;

+ 6 - 5
code/OptimizeGraphProcess.cpp

@@ -417,10 +417,11 @@ void OptimizeGraphProcess::JoinBones(
 			wmit = (*it).pSrcBones.begin(); wmit != wend; ++wmit)
 		{
 			aiBone* pip = (*wmit).first;
-			for (unsigned int mp = 0; mp < pip->mNumWeights;++mp)
+			for (unsigned int mp = 0; mp < pip->mNumWeights;++mp,++avw)
 			{
-				aiVertexWeight& vf = aiVertexWeight(pip->mWeights[mp]);
-				vf.mVertexId += (*wmit).second;
+				const aiVertexWeight& vfi = pip->mWeights[mp];
+				avw->mWeight = vfi.mWeight;
+				avw->mVertexId = vfi.mVertexId + (*wmit).second;
 			}
 		}
 	}
@@ -592,9 +593,9 @@ void OptimizeGraphProcess::ApplyNodeMeshesOptimization(aiNode* pNode)
 // ------------------------------------------------------------------------------------------------
 void OptimizeGraphProcess::TransformMeshes(aiNode* quak,aiNode* pNode)
 {
-	for (unsigned int ä = 0; ä < quak->mNumMeshes;++ä)
+	for (unsigned int pl = 0; pl < quak->mNumMeshes;++pl)
 	{
-		aiMesh* mariusIsHot = pScene->mMeshes[quak->mMeshes[ä]];
+		aiMesh* mariusIsHot = pScene->mMeshes[quak->mMeshes[pl]];
 		aiMatrix4x4 mMatTransform = pNode->mTransformation;
 
 		// transformation: first back to the parent's local space,

+ 1 - 1
code/ParsingUtils.h

@@ -109,4 +109,4 @@ inline bool SkipSpacesAndLineEnd( const char_t** inout)
 }
 
 
-#endif // ! AI_PARSING_UTILS_H_INC
+#endif // ! AI_PARSING_UTILS_H_INC

+ 2 - 1
code/PlyLoader.cpp

@@ -593,6 +593,7 @@ float PLYImporter::NormalizeColorValue (PLY::PropertyInstance::ValueUnion val,
 		return (float)val.iUInt / (float)0xFFFF;
 	case EDT_Int:
 		return ((float)val.iInt / (float)0xFF) + 0.5f;
+	default: ;
 	};
 	return 0.0f;
 }
@@ -1077,4 +1078,4 @@ void PLYImporter::LoadMaterial(std::vector<MaterialHelper*>* pvOut)
 		}
 	}
 	return;
-}
+}

+ 1 - 1
code/PlyLoader.h

@@ -173,4 +173,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_3DSIMPORTER_H_INC
+#endif // AI_3DSIMPORTER_H_INC

+ 21 - 61
code/PlyParser.cpp

@@ -60,10 +60,7 @@ using namespace Assimp;
 // ------------------------------------------------------------------------------------------------
 PLY::EDataType PLY::Property::ParseDataType(const char* p_szIn,const char** p_szOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-
-
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 	PLY::EDataType eOut = PLY::EDT_INVALID;
 
 	if (0 == ASSIMP_strincmp(p_szIn,"char",4) ||
@@ -150,8 +147,7 @@ PLY::EDataType PLY::Property::ParseDataType(const char* p_szIn,const char** p_sz
 // ------------------------------------------------------------------------------------------------
 PLY::ESemantic PLY::Property::ParseSemantic(const char* p_szIn,const char** p_szOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 
 	PLY::ESemantic eOut = PLY::EST_INVALID;
 	if (0 == ASSIMP_strincmp(p_szIn,"red",3))
@@ -330,8 +326,7 @@ bool PLY::Property::ParseProperty (const char* p_szIn,
 	const char** p_szOut,
 	PLY::Property* pOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 
 	// Forms supported:
 	// "property float x"
@@ -405,9 +400,7 @@ bool PLY::Property::ParseProperty (const char* p_szIn,
 PLY::EElementSemantic PLY::Element::ParseSemantic(const char* p_szIn,
 	const char** p_szOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 	PLY::EElementSemantic eOut = PLY::EEST_INVALID;
 	if (0 == ASSIMP_strincmp(p_szIn,"vertex",6))
 	{
@@ -455,9 +448,7 @@ bool PLY::Element::ParseElement (const char* p_szIn,
 	const char** p_szOut,
 	PLY::Element* pOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != pOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != pOut);
 
 	// Example format: "element vertex 8"
 	*p_szOut = p_szIn;
@@ -514,9 +505,7 @@ bool PLY::Element::ParseElement (const char* p_szIn,
 bool PLY::DOM::SkipComments (const char* p_szIn,
 	const char** p_szOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 	*p_szOut = p_szIn;
 
 	// skip spaces
@@ -538,13 +527,10 @@ bool PLY::DOM::SkipComments (const char* p_szIn,
 // ------------------------------------------------------------------------------------------------
 bool PLY::DOM::ParseHeader (const char* p_szIn,const char** p_szOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 	DefaultLogger::get()->debug("PLY::DOM::ParseHeader() begin");
 
 	// after ply and format line
-	const char* szMax = *p_szOut;
 	*p_szOut = p_szIn;
 
 	// parse all elements
@@ -578,12 +564,9 @@ bool PLY::DOM::ParseElementInstanceLists (
 	const char* p_szIn,
 	const char** p_szOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 
 	DefaultLogger::get()->debug("PLY::DOM::ParseElementInstanceLists() begin");
-
-	const char* szMax = *p_szOut;
 	*p_szOut = p_szIn;
 
 	this->alElementData.resize(this->alElements.size());
@@ -608,8 +591,7 @@ bool PLY::DOM::ParseElementInstanceListsBinary (
 	const char** p_szOut,
 	bool p_bBE)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut);
 
 	DefaultLogger::get()->debug("PLY::DOM::ParseElementInstanceListsBinary() begin");
 	*p_szOut = p_szIn;
@@ -633,8 +615,7 @@ bool PLY::DOM::ParseElementInstanceListsBinary (
 // ------------------------------------------------------------------------------------------------
 bool PLY::DOM::ParseInstanceBinary (const char* p_szIn,DOM* p_pcOut,bool p_bBE)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_pcOut);
+	ai_assert(NULL != p_szIn && NULL != p_pcOut);
 
 	DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() begin");
 
@@ -680,12 +661,7 @@ bool PLY::ElementInstanceList::ParseInstanceList (
 	const PLY::Element* pcElement, 
 	PLY::ElementInstanceList* p_pcOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != pcElement);
-	ai_assert(NULL != p_pcOut);
-
-	const char* szMax = *p_szOut;
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != pcElement && NULL != p_pcOut);
 
 	if (EEST_INVALID == pcElement->eSemantic)
 	{
@@ -722,10 +698,7 @@ bool PLY::ElementInstanceList::ParseInstanceListBinary (
 	PLY::ElementInstanceList* p_pcOut,
 	bool p_bBE /* = false */)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != pcElement);
-	ai_assert(NULL != p_pcOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != pcElement && NULL != p_pcOut);
 
 	// we can add special handling code for unknown element semantics since
 	// we can't skip it as a whole block (we don't know its exact size
@@ -748,10 +721,7 @@ bool PLY::ElementInstance::ParseInstance (
 	const PLY::Element* pcElement,
 	PLY::ElementInstance* p_pcOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != pcElement);
-	ai_assert(NULL != p_pcOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != pcElement && NULL != p_pcOut);
 
 	if (!SkipSpaces(p_szIn, &p_szIn))return false;
 
@@ -785,10 +755,7 @@ bool PLY::ElementInstance::ParseInstanceBinary (
 	PLY::ElementInstance* p_pcOut,
 	bool p_bBE /* = false */)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != pcElement);
-	ai_assert(NULL != p_pcOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != pcElement && NULL != p_pcOut);
 
 	// allocate enough storage
 	p_pcOut->alProperties.resize(pcElement->alProperties.size());
@@ -813,10 +780,7 @@ bool PLY::ElementInstance::ParseInstanceBinary (
 bool PLY::PropertyInstance::ParseInstance (const char* p_szIn,const char** p_szOut,
 	const PLY::Property* prop, PLY::PropertyInstance* p_pcOut)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != prop);
-	ai_assert(NULL != p_pcOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL !=  prop && NULL != p_pcOut);
 
 	*p_szOut = p_szIn;
 
@@ -856,10 +820,7 @@ bool PLY::PropertyInstance::ParseInstance (const char* p_szIn,const char** p_szO
 bool PLY::PropertyInstance::ParseInstanceBinary (const char* p_szIn,const char** p_szOut,
 	const PLY::Property* prop, PLY::PropertyInstance* p_pcOut,bool p_bBE)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != prop);
-	ai_assert(NULL != p_pcOut);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != prop && NULL != p_pcOut);
 
 	if (prop->bIsList)
 	{
@@ -902,6 +863,8 @@ PLY::PropertyInstance::ValueUnion PLY::PropertyInstance::DefaultValue(
 	case EDT_Double:
 		out.fDouble = 0.0;
 		return out;
+
+	default: ;
 	};
 	out.iUInt = 0;
 	return out;
@@ -910,9 +873,7 @@ PLY::PropertyInstance::ValueUnion PLY::PropertyInstance::DefaultValue(
 bool PLY::PropertyInstance::ParseValue(const char* p_szIn,const char** p_szOut,
 	PLY::EDataType eType,PLY::PropertyInstance::ValueUnion* out)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != out);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != out);
 
 	switch (eType)
 	{
@@ -956,6 +917,7 @@ bool PLY::PropertyInstance::ParseValue(const char* p_szIn,const char** p_szOut,
 		float f;
 		p_szIn = fast_atof_move(p_szIn,f);
 		out->fDouble = (double)f;
+		break;
 
 	default:
 		*p_szOut = p_szIn;
@@ -972,9 +934,7 @@ bool PLY::PropertyInstance::ParseValueBinary(
 	PLY::PropertyInstance::ValueUnion* out, 
 	bool p_bBE)
 {
-	ai_assert(NULL != p_szIn);
-	ai_assert(NULL != p_szOut);
-	ai_assert(NULL != out);
+	ai_assert(NULL != p_szIn && NULL != p_szOut && NULL != out);
 
 	switch (eType)
 	{

+ 3 - 1
code/PlyParser.h

@@ -264,7 +264,8 @@ public:
 
 	//! Default constructor
 	Element()
-		: NumOccur(0), eSemantic (EEST_INVALID)
+		:	eSemantic (EEST_INVALID)
+		,	NumOccur(0)
 	{}
 
 	//! Destructor. Dallocates all storage
@@ -548,6 +549,7 @@ TYPE PLY::PropertyInstance::ConvertTo(
 	case EDT_Short:
 	case EDT_Char:
 		return (TYPE)v.iInt;
+	default: ;
 	};
 	return (TYPE)0;
 }

+ 1 - 1
code/PretransformVertices.h

@@ -85,4 +85,4 @@ public:
 
 } // end of namespace Assimp
 
-#endif // !!AI_GENFACENORMALPROCESS_H_INC
+#endif // !!AI_GENFACENORMALPROCESS_H_INC

+ 2 - 1
code/RemoveComments.cpp

@@ -101,7 +101,8 @@ void CommentRemover::RemoveMultiLineComments(const char* szCommentStart,
 		++szBuffer;
 __continue_outer:
 		int i = 4; // NOP dummy
+		++i;
 	}
 }
 
-}; // !! Assimp
+}; // !! Assimp

+ 1 - 0
code/SGSpatialSort.cpp

@@ -140,3 +140,4 @@ void SGSpatialSort::FindPositions( const aiVector3D& pPosition,
 	}
 }
 
+

+ 28 - 28
code/SMDLoader.cpp

@@ -712,7 +712,7 @@ void SMDImporter::ParseFile()
 				DefaultLogger::get()->warn("SMD.version is not 1. This "
 					"file format is not known. Continuing happily ...");
 			}
-			//continue;
+			continue;
 		}
 		// "nodes\n" - Starts the node section
 		if (0 == ASSIMP_strincmp(szCurrent,"nodes",5) &&
@@ -720,7 +720,7 @@ void SMDImporter::ParseFile()
 		{
 			szCurrent += 6;
 			this->ParseNodesSection(szCurrent,&szCurrent);
-			//continue;
+			continue;
 		}
 		// "triangles\n" - Starts the triangle section
 		if (0 == ASSIMP_strincmp(szCurrent,"triangles",9) &&
@@ -728,7 +728,7 @@ void SMDImporter::ParseFile()
 		{
 			szCurrent += 10;
 			this->ParseTrianglesSection(szCurrent,&szCurrent);
-			//continue;
+			continue;
 		}
 		// "vertexanimation\n" - Starts the vertex animation section
 		if (0 == ASSIMP_strincmp(szCurrent,"vertexanimation",15) &&
@@ -737,7 +737,7 @@ void SMDImporter::ParseFile()
 			this->bHasUVs = false;
 			szCurrent += 16;
 			this->ParseVASection(szCurrent,&szCurrent);
-			//continue;
+			continue;
 		}
 		// "skeleton\n" - Starts the skeleton section
 		if (0 == ASSIMP_strincmp(szCurrent,"skeleton",8) &&
@@ -745,9 +745,9 @@ void SMDImporter::ParseFile()
 		{
 			szCurrent += 9;
 			this->ParseSkeletonSection(szCurrent,&szCurrent);
-			//continue;
+			continue;
 		}
-		else SkipLine(szCurrent,&szCurrent);
+		SkipLine(szCurrent,&szCurrent);
 	}
 	return;
 }
@@ -782,8 +782,8 @@ void SMDImporter::ParseNodesSection(const char* szCurrent,
 		}
 		this->ParseNodeInfo(szCurrent,&szCurrent);
 	}
-	*szCurrentOut = szCurrent;
 	SkipSpacesAndLineEnd(szCurrent,&szCurrent);
+	*szCurrentOut = szCurrent;
 }
 // ------------------------------------------------------------------------------------------------
 // Parse the triangles section of the file
@@ -805,8 +805,8 @@ void SMDImporter::ParseTrianglesSection(const char* szCurrent,
 		}
 		this->ParseTriangle(szCurrent,&szCurrent);
 	}
-	*szCurrentOut = szCurrent;
 	SkipSpacesAndLineEnd(szCurrent,&szCurrent);
+	*szCurrentOut = szCurrent;
 }
 // ------------------------------------------------------------------------------------------------
 // Parse the vertex animation section of the file
@@ -823,7 +823,7 @@ void SMDImporter::ParseVASection(const char* szCurrent,
 			IsSpaceOrNewLine(*(szCurrent+3)))
 		{
 			szCurrent += 4;
-			SkipLine(szCurrent,&szCurrent);
+			//SkipLine(szCurrent,&szCurrent);
 			break;
 		}
 		// "time <n>\n" 
@@ -834,7 +834,7 @@ void SMDImporter::ParseVASection(const char* szCurrent,
 			// NOTE: The doc says that time values COULD be negative ...
 			// note2: this is the shape key -> valve docs
 			int iTime = 0;
-			if(!this->ParseSignedInt(szCurrent,&szCurrent,iTime) || this->configFrameID != iTime)break;
+			if(!this->ParseSignedInt(szCurrent,&szCurrent,iTime) || this->configFrameID != (unsigned int)iTime)break;
 			SkipLine(szCurrent,&szCurrent);
 		}
 		else 
@@ -854,8 +854,8 @@ void SMDImporter::ParseVASection(const char* szCurrent,
 		this->aszTextures.pop_back();
 	}
 
-	*szCurrentOut = szCurrent;
 	SkipSpacesAndLineEnd(szCurrent,&szCurrent);
+	*szCurrentOut = szCurrent;
 }
 // ------------------------------------------------------------------------------------------------
 // Parse the skeleton section of the file
@@ -872,7 +872,7 @@ void SMDImporter::ParseSkeletonSection(const char* szCurrent,
 			IsSpaceOrNewLine(*(szCurrent+3)))
 		{
 			szCurrent += 4;
-			SkipLine(szCurrent,&szCurrent);
+			//SkipLine(szCurrent,&szCurrent);
 			break;
 		}
 		// "time <n>\n" - Specifies the current animation frame
@@ -981,32 +981,32 @@ void SMDImporter::ParseSkeletonElement(const char* szCurrent,
 	SMD::Bone::Animation::MatrixKey& key = bone.sAnim.asKeys.back();
 
 	key.dTime = (double)iTime;
-	if(!this->ParseFloat(szCurrent,&szCurrent,vPos.x))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vPos.x))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.pos.x");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vPos.y))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vPos.y))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.pos.y");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vPos.z))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vPos.z))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.pos.z");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vRot.x))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vRot.x))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.rot.x");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vRot.y))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vRot.y))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.rot.y");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vRot.z))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vRot.z))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.rot.z");
 		SMDI_PARSE_RETURN;
@@ -1099,32 +1099,32 @@ void SMDImporter::ParseVertex(const char* szCurrent,
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.parent");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.pos.x))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.pos.x))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.pos.x");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.pos.y))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.pos.y))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.pos.y");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.pos.z))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.pos.z))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.pos.z");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.nor.x))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.nor.x))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.nor.x");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.nor.y))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.nor.y))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.nor.y");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.nor.z))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.nor.z))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.nor.z");
 		SMDI_PARSE_RETURN;
@@ -1132,12 +1132,12 @@ void SMDImporter::ParseVertex(const char* szCurrent,
 
 	if (bVASection)SMDI_PARSE_RETURN;
 
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.uv.x))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.uv.x))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.uv.x");
 		SMDI_PARSE_RETURN;
 	}
-	if(!this->ParseFloat(szCurrent,&szCurrent,vertex.uv.y))
+	if(!this->ParseFloat(szCurrent,&szCurrent,(float&)vertex.uv.y))
 	{
 		this->LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.uv.y");
 		SMDI_PARSE_RETURN;
@@ -1147,7 +1147,7 @@ void SMDImporter::ParseVertex(const char* szCurrent,
 	// all elements from now are fully optional, we don't need them
 	unsigned int iSize = 0;
 	if(!this->ParseUnsignedInt(szCurrent,&szCurrent,iSize))SMDI_PARSE_RETURN;
-	vertex.aiBoneLinks.resize(iSize,std::pair<unsigned int, float>(-1,0.0f));
+	vertex.aiBoneLinks.resize(iSize,std::pair<unsigned int, float>(0,0.0f));
 
 	for (std::vector<std::pair<unsigned int, float> >::iterator
 		i =  vertex.aiBoneLinks.begin();
@@ -1159,4 +1159,4 @@ void SMDImporter::ParseVertex(const char* szCurrent,
 
 	// go to the beginning of the next line
 	SMDI_PARSE_RETURN;
-}
+}

+ 6 - 6
code/STLLoader.cpp

@@ -240,11 +240,11 @@ void STLImporter::LoadASCIIFile()
 			{
 				sz += 7;
 				SkipSpaces(&sz);
-				sz = fast_atof_move(sz, vn->x ); 
+				sz = fast_atof_move(sz, (float&)vn->x ); 
 				SkipSpaces(&sz);
-				sz = fast_atof_move(sz, vn->y ); 
+				sz = fast_atof_move(sz, (float&)vn->y ); 
 				SkipSpaces(&sz);
-				sz = fast_atof_move(sz, vn->z ); 
+				sz = fast_atof_move(sz, (float&)vn->z ); 
 				*(vn+1) = *vn;
 				*(vn+2) = *vn;
 			}
@@ -261,11 +261,11 @@ void STLImporter::LoadASCIIFile()
 				sz += 7;
 				SkipSpaces(&sz);
 				aiVector3D* vn = &pMesh->mVertices[(curFace-1)*3 + curVertex++];
-				sz = fast_atof_move(sz, vn->x ); 
+				sz = fast_atof_move(sz, (float&)vn->x ); 
 				SkipSpaces(&sz);
-				sz = fast_atof_move(sz, vn->y ); 
+				sz = fast_atof_move(sz, (float&)vn->y ); 
 				SkipSpaces(&sz);
-				sz = fast_atof_move(sz, vn->z ); 
+				sz = fast_atof_move(sz, (float&)vn->z ); 
 			}
 		}
 		else if (!::strncmp(sz,"endsolid",8))

+ 1 - 1
code/STLLoader.h

@@ -115,4 +115,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_3DSIMPORTER_H_IN
+#endif // AI_3DSIMPORTER_H_IN

+ 2 - 2
code/SmoothingGroups.inl

@@ -95,7 +95,7 @@ void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups<T>& sMesh)
 	
 	// now generate the spatial sort tree
 	SGSpatialSort sSort;
-	for( std::vector<T>::iterator i =  sMesh.mFaces.begin();
+	for( typename std::vector<T>::iterator i =  sMesh.mFaces.begin();
 		i != sMesh.mFaces.end();++i)
 	{
 		sSort.Add(sMesh.mPositions[(*i).mIndices[0]],(*i).mIndices[0],(*i).iSmoothGroup);
@@ -104,7 +104,7 @@ void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups<T>& sMesh)
 	}
 	sSort.Prepare();
 
-	for( std::vector<T>::iterator i =  sMesh.mFaces.begin();
+	for( typename std::vector<T>::iterator i =  sMesh.mFaces.begin();
 		i != sMesh.mFaces.end();++i)
 	{
 		std::vector<unsigned int> poResult;

+ 1 - 0
code/SpatialSort.cpp

@@ -132,3 +132,4 @@ void SpatialSort::FindPositions( const aiVector3D& pPosition, float pRadius, std
 	// that's it
 }
 
+

+ 4 - 5
code/SplitLargeMeshes.cpp

@@ -274,15 +274,14 @@ void SplitLargeMeshesProcess_Triangle::SplitMesh(
 				// setup face type and number of indices
 				pcMesh->mFaces[p].mNumIndices = iNumIndices;
 				unsigned int* pi = pMesh->mFaces[iTemp].mIndices;
-
-				pcMesh->mFaces[p].mIndices = new unsigned int[iNumIndices];
+				unsigned int* piOut = pcMesh->mFaces[p].mIndices = new unsigned int[iNumIndices];
 
 				// and copy the contents of the old array, offset by current base
 				for (unsigned int v = 0; v < iNumIndices;++v)
 				{
-					unsigned int iIndex = pMesh->mFaces[iTemp].mIndices[v];
+					unsigned int iIndex = pi[v];
 					unsigned int iIndexOut = iCurrent++;
-					pcMesh->mFaces[p].mIndices[v] = iIndexOut;
+					piOut[v] = iIndexOut;
 
 					// copy positions
 					if (pMesh->mVertices != NULL)
@@ -407,7 +406,7 @@ void SplitLargeMeshesProcess_Vertex::SplitMesh(
 		// determine the estimated size of a submesh
 		// (this could be too large. Max waste is a single digit percentage)
 		const unsigned int iSubMeshes = (pMesh->mNumVertices / SplitLargeMeshesProcess_Vertex::LIMIT) + 1;
-		const unsigned int iOutVertexNum2 = pMesh->mNumVertices /iSubMeshes;
+		//const unsigned int iOutVertexNum2 = pMesh->mNumVertices /iSubMeshes;
 
 		// create a std::vector<unsigned int> to indicate which vertices
 		// have already been copied

+ 1 - 1
code/SplitLargeMeshes.h

@@ -213,4 +213,4 @@ public:
 
 } // end of namespace Assimp
 
-#endif // !!AI_SPLITLARGEMESHES_H_INC
+#endif // !!AI_SPLITLARGEMESHES_H_INC

BIN
code/StandardShapes.cpp


+ 50 - 2
code/StandardShapes.h

@@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <vector>
 
+
 namespace Assimp	{
 
 // ---------------------------------------------------------------------------
@@ -65,6 +66,9 @@ public:
 	 *  @param center Center point of the hexahedron
 	 *  @param length Radius of the hexahedron 
 	 *  @param positions Receives output triangles.
+	 *
+	 *  @note If you define AI_STANDARD_SHAPES_OUTPUT_POLYGONS quads
+	 *    instead of triangles are returned.
 	 */
 	static void MakeHexahedron(aiVector3D& center,const aiVector3D& length,
 		std::vector<aiVector3D>& positions);
@@ -85,6 +89,8 @@ public:
 	 *  @param center Center point of the dodecahedron
 	 *  @param length Radius of the dodecahedron
 	 *  @param positions Receives output triangles
+	 *  @note If you define AI_STANDARD_SHAPES_OUTPUT_POLYGONS pentagons
+	 *    instead of triangles are returned.
 	 */
 	static void MakeDodecahedron(aiVector3D& center,const aiVector3D& length,
 		std::vector<aiVector3D>& positions);
@@ -165,6 +171,7 @@ public:
 	// simplified versions - the radius is a single float and applies
 	// to all axes. These version of the functions must be used if ou 
 	// REALLY want a platonic primitive :-)
+	// ---------------------------------------------------------------------
 	static void MakeHexahedron(aiVector3D& center,float length,
 		std::vector<aiVector3D>& positions)
 	{
@@ -177,7 +184,7 @@ public:
 		MakeDodecahedron(center,aiVector3D(length),positions);
 	}
 
-	static void MakeOcathedron(aiVector3D& center,float length,
+	static void MakeOctahedron(aiVector3D& center,float length,
 		std::vector<aiVector3D>& positions)
 	{
 		MakeOctahedron(center,aiVector3D(length),positions);
@@ -194,8 +201,49 @@ public:
 	{
 		MakeIcosahedron(center,aiVector3D(length),positions);
 	}
+
+
+	// simplified versions - radius is 1, position is 0|0|0
+	// ---------------------------------------------------------------------
+	static void MakeHexahedron(std::vector<aiVector3D>& positions)
+	{
+		aiVector3D v;
+		MakeHexahedron(v,1.0f,positions);
+	}
+
+	static void MakeDodecahedron(std::vector<aiVector3D>& positions)
+	{
+		aiVector3D v;
+		MakeDodecahedron(v,1.0f,positions);
+	}
+
+	static void MakeOctahedron(std::vector<aiVector3D>& positions)
+	{
+		aiVector3D v;
+		MakeOctahedron(v,1.0f,positions);
+	}
+
+	static void MakeTetrahedron(std::vector<aiVector3D>& positions)
+	{
+		aiVector3D v;
+		MakeTetrahedron(v,1.0f,positions);
+	}
+
+	static void MakeIcosahedron(std::vector<aiVector3D>& positions)
+	{
+		aiVector3D v;
+		MakeIcosahedron(v,1.0f,positions);
+	}
+
+
+	static void MakeSphere(unsigned int tess,
+		std::vector<aiVector3D>& positions)
+	{
+		aiVector3D v;
+		MakeSphere(v,1.0f,tess,positions);
+	}
 	
 };
 } // ! Assimp
 
-#endif // !! AI_STANDARD_SHAPES_H_INC
+#endif // !! AI_STANDARD_SHAPES_H_INC

+ 2 - 2
code/TextureTransform.cpp

@@ -158,7 +158,7 @@ void TextureTransform::AddToList(std::vector<STransformVecInfo>& rasVec,
 			(*i).fScaleU  == pcTex->mScaleU  &&
 			(*i).fScaleV  == pcTex->mScaleV  &&
 			(*i).fRotation == pcTex->mRotation &&
-			(*i).iUVIndex == pcTex->iUVSrc)
+			(*i).iUVIndex == (unsigned int)pcTex->iUVSrc)
 		{
 			(*i).pcTextures.push_back(pcTex);
 			return;
@@ -577,4 +577,4 @@ void TextureTransform::SetupMatUVSrc (aiMaterial* pcMat, const Dot3DS::Material*
 		pcHelper->AddProperty<int>(&pcMatIn->sTexAmbient.iUVSrc,1,
 			AI_MATKEY_UVWSRC_AMBIENT(0));
 }
-};
+};

+ 1 - 1
code/TriangulateProcess.h

@@ -93,4 +93,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_TRIANGULATEPROCESS_H_INC
+#endif // AI_TRIANGULATEPROCESS_H_INC

+ 5 - 4
code/ValidateDataStructure.cpp

@@ -472,7 +472,7 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
 			}
 
 			if (aiPTI_String != prop->mType)
-				this->ReportError("Material property %s is expected to be a string",prop->mKey);
+				this->ReportError("Material property %s is expected to be a string",prop->mKey.data);
 		}
 	}
 	if (iIndex +1 != iNumIndices)
@@ -491,7 +491,7 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
 		if (0 == ASSIMP_strincmp( prop->mKey.data, szBaseBuf, iLen ))
 		{
 			if (aiPTI_Integer != prop->mType || sizeof(int) > prop->mDataLength)
-				this->ReportError("Material property %s is expected to be an integer",prop->mKey);
+				this->ReportError("Material property %s is expected to be an integer",prop->mKey.data);
 
 			const char* sz = &prop->mKey.data[iLen];
 			if (*sz)
@@ -510,14 +510,14 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
 					for (unsigned int a = 0; a < this->mScene->mNumMeshes;++a)
 					{
 						aiMesh* mesh = this->mScene->mMeshes[a];
-						if(mesh->mMaterialIndex == iIndex)
+						if(mesh->mMaterialIndex == (unsigned int)iIndex)
 						{
 							int iChannels = 0;
 							while (mesh->HasTextureCoords(iChannels++));
 							if (iIndex >= iChannels)
 							{
 								this->ReportError("Invalid UV index: %i (key %s). Mesh %i has only %i UV channels",
-									iIndex,prop->mKey,a,iChannels);
+									iIndex,prop->mKey.data,a,iChannels);
 							}
 						}
 					}
@@ -598,6 +598,7 @@ void ValidateDSProcess::Validate( const aiMaterial* pMaterial)
 					"AI_MATKEY_SHININESS_STRENGTH key is 0.0");
 			}
 			break;
+		default: ;
 		};
 	}
 

+ 1 - 1
code/ValidateDataStructure.h

@@ -173,4 +173,4 @@ private:
 
 } // end of namespace Assimp
 
-#endif // AI_VALIDATEPROCESS_H_INC
+#endif // AI_VALIDATEPROCESS_H_INC

+ 1 - 1
code/VertexTriangleAdjacency.cpp

@@ -133,4 +133,4 @@ VertexTriangleAdjacency::~VertexTriangleAdjacency()
 	delete[] this->mOffsetTable;
 	delete[] this->mAdjacencyTable;
 	delete[] this->mLiveTriangles;
-}
+}

+ 1 - 1
code/VertexTriangleAdjacency.h

@@ -123,4 +123,4 @@ public:
 };
 }
 
-#endif // !! AI_VTADJACENCY_H_INC
+#endif // !! AI_VTADJACENCY_H_INC

+ 1 - 1
code/XFileHelper.h

@@ -197,4 +197,4 @@ struct Scene
 } // end of namespace XFile
 } // end of namespace Assimp
 
-#endif // AI_XFILEHELPER_H_INC
+#endif // AI_XFILEHELPER_H_INC

+ 12 - 27
code/XFileImporter.cpp

@@ -54,6 +54,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace Assimp;
 
+#if _MSC_VER >= 1400
+#	define sprintf sprintf_s
+#endif
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 XFileImporter::XFileImporter()
@@ -153,9 +157,13 @@ void XFileImporter::CreateDataRepresentationFromImport( aiScene* pScene, const X
 		mat->AddProperty<int>( &shadeMode, 1, AI_MATKEY_SHADING_MODEL);
 		// material colours
 		int specExp = 1;
-		mat->AddProperty( &aiColor3D( 0, 0, 0), 1, AI_MATKEY_COLOR_EMISSIVE);
-		mat->AddProperty( &aiColor3D( 0.5f, 0.5f, 0.5f), 1, AI_MATKEY_COLOR_DIFFUSE);
-		mat->AddProperty( &aiColor3D( 0, 0, 0), 1, AI_MATKEY_COLOR_SPECULAR);
+
+		aiColor3D clr = aiColor3D( 0, 0, 0);
+		mat->AddProperty( &clr, 1, AI_MATKEY_COLOR_EMISSIVE);
+		mat->AddProperty( &clr, 1, AI_MATKEY_COLOR_SPECULAR);
+
+		clr = aiColor3D( 0.5f, 0.5f, 0.5f);
+		mat->AddProperty( &clr, 1, AI_MATKEY_COLOR_DIFFUSE);
 		mat->AddProperty( &specExp, 1, AI_MATKEY_SHININESS);
 
 		pScene->mMaterials = new aiMaterial*[1];
@@ -628,51 +636,27 @@ void XFileImporter::ConvertMaterials( aiScene* pScene, const std::vector<XFile::
 				// bump map
 				if (std::string::npos != sz.find("bump", s) || std::string::npos != sz.find("height", s))
 				{
-#if _MSC_VER >= 1400
-					::sprintf_s(key,AI_MATKEY_TEXTURE_HEIGHT_ "[%i]",iHM++);
-#else
 					::sprintf(key,AI_MATKEY_TEXTURE_HEIGHT_ "[%i]",iHM++);
-#endif
 				} else
 				if (otex.mIsNormalMap || std::string::npos != sz.find( "normal", s) || std::string::npos != sz.find("nm", s))
 				{
-#if _MSC_VER >= 1400
-					::sprintf_s(key,AI_MATKEY_TEXTURE_NORMALS_ "[%i]",iNM++);
-#else
 					::sprintf(key,AI_MATKEY_TEXTURE_NORMALS_ "[%i]",iNM++);
-#endif
 				} else
 				if (std::string::npos != sz.find( "spec", s) || std::string::npos != sz.find( "glanz", s))
 				{
-#if _MSC_VER >= 1400
-					::sprintf_s(key,AI_MATKEY_TEXTURE_SPECULAR_ "[%i]",iSM++);
-#else
 					::sprintf(key,AI_MATKEY_TEXTURE_SPECULAR_ "[%i]",iSM++);
-#endif
 				} else
 				if (std::string::npos != sz.find( "ambi", s) || std::string::npos != sz.find( "env", s))
 				{
-#if _MSC_VER >= 1400
-					::sprintf_s(key,AI_MATKEY_TEXTURE_AMBIENT_ "[%i]",iAM++);
-#else
 					::sprintf(key,AI_MATKEY_TEXTURE_AMBIENT_ "[%i]",iAM++);
-#endif
 				} else
 				if (std::string::npos != sz.find( "emissive", s) || std::string::npos != sz.find( "self", s))
 				{
-#if _MSC_VER >= 1400
-					::sprintf_s(key,AI_MATKEY_TEXTURE_EMISSIVE_ "[%i]",iEM++);
-#else
 					::sprintf(key,AI_MATKEY_TEXTURE_EMISSIVE_ "[%i]",iEM++);
-#endif
 				} else
 				{
 				// assume it is a diffuse texture
-#if _MSC_VER >= 1400
-					::sprintf_s(key,AI_MATKEY_TEXTURE_DIFFUSE_ "[%i]",iDM++);
-#else
 					::sprintf(key,AI_MATKEY_TEXTURE_DIFFUSE_ "[%i]",iDM++);
-#endif
 				}
 
 				// place texture filename property under the corresponding name
@@ -686,3 +670,4 @@ void XFileImporter::ConvertMaterials( aiScene* pScene, const std::vector<XFile::
 		pScene->mNumMaterials++;
 	}
 }
+

+ 1 - 1
code/XFileImporter.h

@@ -154,4 +154,4 @@ protected:
 
 } // end of namespace Assimp
 
-#endif // AI_BASEIMPORTER_H_INC
+#endif // AI_BASEIMPORTER_H_INC

+ 4 - 4
code/XFileParser.cpp

@@ -391,9 +391,9 @@ void XFileParser::ParseDataObjectSkinMeshHeader( Mesh* pMesh)
 {
 	readHeadOfDataObject();
 
-	unsigned int maxSkinWeightsPerVertex = ReadInt();
-	unsigned int maxSkinWeightsPerFace = ReadInt();
-	unsigned int numBonesInMesh = ReadInt();
+	/*unsigned int maxSkinWeightsPerVertex =*/ ReadInt();
+	/*unsigned int maxSkinWeightsPerFace =*/ ReadInt();
+	/*unsigned int numBonesInMesh = */ReadInt();
 
 	CheckForClosingBrace();
 }
@@ -478,7 +478,7 @@ void XFileParser::ParseDataObjectMeshMaterialList( Mesh* pMesh)
 	readHeadOfDataObject();
 
 	// read material count
-	unsigned int numMaterials = ReadInt();
+	/*unsigned int numMaterials =*/ ReadInt();
 	// read non triangulated face material index count
 	unsigned int numMatIndices = ReadInt();
 

+ 1 - 1
code/XFileParser.h

@@ -156,4 +156,4 @@ protected:
 };
 
 }
-#endif // AI_XFILEPARSER_H_INC
+#endif // AI_XFILEPARSER_H_INC

+ 1 - 1
code/aiAssert.cpp

@@ -24,4 +24,4 @@ void Assimp::aiAssert (bool expression, const std::string &message, unsigned int
 		exit (1);
 #endif
 	}
-}
+}

+ 1 - 1
code/extra/MakeVerboseFormat.cpp

@@ -217,4 +217,4 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
 		pcMesh->mBitangents = pvBitangents;
 	}
 	return (pcMesh->mNumVertices != iOldNumVertices);
-}
+}

+ 71 - 72
code/makefile

@@ -1,72 +1,71 @@
-#rough makefile for linux/gnu systems.  requires that boost libs are installed
-#produces shared library output in bin/libassimp.so
-
-SOURCES = \
-	3DSConverter.cpp \
-	3DSGenNormals.cpp \
-	3DSLoader.cpp \
-	3DSSpatialSort.cpp \
-	aiAssert.cpp \
-	ASELoader.cpp \
-	ASEParser.cpp \
-	Assimp.cpp \
-	BaseImporter.cpp \
-	BaseProcess.cpp \
-	CalcTangentsProcess.cpp \
-	ConvertToLHProcess.cpp \
-	DefaultIOStream.cpp \
-	DefaultIOSystem.cpp \
-	DefaultLogger.cpp \
-	extra/MakeVerboseFormat.cpp \
-	FixNormalsStep.cpp \
-	GenFaceNormalsProcess.cpp \
-	GenVertexNormalsProcess.cpp \
-	HMPLoader.cpp \
-	Importer.cpp \
-	ImproveCacheLocality.cpp \
-	JoinVerticesProcess.cpp \
-	KillNormalsProcess.cpp \
-	LimitBoneWeightsProcess.cpp \
-	LWOMaterial.cpp \
-	LWOLoader.cpp \
-	MaterialSystem.cpp \
-	MD2Loader.cpp \
-	MD3Loader.cpp \
-	MD5Loader.cpp \
-	MD5Parser.cpp \
-	MDCLoader.cpp \
-	MDLLoader.cpp \
-	MDLMaterialLoader.cpp \
-	ObjFileImporter.cpp \
-	ObjFileMtlImporter.cpp \
-	ObjFileParser.cpp \
-	PlyLoader.cpp \
-	PlyParser.cpp \
-	PretransformVertices.cpp \
-	RemoveComments.cpp \
-	RemoveRedundantMaterials.cpp \
-	SMDLoader.cpp \
-	SpatialSort.cpp \
-	SplitLargeMeshes.cpp \
-	STLLoader.cpp \
-	TextureTransform.cpp \
-	TriangulateProcess.cpp \
-	ValidateDataStructure.cpp \
-	VertexTriangleAdjacency.cpp \
-	XFileImporter.cpp \
-	XFileParser.cpp
-
-OBJECTS = $(SOURCES:.cpp=.o)
-
-TARGET = ../bin/libassimp.so
-
-all:	$(TARGET)
-
-$(TARGET):	$(OBJECTS)
-	gcc -o $@ $(OBJECTS) -shared -lstdc++ -lboost_thread-mt -lboost_date_time-mt
-
-%.o:%.cpp
-	$(CXX) -g -Wall -c $? -o $@ -I../include -fPIC
-
-clean:
-	rm -f $(OBJECTS) $(TARGET)
+#rough makefile for linux/gnu systems.  requires that boost libs are installed
+#produces shared library output in bin/libassimp.so
+
+
+SOURCES = 3DSConverter.cpp \
+	3DSLoader.cpp \
+	aiAssert.cpp \
+	ASELoader.cpp \
+	ASEParser.cpp \
+	Assimp.cpp BaseImporter.cpp BaseProcess.cpp \
+	CalcTangentsProcess.cpp \
+	ConvertToLHProcess.cpp \
+	DefaultIOStream.cpp \
+	DefaultIOSystem.cpp \
+	DefaultLogger.cpp \
+	DXFLoader.cpp \
+	FixNormalsStep.cpp \
+	GenFaceNormalsProcess.cpp \
+	GenVertexNormalsProcess.cpp \
+	HMPLoader.cpp \
+	Importer.cpp \
+	ImproveCacheLocality.cpp \
+	JoinVerticesProcess.cpp \
+	KillNormalsProcess.cpp \
+	LimitBoneWeightsProcess.cpp \
+	LWOBLoader.cpp \
+	LWOLoader.cpp \
+	LWOMaterial.cpp \
+	MaterialSystem.cpp \
+	MD2Loader.cpp \
+	MD3Loader.cpp \
+	MD5Loader.cpp \
+	MD5Parser.cpp \
+	MDCLoader.cpp \
+	MDLLoader.cpp \
+	MDLMaterialLoader.cpp \
+	NFFLoader.cpp \
+	ObjFileImporter.cpp \
+	ObjFileMtlImporter.cpp \
+	ObjFileParser.cpp \
+	OptimizeGraphProcess.cpp \
+	PlyLoader.cpp \
+	PlyParser.cpp \
+	PretransformVertices.cpp \
+	RemoveComments.cpp \
+	RemoveRedundantMaterials.cpp \
+	SGSpatialSort.cpp \
+	SMDLoader.cpp \
+	SpatialSort.cpp \
+	SplitLargeMeshes.cpp \
+	StandardShapes.cpp \
+	STLLoader.cpp \
+	TextureTransform.cpp \
+	TriangulateProcess.cpp \
+	ValidateDataStructure.cpp \
+	VertexTriangleAdjacency.cpp \
+	XFileImporter.cpp \
+	XFileParser.cpp
+
+OBJECTS = $(SOURCES:.cpp=.o)
+
+TARGET = ./../bin/libassimp.so
+
+all:	$(TARGET)
+
+$(TARGET):	$(OBJECTS)
+	gcc -o $@ $(OBJECTS) -shared -lstdc++ 
+%.o:%.cpp
+	$(CXX) -g -Wall -c $? -o $@ -I../include -fPIC
+clean:
+	rm -f $(OBJECTS) $(TARGET)

+ 1 - 1
code/Compiler/poppack1.h → include/Compiler/poppack1.h

@@ -13,4 +13,4 @@
 #endif
 #undef PACK_STRUCT
 
-#undef AI_PUSHPACK_IS_DEFINED
+#undef AI_PUSHPACK_IS_DEFINED

+ 0 - 0
code/Compiler/pushpack1.h → include/Compiler/pushpack1.h


+ 7 - 3
include/aiTypes.h

@@ -67,6 +67,8 @@ const size_t MAXLEN = 1024;
 #	define MAXLEN 1024
 #endif
 
+#include "./Compiler/pushpack1.h"
+
 // ---------------------------------------------------------------------------
 /** Represents a two-dimensional vector. 
 */
@@ -82,7 +84,7 @@ struct aiVector2D
 
 	//! X and y coordinates
 	float x, y;
-} ;
+} PACK_STRUCT;
 
 // aiVector3D type moved to separate header due to size of operators
 // aiQuaternion type moved to separate header due to size of operators
@@ -109,7 +111,7 @@ struct aiColor3D
 
 	//! Red, green and blue color values
 	float r, g, b;
-};
+} PACK_STRUCT;
 
 
 // ---------------------------------------------------------------------------
@@ -136,7 +138,9 @@ struct aiColor4D
 
 	//! Red, green, blue and alpha color values
 	float r, g, b, a;
-};
+} PACK_STRUCT;
+
+#include "./Compiler/poppack1.h"
 
 
 // ---------------------------------------------------------------------------

+ 5 - 1
include/aiVector3D.h

@@ -48,6 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 extern "C" {
 #endif
 
+#include "./Compiler/pushpack1.h"
+
 // ---------------------------------------------------------------------------
 /** Represents a three-dimensional vector. */
 struct aiVector3D
@@ -85,7 +87,9 @@ struct aiVector3D
 #endif // __cplusplus
 
 	float x, y, z;	
-};
+} PACK_STRUCT;
+
+#include "./Compiler/poppack1.h"
 
 #ifdef __cplusplus
 } // end extern "C"

+ 1 - 1
include/assimp.h

@@ -181,4 +181,4 @@ ASSIMP_API void aiSetImportPropertyString(const char* szName,
 }
 #endif
 
-#endif // AI_ASSIMP_H_INC
+#endif // AI_ASSIMP_H_INC