CSkin: Make use of ranged for where applicable

Same behavior, less code.
This commit is contained in:
Lioncash 2020-06-17 04:27:51 -04:00
parent 32dafc6bb8
commit 4a020d1d4a

View File

@ -28,19 +28,19 @@ public:
const SVertexWeights& WeightsForVertex(uint32 VertIdx) const SVertexWeights& WeightsForVertex(uint32 VertIdx)
{ {
// Null weights bind everything to the root bone in case there is no matching vertex group // Null weights bind everything to the root bone in case there is no matching vertex group
static const SVertexWeights skNullWeights = { static constexpr SVertexWeights skNullWeights{
{3, 0, 0, 0}, {3, 0, 0, 0},
{ 1.f, 0.f, 0.f, 0.f } {1.f, 0.f, 0.f, 0.f},
}; };
uint32 Index = 0; uint32 Index = 0;
for (uint32 iGrp = 0; iGrp < mVertGroups.size(); iGrp++) for (const auto& group : mVertGroups)
{ {
if (VertIdx < Index + mVertGroups[iGrp].NumVertices) if (VertIdx < Index + group.NumVertices)
return mVertGroups[iGrp].Weights; return group.Weights;
Index += mVertGroups[iGrp].NumVertices; Index += group.NumVertices;
} }
return skNullWeights; return skNullWeights;