diff options
author | Rye Mutt <rye@alchemyviewer.org> | 2024-07-22 08:29:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 15:29:35 +0300 |
commit | 7ebbc58ae310b5c41efb3fe1460d63663ab92004 (patch) | |
tree | 031d0ad22e888a646ff20557854012574d1cd328 /indra/newview/llcontrolavatar.cpp | |
parent | 8a3c9a0b9d3bdf193b49f7f82378558c275948a6 (diff) |
Cache various frequently accessed settings (#2080)
Diffstat (limited to 'indra/newview/llcontrolavatar.cpp')
-rw-r--r-- | indra/newview/llcontrolavatar.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 716333b217..2a52b7dde9 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) |