aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llinventorybridge.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llinventorybridge.cpp')
-rw-r--r--linden/indra/newview/llinventorybridge.cpp52
1 files changed, 35 insertions, 17 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp
index 58b8af2..6d981cc 100644
--- a/linden/indra/newview/llinventorybridge.cpp
+++ b/linden/indra/newview/llinventorybridge.cpp
@@ -488,11 +488,11 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
488} 488}
489 489
490// *TODO: remove this 490// *TODO: remove this
491BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) 491BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
492{ 492{
493 BOOL rv = FALSE; 493 BOOL rv = FALSE;
494 494
495 LLInventoryObject* obj = getInventoryObject(); 495 const LLInventoryObject* obj = getInventoryObject();
496 496
497 if(obj) 497 if(obj)
498 { 498 {
@@ -3273,8 +3273,20 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach
3273{ 3273{
3274 LLAttachmentRezAction* rez_action = new LLAttachmentRezAction; 3274 LLAttachmentRezAction* rez_action = new LLAttachmentRezAction;
3275 rez_action->mItemID = item->getUUID(); 3275 rez_action->mItemID = item->getUUID();
3276 rez_action->mAttachPt = gAgent.getAvatarObject()->mAttachmentPoints.reverseLookup(attachment); 3276 S32 attach_pt = 0;
3277 3277 if (gAgent.getAvatarObject() && attachment)
3278 {
3279 for (LLVOAvatar::attachment_map_t::iterator iter = gAgent.getAvatarObject()->mAttachmentPoints.begin();
3280 iter != gAgent.getAvatarObject()->mAttachmentPoints.end(); ++iter)
3281 {
3282 if (iter->second == attachment)
3283 {
3284 rez_action->mAttachPt = iter->first;
3285 break;
3286 }
3287 }
3288 }
3289 rez_action->mAttachPt = attach_pt;
3278 if (attachment && attachment->getObject()) 3290 if (attachment && attachment->getObject())
3279 { 3291 {
3280 gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); 3292 gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action);
@@ -3365,10 +3377,11 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
3365 attach_hud_menu && (attach_hud_menu->getChildCount() == 0) && 3377 attach_hud_menu && (attach_hud_menu->getChildCount() == 0) &&
3366 avatarp) 3378 avatarp)
3367 { 3379 {
3368 for (LLViewerJointAttachment* attachment = avatarp->mAttachmentPoints.getFirstData(); 3380 for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
3369 attachment; 3381 iter != avatarp->mAttachmentPoints.end(); )
3370 attachment = gAgent.getAvatarObject()->mAttachmentPoints.getNextData())
3371 { 3382 {
3383 LLVOAvatar::attachment_map_t::iterator curiter = iter++;
3384 LLViewerJointAttachment* attachment = curiter->second;
3372 LLMenuItemCallGL *new_item; 3385 LLMenuItemCallGL *new_item;
3373 if (attachment->getIsHUDAttachment()) 3386 if (attachment->getIsHUDAttachment())
3374 { 3387 {
@@ -3509,8 +3522,13 @@ struct LLFoundData
3509struct LLWearableHoldingPattern 3522struct LLWearableHoldingPattern
3510{ 3523{
3511 LLWearableHoldingPattern() : mResolved(0) {} 3524 LLWearableHoldingPattern() : mResolved(0) {}
3512 ~LLWearableHoldingPattern() { mFoundList.deleteAllData(); } 3525 ~LLWearableHoldingPattern()
3513 LLDoubleLinkedList<LLFoundData> mFoundList; 3526 {
3527 for_each(mFoundList.begin(), mFoundList.end(), DeletePointer());
3528 mFoundList.clear();
3529 }
3530 typedef std::list<LLFoundData*> found_list_t;
3531 found_list_t mFoundList;
3514 S32 mResolved; 3532 S32 mResolved;
3515}; 3533};
3516 3534
@@ -3900,7 +3918,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata )
3900 item_array.get(i)->getAssetUUID(), 3918 item_array.get(i)->getAssetUUID(),
3901 item_array.get(i)->getName(), 3919 item_array.get(i)->getName(),
3902 item_array.get(i)->getType()); 3920 item_array.get(i)->getType());
3903 holder->mFoundList.addData(found); 3921 holder->mFoundList.push_front(found);
3904 found_container.put(found); 3922 found_container.put(found);
3905 } 3923 }
3906 for(i = 0; i < wearable_count; ++i) 3924 for(i = 0; i < wearable_count; ++i)
@@ -3991,10 +4009,10 @@ void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void* data)
3991 4009
3992 if(wearable) 4010 if(wearable)
3993 { 4011 {
3994 for(LLFoundData* data = holder->mFoundList.getFirstData(); 4012 for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin();
3995 data; 4013 iter != holder->mFoundList.end(); ++iter)
3996 data = holder->mFoundList.getNextData() )
3997 { 4014 {
4015 LLFoundData* data = *iter;
3998 if(wearable->getID() == data->mAssetID) 4016 if(wearable->getID() == data->mAssetID)
3999 { 4017 {
4000 data->mWearable = wearable; 4018 data->mWearable = wearable;
@@ -4003,7 +4021,7 @@ void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void* data)
4003 } 4021 }
4004 } 4022 }
4005 holder->mResolved += 1; 4023 holder->mResolved += 1;
4006 if(holder->mResolved >= holder->mFoundList.getLength()) 4024 if(holder->mResolved >= (S32)holder->mFoundList.size())
4007 { 4025 {
4008 wear_inventory_category_on_avatar_step3(holder, append); 4026 wear_inventory_category_on_avatar_step3(holder, append);
4009 } 4027 }
@@ -4019,10 +4037,10 @@ void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, B
4019 // that we recursed through. 4037 // that we recursed through.
4020 for( S32 i = 0; i < WT_COUNT; i++ ) 4038 for( S32 i = 0; i < WT_COUNT; i++ )
4021 { 4039 {
4022 for(LLFoundData* data = holder->mFoundList.getFirstData(); 4040 for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin();
4023 data; 4041 iter != holder->mFoundList.end(); ++iter)
4024 data = holder->mFoundList.getNextData())
4025 { 4042 {
4043 LLFoundData* data = *iter;
4026 LLWearable* wearable = data->mWearable; 4044 LLWearable* wearable = data->mWearable;
4027 if( wearable && ((S32)wearable->getType() == i) ) 4045 if( wearable && ((S32)wearable->getType() == i) )
4028 { 4046 {