Fixed build warnings on MSVC14 x64 in the Collada exporter.
authorJared Mulconry <j.mulconry@atomizergames.com>
Fri, 18 Nov 2016 16:24:55 +0000 (03:24 +1100)
committerJared Mulconry <j.mulconry@atomizergames.com>
Fri, 18 Nov 2016 16:24:55 +0000 (03:24 +1100)
code/ColladaExporter.cpp

index fdb3190..72ca6ae 100644 (file)
@@ -524,7 +524,7 @@ void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial*
   } else
   {
     if( pKey )
-      poSurface.exist = pSrcMat->Get( pKey, pType, pIndex, poSurface.color) == aiReturn_SUCCESS;
+      poSurface.exist = pSrcMat->Get( pKey, static_cast<unsigned int>(pType), static_cast<unsigned int>(pIndex), poSurface.color) == aiReturn_SUCCESS;
   }
 }
 
@@ -827,7 +827,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
     // texture coords
     for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a)
     {
-        if( mesh->HasTextureCoords( a) )
+        if( mesh->HasTextureCoords(static_cast<unsigned int>(a)) )
         {
             WriteFloatArray( idstr + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2,
                 (ai_real*) mesh->mTextureCoords[a], mesh->mNumVertices);
@@ -837,7 +837,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
     // vertex colors
     for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a)
     {
-        if( mesh->HasVertexColors( a) )
+        if( mesh->HasVertexColors(static_cast<unsigned int>(a)) )
             WriteFloatArray( idstr + "-color" + to_string(a), FloatType_Color, (ai_real*) mesh->mColors[a], mesh->mNumVertices);
     }
 
@@ -849,12 +849,12 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
         mOutput << startstr << "<input semantic=\"NORMAL\" source=\"#" << idstrEscaped << "-normals\" />" << endstr;
     for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a )
     {
-        if( mesh->HasTextureCoords( a) )
+        if( mesh->HasTextureCoords(static_cast<unsigned int>(a)) )
             mOutput << startstr << "<input semantic=\"TEXCOORD\" source=\"#" << idstrEscaped << "-tex" << a << "\" " /*<< "set=\"" << a << "\"" */ << " />" << endstr;
     }
     for( size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a )
     {
-        if( mesh->HasVertexColors( a) )
+        if( mesh->HasVertexColors(static_cast<unsigned int>(a) ) )
             mOutput << startstr << "<input semantic=\"COLOR\" source=\"#" << idstrEscaped << "-color" << a << "\" " /*<< set=\"" << a << "\"" */ << " />" << endstr;
     }
 
@@ -899,7 +899,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
         mOutput << startstr << "<input offset=\"0\" semantic=\"VERTEX\" source=\"#" << idstrEscaped << "-vertices\" />" << endstr;
         for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a )
         {
-            if( mesh->HasTextureCoords( a) )
+            if( mesh->HasTextureCoords(static_cast<unsigned int>(a) ) )
                 mOutput << startstr << "<input offset=\"0\" semantic=\"TEXCOORD\" source=\"#" << idstrEscaped << "-tex" << a << "\" set=\"" << a << "\" />" << endstr;
         }
 
@@ -1129,7 +1129,7 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode)
     PushTag();
     for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a )
     {
-        if( mesh->HasTextureCoords( a) )
+        if( mesh->HasTextureCoords( static_cast<unsigned int>(a) ) )
             // semantic       as in <texture texcoord=...>
             // input_semantic as in <input semantic=...>
             // input_set      as in <input set=...>