Commits

leyla_linden  committed 0adca23 Merge

Merge

  • Participants
  • Parent commits fd49f2e, eae9260

Comments (0)

Files changed (10)

File indra/newview/llappearancemgr.cpp

 	return outfit_cat->getUUID();
 }
 
-bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_update, bool replace)
+bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_update, bool replace, LLPointer<LLInventoryCallback> cb)
 {
 	if (item_id_to_wear.isNull()) return false;
 
 		// Remove existing body parts anyway because we must not be able to wear e.g. two skins.
 		removeCOFLinksOfType(item_to_wear->getWearableType(), false);
 
-		addCOFItemLink(item_to_wear, do_update);
+		addCOFItemLink(item_to_wear, do_update, cb);
 		break;
 	case LLAssetType::AT_OBJECT:
 		rez_attachment(item_to_wear, NULL);
 class LLDeferredCOFLinkObserver: public LLInventoryObserver
 {
 public:
-	LLDeferredCOFLinkObserver(const LLUUID& item_id, bool do_update):
+	LLDeferredCOFLinkObserver(const LLUUID& item_id, bool do_update, LLPointer<LLInventoryCallback> cb = NULL):
 		mItemID(item_id),
-		mDoUpdate(do_update)
+		mDoUpdate(do_update),
+		mCallback(cb)
 	{
 	}
 
 		if (item)
 		{
 			gInventory.removeObserver(this);
-			LLAppearanceMgr::instance().addCOFItemLink(item,mDoUpdate);
+			LLAppearanceMgr::instance().addCOFItemLink(item,mDoUpdate,mCallback);
 			delete this;
 		}
 	}
 private:
 	const LLUUID mItemID;
 	bool mDoUpdate;
+	LLPointer<LLInventoryCallback> mCallback;
 };
 
 
 // BAP - note that this runs asynchronously if the item is not already loaded from inventory.
 // Dangerous if caller assumes link will exist after calling the function.
-void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, bool do_update )
+void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, bool do_update, LLPointer<LLInventoryCallback> cb)
 {
 	const LLInventoryItem *item = gInventory.getItem(item_id);
 	if (!item)
 	{
-		LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, do_update);
+		LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, do_update, cb);
 		gInventory.addObserver(observer);
 	}
 	else
 	{
-		addCOFItemLink(item, do_update);
+		addCOFItemLink(item, do_update, cb);
 	}
 }
 
-void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update )
+void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update, LLPointer<LLInventoryCallback> cb)
 {		
 	const LLViewerInventoryItem *vitem = dynamic_cast<const LLViewerInventoryItem*>(item);
 	if (!vitem)
 	}
 	else
 	{
-		LLPointer<LLInventoryCallback> cb = do_update ? new ModifiedCOFCallback : 0;
+		if(do_update && cb.isNull())
+		{
+			cb = new ModifiedCOFCallback;
+		}
 		const std::string description = vitem->getIsLinkType() ? vitem->getDescription() : "";
 		link_inventory_item( gAgent.getID(),
 							 vitem->getLinkedUUID(),

File indra/newview/llappearancemgr.h

 	const LLUUID getBaseOutfitUUID();
 
 	// Wear/attach an item (from a user's inventory) on the agent
-	bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update = true, bool replace = false);
+	bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update = true, bool replace = false, LLPointer<LLInventoryCallback> cb = NULL);
 
 	// Update the displayed outfit name in UI.
 	void updatePanelOutfitName(const std::string& name);
 				 LLPointer<LLInventoryCallback> cb);
 
 	// Add COF link to individual item.
-	void addCOFItemLink(const LLUUID& item_id, bool do_update = true);
-	void addCOFItemLink(const LLInventoryItem *item, bool do_update = true);
+	void addCOFItemLink(const LLUUID& item_id, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL);
+	void addCOFItemLink(const LLInventoryItem *item, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL);
 
 	// Remove COF entries
 	void removeCOFItemLinks(const LLUUID& item_id, bool do_update = true);

