diff options
Diffstat (limited to 'linden/indra/newview/llselectmgr.cpp')
-rw-r--r-- | linden/indra/newview/llselectmgr.cpp | 217 |
1 files changed, 121 insertions, 96 deletions
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index 75e1fcc..ebfdd39 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp | |||
@@ -96,9 +96,6 @@ const S32 MAX_ACTION_QUEUE_SIZE = 20; | |||
96 | const S32 MAX_SILS_PER_FRAME = 50; | 96 | const S32 MAX_SILS_PER_FRAME = 50; |
97 | const S32 MAX_OBJECTS_PER_PACKET = 254; | 97 | const S32 MAX_OBJECTS_PER_PACKET = 254; |
98 | 98 | ||
99 | extern LLUUID gLastHitObjectID; | ||
100 | extern LLVector3d gLastHitObjectOffset; | ||
101 | |||
102 | // | 99 | // |
103 | // Globals | 100 | // Globals |
104 | // | 101 | // |
@@ -848,9 +845,12 @@ void LLSelectMgr::highlightObjectAndFamily(LLViewerObject* objectp) | |||
848 | 845 | ||
849 | highlightObjectOnly(root_obj); | 846 | highlightObjectOnly(root_obj); |
850 | 847 | ||
851 | for(U32 i = 0; i < root_obj->mChildList.size(); i++) | 848 | LLViewerObject::const_child_list_t& child_list = root_obj->getChildren(); |
849 | for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); | ||
850 | iter != child_list.end(); iter++) | ||
852 | { | 851 | { |
853 | highlightObjectOnly(root_obj->mChildList[i]); | 852 | LLViewerObject* child = *iter; |
853 | highlightObjectOnly(child); | ||
854 | } | 854 | } |
855 | } | 855 | } |
856 | 856 | ||
@@ -875,8 +875,9 @@ void LLSelectMgr::highlightObjectAndFamily(const std::vector<LLViewerObject*>& o | |||
875 | LLViewerObject* root = (LLViewerObject*)object->getRoot(); | 875 | LLViewerObject* root = (LLViewerObject*)object->getRoot(); |
876 | mRectSelectedObjects.insert(root); | 876 | mRectSelectedObjects.insert(root); |
877 | 877 | ||
878 | for (LLViewerObject::child_list_t::const_iterator iter2 = root->mChildList.begin(); | 878 | LLViewerObject::const_child_list_t& child_list = root->getChildren(); |
879 | iter2 != root->mChildList.end(); ++iter2) | 879 | for (LLViewerObject::child_list_t::const_iterator iter2 = child_list.begin(); |
880 | iter2 != child_list.end(); iter2++) | ||
880 | { | 881 | { |
881 | LLViewerObject* child = *iter2; | 882 | LLViewerObject* child = *iter2; |
882 | mRectSelectedObjects.insert(child); | 883 | mRectSelectedObjects.insert(child); |
@@ -905,10 +906,11 @@ void LLSelectMgr::unhighlightObjectAndFamily(LLViewerObject* objectp) | |||
905 | 906 | ||
906 | unhighlightObjectOnly(root_obj); | 907 | unhighlightObjectOnly(root_obj); |
907 | 908 | ||
908 | for (LLViewerObject::child_list_t::iterator iter2 = root_obj->mChildList.begin(); | 909 | LLViewerObject::const_child_list_t& child_list = root_obj->getChildren(); |
909 | iter2 != root_obj->mChildList.end(); ++iter2) | 910 | for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); |
911 | iter != child_list.end(); iter++) | ||
910 | { | 912 | { |
911 | LLViewerObject* child = *iter2; | 913 | LLViewerObject* child = *iter; |
912 | unhighlightObjectOnly(child); | 914 | unhighlightObjectOnly(child); |
913 | } | 915 | } |
914 | } | 916 | } |
@@ -1008,10 +1010,11 @@ void LLSelectMgr::addGridObject(LLViewerObject* objectp) | |||
1008 | LLSelectNode* nodep = new LLSelectNode(objectp, FALSE); | 1010 | LLSelectNode* nodep = new LLSelectNode(objectp, FALSE); |
1009 | mGridObjects.addNodeAtEnd(nodep); | 1011 | mGridObjects.addNodeAtEnd(nodep); |
1010 | 1012 | ||
1011 | for (LLViewerObject::child_list_t::iterator iter2 = objectp->mChildList.begin(); | 1013 | LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); |
1012 | iter2 != objectp->mChildList.end(); ++iter2) | 1014 | for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); |
1015 | iter != child_list.end(); iter++) | ||
1013 | { | 1016 | { |
1014 | LLViewerObject* child = *iter2; | 1017 | LLViewerObject* child = *iter; |
1015 | nodep = new LLSelectNode(child, FALSE); | 1018 | nodep = new LLSelectNode(child, FALSE); |
1016 | mGridObjects.addNodeAtEnd(nodep); | 1019 | mGridObjects.addNodeAtEnd(nodep); |
1017 | } | 1020 | } |
@@ -1955,12 +1958,13 @@ void LLSelectMgr::selectionSetClickAction(U8 action) | |||
1955 | // godlike requests | 1958 | // godlike requests |
1956 | //----------------------------------------------------------------------------- | 1959 | //----------------------------------------------------------------------------- |
1957 | 1960 | ||
1958 | typedef std::pair<const LLString, const LLString> godlike_request_t; | 1961 | typedef std::pair<const std::string, const std::string> godlike_request_t; |
1959 | void LLSelectMgr::sendGodlikeRequest(const LLString& request, const LLString& param) | 1962 | |
1963 | void LLSelectMgr::sendGodlikeRequest(const std::string& request, const std::string& param) | ||
1960 | { | 1964 | { |
1961 | // If the agent is neither godlike nor an estate owner, the server | 1965 | // If the agent is neither godlike nor an estate owner, the server |
1962 | // will reject the request. | 1966 | // will reject the request. |
1963 | LLString message_type; | 1967 | std::string message_type; |
1964 | if (gAgent.isGodlike()) | 1968 | if (gAgent.isGodlike()) |
1965 | { | 1969 | { |
1966 | message_type = "GodlikeMessage"; | 1970 | message_type = "GodlikeMessage"; |
@@ -1993,7 +1997,7 @@ void LLSelectMgr::packGodlikeHead(void* user_data) | |||
1993 | msg->addUUID("TransactionID", LLUUID::null); | 1997 | msg->addUUID("TransactionID", LLUUID::null); |
1994 | godlike_request_t* data = (godlike_request_t*)user_data; | 1998 | godlike_request_t* data = (godlike_request_t*)user_data; |
1995 | msg->nextBlock("MethodData"); | 1999 | msg->nextBlock("MethodData"); |
1996 | msg->addString("Method", data->first.c_str()); | 2000 | msg->addString("Method", data->first); |
1997 | msg->addUUID("Invoice", LLUUID::null); | 2001 | msg->addUUID("Invoice", LLUUID::null); |
1998 | 2002 | ||
1999 | // The parameters used to be restricted to either string or | 2003 | // The parameters used to be restricted to either string or |
@@ -2011,8 +2015,7 @@ void LLSelectMgr::packGodlikeHead(void* user_data) | |||
2011 | // static | 2015 | // static |
2012 | void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *) | 2016 | void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *) |
2013 | { | 2017 | { |
2014 | char buf [MAX_STRING]; /* Flawfinder: ignore */ | 2018 | std::string buf = llformat("%u", node->getObject()->getLocalID()); |
2015 | snprintf(buf, MAX_STRING, "%u", node->getObject()->getLocalID()); /* Flawfinder: ignore */ | ||
2016 | gMessageSystem->nextBlock("ParamList"); | 2019 | gMessageSystem->nextBlock("ParamList"); |
2017 | gMessageSystem->addString("Parameter", buf); | 2020 | gMessageSystem->addString("Parameter", buf); |
2018 | } | 2021 | } |
@@ -2304,7 +2307,7 @@ BOOL LLSelectMgr::selectGetRootsCopy() | |||
2304 | // selectGetCreator() | 2307 | // selectGetCreator() |
2305 | // Creator information only applies to root objects. | 2308 | // Creator information only applies to root objects. |
2306 | //----------------------------------------------------------------------------- | 2309 | //----------------------------------------------------------------------------- |
2307 | BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, LLString& name) | 2310 | BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) |
2308 | { | 2311 | { |
2309 | BOOL identical = TRUE; | 2312 | BOOL identical = TRUE; |
2310 | BOOL first = TRUE; | 2313 | BOOL first = TRUE; |
@@ -2356,7 +2359,7 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, LLString& name) | |||
2356 | // selectGetOwner() | 2359 | // selectGetOwner() |
2357 | // Owner information only applies to roots. | 2360 | // Owner information only applies to roots. |
2358 | //----------------------------------------------------------------------------- | 2361 | //----------------------------------------------------------------------------- |
2359 | BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, LLString& name) | 2362 | BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name) |
2360 | { | 2363 | { |
2361 | BOOL identical = TRUE; | 2364 | BOOL identical = TRUE; |
2362 | BOOL first = TRUE; | 2365 | BOOL first = TRUE; |
@@ -2424,7 +2427,7 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, LLString& name) | |||
2424 | // selectGetLastOwner() | 2427 | // selectGetLastOwner() |
2425 | // Owner information only applies to roots. | 2428 | // Owner information only applies to roots. |
2426 | //----------------------------------------------------------------------------- | 2429 | //----------------------------------------------------------------------------- |
2427 | BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, LLString& name) | 2430 | BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name) |
2428 | { | 2431 | { |
2429 | BOOL identical = TRUE; | 2432 | BOOL identical = TRUE; |
2430 | BOOL first = TRUE; | 2433 | BOOL first = TRUE; |
@@ -2825,27 +2828,53 @@ void LLSelectMgr::selectForceDelete() | |||
2825 | SEND_ONLY_ROOTS); | 2828 | SEND_ONLY_ROOTS); |
2826 | } | 2829 | } |
2827 | 2830 | ||
2828 | 2831 | void LLSelectMgr::selectGetAggregateSaleInfo(U32 &num_for_sale, | |
2829 | // returns TRUE if anything is for sale. calculates the total price | 2832 | BOOL &is_for_sale_mixed, |
2830 | // and stores that value in price. | 2833 | BOOL &is_sale_price_mixed, |
2831 | BOOL LLSelectMgr::selectIsForSale(S32& price) | 2834 | S32 &total_sale_price, |
2835 | S32 &individual_sale_price) | ||
2832 | { | 2836 | { |
2833 | BOOL any_for_sale = FALSE; | 2837 | num_for_sale = 0; |
2834 | price = 0; | 2838 | is_for_sale_mixed = FALSE; |
2839 | is_sale_price_mixed = FALSE; | ||
2840 | total_sale_price = 0; | ||
2841 | individual_sale_price = 0; | ||
2842 | |||
2835 | 2843 | ||
2844 | // Empty set. | ||
2845 | if (getSelection()->root_begin() == getSelection()->root_end()) | ||
2846 | return; | ||
2847 | |||
2848 | LLSelectNode *node = *(getSelection()->root_begin()); | ||
2849 | const BOOL first_node_for_sale = node->mSaleInfo.isForSale(); | ||
2850 | const S32 first_node_sale_price = node->mSaleInfo.getSalePrice(); | ||
2851 | |||
2836 | for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); | 2852 | for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); |
2837 | iter != getSelection()->root_end(); iter++) | 2853 | iter != getSelection()->root_end(); iter++) |
2838 | { | 2854 | { |
2839 | LLSelectNode* node = *iter; | 2855 | LLSelectNode* node = *iter; |
2840 | if (node->mSaleInfo.isForSale()) | 2856 | const BOOL node_for_sale = node->mSaleInfo.isForSale(); |
2857 | const S32 node_sale_price = node->mSaleInfo.getSalePrice(); | ||
2858 | |||
2859 | // Set mixed if the fields don't match the first node's fields. | ||
2860 | if (node_for_sale != first_node_for_sale) | ||
2861 | is_for_sale_mixed = TRUE; | ||
2862 | if (node_sale_price != first_node_sale_price) | ||
2863 | is_sale_price_mixed = TRUE; | ||
2864 | |||
2865 | if (node_for_sale) | ||
2841 | { | 2866 | { |
2842 | price += node->mSaleInfo.getSalePrice(); | 2867 | total_sale_price += node_sale_price; |
2843 | any_for_sale = TRUE; | 2868 | num_for_sale ++; |
2844 | } | 2869 | } |
2845 | } | 2870 | } |
2846 | 2871 | ||
2847 | return any_for_sale; | 2872 | individual_sale_price = first_node_sale_price; |
2848 | 2873 | if (is_for_sale_mixed) | |
2874 | { | ||
2875 | is_sale_price_mixed = TRUE; | ||
2876 | individual_sale_price = 0; | ||
2877 | } | ||
2849 | } | 2878 | } |
2850 | 2879 | ||
2851 | // returns TRUE if all nodes are valid. method also stores an | 2880 | // returns TRUE if all nodes are valid. method also stores an |
@@ -3445,7 +3474,7 @@ void LLSelectMgr::deselectAllIfTooFar() | |||
3445 | } | 3474 | } |
3446 | 3475 | ||
3447 | 3476 | ||
3448 | void LLSelectMgr::selectionSetObjectName(const LLString& name) | 3477 | void LLSelectMgr::selectionSetObjectName(const std::string& name) |
3449 | { | 3478 | { |
3450 | // we only work correctly if 1 object is selected. | 3479 | // we only work correctly if 1 object is selected. |
3451 | if(mSelectedObjects->getRootObjectCount() == 1) | 3480 | if(mSelectedObjects->getRootObjectCount() == 1) |
@@ -3453,7 +3482,7 @@ void LLSelectMgr::selectionSetObjectName(const LLString& name) | |||
3453 | sendListToRegions("ObjectName", | 3482 | sendListToRegions("ObjectName", |
3454 | packAgentAndSessionID, | 3483 | packAgentAndSessionID, |
3455 | packObjectName, | 3484 | packObjectName, |
3456 | (void*)name.c_str(), | 3485 | (void*)(new std::string(name)), |
3457 | SEND_ONLY_ROOTS); | 3486 | SEND_ONLY_ROOTS); |
3458 | } | 3487 | } |
3459 | else if(mSelectedObjects->getObjectCount() == 1) | 3488 | else if(mSelectedObjects->getObjectCount() == 1) |
@@ -3461,12 +3490,12 @@ void LLSelectMgr::selectionSetObjectName(const LLString& name) | |||
3461 | sendListToRegions("ObjectName", | 3490 | sendListToRegions("ObjectName", |
3462 | packAgentAndSessionID, | 3491 | packAgentAndSessionID, |
3463 | packObjectName, | 3492 | packObjectName, |
3464 | (void*)name.c_str(), | 3493 | (void*)(new std::string(name)), |
3465 | SEND_INDIVIDUALS); | 3494 | SEND_INDIVIDUALS); |
3466 | } | 3495 | } |
3467 | } | 3496 | } |
3468 | 3497 | ||
3469 | void LLSelectMgr::selectionSetObjectDescription(const LLString& desc) | 3498 | void LLSelectMgr::selectionSetObjectDescription(const std::string& desc) |
3470 | { | 3499 | { |
3471 | // we only work correctly if 1 object is selected. | 3500 | // we only work correctly if 1 object is selected. |
3472 | if(mSelectedObjects->getRootObjectCount() == 1) | 3501 | if(mSelectedObjects->getRootObjectCount() == 1) |
@@ -3474,7 +3503,7 @@ void LLSelectMgr::selectionSetObjectDescription(const LLString& desc) | |||
3474 | sendListToRegions("ObjectDescription", | 3503 | sendListToRegions("ObjectDescription", |
3475 | packAgentAndSessionID, | 3504 | packAgentAndSessionID, |
3476 | packObjectDescription, | 3505 | packObjectDescription, |
3477 | (void*)desc.c_str(), | 3506 | (void*)(new std::string(desc)), |
3478 | SEND_ONLY_ROOTS); | 3507 | SEND_ONLY_ROOTS); |
3479 | } | 3508 | } |
3480 | else if(mSelectedObjects->getObjectCount() == 1) | 3509 | else if(mSelectedObjects->getObjectCount() == 1) |
@@ -3482,7 +3511,7 @@ void LLSelectMgr::selectionSetObjectDescription(const LLString& desc) | |||
3482 | sendListToRegions("ObjectDescription", | 3511 | sendListToRegions("ObjectDescription", |
3483 | packAgentAndSessionID, | 3512 | packAgentAndSessionID, |
3484 | packObjectDescription, | 3513 | packObjectDescription, |
3485 | (void*)desc.c_str(), | 3514 | (void*)(new std::string(desc)), |
3486 | SEND_INDIVIDUALS); | 3515 | SEND_INDIVIDUALS); |
3487 | } | 3516 | } |
3488 | } | 3517 | } |
@@ -3501,8 +3530,6 @@ void LLSelectMgr::selectionSetObjectCategory(const LLCategory& category) | |||
3501 | 3530 | ||
3502 | void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info) | 3531 | void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info) |
3503 | { | 3532 | { |
3504 | // Only one sale info at a time for now | ||
3505 | if(mSelectedObjects->getRootObjectCount() != 1) return; | ||
3506 | sendListToRegions("ObjectSaleInfo", | 3533 | sendListToRegions("ObjectSaleInfo", |
3507 | packAgentAndSessionID, | 3534 | packAgentAndSessionID, |
3508 | packObjectSaleInfo, | 3535 | packObjectSaleInfo, |
@@ -3969,22 +3996,26 @@ void LLSelectMgr::packObjectLocalID(LLSelectNode* node, void *) | |||
3969 | // static | 3996 | // static |
3970 | void LLSelectMgr::packObjectName(LLSelectNode* node, void* user_data) | 3997 | void LLSelectMgr::packObjectName(LLSelectNode* node, void* user_data) |
3971 | { | 3998 | { |
3972 | char* name = (char*)user_data; | 3999 | const std::string* name = (const std::string*)user_data; |
3973 | if(!name) return; | 4000 | if(!name->empty()) |
3974 | gMessageSystem->nextBlockFast(_PREHASH_ObjectData); | 4001 | { |
3975 | gMessageSystem->addU32Fast(_PREHASH_LocalID, node->getObject()->getLocalID()); | 4002 | gMessageSystem->nextBlockFast(_PREHASH_ObjectData); |
3976 | gMessageSystem->addStringFast(_PREHASH_Name, name); | 4003 | gMessageSystem->addU32Fast(_PREHASH_LocalID, node->getObject()->getLocalID()); |
4004 | gMessageSystem->addStringFast(_PREHASH_Name, *name); | ||
4005 | } | ||
4006 | delete name; | ||
3977 | } | 4007 | } |
3978 | 4008 | ||
3979 | // static | 4009 | // static |
3980 | void LLSelectMgr::packObjectDescription(LLSelectNode* node, | 4010 | void LLSelectMgr::packObjectDescription(LLSelectNode* node, void* user_data) |
3981 | void* user_data) | ||
3982 | { | 4011 | { |
3983 | char* desc = (char*)user_data; | 4012 | const std::string* desc = (const std::string*)user_data; |
3984 | if(!desc) return; | 4013 | if(!desc->empty()) |
3985 | gMessageSystem->nextBlockFast(_PREHASH_ObjectData); | 4014 | { |
3986 | gMessageSystem->addU32Fast(_PREHASH_LocalID, node->getObject()->getLocalID()); | 4015 | gMessageSystem->nextBlockFast(_PREHASH_ObjectData); |
3987 | gMessageSystem->addStringFast(_PREHASH_Description, desc); | 4016 | gMessageSystem->addU32Fast(_PREHASH_LocalID, node->getObject()->getLocalID()); |
4017 | gMessageSystem->addStringFast(_PREHASH_Description, *desc); | ||
4018 | } | ||
3988 | } | 4019 | } |
3989 | 4020 | ||
3990 | // static | 4021 | // static |
@@ -4033,7 +4064,7 @@ void LLSelectMgr::packPermissions(LLSelectNode* node, void *user_data) | |||
4033 | // Utility function to send some information to every region containing | 4064 | // Utility function to send some information to every region containing |
4034 | // an object on the selection list. We want to do this to reduce the total | 4065 | // an object on the selection list. We want to do this to reduce the total |
4035 | // number of packets sent by the viewer. | 4066 | // number of packets sent by the viewer. |
4036 | void LLSelectMgr::sendListToRegions(const LLString& message_name, | 4067 | void LLSelectMgr::sendListToRegions(const std::string& message_name, |
4037 | void (*pack_header)(void *user_data), | 4068 | void (*pack_header)(void *user_data), |
4038 | void (*pack_body)(LLSelectNode* node, void *user_data), | 4069 | void (*pack_body)(LLSelectNode* node, void *user_data), |
4039 | void *user_data, | 4070 | void *user_data, |
@@ -4273,15 +4304,15 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data | |||
4273 | 4304 | ||
4274 | msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id, i); | 4305 | msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id, i); |
4275 | 4306 | ||
4276 | char name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 4307 | std::string name; |
4277 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name, i); | 4308 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, name, i); |
4278 | char desc[DB_INV_ITEM_DESC_BUF_SIZE]; /* Flawfinder: ignore */ | 4309 | std::string desc; |
4279 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc, i); | 4310 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, desc, i); |
4280 | 4311 | ||
4281 | char touch_name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 4312 | std::string touch_name; |
4282 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_TouchName, DB_INV_ITEM_NAME_BUF_SIZE, touch_name, i); | 4313 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_TouchName, touch_name, i); |
4283 | char sit_name[DB_INV_ITEM_DESC_BUF_SIZE]; /* Flawfinder: ignore */ | 4314 | std::string sit_name; |
4284 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_SitName, DB_INV_ITEM_DESC_BUF_SIZE, sit_name, i); | 4315 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_SitName, sit_name, i); |
4285 | 4316 | ||
4286 | //unpack TE IDs | 4317 | //unpack TE IDs |
4287 | std::vector<LLUUID> texture_ids; | 4318 | std::vector<LLUUID> texture_ids; |
@@ -4424,11 +4455,11 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use | |||
4424 | msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id ); | 4455 | msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id ); |
4425 | 4456 | ||
4426 | // unpack name & desc | 4457 | // unpack name & desc |
4427 | char name[DB_INV_ITEM_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 4458 | std::string name; |
4428 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, DB_INV_ITEM_NAME_BUF_SIZE, name); | 4459 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, name); |
4429 | 4460 | ||
4430 | char desc[DB_INV_ITEM_DESC_BUF_SIZE]; /* Flawfinder: ignore */ | 4461 | std::string desc; |
4431 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, DB_INV_ITEM_DESC_BUF_SIZE, desc); | 4462 | msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, desc); |
4432 | 4463 | ||
4433 | // the reporter widget askes the server for info about picked objects | 4464 | // the reporter widget askes the server for info about picked objects |
4434 | if (request_flags & (COMPLAINT_REPORT_REQUEST | BUG_REPORT_REQUEST)) | 4465 | if (request_flags & (COMPLAINT_REPORT_REQUEST | BUG_REPORT_REQUEST)) |
@@ -4694,8 +4725,9 @@ void LLSelectMgr::updateSilhouettes() | |||
4694 | } | 4725 | } |
4695 | else | 4726 | else |
4696 | { | 4727 | { |
4697 | for (LLViewerObject::child_list_t::iterator iter = objectp->mChildList.begin(); | 4728 | LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); |
4698 | iter != objectp->mChildList.end(); ++iter) | 4729 | for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); |
4730 | iter != child_list.end(); iter++) | ||
4699 | { | 4731 | { |
4700 | LLViewerObject* child_objectp = *iter; | 4732 | LLViewerObject* child_objectp = *iter; |
4701 | 4733 | ||
@@ -4805,7 +4837,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) | |||
4805 | { | 4837 | { |
4806 | LLBBox hud_bbox = avatar->getHUDBBox(); | 4838 | LLBBox hud_bbox = avatar->getHUDBBox(); |
4807 | 4839 | ||
4808 | F32 cur_zoom = avatar->mHUDCurZoom; | 4840 | F32 cur_zoom = gAgent.mHUDCurZoom; |
4809 | 4841 | ||
4810 | // set up transform to encompass bounding box of HUD | 4842 | // set up transform to encompass bounding box of HUD |
4811 | glMatrixMode(GL_PROJECTION); | 4843 | glMatrixMode(GL_PROJECTION); |
@@ -4928,10 +4960,10 @@ LLSelectNode::LLSelectNode(LLViewerObject* object, BOOL glow) | |||
4928 | mValid = FALSE; | 4960 | mValid = FALSE; |
4929 | mPermissions = new LLPermissions(); | 4961 | mPermissions = new LLPermissions(); |
4930 | mInventorySerial = 0; | 4962 | mInventorySerial = 0; |
4931 | mName = LLString::null; | 4963 | mName = LLStringUtil::null; |
4932 | mDescription = LLString::null; | 4964 | mDescription = LLStringUtil::null; |
4933 | mTouchName = LLString::null; | 4965 | mTouchName = LLStringUtil::null; |
4934 | mSitName = LLString::null; | 4966 | mSitName = LLStringUtil::null; |
4935 | mSilhouetteExists = FALSE; | 4967 | mSilhouetteExists = FALSE; |
4936 | mDuplicated = FALSE; | 4968 | mDuplicated = FALSE; |
4937 | 4969 | ||
@@ -5252,7 +5284,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) | |||
5252 | F32 silhouette_thickness; | 5284 | F32 silhouette_thickness; |
5253 | if (is_hud_object && gAgent.getAvatarObject()) | 5285 | if (is_hud_object && gAgent.getAvatarObject()) |
5254 | { | 5286 | { |
5255 | silhouette_thickness = LLSelectMgr::sHighlightThickness / gAgent.getAvatarObject()->mHUDCurZoom; | 5287 | silhouette_thickness = LLSelectMgr::sHighlightThickness / gAgent.mHUDCurZoom; |
5256 | } | 5288 | } |
5257 | else | 5289 | else |
5258 | { | 5290 | { |
@@ -5387,8 +5419,9 @@ S32 get_family_count(LLViewerObject *parent) | |||
5387 | llwarns << "Trying to get_family_count on null parent!" << llendl; | 5419 | llwarns << "Trying to get_family_count on null parent!" << llendl; |
5388 | } | 5420 | } |
5389 | S32 count = 1; // for this object | 5421 | S32 count = 1; // for this object |
5390 | for (LLViewerObject::child_list_t::iterator iter = parent->mChildList.begin(); | 5422 | LLViewerObject::const_child_list_t& child_list = parent->getChildren(); |
5391 | iter != parent->mChildList.end(); ++iter) | 5423 | for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); |
5424 | iter != child_list.end(); iter++) | ||
5392 | { | 5425 | { |
5393 | LLViewerObject* child = *iter; | 5426 | LLViewerObject* child = *iter; |
5394 | 5427 | ||
@@ -5451,8 +5484,8 @@ void LLSelectMgr::updateSelectionCenter() | |||
5451 | if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && gAgent.getAvatarObject()) | 5484 | if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && gAgent.getAvatarObject()) |
5452 | { | 5485 | { |
5453 | // reset hud ZOOM | 5486 | // reset hud ZOOM |
5454 | gAgent.getAvatarObject()->mHUDTargetZoom = 1.f; | 5487 | gAgent.mHUDTargetZoom = 1.f; |
5455 | gAgent.getAvatarObject()->mHUDCurZoom = 1.f; | 5488 | gAgent.mHUDCurZoom = 1.f; |
5456 | } | 5489 | } |
5457 | 5490 | ||
5458 | mShowSelection = FALSE; | 5491 | mShowSelection = FALSE; |
@@ -5536,11 +5569,12 @@ void LLSelectMgr::updatePointAt() | |||
5536 | if (mSelectedObjects->getObjectCount()) | 5569 | if (mSelectedObjects->getObjectCount()) |
5537 | { | 5570 | { |
5538 | LLVector3 select_offset; | 5571 | LLVector3 select_offset; |
5539 | LLViewerObject *click_object = gObjectList.findObject(gLastHitObjectID); | 5572 | const LLPickInfo& pick = gViewerWindow->getLastPick(); |
5573 | LLViewerObject *click_object = pick.getObject(); | ||
5540 | if (click_object && click_object->isSelected()) | 5574 | if (click_object && click_object->isSelected()) |
5541 | { | 5575 | { |
5542 | // clicked on another object in our selection group, use that as target | 5576 | // clicked on another object in our selection group, use that as target |
5543 | select_offset.setVec(gLastHitObjectOffset); | 5577 | select_offset.setVec(pick.mObjectOffset); |
5544 | select_offset.rotVec(~click_object->getRenderRotation()); | 5578 | select_offset.rotVec(~click_object->getRenderRotation()); |
5545 | 5579 | ||
5546 | gAgent.setPointAt(POINTAT_TARGET_SELECT, click_object, select_offset); | 5580 | gAgent.setPointAt(POINTAT_TARGET_SELECT, click_object, select_offset); |
@@ -5738,29 +5772,20 @@ BOOL LLSelectMgr::setForceSelection(BOOL force) | |||
5738 | 5772 | ||
5739 | void LLSelectMgr::resetAgentHUDZoom() | 5773 | void LLSelectMgr::resetAgentHUDZoom() |
5740 | { | 5774 | { |
5741 | if (gAgent.getAvatarObject()) | 5775 | gAgent.mHUDTargetZoom = 1.f; |
5742 | { | 5776 | gAgent.mHUDCurZoom = 1.f; |
5743 | gAgent.getAvatarObject()->mHUDTargetZoom = 1.f; | ||
5744 | gAgent.getAvatarObject()->mHUDCurZoom = 1.f; | ||
5745 | } | ||
5746 | } | 5777 | } |
5747 | 5778 | ||
5748 | void LLSelectMgr::getAgentHUDZoom(F32 &target_zoom, F32 ¤t_zoom) const | 5779 | void LLSelectMgr::getAgentHUDZoom(F32 &target_zoom, F32 ¤t_zoom) const |
5749 | { | 5780 | { |
5750 | if (gAgent.getAvatarObject()) | 5781 | target_zoom = gAgent.mHUDTargetZoom; |
5751 | { | 5782 | current_zoom = gAgent.mHUDCurZoom; |
5752 | target_zoom = gAgent.getAvatarObject()->mHUDTargetZoom; | ||
5753 | current_zoom = gAgent.getAvatarObject()->mHUDCurZoom; | ||
5754 | } | ||
5755 | } | 5783 | } |
5756 | 5784 | ||
5757 | void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom) | 5785 | void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom) |
5758 | { | 5786 | { |
5759 | if (gAgent.getAvatarObject()) | 5787 | gAgent.mHUDTargetZoom = target_zoom; |
5760 | { | 5788 | gAgent.mHUDCurZoom = current_zoom; |
5761 | gAgent.getAvatarObject()->mHUDTargetZoom = target_zoom; | ||
5762 | gAgent.getAvatarObject()->mHUDCurZoom = current_zoom; | ||
5763 | } | ||
5764 | } | 5789 | } |
5765 | 5790 | ||
5766 | LLObjectSelection::LLObjectSelection() : | 5791 | LLObjectSelection::LLObjectSelection() : |