Переглянути джерело

Merge branch 'master' of https://github.com/assimp/assimp

Conflicts:
	tools/assimp_cmd/ImageExtractor.cpp
Kim Kulling 10 роки тому
батько
коміт
36f0ccced1

+ 4 - 2
CMakeLists.txt

@@ -133,6 +133,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in"         "${C
 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake"             "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
 
+FIND_PACKAGE( DirectX )
+
 option ( ASSIMP_NO_EXPORT
   "Disable Assimp's export functionality."
   OFF
@@ -242,9 +244,9 @@ option ( ASSIMP_BUILD_ASSIMP_TOOLS
   ON
 )
 IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
-  IF ( WIN32 )
+  IF ( WIN32 AND DirectX_FOUND )
     ADD_SUBDIRECTORY( tools/assimp_view/ )
-  ENDIF ( WIN32 )
+  ENDIF ( WIN32 AND DirectX_FOUND )
   ADD_SUBDIRECTORY( tools/assimp_cmd/ )
 ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )
 

+ 1 - 1
code/ACLoader.cpp

@@ -620,7 +620,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
                                     face.mIndices[i] = cur++;
 
                                     // copy vertex positions
-                                    if ((vertices - mesh->mVertices) >= mesh->mNumVertices) {
+                                    if (static_cast<unsigned>(vertices - mesh->mVertices) >= mesh->mNumVertices) {
                                         throw DeadlyImportError("AC3D: Invalid number of vertices");
                                     }
                                     *vertices = object.vertices[entry.first] + object.translation;

+ 9 - 1
code/ColladaLoader.cpp

@@ -333,8 +333,16 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
         out->mAttenuationLinear = srcLight->mAttLinear;
         out->mAttenuationQuadratic = srcLight->mAttQuadratic;
 
-        // collada doesn't differenciate between these color types
         out->mColorDiffuse = out->mColorSpecular = out->mColorAmbient = srcLight->mColor*srcLight->mIntensity;
+        if (out->mType == aiLightSource_AMBIENT) {
+            out->mColorDiffuse = out->mColorSpecular = aiColor3D(0, 0, 0);
+            out->mColorAmbient = srcLight->mColor*srcLight->mIntensity;
+        }
+        else {
+            // collada doesn't differentiate between these color types
+            out->mColorDiffuse = out->mColorSpecular = srcLight->mColor*srcLight->mIntensity;
+            out->mColorAmbient = aiColor3D(0, 0, 0);
+        }
 
         // convert falloff angle and falloff exponent in our representation, if given
         if (out->mType == aiLightSource_SPOT) {

+ 9 - 10
code/FBXUtil.cpp

@@ -84,29 +84,29 @@ const char* TokenTypeString(TokenType t)
 // ------------------------------------------------------------------------------------------------
 std::string AddOffset(const std::string& prefix, const std::string& text, unsigned int offset)
 {
-    return static_cast<std::string>( (Formatter::format(),prefix," (offset 0x",std::hex,offset,") ",text) );
+    return static_cast<std::string>( (Formatter::format() << prefix << " (offset 0x" << std::hex << offset << ") " << text) );
 }
 
 // ------------------------------------------------------------------------------------------------
 std::string AddLineAndColumn(const std::string& prefix, const std::string& text, unsigned int line, unsigned int column)
 {
-    return static_cast<std::string>( (Formatter::format(),prefix," (line ",line,", col ",column,") ",text) );
+    return static_cast<std::string>( (Formatter::format() << prefix << " (line " << line << " <<  col " << column << ") " << text) );
 }
 
 // ------------------------------------------------------------------------------------------------
 std::string AddTokenText(const std::string& prefix, const std::string& text, const Token* tok)
 {
     if(tok->IsBinary()) {
-        return static_cast<std::string>( (Formatter::format(),prefix,
-            " (",TokenTypeString(tok->Type()),
-            ", offset 0x", std::hex, tok->Offset(),") ",
+        return static_cast<std::string>( (Formatter::format() << prefix <<
+            " (" << TokenTypeString(tok->Type()) <<
+            ", offset 0x" << std::hex << tok->Offset() << ") " <<
             text) );
     }
 
-    return static_cast<std::string>( (Formatter::format(),prefix,
-        " (",TokenTypeString(tok->Type()),
-        ", line ",tok->Line(),
-        ", col ",tok->Column(),") ",
+    return static_cast<std::string>( (Formatter::format() << prefix <<
+        " (" << TokenTypeString(tok->Type()) <<
+        ", line " << tok->Line() <<
+        ", col " << tok->Column() << ") " <<
         text) );
 }
 
@@ -115,4 +115,3 @@ std::string AddTokenText(const std::string& prefix, const std::string& text, con
 } // !Assimp
 
 #endif
-

+ 8 - 8
contrib/openddlparser/code/OpenDDLParser.cpp

@@ -39,14 +39,14 @@ BEGIN_ODDLPARSER_NS
 static const char *Version = "0.1.0";
 
 namespace Grammar {
-    static const char *OpenBracketToken   = "{";
-    static const char *CloseBracketToken  = "}";
-    static const char *OpenPropertyToken  = "(";
-    static const char *ClosePropertyToken = ")";
-    static const char *BoolTrue           = "true";
-    static const char *BoolFalse          = "false";
-    static const char *RefToken           = "ref";
-    static const char *CommaSeparator     = ",";
+    static const char * const OpenBracketToken   = "{";
+    static const char * const CloseBracketToken  = "}";
+    static const char * const OpenPropertyToken  = "(";
+    static const char * const ClosePropertyToken = ")";
+    static const char * const BoolTrue           = "true";
+    static const char * const BoolFalse          = "false";
+    static const char * const RefToken           = "ref";
+    static const char * const CommaSeparator     = ",";
 
     static const char* PrimitiveTypeToken[ Value::ddl_types_max ] = {
         "bool",

+ 0 - 14
contrib/poly2tri/poly2tri/sweep/sweep.cc

@@ -652,13 +652,6 @@ void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t,
   Triangle& ot = t->NeighborAcross(p);
   Point& op = *ot.OppositePoint(*t, p);
 
-  if (&ot == NULL) {
-    // If we want to integrate the fillEdgeEvent do it here
-    // With current implementation we should never get here
-    //throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
-    assert(0);
-  }
-
   if (InScanArea(p, *t->PointCCW(p), *t->PointCW(p), op)) {
     // Lets rotate shared edge one vertex CW
     RotateTrianglePair(*t, p, ot, op);
@@ -728,13 +721,6 @@ void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle&
   Triangle& ot = t.NeighborAcross(p);
   Point& op = *ot.OppositePoint(t, p);
 
-  if (&t.NeighborAcross(p) == NULL) {
-    // If we want to integrate the fillEdgeEvent do it here
-    // With current implementation we should never get here
-    //throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
-    assert(0);
-  }
-
   if (InScanArea(eq, *flip_triangle.PointCCW(eq), *flip_triangle.PointCW(eq), op)) {
     // flip with new edge op->eq
     FlipEdgeEvent(tcx, eq, op, &ot, op);

+ 1 - 1
contrib/poly2tri/poly2tri/sweep/sweep_context.cc

@@ -164,7 +164,7 @@ void SweepContext::RemoveFromMap(Triangle* triangle)
 
 void SweepContext::MeshClean(Triangle& triangle)
 {
-  if (&triangle != NULL && !triangle.IsInterior()) {
+  if (!triangle.IsInterior()) {
     triangle.IsInterior(true);
     triangles_.push_back(&triangle);
     for (int i = 0; i < 3; i++) {

+ 5 - 1
samples/SimpleOpenGL/CMakeLists.txt

@@ -1,6 +1,10 @@
 FIND_PACKAGE(OpenGL)
 FIND_PACKAGE(GLUT)
-find_library(M_LIB m)
+IF ( MSVC )
+  SET(M_LIB)
+ELSE ( MSVC )
+  find_library(M_LIB m)
+ENDIF ( MSVC )
 
 IF ( NOT GLUT_FOUND )
   IF ( MSVC )

+ 4 - 0
samples/SimpleOpenGL/Sample_SimpleOpenGL.c

@@ -14,7 +14,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#ifdef __APPLE__
+#include <glut.h>
+#else
 #include <GL/glut.h>
+#endif
 
 /* assimp include files. These three are usually needed. */
 #include <assimp/cimport.h>

+ 8 - 0
test/models/Collada/cube.dae

@@ -69,6 +69,13 @@ limitations under the License.
                 <intensity>1.000000</intensity>
             </technique>
         </light>
+        <light id="ambientLight-lib" name="ambientLight">
+            <technique_common>
+                <ambient>
+                    <color>0.1 0.1 0.2</color>
+                </ambient>
+            </technique_common>
+        </light>
         <light id="pointLightShape1-lib" name="pointLightShape1">
             <technique_common>
                 <point>
@@ -175,6 +182,7 @@ limitations under the License.
                 <rotate sid="rotateY">0 1 0 0</rotate>
                 <rotate sid="rotateX">1 0 0 0</rotate>
                 <instance_light url="#light-lib"/>
+                <instance_light url="#ambientLight-lib"/>
             </node>
             <node id="Box" name="Box">
                 <rotate sid="rotateZ">0 0 1 0</rotate>

BIN
test/regression/db.zip


+ 1 - 1
tools/assimp_cmd/Info.cpp

@@ -191,7 +191,7 @@ void PrintHierarchy(const aiNode* root, unsigned int maxnest, unsigned int maxli
 	for(unsigned int i = 0; i < cnest; ++i) {
 		printf("-- ");
 	}
-	printf("\'%s\', meshes: %i\n",root->mName.data,root->mNumMeshes);
+	printf("\'%s\', meshes: %u\n",root->mName.data,root->mNumMeshes);
 	for (unsigned int i = 0; i < root->mNumChildren; ++i ) {
 		PrintHierarchy(root->mChildren[i],maxnest,maxline,cline,cnest+1);
 		if(i == root->mNumChildren-1) {

+ 46 - 36
tools/assimp_cmd/WriteDumb.cpp

@@ -677,16 +677,26 @@ void WriteBinaryDump(const aiScene* scene, FILE* _out, const char* src, const ch
 	Write<uint16_t>(compressed);
 	// ==  20 bytes
 
-	char buff[256]; 
-	strncpy(buff,src,256);
-	fwrite(buff,256,1,out);
+	{
+		char buff[256] = { 0 };
+		strncpy(buff,src,256);
+		buff[255] = 0;
+		fwrite(buff,256,1,out);
+	}
 
-	strncpy(buff,cmd,128);
-	fwrite(buff,128,1,out);
+	{
+		char buff[128] = { 0 };
+		strncpy(buff,cmd,128);
+		buff[127] = 0;
+		fwrite(buff,128,1,out);
+	}
 
 	// leave 64 bytes free for future extensions
-	memset(buff,0xcd,64);
-	fwrite(buff,64,1,out);
+	{
+		char buff[64];
+		memset(buff,0xcd,64);
+		fwrite(buff,64,1,out);
+	}
 	// == 435 bytes
 
 	// ==== total header size: 512 bytes
@@ -748,17 +758,17 @@ void WriteNode(const aiNode* node, FILE* out, unsigned int depth)
 		prefix,m.d1,m.d2,m.d3,m.d4,prefix);
 
 	if (node->mNumMeshes) {
-		fprintf(out, "%s\t<MeshRefs num=\"%i\">\n%s\t",
+		fprintf(out, "%s\t<MeshRefs num=\"%u\">\n%s\t",
 			prefix,node->mNumMeshes,prefix);
 
 		for (unsigned int i = 0; i < node->mNumMeshes;++i) {
-			fprintf(out,"%i ",node->mMeshes[i]);
+			fprintf(out,"%u ",node->mMeshes[i]);
 		}
 		fprintf(out,"\n%s\t</MeshRefs>\n",prefix);
 	}
 
 	if (node->mNumChildren) {
-		fprintf(out,"%s\t<NodeList num=\"%i\">\n",
+		fprintf(out,"%s\t<NodeList num=\"%u\">\n",
 			prefix,node->mNumChildren);
 
 		for (unsigned int i = 0; i < node->mNumChildren;++i) {
@@ -853,13 +863,13 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 		"<ASSIMP format_id=\"1\">\n\n"
 
 		"<!-- XML Model dump produced by assimp dump\n"
-		"  Library version: %i.%i.%i\n"
+		"  Library version: %u.%u.%u\n"
 		"  Source: %s\n"
 		"  Command line: %s\n"
 		"  %s\n"
 		"-->"
 		" \n\n"
-		"<Scene flags=\"%i\" postprocessing=\"%i\">\n",
+		"<Scene flags=\"%u\" postprocessing=\"%i\">\n",
 		
 		aiGetVersionMajor(),aiGetVersionMinor(),aiGetVersionRevision(),src,c.c_str(),asctime(p),
 		scene->mFlags,
@@ -936,7 +946,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 	// write textures
 	if (scene->mNumTextures) {
-		fprintf(out,"<TextureList num=\"%i\">\n",scene->mNumTextures);
+		fprintf(out,"<TextureList num=\"%u\">\n",scene->mNumTextures);
 		for (unsigned int i = 0; i < scene->mNumTextures;++i) {
 			aiTexture* tex  = scene->mTextures[i];
 			bool compressed = (tex->mHeight == 0);
@@ -947,7 +957,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 				(compressed ? "true" : "false"));
 
 			if (compressed) {
-				fprintf(out,"\t\t<Data length=\"%i\"> \n",tex->mWidth);
+				fprintf(out,"\t\t<Data length=\"%u\"> \n",tex->mWidth);
 
 				if (!shortened) {
 					for (unsigned int n = 0; n < tex->mWidth;++n) {
@@ -981,12 +991,12 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 	// write materials
 	if (scene->mNumMaterials) {
-		fprintf(out,"<MaterialList num=\"%i\">\n",scene->mNumMaterials);
+		fprintf(out,"<MaterialList num=\"%u\">\n",scene->mNumMaterials);
 		for (unsigned int i = 0; i< scene->mNumMaterials; ++i) {
 			const aiMaterial* mat = scene->mMaterials[i];
 
 			fprintf(out,"\t<Material>\n");
-			fprintf(out,"\t\t<MatPropertyList  num=\"%i\">\n",mat->mNumProperties);
+			fprintf(out,"\t\t<MatPropertyList  num=\"%u\">\n",mat->mNumProperties);
 			for (unsigned int n = 0; n < mat->mNumProperties;++n) {
 
 				const aiMaterialProperty* prop = mat->mProperties[n];
@@ -1004,7 +1014,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 					sz = "binary_buffer";
 				}
 
-				fprintf(out,"\t\t\t<MatProperty key=\"%s\" \n\t\t\ttype=\"%s\" tex_usage=\"%s\" tex_index=\"%i\"",
+				fprintf(out,"\t\t\t<MatProperty key=\"%s\" \n\t\t\ttype=\"%s\" tex_usage=\"%s\" tex_index=\"%u\"",
 					prop->mKey.data, sz,
 					::TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex);
 
@@ -1048,7 +1058,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 	// write animations
 	if (scene->mNumAnimations) {
-		fprintf(out,"<AnimationList num=\"%i\">\n",scene->mNumAnimations);
+		fprintf(out,"<AnimationList num=\"%u\">\n",scene->mNumAnimations);
 		for (unsigned int i = 0; i < scene->mNumAnimations;++i) {
 			aiAnimation* anim = scene->mAnimations[i];
 
@@ -1059,7 +1069,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 			// write bone animation channels
 			if (anim->mNumChannels) {
-				fprintf(out,"\t\t<NodeAnimList num=\"%i\">\n",anim->mNumChannels);
+				fprintf(out,"\t\t<NodeAnimList num=\"%u\">\n",anim->mNumChannels);
 				for (unsigned int n = 0; n < anim->mNumChannels;++n) {
 					aiNodeAnim* nd = anim->mChannels[n];
 
@@ -1070,7 +1080,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 					if (!shortened) {
 						// write position keys
 						if (nd->mNumPositionKeys) {
-							fprintf(out,"\t\t\t\t<PositionKeyList num=\"%i\">\n",nd->mNumPositionKeys);
+							fprintf(out,"\t\t\t\t<PositionKeyList num=\"%u\">\n",nd->mNumPositionKeys);
 							for (unsigned int a = 0; a < nd->mNumPositionKeys;++a) {
 								aiVectorKey* vc = nd->mPositionKeys+a;
 								fprintf(out,"\t\t\t\t\t<PositionKey time=\"%e\">\n"
@@ -1082,7 +1092,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 						// write scaling keys
 						if (nd->mNumScalingKeys) {
-							fprintf(out,"\t\t\t\t<ScalingKeyList num=\"%i\">\n",nd->mNumScalingKeys);
+							fprintf(out,"\t\t\t\t<ScalingKeyList num=\"%u\">\n",nd->mNumScalingKeys);
 							for (unsigned int a = 0; a < nd->mNumScalingKeys;++a) {
 								aiVectorKey* vc = nd->mScalingKeys+a;
 								fprintf(out,"\t\t\t\t\t<ScalingKey time=\"%e\">\n"
@@ -1094,7 +1104,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 						// write rotation keys
 						if (nd->mNumRotationKeys) {
-							fprintf(out,"\t\t\t\t<RotationKeyList num=\"%i\">\n",nd->mNumRotationKeys);
+							fprintf(out,"\t\t\t\t<RotationKeyList num=\"%u\">\n",nd->mNumRotationKeys);
 							for (unsigned int a = 0; a < nd->mNumRotationKeys;++a) {
 								aiQuatKey* vc = nd->mRotationKeys+a;
 								fprintf(out,"\t\t\t\t\t<RotationKey time=\"%e\">\n"
@@ -1115,13 +1125,13 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 	// write meshes
 	if (scene->mNumMeshes) {
-		fprintf(out,"<MeshList num=\"%i\">\n",scene->mNumMeshes);
+		fprintf(out,"<MeshList num=\"%u\">\n",scene->mNumMeshes);
 		for (unsigned int i = 0; i < scene->mNumMeshes;++i) {
 			aiMesh* mesh = scene->mMeshes[i];
 			// const unsigned int width = (unsigned int)log10((double)mesh->mNumVertices)+1;
 
 			// mesh header
-			fprintf(out,"\t<Mesh types=\"%s %s %s %s\" material_index=\"%i\">\n",
+			fprintf(out,"\t<Mesh types=\"%s %s %s %s\" material_index=\"%u\">\n",
 				(mesh->mPrimitiveTypes & aiPrimitiveType_POINT    ? "points"    : ""),
 				(mesh->mPrimitiveTypes & aiPrimitiveType_LINE     ? "lines"     : ""),
 				(mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE ? "triangles" : ""),
@@ -1130,7 +1140,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 			// bones
 			if (mesh->mNumBones) {
-				fprintf(out,"\t\t<BoneList num=\"%i\">\n",mesh->mNumBones);
+				fprintf(out,"\t\t<BoneList num=\"%u\">\n",mesh->mNumBones);
 
 				for (unsigned int n = 0; n < mesh->mNumBones;++n) {
 					aiBone* bone = mesh->mBones[n];
@@ -1151,13 +1161,13 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 						bone->mOffsetMatrix.d1,bone->mOffsetMatrix.d2,bone->mOffsetMatrix.d3,bone->mOffsetMatrix.d4);
 
 					if (!shortened && bone->mNumWeights) {
-						fprintf(out,"\t\t\t\t<WeightList num=\"%i\">\n",bone->mNumWeights);
+						fprintf(out,"\t\t\t\t<WeightList num=\"%u\">\n",bone->mNumWeights);
 
 						// bone weights
 						for (unsigned int a = 0; a < bone->mNumWeights;++a) {
 							aiVertexWeight* wght = bone->mWeights+a;
 
-							fprintf(out,"\t\t\t\t\t<Weight index=\"%i\">\n\t\t\t\t\t\t%f\n\t\t\t\t\t</Weight>\n",
+							fprintf(out,"\t\t\t\t\t<Weight index=\"%u\">\n\t\t\t\t\t\t%f\n\t\t\t\t\t</Weight>\n",
 								wght->mVertexId,wght->mWeight);
 						}
 						fprintf(out,"\t\t\t\t</WeightList>\n");
@@ -1169,14 +1179,14 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 			// faces
 			if (!shortened && mesh->mNumFaces) {
-				fprintf(out,"\t\t<FaceList num=\"%i\">\n",mesh->mNumFaces);
+				fprintf(out,"\t\t<FaceList num=\"%u\">\n",mesh->mNumFaces);
 				for (unsigned int n = 0; n < mesh->mNumFaces; ++n) {
 					aiFace& f = mesh->mFaces[n];
-					fprintf(out,"\t\t\t<Face num=\"%i\">\n"
+					fprintf(out,"\t\t\t<Face num=\"%u\">\n"
 						"\t\t\t\t",f.mNumIndices);
 
 					for (unsigned int j = 0; j < f.mNumIndices;++j)
-						fprintf(out,"%i ",f.mIndices[j]);
+						fprintf(out,"%u ",f.mIndices[j]);
 
 					fprintf(out,"\n\t\t\t</Face>\n");
 				}
@@ -1185,7 +1195,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 			// vertex positions
 			if (mesh->HasPositions()) {
-				fprintf(out,"\t\t<Positions num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
+				fprintf(out,"\t\t<Positions num=\"%u\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
 				if (!shortened) {
 					for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
 						fprintf(out,"\t\t%0 8f %0 8f %0 8f\n",
@@ -1199,7 +1209,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 			// vertex normals
 			if (mesh->HasNormals()) {
-				fprintf(out,"\t\t<Normals num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
+				fprintf(out,"\t\t<Normals num=\"%u\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
 				if (!shortened) {
 					for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
 						fprintf(out,"\t\t%0 8f %0 8f %0 8f\n",
@@ -1215,7 +1225,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 
 			// vertex tangents and bitangents
 			if (mesh->HasTangentsAndBitangents()) {
-				fprintf(out,"\t\t<Tangents num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
+				fprintf(out,"\t\t<Tangents num=\"%u\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
 				if (!shortened) {
 					for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
 						fprintf(out,"\t\t%0 8f %0 8f %0 8f\n",
@@ -1226,7 +1236,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 				}
 				fprintf(out,"\t\t</Tangents>\n");
 
-				fprintf(out,"\t\t<Bitangents num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
+				fprintf(out,"\t\t<Bitangents num=\"%u\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
 				if (!shortened) {
 					for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
 						fprintf(out,"\t\t%0 8f %0 8f %0 8f\n",
@@ -1243,7 +1253,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 				if (!mesh->mTextureCoords[a])
 					break;
 
-				fprintf(out,"\t\t<TextureCoords num=\"%i\" set=\"%i\" num_components=\"%i\"> \n",mesh->mNumVertices,
+				fprintf(out,"\t\t<TextureCoords num=\"%u\" set=\"%u\" num_components=\"%u\"> \n",mesh->mNumVertices,
 					a,mesh->mNumUVComponents[a]);
 				
 				if (!shortened) {
@@ -1270,7 +1280,7 @@ void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd
 			for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) {
 				if (!mesh->mColors[a])
 					break;
-				fprintf(out,"\t\t<Colors num=\"%i\" set=\"%i\" num_components=\"4\"> \n",mesh->mNumVertices,a);
+				fprintf(out,"\t\t<Colors num=\"%u\" set=\"%u\" num_components=\"4\"> \n",mesh->mNumVertices,a);
 				if (!shortened) {
 					for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
 						fprintf(out,"\t\t%0 8f %0 8f %0 8f %0 8f\n",

+ 11 - 7
tools/assimp_view/Display.cpp

@@ -169,7 +169,7 @@ int CDisplay::AddNodeToDisplayList(
             iIndex += iDepth  * 100;
         }
         else iIndex += iDepth  * 10;
-        sprintf(chTemp,"Node %i",iIndex);
+        sprintf(chTemp,"Node %u",iIndex);
     }
     else {
         sprintf(chTemp,"%s",pcNode->mName.data);
@@ -222,7 +222,7 @@ int CDisplay::AddMeshToDisplayList(unsigned int iIndex, HTREEITEM hRoot)
     char chTemp[MAXLEN];
 
     if(0 == pcMesh->mName.length)   {
-        sprintf(chTemp,"Mesh %i",iIndex);
+        sprintf(chTemp,"Mesh %u",iIndex);
     }
     else {
         sprintf(chTemp,"%s",pcMesh->mName.data);
@@ -1028,7 +1028,7 @@ int CDisplay::OnSetupTextureView(TextureInfo* pcNew)
         sprintf(szTemp,"%i",(*pcNew->piTexture)->GetLevelCount());
         SetWindowText(GetDlgItem(g_hDlg,IDC_ESHADER),szTemp);
 
-        sprintf(szTemp,"%i",pcNew->iUV);
+        sprintf(szTemp,"%u",pcNew->iUV);
         SetWindowText(GetDlgItem(g_hDlg,IDC_EMAT),szTemp);
 
         sprintf(szTemp,"%f",pcNew->fBlend);
@@ -1320,8 +1320,10 @@ int CDisplay::HandleTreeViewPopup2(WPARAM wParam,LPARAM lParam)
         {
             // need to remove the file name
             char* sz = strrchr(szFileName,'\\');
-            if (!sz)sz = strrchr(szFileName,'/');
-            if (!sz)*sz = 0;
+            if (!sz)
+                sz = strrchr(szFileName,'/');
+            if (sz)
+                *sz = 0;
         }
         OPENFILENAME sFilename1 = {
             sizeof(OPENFILENAME),
@@ -1353,8 +1355,10 @@ int CDisplay::HandleTreeViewPopup2(WPARAM wParam,LPARAM lParam)
         {
             // need to remove the file name
             char* sz = strrchr(szFileName,'\\');
-            if (!sz)sz = strrchr(szFileName,'/');
-            if (!sz)*sz = 0;
+            if (!sz)
+                sz = strrchr(szFileName,'/');
+            if (sz)
+                *sz = 0;
         }
         OPENFILENAME sFilename1 = {
             sizeof(OPENFILENAME),

+ 4 - 2
tools/assimp_view/LogWindow.cpp

@@ -168,8 +168,10 @@ void CLogWindow::Save()
     {
         // need to remove the file name
         char* sz = strrchr(szFileName,'\\');
-        if (!sz)sz = strrchr(szFileName,'/');
-        if (!sz)*sz = 0;
+        if (!sz)
+            sz = strrchr(szFileName,'/');
+        if (sz)
+            *sz = 0;
     }
     OPENFILENAME sFilename1 = {
         sizeof(OPENFILENAME),

+ 16 - 8
tools/assimp_view/MessageProc.cpp

@@ -474,8 +474,10 @@ void LoadBGTexture()
     {
         // need to remove the file name
         char* sz = strrchr(szFileName,'\\');
-        if (!sz)sz = strrchr(szFileName,'/');
-        if (!sz)*sz = 0;
+        if (!sz)
+            sz = strrchr(szFileName,'/');
+        if (sz)
+            *sz = 0;
     }
     OPENFILENAME sFilename1 = {
         sizeof(OPENFILENAME),
@@ -597,8 +599,10 @@ void LoadSkybox()
     {
         // need to remove the file name
         char* sz = strrchr(szFileName,'\\');
-        if (!sz)sz = strrchr(szFileName,'/');
-        if (!sz)*sz = 0;
+        if (!sz)
+            sz = strrchr(szFileName,'/');
+        if (sz)
+            *sz = 0;
     }
     OPENFILENAME sFilename1 = {
         sizeof(OPENFILENAME),
@@ -639,8 +643,10 @@ void SaveScreenshot()
     {
         // need to remove the file name
         char* sz = strrchr(szFileName,'\\');
-        if (!sz)sz = strrchr(szFileName,'/');
-        if (!sz)*sz = 0;
+        if (!sz)
+            sz = strrchr(szFileName,'/');
+        if (sz)
+            *sz = 0;
     }
     OPENFILENAME sFilename1 = {
         sizeof(OPENFILENAME),
@@ -938,8 +944,10 @@ void OpenAsset()
     {
         // need to remove the file name
         char* sz = strrchr(szFileName,'\\');
-        if (!sz)sz = strrchr(szFileName,'/');
-        if (!sz)*sz = 0;
+        if (!sz)
+            sz = strrchr(szFileName,'/');
+        if (sz)
+            *sz = 0;
     }
 
     // get a list of all file extensions supported by ASSIMP