File indra/newview/lldrawable.h

 
 inline LLFace* LLDrawable::getFace(const S32 i) const
 {
-	llassert((U32)i < mFaces.size());
-	llassert(mFaces[i]);
+	//switch these asserts to llerrs -- davep
+	//llassert((U32)i < mFaces.size());
+	//llassert(mFaces[i]);
+
+	if ((U32) i >= mFaces.size())
+	{
+		llerrs << "Invalid face index." << llendl;
+	}
+
+	if (!mFaces[i])
+	{
+		llerrs << "Null face found." << llendl;
+	}
+	
 	return mFaces[i];
 }
 

File indra/newview/llface.h

 	{
 		bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
 		{
-			return lhs->mDistance > rhs->mDistance; // farthest = first
+			return !lhs || (rhs && (lhs->mDistance > rhs->mDistance)); // farthest = first
 		}
 	};
 	

File indra/newview/llpaneloutfitedit.cpp

 
 void LLPanelOutfitEdit::onPlusBtnClicked(void)
 {
-	LLUUID selected_id;
-	getCurrentItemUUID(selected_id);
+	uuid_vec_t selected_items;
+	getSelectedItemsUUID(selected_items);
 
-	if (selected_id.isNull()) return;
-
-	//replacing instead of adding the item
-	LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id, true, true);
+	LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
+	
+	for(uuid_vec_t::iterator iter = selected_items.begin(); iter != selected_items.end(); iter++)
+	{
+		LLUUID selected_id = *iter;
+		if (!selected_id.isNull())
+		{
+			//replacing instead of adding the item
+			LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id, false, true, link_waiter);
+		}
+	}
 }
 
 void LLPanelOutfitEdit::onVisibilityChange()

File indra/newview/llspatialpartition.cpp

 	}
 
 	delete [] mOcclusionVerts;
+	mOcclusionVerts = NULL;
 
 	LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
 	clearDrawMap();

File indra/newview/llspatialpartition.h

 	static BOOL sNoDelete; //deletion of spatial groups and draw info not allowed if TRUE
 
 	typedef std::vector<LLPointer<LLSpatialGroup> > sg_vector_t;
-	typedef std::set<LLPointer<LLSpatialGroup> > sg_set_t;
-	typedef std::list<LLPointer<LLSpatialGroup> > sg_list_t;
 	typedef std::vector<LLPointer<LLSpatialBridge> > bridge_list_t;
 	typedef std::vector<LLPointer<LLDrawInfo> > drawmap_elem_t; 
 	typedef std::map<U32, drawmap_elem_t > draw_map_t;	

File indra/newview/llwearableitemslist.cpp

 	const uuid_vec_t& ids = mUUIDs;		// selected items IDs
 	LLUUID selected_id = ids.front();	// ID of the first selected item
 
-	functor_t wear = boost::bind(&LLAppearanceMgr::wearItemOnAvatar, LLAppearanceMgr::getInstance(), _1, true, true);
-	functor_t add = boost::bind(&LLAppearanceMgr::wearItemOnAvatar, LLAppearanceMgr::getInstance(), _1, true, false);
+	functor_t wear = boost::bind(&LLAppearanceMgr::wearItemOnAvatar, LLAppearanceMgr::getInstance(), _1, true, true, LLPointer<LLInventoryCallback>(NULL));
+	functor_t add = boost::bind(&LLAppearanceMgr::wearItemOnAvatar, LLAppearanceMgr::getInstance(), _1, true, false, LLPointer<LLInventoryCallback>(NULL));
 	functor_t take_off = boost::bind(&LLAppearanceMgr::removeItemFromAvatar, LLAppearanceMgr::getInstance(), _1);
 
 	// Register handlers common for all wearable types.

File indra/newview/pipeline.cpp

 	assertInitialized();
 
 	// Iterate through all drawables on the priority build queue,
-	for (LLSpatialGroup::sg_list_t::iterator iter = mGroupQ1.begin();
+	for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin();
 		 iter != mGroupQ1.end(); ++iter)
 	{
 		LLSpatialGroup* group = *iter;

File indra/newview/pipeline.h

 	//
 	LLDrawable::drawable_list_t 	mBuildQ1; // priority
 	LLDrawable::drawable_list_t 	mBuildQ2; // non-priority
-	LLSpatialGroup::sg_list_t		mGroupQ1; //priority
+	LLSpatialGroup::sg_vector_t		mGroupQ1; //priority
 	LLSpatialGroup::sg_vector_t		mGroupQ2; // non-priority
 
 	LLViewerObject::vobj_list_t		mCreateQ;