diff options
-rw-r--r-- | indra/newview/llmutelist.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 5 | ||||
-rw-r--r-- | indra/newview/llviewerpartsim.cpp | 6 |
4 files changed, 38 insertions, 9 deletions
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index bf1716e18c..64df449c26 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -316,14 +316,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) updateAdd(localmute); notifyObservers(); notifyObserversDetailed(localmute); - if(!(localmute.mFlags & LLMute::flagParticles)) - { - //Kill all particle systems owned by muted task - if(localmute.mType == LLMute::AGENT || localmute.mType == LLMute::OBJECT) - { - LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID); - } - } + //mute local lights that are attached to the avatar LLVOAvatar *avatarp = find_avatar(localmute.mID); if (avatarp) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 5de4029542..e86d39e9d0 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -270,7 +270,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mPhysicsShapeUnknown(true), mAttachmentItemID(LLUUID::null), mLastUpdateType(OUT_UNKNOWN), - mLastUpdateCached(FALSE) + mLastUpdateCached(FALSE), + mCachedMuteListUpdateTime(0), + mCachedOwnerInMuteList(false) { if (!is_global) { @@ -5116,6 +5118,29 @@ void LLViewerObject::updateText() } } +bool LLViewerObject::isOwnerInMuteList() +{ + if (isAvatar() || mOwnerID.isNull()) + { + return false; + } + bool muted = false; + F64 now = LLFrameTimer::getTotalSeconds(); + if (now < mCachedMuteListUpdateTime) + { + muted = mCachedOwnerInMuteList; + } + else + { + muted = LLMuteList::getInstance()->isMuted(mOwnerID); + + const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1; + mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES; + mCachedOwnerInMuteList = muted; + } + return muted; +} + LLVOAvatar* LLViewerObject::asAvatar() { return NULL; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 7a490f6957..4f826b9eac 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -422,6 +422,8 @@ public: void updateText(); // update text label position virtual void updateDrawable(BOOL force_damped); // force updates on static objects + bool isOwnerInMuteList(); + void setDrawableState(U32 state, BOOL recursive = TRUE); void clearDrawableState(U32 state, BOOL recursive = TRUE); BOOL isDrawableState(U32 state, BOOL recursive = TRUE) const; @@ -823,6 +825,9 @@ private: static BOOL sVelocityInterpolate; static BOOL sPingInterpolate; + bool mCachedOwnerInMuteList; + F64 mCachedMuteListUpdateTime; + //-------------------------------------------------------------------- // For objects that are attachments //-------------------------------------------------------------------- diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index b4617566ac..e8ea0eb26d 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -37,6 +37,7 @@ #include "llviewerregion.h" #include "llvopartgroup.h" #include "llworld.h" +#include "llmutelist.h" #include "pipeline.h" #include "llspatialpartition.h" #include "llvoavatarself.h" @@ -711,6 +712,11 @@ void LLViewerPartSim::updateSimulation() upd = FALSE; } + if(vobj && vobj->isOwnerInMuteList()) + { + upd = FALSE; + } + if (upd && vobj && (vobj->getPCode() == LL_PCODE_VOLUME)) { if(vobj->getAvatar() && vobj->getAvatar()->isTooComplex()) |