Pārlūkot izejas kodu

Fixed warnings when compiling for x64 on MSVC through VS 2017 v15.3.3.

Jared Mulconry 8 gadi atpakaļ
vecāks
revīzija
698cd5826d
3 mainītis faili ar 10 papildinājumiem un 10 dzēšanām
  1. 1 1
      code/glTF2Asset.inl
  2. 5 5
      code/glTF2Exporter.cpp
  3. 4 4
      code/glTFExporter.cpp

+ 1 - 1
code/glTF2Asset.inl

@@ -242,7 +242,7 @@ Ref<T> LazyDict<T>::Create(const char* id)
     }
     }
     T* inst = new T();
     T* inst = new T();
     inst->id = id;
     inst->id = id;
-    inst->index = mObjs.size();
+    inst->index = static_cast<int>(mObjs.size());
     return Add(inst);
     return Add(inst);
 }
 }
 
 

+ 5 - 5
code/glTF2Exporter.cpp

@@ -886,7 +886,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             timeData[i] = nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond;
             timeData[i] = nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond;
         }
         }
 
 
-        Ref<Accessor> timeAccessor = ExportData(mAsset, animId, buffer, numKeyframes, &timeData[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT);
+        Ref<Accessor> timeAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), &timeData[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT);
         if (timeAccessor) animRef->Parameters.TIME = timeAccessor;
         if (timeAccessor) animRef->Parameters.TIME = timeAccessor;
     }
     }
 
 
@@ -899,7 +899,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             translationData[i] = nodeChannel->mPositionKeys[frameIndex].mValue;
             translationData[i] = nodeChannel->mPositionKeys[frameIndex].mValue;
         }
         }
 
 
-        Ref<Accessor> tranAccessor = ExportData(mAsset, animId, buffer, numKeyframes, translationData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
+        Ref<Accessor> tranAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), translationData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
         if ( tranAccessor ) {
         if ( tranAccessor ) {
             animRef->Parameters.translation = tranAccessor;
             animRef->Parameters.translation = tranAccessor;
         }
         }
@@ -915,7 +915,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             scaleData[i] = nodeChannel->mScalingKeys[frameIndex].mValue;
             scaleData[i] = nodeChannel->mScalingKeys[frameIndex].mValue;
         }
         }
 
 
-        Ref<Accessor> scaleAccessor = ExportData(mAsset, animId, buffer, numKeyframes, scaleData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
+        Ref<Accessor> scaleAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), scaleData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
         if ( scaleAccessor ) {
         if ( scaleAccessor ) {
             animRef->Parameters.scale = scaleAccessor;
             animRef->Parameters.scale = scaleAccessor;
         }
         }
@@ -934,7 +934,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             rotationData[i][3] = nodeChannel->mRotationKeys[frameIndex].mValue.w;
             rotationData[i][3] = nodeChannel->mRotationKeys[frameIndex].mValue.w;
         }
         }
 
 
-        Ref<Accessor> rotAccessor = ExportData(mAsset, animId, buffer, numKeyframes, rotationData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT);
+        Ref<Accessor> rotAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), rotationData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT);
         if ( rotAccessor ) {
         if ( rotAccessor ) {
             animRef->Parameters.rotation = rotAccessor;
             animRef->Parameters.rotation = rotAccessor;
         }
         }
@@ -989,7 +989,7 @@ void glTF2Exporter::ExportAnimations()
                 Animation::AnimChannel tmpAnimChannel;
                 Animation::AnimChannel tmpAnimChannel;
                 Animation::AnimSampler tmpAnimSampler;
                 Animation::AnimSampler tmpAnimSampler;
 
 
-                tmpAnimChannel.sampler = animRef->Samplers.size();
+                tmpAnimChannel.sampler = static_cast<int>(animRef->Samplers.size());
                 tmpAnimChannel.target.path = channelType;
                 tmpAnimChannel.target.path = channelType;
                 tmpAnimSampler.output = channelType;
                 tmpAnimSampler.output = channelType;
                 tmpAnimSampler.id = name + "_" + channelType;
                 tmpAnimSampler.id = name + "_" + channelType;

+ 4 - 4
code/glTFExporter.cpp

@@ -875,7 +875,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             timeData[i] = nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond;
             timeData[i] = nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond;
         }
         }
 
 
-        Ref<Accessor> timeAccessor = ExportData(mAsset, animId, buffer, numKeyframes, &timeData[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT);
+        Ref<Accessor> timeAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), &timeData[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT);
         if (timeAccessor) animRef->Parameters.TIME = timeAccessor;
         if (timeAccessor) animRef->Parameters.TIME = timeAccessor;
     }
     }
 
 
@@ -888,7 +888,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             translationData[i] = nodeChannel->mPositionKeys[frameIndex].mValue;
             translationData[i] = nodeChannel->mPositionKeys[frameIndex].mValue;
         }
         }
 
 
-        Ref<Accessor> tranAccessor = ExportData(mAsset, animId, buffer, numKeyframes, translationData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
+        Ref<Accessor> tranAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), translationData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
         if ( tranAccessor ) {
         if ( tranAccessor ) {
             animRef->Parameters.translation = tranAccessor;
             animRef->Parameters.translation = tranAccessor;
         }
         }
@@ -904,7 +904,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             scaleData[i] = nodeChannel->mScalingKeys[frameIndex].mValue;
             scaleData[i] = nodeChannel->mScalingKeys[frameIndex].mValue;
         }
         }
 
 
-        Ref<Accessor> scaleAccessor = ExportData(mAsset, animId, buffer, numKeyframes, scaleData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
+        Ref<Accessor> scaleAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), scaleData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
         if ( scaleAccessor ) {
         if ( scaleAccessor ) {
             animRef->Parameters.scale = scaleAccessor;
             animRef->Parameters.scale = scaleAccessor;
         }
         }
@@ -923,7 +923,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
             rotationData[i][3] = nodeChannel->mRotationKeys[frameIndex].mValue.w;
             rotationData[i][3] = nodeChannel->mRotationKeys[frameIndex].mValue.w;
         }
         }
 
 
-        Ref<Accessor> rotAccessor = ExportData(mAsset, animId, buffer, numKeyframes, rotationData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT);
+        Ref<Accessor> rotAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), rotationData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT);
         if ( rotAccessor ) {
         if ( rotAccessor ) {
             animRef->Parameters.rotation = rotAccessor;
             animRef->Parameters.rotation = rotAccessor;
         }
         }