diff options
author | Steven Bennetts <steve@lindenlab.com> | 2007-03-06 00:37:09 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2007-03-06 00:37:09 +0000 |
commit | 14360b815ed486c90c57b8025f8c93376ca6b6c6 (patch) | |
tree | 30707bf0bf390ebf6357325aa31e34ad8553f2ac /indra | |
parent | b06b9cd30464188f68a1125db9ecc588fdf5ca71 (diff) |
merge -r 58641:58711 maintenance -> release
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llmemory.h | 2 | ||||
-rw-r--r-- | indra/llprimitive/llprimitive.cpp | 40 | ||||
-rw-r--r-- | indra/llprimitive/llprimitive.h | 1 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 37 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 68 | ||||
-rw-r--r-- | indra/newview/llviewermenu.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 6 |
7 files changed, 82 insertions, 73 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index d543d023ff..f7f4818740 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -239,7 +239,7 @@ public: // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. template<typename Subclass> - LLHandle(const LLPointer<Subclass>& ptr) : + LLHandle(const LLHandle<Subclass>& ptr) : mPointer(ptr.get()) { ref(); diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 105f7c8c9e..1b96ac16d4 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1609,6 +1609,24 @@ void LLPrimitive::setTextureList(LLTextureEntry *listp) //============================================================================ +//static +BOOL LLNetworkData::isValid(U16 param_type, U32 size) +{ + // ew - better mechanism needed + + switch(param_type) + { + case PARAMS_FLEXIBLE: + return (size == 16); + case PARAMS_LIGHT: + return (size == 16); + } + + return FALSE; +} + +//============================================================================ + LLLightParams::LLLightParams() { mColor.setToWhite(); @@ -1631,12 +1649,22 @@ BOOL LLLightParams::pack(LLDataPacker &dp) const BOOL LLLightParams::unpack(LLDataPacker &dp) { - LLColor4U color4u; - dp.unpackColor4U(color4u, "color"); - mColor = LLColor4(color4u); - dp.unpackF32(mRadius, "radius"); - dp.unpackF32(mCutoff, "cutoff"); - dp.unpackF32(mFalloff, "falloff"); + LLColor4U color; + dp.unpackColor4U(color, "color"); + setColor(LLColor4(color)); + + F32 radius; + dp.unpackF32(radius, "radius"); + setRadius(radius); + + F32 cutoff; + dp.unpackF32(cutoff, "cutoff"); + setCutoff(cutoff); + + F32 falloff; + dp.unpackF32(falloff, "falloff"); + setFalloff(falloff); + return TRUE; } diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 3ad96bf6e1..90871fd319 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -89,6 +89,7 @@ public: virtual BOOL unpack(LLDataPacker &dp) = 0; virtual bool operator==(const LLNetworkData& data) const = 0; virtual void copy(const LLNetworkData& data) = 0; + static BOOL isValid(U16 param_type, U32 size); }; extern const F32 LIGHT_MIN_RADIUS; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 27cf29cee0..434d7a4492 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2799,6 +2799,8 @@ void LLSelectMgr::selectDelete() return; } + LLObjectSelectionHandle* selection_handlep = new LLObjectSelectionHandle(getSelection()); + if(locked_but_deleteable_object || no_copy_but_deleteable_object || !all_owned_by_you) @@ -2815,49 +2817,49 @@ void LLSelectMgr::selectDelete() //Locked only gViewerWindow->alertXml( "ConfirmObjectDeleteLock", &LLSelectMgr::confirmDelete, - this); + selection_handlep); } else if(!locked_but_deleteable_object && no_copy_but_deleteable_object && all_owned_by_you) { //No Copy only gViewerWindow->alertXml( "ConfirmObjectDeleteNoCopy", &LLSelectMgr::confirmDelete, - this); + selection_handlep); } else if(!locked_but_deleteable_object && !no_copy_but_deleteable_object && !all_owned_by_you) { //not owned only gViewerWindow->alertXml( "ConfirmObjectDeleteNoOwn", &LLSelectMgr::confirmDelete, - this); + selection_handlep); } else if(locked_but_deleteable_object && no_copy_but_deleteable_object && all_owned_by_you) { //locked and no copy gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoCopy", &LLSelectMgr::confirmDelete, - this); + selection_handlep); } else if(locked_but_deleteable_object && !no_copy_but_deleteable_object && !all_owned_by_you) { //locked and not owned gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoOwn", &LLSelectMgr::confirmDelete, - this); + selection_handlep); } else if(!locked_but_deleteable_object && no_copy_but_deleteable_object && !all_owned_by_you) { //no copy and not owned gViewerWindow->alertXml( "ConfirmObjectDeleteNoCopyNoOwn", &LLSelectMgr::confirmDelete, - this); + selection_handlep); } else { //locked, no copy and not owned gViewerWindow->alertXml( "ConfirmObjectDeleteLockNoCopyNoOwn", &LLSelectMgr::confirmDelete, - this); + selection_handlep); } @@ -2872,8 +2874,15 @@ void LLSelectMgr::selectDelete() // static void LLSelectMgr::confirmDelete(S32 option, void* data) { - LLSelectMgr* self = (LLSelectMgr*)data; - if(!self) return; + LLObjectSelectionHandle handle = *(LLObjectSelectionHandle*)data; + delete (LLObjectSelectionHandle*)data; + + if (!handle->getObjectCount()) + { + llwarns << "Nothing to delete!" << llendl; + return; + } + switch(option) { case 0: @@ -2882,19 +2891,19 @@ void LLSelectMgr::confirmDelete(S32 option, void* data) LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); // attempt to derez into the trash. LLDeRezInfo* info = new LLDeRezInfo(DRD_TRASH, trash_id); - self->sendListToRegions("DeRezObject", + gSelectMgr->sendListToRegions("DeRezObject", packDeRezHeader, packObjectLocalID, (void*)info, SEND_ONLY_ROOTS); // VEFFECT: Delete Object - one effect for all deletes - if (self->mSelectedObjects->mSelectType != SELECT_TYPE_HUD) + if (gSelectMgr->mSelectedObjects->mSelectType != SELECT_TYPE_HUD) { LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); - effectp->setPositionGlobal( self->getSelectionCenterGlobal() ); + effectp->setPositionGlobal( gSelectMgr->getSelectionCenterGlobal() ); effectp->setColor(LLColor4U(gAgent.getEffectColor())); F32 duration = 0.5f; - duration += self->mSelectedObjects->getObjectCount() / 64.f; + duration += gSelectMgr->mSelectedObjects->getObjectCount() / 64.f; effectp->setDuration(duration); } @@ -2902,7 +2911,7 @@ void LLSelectMgr::confirmDelete(S32 option, void* data) // Keep track of how many objects have been deleted. F64 obj_delete_count = gViewerStats->getStat(LLViewerStats::ST_OBJECT_DELETE_COUNT); - obj_delete_count += self->mSelectedObjects->getObjectCount(); + obj_delete_count += gSelectMgr->mSelectedObjects->getObjectCount(); gViewerStats->setStat(LLViewerStats::ST_OBJECT_DELETE_COUNT, obj_delete_count ); } break; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e9e98a4916..275db0f906 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4136,10 +4136,8 @@ void handle_take() !you_own_everything) { - if(locked_but_takeable_object && you_own_everything) { - gViewerWindow->alertXml("ConfirmObjectTakeLock", confirm_take, (void*)cat_id); @@ -4147,7 +4145,6 @@ void handle_take() } else if(!locked_but_takeable_object && !you_own_everything) { - gViewerWindow->alertXml("ConfirmObjectTakeNoOwn", confirm_take, (void*)cat_id); @@ -6093,54 +6090,47 @@ void complete_give_money(S32 option, void* user_data) gAgent.clearBusy(); } - LLUUID* object_id = (LLUUID*)user_data; + LLObjectSelectionHandle handle(*(LLObjectSelectionHandle*)user_data); + delete (LLObjectSelectionHandle*)user_data; - LLViewerObject* object = gObjectList.findObject(*object_id); - if (object) + LLViewerObject *objectp = handle->getFirstRootObject(); + + // Show avatar's name if paying attachment + if (objectp && objectp->isAttachment()) { - if (object->isAvatar()) + while (objectp && !objectp->isAvatar()) + { + objectp = (LLViewerObject*)objectp->getParent(); + } + } + + if (objectp) + { + if (objectp->isAvatar()) { const BOOL is_group = FALSE; LLFloaterPay::payDirectly(&give_money, - *object_id, + objectp->getID(), is_group); } else { - LLFloaterPay::payViaObject(&give_money, *object_id); + LLFloaterPay::payViaObject(&give_money, objectp->getID()); } } - - delete object_id; } bool handle_give_money_dialog() { - LLViewerObject *objectp = gViewerWindow->lastObjectHit(); - LLUUID* object_id = new LLUUID(); - - // Show avatar's name if paying attachment - if (objectp && objectp->isAttachment()) - { - while (objectp && !objectp->isAvatar()) - { - objectp = (LLViewerObject*)objectp->getParent(); - } - } - - if (objectp) - { - *object_id = objectp->getID(); - } - + LLObjectSelectionHandle* handlep = new LLObjectSelectionHandle(gSelectMgr->getSelection()); if (gAgent.getBusy()) { // warn users of being in busy mode during a transaction - gViewerWindow->alertXml("BusyModePay", complete_give_money, object_id); + gViewerWindow->alertXml("BusyModePay", complete_give_money, handlep); } else { - complete_give_money(1, object_id); + complete_give_money(1, handlep); } return true; } @@ -6793,24 +6783,6 @@ void near_attach_object(BOOL success, void *user_data) LLObjectAttachToAvatar::setObjectSelection(NULL); } -// move this somewhere global -void handle_attach_to_avatar(void* user_data) -{ - LLViewerObject* selectedObject = gSelectMgr->getSelection()->getFirstRootObject(); - if (selectedObject) - { - LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; - - if (attachment && attachment->getObject()) - { - gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment, user_data); - } - else - { - confirm_replace_attachment(0, user_data); - } - } -} void confirm_replace_attachment(S32 option, void* user_data) { if (option == 0/*YES*/) diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index f2d7e360c7..70d34c73c3 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -68,7 +68,6 @@ BOOL is_agent_mappable(const LLUUID& agent_id); void menu_toggle_control( void* user_data ); void check_toggle_control( LLUICtrl *, void* user_data ); -void handle_attach_to_avatar(void* user_data); void confirm_replace_attachment(S32 option, void* user_data); void handle_detach_from_avatar(void* user_data); void attach_label(LLString& label, void* user_data); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9d4367cc79..aebcfdb9ce 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2699,13 +2699,13 @@ BOOL LLViewerWindow::handlePerFrameHover() gChatBar->startChat(NULL); } - // cleanup unused selections - if (gParcelMgr) + // cleanup unused selections when no modal dialogs are open + if (gParcelMgr && LLModalDialog::activeCount() == 0) { gParcelMgr->deselectUnused(); } - if (gSelectMgr) + if (gSelectMgr && LLModalDialog::activeCount() == 0) { gSelectMgr->deselectUnused(); } |