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

Fixed build warnings on MSVC14 x64 in the FBX format sources.

Jared Mulconry 9 роки тому
батько
коміт
2ac9b0ce45
4 змінених файлів з 7 додано та 7 видалено
  1. 4 4
      code/FBXConverter.cpp
  2. 1 1
      code/FBXDocument.h
  3. 1 1
      code/FBXImporter.cpp
  4. 1 1
      code/FBXParser.cpp

+ 4 - 4
code/FBXConverter.cpp

@@ -1076,7 +1076,7 @@ void Converter::SetupNodeMetadata( const Model& model, aiNode& nd )
     // create metadata on node
     std::size_t numStaticMetaData = 2;
     aiMetadata* data = new aiMetadata();
-    data->mNumProperties = unparsedProperties.size() + numStaticMetaData;
+    data->mNumProperties = static_cast<unsigned int>(unparsedProperties.size() + numStaticMetaData);
     data->mKeys = new aiString[ data->mNumProperties ]();
     data->mValues = new aiMetadataEntry[ data->mNumProperties ]();
     nd.mMetaData = data;
@@ -2964,10 +2964,10 @@ Converter::KeyFrameListList Converter::GetKeyframeList( const std::vector<const
             //get values within the start/stop time window
             std::shared_ptr<KeyTimeList> Keys( new KeyTimeList() );
             std::shared_ptr<KeyValueList> Values( new KeyValueList() );
-            const int count = curve->GetKeys().size();
+            const size_t count = curve->GetKeys().size();
             Keys->reserve( count );
             Values->reserve( count );
-            for ( int n = 0; n < count; n++ )
+            for (size_t n = 0; n < count; n++ )
             {
                 int64_t k = curve->GetKeys().at( n );
                 if ( k >= adj_start && k <= adj_stop )
@@ -3068,7 +3068,7 @@ void Converter::InterpolateKeys( aiVectorKey* valOut, const KeyTimeList& keys, c
             const KeyTimeList::value_type timeA = std::get<0>(kfl)->at( id0 );
             const KeyTimeList::value_type timeB = std::get<0>(kfl)->at( id1 );
 
-            const ai_real factor = timeB == timeA ? 0. : static_cast<ai_real>( ( time - timeA ) ) / ( timeB - timeA );
+            const ai_real factor = timeB == timeA ? ai_real(0.) : static_cast<ai_real>( ( time - timeA ) ) / ( timeB - timeA );
             const ai_real interpValue = static_cast<ai_real>( valueA + ( valueB - valueA ) * factor );
 
             result[ std::get<2>(kfl) ] = interpValue;

+ 1 - 1
code/FBXDocument.h

@@ -600,7 +600,7 @@ public:
 
     }
 	const int textureCount() const {
-		return textures.size();
+		return static_cast<int>(textures.size());
 	}
     const BlendMode GetBlendMode() const
     {

+ 1 - 1
code/FBXImporter.cpp

@@ -165,7 +165,7 @@ void FBXImporter::InternReadFile( const std::string& pFile,
         bool is_binary = false;
         if (!strncmp(begin,"Kaydara FBX Binary",18)) {
             is_binary = true;
-            TokenizeBinary(tokens,begin,contents.size());
+            TokenizeBinary(tokens,begin,static_cast<unsigned int>(contents.size()));
         }
         else {
             Tokenize(tokens,begin);

+ 1 - 1
code/FBXParser.cpp

@@ -583,7 +583,7 @@ void ReadBinaryDataArray(char type, uint32_t count, const char*& data, const cha
         zstream.next_in   = reinterpret_cast<Bytef*>( const_cast<char*>(data) );
         zstream.avail_in  = comp_len;
 
-        zstream.avail_out = buff.size();
+        zstream.avail_out = static_cast<uInt>(buff.size());
         zstream.next_out = reinterpret_cast<Bytef*>(&*buff.begin());
         const int ret = inflate(&zstream, Z_FINISH);