summaryrefslogtreecommitdiff
path: root/indra/llappearance/llpolymorph.cpp
diff options
context:
space:
mode:
authorFawrsk <45524015+Fawrsk@users.noreply.github.com>2023-01-03 17:08:15 -0400
committerGitHub <noreply@github.com>2023-01-03 23:08:15 +0200
commit74a9280c698b4f88a46549923a2d717b82dd7ee2 (patch)
tree029f57168a5f69cb7eb60b21faddecdeadec0f26 /indra/llappearance/llpolymorph.cpp
parent43496fe04e7dadae230da5b633a389ba0b7c0b0b (diff)
SL-18893 Clean up for loops in llappearance to use C++11 range based for loops (#38)
Diffstat (limited to 'indra/llappearance/llpolymorph.cpp')
-rw-r--r--indra/llappearance/llpolymorph.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index 84dd6156a9..1f83f748a1 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -364,17 +364,16 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
LLAvatarAppearance* avatarp = mMesh->getAvatar();
LLPolyMorphTargetInfo::volume_info_list_t::iterator iter;
- for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++)
+ for (auto& volume_info : getInfo()->mVolumeInfoList)
{
- LLPolyVolumeMorphInfo *volume_info = &(*iter);
for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++)
{
- if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName)
+ if (avatarp->mCollisionVolumes[i].getName() == volume_info.mName)
{
mVolumeMorphs.push_back(
LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i],
- volume_info->mScale,
- volume_info->mPos));
+ volume_info.mScale,
+ volume_info.mPos));
break;
}
}
@@ -641,15 +640,14 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
}
// now apply volume changes
- for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ )
+ for(auto& volume_morph : mVolumeMorphs)
{
- LLPolyVolumeMorph* volume_morph = &(*iter);
- LLVector3 scale_delta = volume_morph->mScale * delta_weight;
- LLVector3 pos_delta = volume_morph->mPos * delta_weight;
+ LLVector3 scale_delta = volume_morph.mScale * delta_weight;
+ LLVector3 pos_delta = volume_morph.mPos * delta_weight;
- volume_morph->mVolume->setScale(volume_morph->mVolume->getScale() + scale_delta);
+ volume_morph.mVolume->setScale(volume_morph.mVolume->getScale() + scale_delta);
// SL-315
- volume_morph->mVolume->setPosition(volume_morph->mVolume->getPosition() + pos_delta);
+ volume_morph.mVolume->setPosition(volume_morph.mVolume->getPosition() + pos_delta);
}
}
@@ -735,15 +733,14 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight)
{
// now apply volume changes
- for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ )
+ for(auto& volume_morph : mVolumeMorphs)
{
- LLPolyVolumeMorph* volume_morph = &(*iter);
- LLVector3 scale_delta = volume_morph->mScale * delta_weight;
- LLVector3 pos_delta = volume_morph->mPos * delta_weight;
+ LLVector3 scale_delta = volume_morph.mScale * delta_weight;
+ LLVector3 pos_delta = volume_morph.mPos * delta_weight;
- volume_morph->mVolume->setScale(volume_morph->mVolume->getScale() + scale_delta);
+ volume_morph.mVolume->setScale(volume_morph.mVolume->getScale() + scale_delta);
// SL-315
- volume_morph->mVolume->setPosition(volume_morph->mVolume->getPosition() + pos_delta);
+ volume_morph.mVolume->setPosition(volume_morph.mVolume->getPosition() + pos_delta);
}
}