summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-01-08 11:05:25 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-01-08 11:05:25 +0200
commit21c61014453042247d83b22024ed6d4b7e22635c (patch)
tree0b8a9c880ddc34b70207c5e87dc2a4b32dcdec2d
parenta555f635da29262a543ec2828a311e3f98a8ebdb (diff)
MAINT-3240 Don't show avatar if it's in mute list
-rwxr-xr-xindra/newview/llvoavatar.cpp29
-rwxr-xr-xindra/newview/llvoavatar.h4
2 files changed, 27 insertions, 6 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 444a26779a..3686ccb48f 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3121,10 +3121,9 @@ bool LLVOAvatar::isVisuallyMuted()
U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5));
- muted = LLMuteList::getInstance()->isMuted(getID()) ||
- (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) ||
- (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) ||
- (mVisualComplexity > max_cost && max_render_cost > 0);
+ muted = (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) ||
+ (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) ||
+ (mVisualComplexity > max_cost && max_render_cost > 0);
// Could be part of the grand || collection above, but yanked out to make the logic visible
if (!muted)
@@ -3156,7 +3155,7 @@ bool LLVOAvatar::isVisuallyMuted()
}
}
- return muted;
+ return muted || isInMuteList();
}
void LLVOAvatar::forceUpdateVisualMuteSettings()
@@ -3165,6 +3164,24 @@ void LLVOAvatar::forceUpdateVisualMuteSettings()
mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() - 1.0;
}
+bool LLVOAvatar::isInMuteList()
+{
+ bool muted = false;
+ F64 now = LLFrameTimer::getTotalSeconds();
+ if (now < mCachedMuteListUpdateTime)
+ {
+ muted = mCachedInMuteList;
+ }
+ else
+ {
+ muted = LLMuteList::getInstance()->isMuted(getID());
+
+ const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1;
+ mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES;
+ mCachedInMuteList = muted;
+ }
+ return muted;
+}
//------------------------------------------------------------------------
// updateCharacter()
@@ -8049,7 +8066,7 @@ void LLVOAvatar::updateImpostors()
BOOL LLVOAvatar::isImpostor()
{
- return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE;
+ return (sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD))) || isInMuteList() ? TRUE : FALSE;
}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 2223acc893..7034f8349f 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -383,6 +383,7 @@ public:
public:
U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
bool isVisuallyMuted();
+ bool isInMuteList();
void setCachedVisualMute(bool muted) { mCachedVisualMute = muted; };
void forceUpdateVisualMuteSettings();
@@ -422,6 +423,9 @@ private:
bool mCachedVisualMute; // cached return value for isVisuallyMuted()
F64 mCachedVisualMuteUpdateTime; // Time to update mCachedVisualMute
+ bool mCachedInMuteList;
+ F64 mCachedMuteListUpdateTime;
+
VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV
//--------------------------------------------------------------------