diff options
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 035c02c804..4f851eabce 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -616,7 +616,8 @@ bool LLVOAvatar::sShowAnimationDebug = false; bool LLVOAvatar::sVisibleInFirstPerson = false; F32 LLVOAvatar::sLODFactor = 1.f; F32 LLVOAvatar::sPhysicsLODFactor = 1.f; -bool LLVOAvatar::sJointDebug = false; +bool LLVOAvatar::sJointDebug = false; +bool LLVOAvatar::sLipSyncEnabled = false; F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; @@ -1179,6 +1180,7 @@ void LLVOAvatar::initClass() LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged); sCloudTexture = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c"); + gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&LLVOAvatar::handleVOAvatarPrefsChanged, _2)); } @@ -1186,6 +1188,12 @@ void LLVOAvatar::cleanupClass() { } +bool LLVOAvatar::handleVOAvatarPrefsChanged(const LLSD &newvalue) +{ + sLipSyncEnabled = gSavedSettings.getBOOL("LipSyncEnabled"); + return true; +} + // virtual void LLVOAvatar::initInstance() { @@ -2587,7 +2595,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) return; } - LLCachedControl<bool> friends_only(gSavedSettings, "RenderAvatarFriendsOnly", false); + static LLCachedControl<bool> friends_only(gSavedSettings, "RenderAvatarFriendsOnly", false); if (friends_only() && !isUIAvatar() && !isControlAvatar() @@ -3103,7 +3111,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) // Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync if ( voice_enabled && mLastRezzedStatus > 0 // no point updating lip-sync for clouds - && (LLVoiceClient::getInstance()->lipSyncEnabled()) + && sLipSyncEnabled && LLVoiceClient::getInstance()->getIsSpeaking( mID ) ) { F32 ooh_morph_amount = 0.0f; @@ -8473,17 +8481,29 @@ bool LLVOAvatar::isTooComplex() const bool LLVOAvatar::isTooSlow() const { + if (mIsControlAvatar) + { + return mTooSlow; + } + static LLCachedControl<S32> compelxity_render_mode(gSavedSettings, "RenderAvatarComplexityMode"); - bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY); + static LLCachedControl<bool> friends_only(gSavedSettings, "RenderAvatarFriendsOnly", false); + bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); + bool render_friend = is_friend && compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY; if (render_friend || mVisuallyMuteSetting == AV_ALWAYS_RENDER) { return false; } - else if (compelxity_render_mode == AV_RENDER_ONLY_SHOW_FRIENDS && !mIsControlAvatar) + else if (compelxity_render_mode == AV_RENDER_ONLY_SHOW_FRIENDS) { return true; } + else if (!is_friend && friends_only()) + { + return true; + } + return mTooSlow; } |