summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-09-27 19:54:10 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-09-27 19:54:10 +0100
commita84ee929a5221aec07bcc93815ca6c57bb8ab6bb (patch)
treeecf9694b9e772161b67c8b0935362b0e05cc7c7d /indra/newview/llviewerwindow.cpp
parent4d4255c27b45ed5e32fe7c4870e2ce3ed10cb140 (diff)
parent58aef8beaf79dc83546a7b080014ca5030733ac8 (diff)
merge
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index d7f98847a4..e53ccd7b8d 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3835,37 +3835,22 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
{
if( !LLSelectMgr::getInstance()->getSelection()->isEmpty() )
{
- BOOL moveable_object_selected = FALSE;
- BOOL all_selected_objects_move = TRUE;
- BOOL all_selected_objects_modify = TRUE;
- BOOL selecting_linked_set = !gSavedSettings.getBOOL("EditLinkedParts");
-
- for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin();
- iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++)
- {
- LLSelectNode* nodep = *iter;
- LLViewerObject* object = nodep->getObject();
- LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit();
- BOOL this_object_movable = FALSE;
- if (object->permMove() && !object->isPermanentEnforced() &&
- ((root_object == NULL) || !root_object->isPermanentEnforced()) &&
- (object->permModify() || selecting_linked_set))
- {
- moveable_object_selected = TRUE;
- this_object_movable = TRUE;
- }
- all_selected_objects_move = all_selected_objects_move && this_object_movable;
- all_selected_objects_modify = all_selected_objects_modify && object->permModify();
- }
+ bool all_selected_objects_move;
+ bool all_selected_objects_modify;
+ // Note: This might be costly to do on each frame and when a lot of objects are selected
+ // we might be better off with some kind of memory for selection and/or states, consider
+ // optimizing, perhaps even some kind of selection generation at level of LLSelectMgr to
+ // make whole viewer benefit.
+ LLSelectMgr::getInstance()->selectGetEditMoveLinksetPermissions(all_selected_objects_move, all_selected_objects_modify);
BOOL draw_handles = TRUE;
- if (tool == LLToolCompTranslate::getInstance() && (!moveable_object_selected || !all_selected_objects_move))
+ if (tool == LLToolCompTranslate::getInstance() && !all_selected_objects_move)
{
draw_handles = FALSE;
}
- if (tool == LLToolCompRotate::getInstance() && (!moveable_object_selected || !all_selected_objects_move))
+ if (tool == LLToolCompRotate::getInstance() && !all_selected_objects_move)
{
draw_handles = FALSE;
}