summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-09-11 17:59:29 -0400
committerOz Linden <oz@lindenlab.com>2015-09-11 17:59:29 -0400
commit58db3502238db8c1580783d6d89bf8946bc863da (patch)
tree6714bcc9826045d5691f0510c069e456092e6c8b /indra/newview/llvoavatar.cpp
parentd81383b46824404cf01c097324e8c1bc2cb0cece (diff)
MAINT-5622: correct rendering of explicitly derendered and blocked avatars
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-xindra/newview/llvoavatar.cpp83
1 files changed, 53 insertions, 30 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index c5a6868502..2c8f38aaad 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -702,7 +702,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mUpdatePeriod(1),
mVisualComplexityStale(true),
mVisuallyMuteSetting(AV_RENDER_NORMALLY),
- mMutedAVColor(calcMutedAVColor(getID())),
+ mMutedAVColor(LLColor4::white /* used for "uninitialize" */),
mFirstFullyVisible(TRUE),
mFullyLoaded(FALSE),
mPreviousFullyLoaded(FALSE),
@@ -3099,6 +3099,10 @@ bool LLVOAvatar::isVisuallyMuted() const
{ // Always want to see this AV as an impostor
muted = true;
}
+ else if (LLMuteList::getInstance()->isMuted(getID()))
+ {
+ muted = true;
+ }
else
{
muted = isTooComplex();
@@ -8089,20 +8093,11 @@ void LLVOAvatar::updateImpostors()
LLVOAvatar* avatar = (LLVOAvatar*) *iter;
if (!avatar->isDead() && avatar->isVisible()
&& (avatar->isImpostor() && avatar->needsImpostorUpdate())
- && (avatar->getVisualMuteSettings() != AV_DO_NOT_RENDER))
+ )
{
+ avatar->calcMutedAVColor();
gPipeline.generateImpostor(avatar);
}
- else
- {
- LL_DEBUGS_ONCE("AvatarRender") << "Avatar " << avatar->getID()
- << (avatar->isDead() ? " _is_ " : " is not ") << "dead"
- << (avatar->needsImpostorUpdate() ? " needs " : " _does_not_need_ ") << "impostor update"
- << (avatar->isVisible() ? " is " : " _is_not_ ") << "visible"
- << (avatar->isImpostor() ? " is " : " is not ") << "impostor"
- << (avatar->isTooComplex() ? " is " : " is not ") << "too complex"
- << LL_ENDL;
- }
}
LLCharacter::sAllowInstancesChange = TRUE;
@@ -8446,31 +8441,59 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
}
}
+void LLVOAvatar::setVisualMuteSettings(VisualMuteSettings set)
+{
+ mVisuallyMuteSetting = set;
+ mNeedsImpostorUpdate = true;
+}
-// static
-LLColor4 LLVOAvatar::calcMutedAVColor(const LLUUID av_id)
+
+void LLVOAvatar::calcMutedAVColor()
{
- // select a color based on the first byte of the agents uuid so any muted agent is always the same color
- F32 color_value = (F32) (av_id.mData[0]);
- F32 spectrum = (color_value / 256.0); // spectrum is between 0 and 1.f
+ LLColor4 new_color;
+ std::string change_msg;
+ LLUUID av_id(getID());
- // Array of colors. These are arranged so only one RGB color changes between each step,
- // and it loops back to red so there is an even distribution. It is not a heat map
- const S32 NUM_SPECTRUM_COLORS = 7;
- static LLColor4 * spectrum_color[NUM_SPECTRUM_COLORS] = { &LLColor4::red, &LLColor4::magenta, &LLColor4::blue, &LLColor4::cyan, &LLColor4::green, &LLColor4::yellow, &LLColor4::red };
+ if (getVisualMuteSettings() == AV_DO_NOT_RENDER)
+ {
+ // explicitly not-rendered avatars are light grey
+ new_color = LLColor4::grey3;
+ change_msg = " not rendered: color is grey3";
+ }
+ else if (LLMuteList::getInstance()->isMuted(av_id)) // the user blocked them
+ {
+ // blocked avatars are dark grey
+ new_color = LLColor4::grey4;
+ change_msg = " blocked: color is grey4";
+ }
+ else if ( mMutedAVColor == LLColor4::white || mMutedAVColor == LLColor4::grey3 || mMutedAVColor == LLColor4::grey4 )
+ {
+ // select a color based on the first byte of the agents uuid so any muted agent is always the same color
+ F32 color_value = (F32) (av_id.mData[0]);
+ F32 spectrum = (color_value / 256.0); // spectrum is between 0 and 1.f
+
+ // Array of colors. These are arranged so only one RGB color changes between each step,
+ // and it loops back to red so there is an even distribution. It is not a heat map
+ const S32 NUM_SPECTRUM_COLORS = 7;
+ static LLColor4 * spectrum_color[NUM_SPECTRUM_COLORS] = { &LLColor4::red, &LLColor4::magenta, &LLColor4::blue, &LLColor4::cyan, &LLColor4::green, &LLColor4::yellow, &LLColor4::red };
- spectrum = spectrum * (NUM_SPECTRUM_COLORS - 1); // Scale to range of number of colors
- S32 spectrum_index_1 = floor(spectrum); // Desired color will be after this index
- S32 spectrum_index_2 = spectrum_index_1 + 1; // and before this index (inclusive)
- F32 fractBetween = spectrum - (F32)(spectrum_index_1); // distance between the two indexes (0-1)
+ spectrum = spectrum * (NUM_SPECTRUM_COLORS - 1); // Scale to range of number of colors
+ S32 spectrum_index_1 = floor(spectrum); // Desired color will be after this index
+ S32 spectrum_index_2 = spectrum_index_1 + 1; // and before this index (inclusive)
+ F32 fractBetween = spectrum - (F32)(spectrum_index_1); // distance between the two indexes (0-1)
- LLColor4 new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween);
- new_color.normalize();
- new_color *= 0.5f; // Tone it down
+ new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween);
+ new_color.normalize();
+ new_color *= 0.5f; // Tone it down
- LL_DEBUGS("AvatarRender") << "avatar "<< av_id << " muted color " << std::setprecision(3) << new_color << LL_ENDL;
+ change_msg = " over limit color ";
+ }
- return new_color;
+ if (mMutedAVColor != new_color)
+ {
+ LL_DEBUGS("AvatarRender") << "avatar "<< av_id << change_msg << std::setprecision(3) << new_color << LL_ENDL;
+ mMutedAVColor = new_color;
+ }
}
// static