Commits

Scott Lawrence committed 30fc336 Merge

merge changes for storm-1878

  • Participants
  • Parent commits a1f2154, ffeb0cb

Comments (0)

Files changed (3)

indra/newview/llmutelist.cpp

 
 #include "llmutelist.h"
 
+#include "pipeline.h"
+
 #include <boost/tokenizer.hpp>
 
 #include "lldispatcher.h"
 	return last_name == "Linden";
 }
 
+static LLVOAvatar* find_avatar(const LLUUID& id)
+{
+	LLViewerObject *obj = gObjectList.findObject(id);
+	while (obj && obj->isAttachment())
+	{
+		obj = (LLViewerObject *)obj->getParent();
+	}
+
+	if (obj && obj->isAvatar())
+	{
+		return (LLVOAvatar*)obj;
+	}
+	else
+	{
+		return NULL;
+	}
+}
 
 BOOL LLMuteList::add(const LLMute& mute, U32 flags)
 {
 						LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID);
 					}
 				}
+				//mute local lights that are attached to the avatar
+				LLVOAvatar *avatarp = find_avatar(localmute.mID);
+				if (avatarp)
+				{
+					LLPipeline::removeMutedAVsLights(avatarp);
+				}
 				return TRUE;
 			}
 		}

indra/newview/pipeline.cpp

 
 }
 
+//static
+void LLPipeline::removeMutedAVsLights(LLVOAvatar* muted_avatar)
+{
+	LLFastTimer t(FTM_REMOVE_FROM_LIGHT_SET);
+	for (light_set_t::iterator iter = gPipeline.mNearbyLights.begin();
+		 iter != gPipeline.mNearbyLights.end(); iter++)
+	{
+		if (iter->drawable->getVObj()->isAttachment() && iter->drawable->getVObj()->getAvatar() == muted_avatar)
+		{
+			gPipeline.mLights.erase(iter->drawable);
+			gPipeline.mNearbyLights.erase(iter);
+		}
+	}
+}
+
 U32 LLPipeline::addObject(LLViewerObject *vobj)
 {
 	LLMemType mt_ao(LLMemType::MTYPE_PIPELINE_ADD_OBJECT);

indra/newview/pipeline.h

 
 	void		 unlinkDrawable(LLDrawable*);
 
+	static void removeMutedAVsLights(LLVOAvatar*);
+
 	// Object related methods
 	void        markVisible(LLDrawable *drawablep, LLCamera& camera);
 	void		markOccluder(LLSpatialGroup* group);