From 2ba8bb839f5ed6f59c836a21fa4af7e54e6845ea Mon Sep 17 00:00:00 2001 From: Cinders Date: Thu, 23 May 2013 19:45:33 -0600 Subject: [PATCH] Use LLCachedControl for faster debug settings on idle Avatar Update --- indra/newview/llvoavatar.cpp | 38 +++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8fd4be472e..eaf67ab68b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1949,8 +1949,12 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) return; } + // Use LLCachedControl + LLCachedControldisable_all_render_types(gSavedSettings, "DisableAllRenderTypes"); if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR)) - && !(gSavedSettings.getBOOL("DisableAllRenderTypes"))) + //&& !(gSavedSettings.getBOOL("DisableAllRenderTypes"))) + && !(disable_all_render_types)) + // { return; } @@ -2710,7 +2714,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) // if we aren't self, if we use colored Clienttags and if we have a color // then use that color as name_tag_color static LLUICachedControl show_friends("NameTagShowFriends"); - if(mClientTagData.has("color") && !(show_friends && (is_friend || LGGContactSets::getInstance()->hasFriendColorThatShouldShow(getID(), LGG_CS_TAG))) && gSavedSettings.getU32("FSColorClienttags") > 0 && !this->isSelf()) + static LLUICachedControl color_client_tags("FSColorClienttags"); + if(mClientTagData.has("color") && !(show_friends && (is_friend || LGGContactSets::getInstance()->hasFriendColorThatShouldShow(getID(), LGG_CS_TAG))) && color_client_tags > 0 && !this->isSelf()) { name_tag_color = mClientTagData["color"]; } @@ -3216,7 +3221,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // clear debug text mDebugText.clear(); - if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + // Use LLCachedControl + //if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) + static LLCachedControl debug_avatar_appearance_message(gSavedSettings, "DebugAvatarAppearanceMessage"); + if (debug_avatar_appearance_message) + // { S32 central_bake_version = -1; if (getRegion()) @@ -3239,7 +3248,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { debug_line += llformat(" - cof: %d req: %d rcv:%d", curr_cof_version, last_request_cof_version, last_received_cof_version); - if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + // Use LLCachedControl + //if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + static LLCachedControl debug_force_appearance_request_failure(gSavedSettings, "DebugForceAppearanceRequestFailure"); + if (debug_force_appearance_request_failure) + // { debug_line += " FORCING ERRS"; } @@ -3250,7 +3263,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } addDebugText(debug_line); } - if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + // Use LLCachedControl + static LLCachedControl debug_avatar_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked"); + if (debug_avatar_composite_baked) + //if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + // { if (!mBakedTextureDebugText.empty()) addDebugText(mBakedTextureDebugText); @@ -3484,7 +3501,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } LLVector3 velDir = getVelocity(); velDir.normalize(); - if (!gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards") && (mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end())) + // Use Cached Control + //if (!gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards") && (mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end())) + static LLCachedControl walk_backwards(gSavedSettings, "TurnAroundWhenWalkingBackwards"); + if (!walk_backwards && mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end()) + // { F32 vpD = velDir * primDir; if (vpD < -0.5f) @@ -7335,7 +7356,10 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { LL_DEBUGS("Avatar") << "starts" << llendl; - bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + // Use LLCachedControl + //bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + static LLCachedControl enable_verbose_dumps(gSavedSettings, "DebugAvatarAppearanceMessage"); + // std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages")) {