summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-02-27 17:15:35 -0600
committerDave Parks <davep@lindenlab.com>2012-02-27 17:15:35 -0600
commit523f94cca97c9345277c33b030160adc19539ba3 (patch)
tree5c04f99978572c98c7e0450f6c0e1a8f06ec7454 /indra/newview
parenta128836dedf25dc56807cced9316fbaa09a7f019 (diff)
SH-2889 Fix for crash when encountering certain attachments.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp13
-rw-r--r--indra/newview/llvoavatar.h4
3 files changed, 13 insertions, 6 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index b002c11af5..0103373fd2 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1138,6 +1138,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
return;
}
+ llassert(LLPipeline::sImpostorRender || !avatarp->isVisuallyMuted());
+
/*if (single_avatar && avatarp->mSpecialRenderMode >= 1) // 1=anim preview, 2=image preview, 3=morph view
{
gPipeline.enableLightsAvatarEdit(LLColor4(.5f, .5f, .5f, 1.f));
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index bc7f5a9744..7cbb47100d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3365,7 +3365,7 @@ void LLVOAvatar::slamPosition()
mRoot.updateWorldMatrixChildren();
}
-bool LLVOAvatar::isVisuallyMuted()
+bool LLVOAvatar::isVisuallyMuted() const
{
static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit");
static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit");
@@ -3434,7 +3434,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
// the rest should only be done occasionally for far away avatars
//--------------------------------------------------------------------
- if (visible && !isSelf() && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter)
+ if (visible && (!isSelf() || isVisuallyMuted()) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter)
{
const LLVector4a* ext = mDrawable->getSpatialExtents();
LLVector4a size;
@@ -3474,6 +3474,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE;
}
+ else
+ {
+ mUpdatePeriod = 1;
+ }
+
// don't early out for your own avatar, as we rely on your animations playing reliably
// for example, the "turn around" animation when entering customize avatar needs to trigger
@@ -5029,7 +5034,7 @@ void LLVOAvatar::addDebugText(const std::string& text)
//-----------------------------------------------------------------------------
// getID()
//-----------------------------------------------------------------------------
-const LLUUID& LLVOAvatar::getID()
+const LLUUID& LLVOAvatar::getID() const
{
return mID;
}
@@ -8296,7 +8301,7 @@ void LLVOAvatar::updateImpostors()
BOOL LLVOAvatar::isImpostor() const
{
- return (sUseImpostors && mUpdatePeriod >= IMPOSTOR_PERIOD) ? TRUE : FALSE;
+ return (isVisuallyMuted() || (sUseImpostors && mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE;
}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index dd0317f555..6a4e09593c 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -185,7 +185,7 @@ public:
void resetSpecificJointPosition( const std::string& name );
virtual const char* getAnimationPrefix() { return "avatar"; }
- virtual const LLUUID& getID();
+ virtual const LLUUID& getID() const;
virtual LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset);
virtual LLJoint* findCollisionVolume(U32 volume_id);
virtual S32 getCollisionVolumeID(std::string &name);
@@ -382,7 +382,7 @@ private:
public:
U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
- bool isVisuallyMuted();
+ bool isVisuallyMuted() const;
U32 renderRigid();
U32 renderSkinned(EAvatarRenderPass pass);