diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-10-16 21:41:31 +0000 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-10-16 21:41:31 +0000 |
commit | 89d92267e233bc34fe600a07f485266e7edb2879 (patch) | |
tree | 6b70df4f746b15024f3956c0dc9cb5fa5233f606 /indra/newview/llagentwearables.cpp | |
parent | fbddb3163824d44cfb2ceee7127ac9ed2874acab (diff) |
svn merge -r134817:136516 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/avatar-pipeline-multiattachments-3 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
For DEV-32867 : Avatar Pipeline Project - Multi-Attachments
This is a viewer-side-only, infrastructure-only merge for multi-attachments. This should not lead to any new functionality; it simply provides backwards compatibility for when multi-attachments are enabled in viewer2.1, so that viewer2.0 users can see viewer2.1 avatars correctly.
Reviewed by: Vir.
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 81 |
1 files changed, 49 insertions, 32 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a26b799d3d..223f8779ec 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1203,25 +1203,30 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, S32 attachment_pt = attachments_to_include[i]; LLViewerJointAttachment* attachment = get_if_there(mAvatarObject->mAttachmentPoints, attachment_pt, (LLViewerJointAttachment*)NULL); if (!attachment) continue; - LLViewerObject* attached_object = attachment->getObject(); - if (!attached_object) continue; - const LLUUID& item_id = attachment->getItemID(); - if (item_id.isNull()) continue; - LLInventoryItem* item = gInventory.getItem(item_id); - if (!item) continue; - if (!msg_started) + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - msg_started = TRUE; - msg->newMessage("CreateNewOutfitAttachments"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("HeaderData"); - msg->addUUID("NewFolderID", folder_id); + LLViewerObject *attached_object = (*attachment_iter); + if(!attached_object) continue; + const LLUUID& item_id = (*attachment_iter)->getItemID(); + if(item_id.isNull()) continue; + LLInventoryItem* item = gInventory.getItem(item_id); + if(!item) continue; + if(!msg_started) + { + msg_started = TRUE; + msg->newMessage("CreateNewOutfitAttachments"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("HeaderData"); + msg->addUUID("NewFolderID", folder_id); + } + msg->nextBlock("ObjectData"); + msg->addUUID("OldItemID", item_id); + msg->addUUID("OldFolderID", item->getParentUUID()); } - msg->nextBlock("ObjectData"); - msg->addUUID("OldItemID", item_id); - msg->addUUID("OldFolderID", item->getParentUUID()); } if (msg_started) @@ -1766,20 +1771,25 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; - LLViewerObject* objectp = attachment->getObject(); - if (objectp) + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - LLUUID object_item_id = attachment->getItemID(); - if (requested_item_ids.find(object_item_id) != requested_item_ids.end()) - { - // Object currently worn, was requested. - // Flag as currently worn so we won't have to add it again. - current_item_ids.insert(object_item_id); - } - else + LLViewerObject *objectp = (*attachment_iter); + if (objectp) { - // object currently worn, not requested. - objects_to_remove.push_back(objectp); + LLUUID object_item_id = objectp->getItemID(); + if (requested_item_ids.find(object_item_id) != requested_item_ids.end()) + { + // Object currently worn, was requested. + // Flag as currently worn so we won't have to add it again. + current_item_ids.insert(object_item_id); + } + else + { + // object currently worn, not requested. + objects_to_remove.push_back(objectp); + } } } } @@ -1855,9 +1865,16 @@ void LLAgentWearables::userRemoveAllAttachments() { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; - LLViewerObject* objectp = attachment->getObject(); - if (objectp) - objects_to_remove.push_back(objectp); + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *attached_object = (*attachment_iter); + if (attached_object) + { + objects_to_remove.push_back(attached_object); + } + } } userRemoveMultipleAttachments(objects_to_remove); } |