summaryrefslogtreecommitdiff
path: root/indra/newview/llcontrolavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llcontrolavatar.cpp')
-rw-r--r--indra/newview/llcontrolavatar.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 716333b217..9201241856 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -99,19 +99,11 @@ LLVOAvatar *LLControlAvatar::getAttachedAvatar()
void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_scale_fixup) const
{
- F32 max_legal_offset = MAX_LEGAL_OFFSET;
- if (gSavedSettings.getControl("AnimatedObjectsMaxLegalOffset"))
- {
- max_legal_offset = gSavedSettings.getF32("AnimatedObjectsMaxLegalOffset");
- }
- max_legal_offset = llmax(max_legal_offset,0.f);
+ static LLCachedControl<F32> anim_max_legal_offset(gSavedSettings, "AnimatedObjectsMaxLegalOffset", MAX_LEGAL_OFFSET);
+ F32 max_legal_offset = llmax(anim_max_legal_offset(), 0.f);
- F32 max_legal_size = MAX_LEGAL_SIZE;
- if (gSavedSettings.getControl("AnimatedObjectsMaxLegalSize"))
- {
- max_legal_size = gSavedSettings.getF32("AnimatedObjectsMaxLegalSize");
- }
- max_legal_size = llmax(max_legal_size, 1.f);
+ static LLCachedControl<F32> anim_max_legal_size(gSavedSettings, "AnimatedObjectsMaxLegalSize", MAX_LEGAL_SIZE);
+ F32 max_legal_size = llmax(anim_max_legal_size(), 1.f);
new_pos_fixup = LLVector3();
new_scale_fixup = 1.0f;
@@ -419,7 +411,8 @@ bool LLControlAvatar::updateCharacter(LLAgent &agent)
//virtual
void LLControlAvatar::updateDebugText()
{
- if (gSavedSettings.getBOOL("DebugAnimatedObjects"))
+ static LLCachedControl<bool> debug_animated_objects(gSavedSettings, "DebugAnimatedObjects");
+ if (debug_animated_objects)
{
S32 total_linkset_count = 0;
if (mRootVolp)
@@ -706,14 +699,14 @@ bool LLControlAvatar::isImpostor()
return LLVOAvatar::isImpostor();
}
-//static
+// static
void LLControlAvatar::onRegionChanged()
{
- std::vector<LLCharacter*>::iterator it = LLCharacter::sInstances.begin();
- for ( ; it != LLCharacter::sInstances.end(); ++it)
+ for (LLCharacter* character : LLCharacter::sInstances)
{
- LLControlAvatar* cav = dynamic_cast<LLControlAvatar*>(*it);
- if (!cav) continue;
- cav->mRegionChanged = true;
+ if (LLControlAvatar* cav = dynamic_cast<LLControlAvatar*>(character))
+ {
+ cav->mRegionChanged = true;
+ }
}
}