From 4e0db5d6414e621c36ee3e4e8172dadb7dad51b6 Mon Sep 17 00:00:00 2001 From: sabrina-shanman Date: Thu, 24 Oct 2019 15:45:06 -0700 Subject: [PATCH] Fix build warnings --- libraries/animation/src/AnimSkeleton.cpp | 2 +- libraries/fbx/src/GLTFSerializer.cpp | 3 ++- libraries/fbx/src/OBJSerializer.cpp | 4 ++-- libraries/render-utils/src/CauterizedModel.cpp | 3 +-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp index 5074ac0776..b60fc42f89 100644 --- a/libraries/animation/src/AnimSkeleton.cpp +++ b/libraries/animation/src/AnimSkeleton.cpp @@ -28,7 +28,7 @@ AnimSkeleton::AnimSkeleton(const HFMModel& hfmModel) { const auto& defor = hfmModel.skinDeformers[i]; std::vector dummyClustersList; - for (int j = 0; j < (uint32_t) defor.clusters.size(); j++) { + for (uint32_t j = 0; j < (uint32_t)defor.clusters.size(); j++) { // cast into a non-const reference, so we can mutate the FBXCluster HFMCluster& cluster = const_cast(defor.clusters.at(j)); diff --git a/libraries/fbx/src/GLTFSerializer.cpp b/libraries/fbx/src/GLTFSerializer.cpp index 16d2962ecc..115e7e0ca7 100755 --- a/libraries/fbx/src/GLTFSerializer.cpp +++ b/libraries/fbx/src/GLTFSerializer.cpp @@ -1389,7 +1389,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash& mesh.clusterWeights.reserve(newWeightsEnd); for (int weightIndex = 0; weightIndex < clusterWeights.size(); ++weightIndex) { // Per the GLTF specification - uint16_t weight = std::round(clusterWeights[weightIndex] * 65535.0); + uint16_t weight = std::round(clusterWeights[weightIndex] * 65535.0f); mesh.clusterWeights.push_back(weight); } mesh.clusterWeightsPerVertex = WEIGHTS_PER_VERTEX; @@ -1542,6 +1542,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash& } // TODO: Fix skinning and remove this workaround which disables skinning + // TODO: Restore after testing { std::vector meshToRootJoint; meshToRootJoint.resize(hfmModel.meshes.size(), -1); diff --git a/libraries/fbx/src/OBJSerializer.cpp b/libraries/fbx/src/OBJSerializer.cpp index 57fcf79aac..445c259650 100644 --- a/libraries/fbx/src/OBJSerializer.cpp +++ b/libraries/fbx/src/OBJSerializer.cpp @@ -1008,8 +1008,8 @@ HFMModel::Pointer OBJSerializer::read(const hifi::ByteArray& data, const hifi::V modelMaterial->setOpacity(hfmMaterial.opacity); } - // GO over the shapes once more to assign hte material index correctly - for (int i = 0; i < (uint32_t) hfmModel.shapes.size(); ++i) { + // GO over the shapes once more to assign the material index correctly + for (uint32_t i = 0; i < (uint32_t)hfmModel.shapes.size(); ++i) { auto foundMaterialIndex = materialNameToIndex.find(materialNamePerShape[i]); if (foundMaterialIndex != materialNameToIndex.end()) { hfmModel.shapes[i].material = foundMaterialIndex.value(); diff --git a/libraries/render-utils/src/CauterizedModel.cpp b/libraries/render-utils/src/CauterizedModel.cpp index ca26b9739c..69710b2ed1 100644 --- a/libraries/render-utils/src/CauterizedModel.cpp +++ b/libraries/render-utils/src/CauterizedModel.cpp @@ -63,9 +63,8 @@ void CauterizedModel::createRenderItemSet() { Transform::mult(transform, transform, offset); // Run through all of the meshes, and place them into their segregated, but unsorted buckets - int shapeID = 0; const auto& shapes = _renderGeometry->getHFMModel().shapes; - for (shapeID; shapeID < (int) shapes.size(); shapeID++) { + for (int shapeID = 0; shapeID < (int) shapes.size(); shapeID++) { const auto& shape = shapes[shapeID]; _modelMeshRenderItems << std::make_shared(shared_from_this(), shape.mesh, shape.meshPart, shapeID, transform);