From dbb613a2d88fda507b7e3ac46e938f4258a70ec8 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 2 Jul 2019 16:52:21 +0300 Subject: SL-11456 Allow scaling of HUD attachments --- indra/newview/llselectmgr.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index d2db6f6649..3df6f25917 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6607,8 +6607,7 @@ void LLSelectMgr::updateSelectionCenter() if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && isAgentAvatarValid()) { // reset hud ZOOM - gAgentCamera.mHUDTargetZoom = 1.f; - gAgentCamera.mHUDCurZoom = 1.f; + resetAgentHUDZoom(); } mShowSelection = FALSE; @@ -6981,8 +6980,11 @@ BOOL LLSelectMgr::setForceSelection(BOOL force) void LLSelectMgr::resetAgentHUDZoom() { - gAgentCamera.mHUDTargetZoom = 1.f; - gAgentCamera.mHUDCurZoom = 1.f; + if (gAgentCamera.mHUDTargetZoom != 1) + { + gAgentCamera.mHUDTargetZoom = 1.f; + gAgentCamera.mHUDCurZoom = 1.f; + } } void LLSelectMgr::getAgentHUDZoom(F32 &target_zoom, F32 ¤t_zoom) const -- cgit v1.2.3 From 45ecb9d6afd2e4c12f03dfa55161fdbd00840ea2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 3 Jul 2019 13:01:56 +0300 Subject: SL-11535 Autopilot should store selection for later use --- indra/newview/llselectmgr.cpp | 91 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 11 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 3df6f25917..b726e841f8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -152,6 +152,53 @@ struct LLDeRezInfo // Imports // +//----------------------------------------------------------------------------- +// ~LLSelectionCallbackData() +//----------------------------------------------------------------------------- + +LLSelectionCallbackData::LLSelectionCallbackData() +{ + LLSelectMgr *instance = LLSelectMgr::getInstance(); + LLObjectSelectionHandle selection = instance->getSelection(); + if (!selection->getNumNodes()) + { + return; + } + mSelectedObjects = new LLObjectSelection(); + + for (LLObjectSelection::iterator iter = selection->begin(); + iter != selection->end();) + { + LLObjectSelection::iterator curiter = iter++; + + LLSelectNode *nodep = *curiter; + LLViewerObject* objectp = nodep->getObject(); + + if (!objectp) + { + mSelectedObjects->mSelectType = SELECT_TYPE_WORLD; + } + else + { + LLSelectNode* new_nodep = new LLSelectNode(*nodep); + mSelectedObjects->addNode(new_nodep); + + if (objectp->isHUDAttachment()) + { + mSelectedObjects->mSelectType = SELECT_TYPE_HUD; + } + else if (objectp->isAttachment()) + { + mSelectedObjects->mSelectType = SELECT_TYPE_ATTACHMENT; + } + else + { + mSelectedObjects->mSelectType = SELECT_TYPE_WORLD; + } + } + } +} + // // Functions @@ -4472,9 +4519,19 @@ void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info) void LLSelectMgr::sendAttach(U8 attachment_point, bool replace) { - LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject(); + sendAttach(mSelectedObjects, attachment_point, replace); +} - if (!attach_object || !isAgentAvatarValid() || mSelectedObjects->mSelectType != SELECT_TYPE_WORLD) +void LLSelectMgr::sendAttach(LLObjectSelectionHandle selection_handle, U8 attachment_point, bool replace) +{ + if (selection_handle.isNull()) + { + return; + } + + LLViewerObject* attach_object = selection_handle->getFirstRootObject(); + + if (!attach_object || !isAgentAvatarValid() || selection_handle->mSelectType != SELECT_TYPE_WORLD) { return; } @@ -4492,6 +4549,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point, bool replace) } sendListToRegions( + selection_handle, "ObjectAttach", packAgentIDAndSessionAndAttachment, packObjectIDAndRotation, @@ -4503,6 +4561,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point, bool replace) // After "ObjectAttach" server will unsubscribe us from properties updates // so either deselect objects or resend selection after attach packet reaches server // In case of build_mode LLPanelObjectInventory::refresh() will deal with selection + // Still unsubscribe even in case selection_handle is not current selection deselectAll(); } } @@ -5044,7 +5103,17 @@ void LLSelectMgr::packPermissions(LLSelectNode* node, void *user_data) void LLSelectMgr::sendListToRegions(const std::string& message_name, void (*pack_header)(void *user_data), void (*pack_body)(LLSelectNode* node, void *user_data), - void (*log_func)(LLSelectNode* node, void *user_data), + void (*log_func)(LLSelectNode* node, void *user_data), + void *user_data, + ESendType send_type) +{ + sendListToRegions(mSelectedObjects, message_name, pack_header, pack_body, log_func, user_data, send_type); +} +void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, + const std::string& message_name, + void (*pack_header)(void *user_data), + void (*pack_body)(LLSelectNode* node, void *user_data), + void (*log_func)(LLSelectNode* node, void *user_data), void *user_data, ESendType send_type) { @@ -5070,7 +5139,7 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name, return true; } } func; - getSelection()->applyToNodes(&func); + selected_handle->applyToNodes(&func); std::queue nodes_to_send; @@ -5113,25 +5182,25 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name, { case SEND_ONLY_ROOTS: if(message_name == "ObjectBuy") - getSelection()->applyToRootNodes(&pushroots); + selected_handle->applyToRootNodes(&pushroots); else - getSelection()->applyToRootNodes(&pushall); + selected_handle->applyToRootNodes(&pushall); break; case SEND_INDIVIDUALS: - getSelection()->applyToNodes(&pushall); + selected_handle->applyToNodes(&pushall); break; case SEND_ROOTS_FIRST: // first roots... - getSelection()->applyToNodes(&pushroots); + selected_handle->applyToNodes(&pushroots); // then children... - getSelection()->applyToNodes(&pushnonroots); + selected_handle->applyToNodes(&pushnonroots); break; case SEND_CHILDREN_FIRST: // first children... - getSelection()->applyToNodes(&pushnonroots); + selected_handle->applyToNodes(&pushnonroots); // then roots... - getSelection()->applyToNodes(&pushroots); + selected_handle->applyToNodes(&pushroots); break; default: -- cgit v1.2.3 From 87be5f79975d0a3a5d6b7665aafc4be68b4f4afc Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 24 Jul 2019 16:58:24 +0300 Subject: SL-4150 Rename htonmemcpy --- indra/newview/llselectmgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index b726e841f8..4c268ae273 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4163,20 +4163,20 @@ void LLSelectMgr::packMultipleUpdate(LLSelectNode* node, void *user_data) if (type & UPD_POSITION) { - htonmemcpy(&data[offset], &(object->getPosition().mV), MVT_LLVector3, 12); + htolememcpy(&data[offset], &(object->getPosition().mV), MVT_LLVector3, 12); offset += 12; } if (type & UPD_ROTATION) { LLQuaternion quat = object->getRotation(); LLVector3 vec = quat.packToVector3(); - htonmemcpy(&data[offset], &(vec.mV), MVT_LLQuaternion, 12); + htolememcpy(&data[offset], &(vec.mV), MVT_LLQuaternion, 12); offset += 12; } if (type & UPD_SCALE) { //LL_INFOS() << "Sending object scale " << object->getScale() << LL_ENDL; - htonmemcpy(&data[offset], &(object->getScale().mV), MVT_LLVector3, 12); + htolememcpy(&data[offset], &(object->getScale().mV), MVT_LLVector3, 12); offset += 12; } gMessageSystem->addBinaryDataFast(_PREHASH_Data, data, offset); -- cgit v1.2.3