diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/lltoolselect.cpp | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/lltoolselect.cpp')
-rw-r--r-- | linden/indra/newview/lltoolselect.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/linden/indra/newview/lltoolselect.cpp b/linden/indra/newview/lltoolselect.cpp index 4371cbe..d4a8153 100644 --- a/linden/indra/newview/lltoolselect.cpp +++ b/linden/indra/newview/lltoolselect.cpp | |||
@@ -51,7 +51,6 @@ | |||
51 | #include "llworld.h" | 51 | #include "llworld.h" |
52 | 52 | ||
53 | // Globals | 53 | // Globals |
54 | LLToolSelect *gToolSelect = NULL; | ||
55 | extern BOOL gAllowSelectAvatar; | 54 | extern BOOL gAllowSelectAvatar; |
56 | 55 | ||
57 | const F32 SELECTION_ROTATION_TRESHOLD = 0.1f; | 56 | const F32 SELECTION_ROTATION_TRESHOLD = 0.1f; |
@@ -106,7 +105,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje | |||
106 | { | 105 | { |
107 | gSavedSettings.setBOOL("SelectOwnedOnly", FALSE); | 106 | gSavedSettings.setBOOL("SelectOwnedOnly", FALSE); |
108 | gSavedSettings.setBOOL("SelectMovableOnly", FALSE); | 107 | gSavedSettings.setBOOL("SelectMovableOnly", FALSE); |
109 | gSelectMgr->setForceSelection(TRUE); | 108 | LLSelectMgr::getInstance()->setForceSelection(TRUE); |
110 | } | 109 | } |
111 | 110 | ||
112 | BOOL extend_select = (mask == MASK_SHIFT) || (mask == MASK_CONTROL); | 111 | BOOL extend_select = (mask == MASK_SHIFT) || (mask == MASK_CONTROL); |
@@ -120,7 +119,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje | |||
120 | } | 119 | } |
121 | else if (!extend_select) | 120 | else if (!extend_select) |
122 | { | 121 | { |
123 | gSelectMgr->deselectAll(); | 122 | LLSelectMgr::getInstance()->deselectAll(); |
124 | } | 123 | } |
125 | } | 124 | } |
126 | else | 125 | else |
@@ -133,22 +132,22 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje | |||
133 | { | 132 | { |
134 | if ( ignore_group ) | 133 | if ( ignore_group ) |
135 | { | 134 | { |
136 | gSelectMgr->deselectObjectOnly(object); | 135 | LLSelectMgr::getInstance()->deselectObjectOnly(object); |
137 | } | 136 | } |
138 | else | 137 | else |
139 | { | 138 | { |
140 | gSelectMgr->deselectObjectAndFamily(object, TRUE, TRUE); | 139 | LLSelectMgr::getInstance()->deselectObjectAndFamily(object, TRUE, TRUE); |
141 | } | 140 | } |
142 | } | 141 | } |
143 | else | 142 | else |
144 | { | 143 | { |
145 | if ( ignore_group ) | 144 | if ( ignore_group ) |
146 | { | 145 | { |
147 | gSelectMgr->selectObjectOnly(object, SELECT_ALL_TES); | 146 | LLSelectMgr::getInstance()->selectObjectOnly(object, SELECT_ALL_TES); |
148 | } | 147 | } |
149 | else | 148 | else |
150 | { | 149 | { |
151 | gSelectMgr->selectObjectAndFamily(object); | 150 | LLSelectMgr::getInstance()->selectObjectAndFamily(object); |
152 | } | 151 | } |
153 | } | 152 | } |
154 | } | 153 | } |
@@ -157,27 +156,27 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje | |||
157 | // Save the current zoom values because deselect resets them. | 156 | // Save the current zoom values because deselect resets them. |
158 | F32 target_zoom; | 157 | F32 target_zoom; |
159 | F32 current_zoom; | 158 | F32 current_zoom; |
160 | gSelectMgr->getAgentHUDZoom(target_zoom, current_zoom); | 159 | LLSelectMgr::getInstance()->getAgentHUDZoom(target_zoom, current_zoom); |
161 | 160 | ||
162 | // JC - Change behavior to make it easier to select children | 161 | // JC - Change behavior to make it easier to select children |
163 | // of linked sets. 9/3/2002 | 162 | // of linked sets. 9/3/2002 |
164 | if( !already_selected || ignore_group) | 163 | if( !already_selected || ignore_group) |
165 | { | 164 | { |
166 | // ...lose current selection in favor of just this object | 165 | // ...lose current selection in favor of just this object |
167 | gSelectMgr->deselectAll(); | 166 | LLSelectMgr::getInstance()->deselectAll(); |
168 | } | 167 | } |
169 | 168 | ||
170 | if ( ignore_group ) | 169 | if ( ignore_group ) |
171 | { | 170 | { |
172 | gSelectMgr->selectObjectOnly(object, SELECT_ALL_TES); | 171 | LLSelectMgr::getInstance()->selectObjectOnly(object, SELECT_ALL_TES); |
173 | } | 172 | } |
174 | else | 173 | else |
175 | { | 174 | { |
176 | gSelectMgr->selectObjectAndFamily(object); | 175 | LLSelectMgr::getInstance()->selectObjectAndFamily(object); |
177 | } | 176 | } |
178 | 177 | ||
179 | // restore the zoom to the previously stored values. | 178 | // restore the zoom to the previously stored values. |
180 | gSelectMgr->setAgentHUDZoom(target_zoom, current_zoom); | 179 | LLSelectMgr::getInstance()->setAgentHUDZoom(target_zoom, current_zoom); |
181 | } | 180 | } |
182 | 181 | ||
183 | if (!gAgent.getFocusOnAvatar() && // if camera not glued to avatar | 182 | if (!gAgent.getFocusOnAvatar() && // if camera not glued to avatar |
@@ -185,7 +184,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje | |||
185 | object != gAgent.getAvatarObject()) // and it's not you | 184 | object != gAgent.getAvatarObject()) // and it's not you |
186 | { | 185 | { |
187 | // have avatar turn to face the selected object(s) | 186 | // have avatar turn to face the selected object(s) |
188 | LLVector3d selection_center = gSelectMgr->getSelectionCenterGlobal(); | 187 | LLVector3d selection_center = LLSelectMgr::getInstance()->getSelectionCenterGlobal(); |
189 | selection_center = selection_center - gAgent.getPositionGlobal(); | 188 | selection_center = selection_center - gAgent.getPositionGlobal(); |
190 | LLVector3 selection_dir; | 189 | LLVector3 selection_dir; |
191 | selection_dir.setVec(selection_center); | 190 | selection_dir.setVec(selection_center); |
@@ -204,7 +203,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje | |||
204 | if (!already_selected) | 203 | if (!already_selected) |
205 | { | 204 | { |
206 | LLViewerObject* root_object = (LLViewerObject*)object->getRootEdit(); | 205 | LLViewerObject* root_object = (LLViewerObject*)object->getRootEdit(); |
207 | LLObjectSelectionHandle selection = gSelectMgr->getSelection(); | 206 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); |
208 | 207 | ||
209 | // this is just a temporary selection | 208 | // this is just a temporary selection |
210 | LLSelectNode* select_node = selection->findNode(root_object); | 209 | LLSelectNode* select_node = selection->findNode(root_object); |
@@ -231,10 +230,10 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje | |||
231 | { | 230 | { |
232 | gSavedSettings.setBOOL("SelectOwnedOnly", select_owned); | 231 | gSavedSettings.setBOOL("SelectOwnedOnly", select_owned); |
233 | gSavedSettings.setBOOL("SelectMovableOnly", select_movable); | 232 | gSavedSettings.setBOOL("SelectMovableOnly", select_movable); |
234 | gSelectMgr->setForceSelection(FALSE); | 233 | LLSelectMgr::getInstance()->setForceSelection(FALSE); |
235 | } | 234 | } |
236 | 235 | ||
237 | return gSelectMgr->getSelection(); | 236 | return LLSelectMgr::getInstance()->getSelection(); |
238 | } | 237 | } |
239 | 238 | ||
240 | BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask) | 239 | BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask) |
@@ -268,7 +267,7 @@ void LLToolSelect::onMouseCaptureLost() | |||
268 | { | 267 | { |
269 | // Finish drag | 268 | // Finish drag |
270 | 269 | ||
271 | gSelectMgr->enableSilhouette(TRUE); | 270 | LLSelectMgr::getInstance()->enableSilhouette(TRUE); |
272 | 271 | ||
273 | // Clean up drag-specific variables | 272 | // Clean up drag-specific variables |
274 | mIgnoreGroup = FALSE; | 273 | mIgnoreGroup = FALSE; |