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/lltooldraganddrop.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 '')
-rw-r--r-- | linden/indra/newview/lltooldraganddrop.cpp | 167 |
1 files changed, 72 insertions, 95 deletions
diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index 9524fd8..67a2153 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp | |||
@@ -64,7 +64,6 @@ | |||
64 | #include "llworld.h" | 64 | #include "llworld.h" |
65 | #include "object_flags.h" | 65 | #include "object_flags.h" |
66 | 66 | ||
67 | LLToolDragAndDrop *gToolDragAndDrop = NULL; | ||
68 | 67 | ||
69 | // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES | 68 | // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES |
70 | // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a | 69 | // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a |
@@ -78,37 +77,6 @@ const char* FOLDER_INCLUDES_ATTACHMENTS_BEING_WORN = | |||
78 | // syntactic sugar | 77 | // syntactic sugar |
79 | #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) | 78 | #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) |
80 | 79 | ||
81 | /* | ||
82 | const LLUUID MULTI_CONTAINER_TEXTURE("b2181ea2-1937-2ee1-78b8-bf05c43536b7"); | ||
83 | LLUUID CONTAINER_TEXTURES[LLAssetType::AT_COUNT]; | ||
84 | |||
85 | const char* CONTAINER_TEXTURE_NAMES[LLAssetType::AT_COUNT] = | ||
86 | { | ||
87 | "container_texture.tga", | ||
88 | "container_sound.tga", | ||
89 | "container_many_things.tga", | ||
90 | "container_landmark.tga", | ||
91 | "container_script.tga", | ||
92 | "container_clothing.tga", | ||
93 | "container_object.tga", | ||
94 | "container_many_things.tga", | ||
95 | "container_many_things.tga", | ||
96 | "container_many_things.tga", | ||
97 | "container_script.tga", | ||
98 | "container_script.tga", | ||
99 | "container_texture.tga", | ||
100 | "container_bodypart.tga", | ||
101 | "container_many_things.tga", | ||
102 | "container_many_things.tga", | ||
103 | "container_many_things.tga", | ||
104 | "container_sound.tga", | ||
105 | "container_texture.tga", | ||
106 | "container_texture.tga", | ||
107 | "container_animation.tga", | ||
108 | "container_gesture.tga" | ||
109 | }; | ||
110 | */ | ||
111 | |||
112 | class LLNoPreferredType : public LLInventoryCollectFunctor | 80 | class LLNoPreferredType : public LLInventoryCollectFunctor |
113 | { | 81 | { |
114 | public: | 82 | public: |
@@ -610,11 +578,7 @@ LLToolDragAndDrop::LLToolDragAndDrop() | |||
610 | mDrop(FALSE), | 578 | mDrop(FALSE), |
611 | mCurItemIndex(0) | 579 | mCurItemIndex(0) |
612 | { | 580 | { |
613 | // setup container texture ids | 581 | |
614 | //for (S32 i = 0; i < LLAssetType::AT_COUNT; i++) | ||
615 | //{ | ||
616 | // CONTAINER_TEXTURES[i].set(gViewerArt.getString(CONTAINER_TEXTURE_NAMES[i])); | ||
617 | //} | ||
618 | } | 582 | } |
619 | 583 | ||
620 | void LLToolDragAndDrop::setDragStart(S32 x, S32 y) | 584 | void LLToolDragAndDrop::setDragStart(S32 x, S32 y) |
@@ -650,7 +614,7 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type, | |||
650 | mObjectID = object_id; | 614 | mObjectID = object_id; |
651 | 615 | ||
652 | setMouseCapture( TRUE ); | 616 | setMouseCapture( TRUE ); |
653 | gToolMgr->setTransientTool( this ); | 617 | LLToolMgr::getInstance()->setTransientTool( this ); |
654 | mCursor = UI_CURSOR_NO; | 618 | mCursor = UI_CURSOR_NO; |
655 | if((mCargoTypes[0] == DAD_CATEGORY) | 619 | if((mCargoTypes[0] == DAD_CATEGORY) |
656 | && ((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY))) | 620 | && ((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY))) |
@@ -719,7 +683,7 @@ void LLToolDragAndDrop::beginMultiDrag( | |||
719 | mSourceID = source_id; | 683 | mSourceID = source_id; |
720 | 684 | ||
721 | setMouseCapture( TRUE ); | 685 | setMouseCapture( TRUE ); |
722 | gToolMgr->setTransientTool( this ); | 686 | LLToolMgr::getInstance()->setTransientTool( this ); |
723 | mCursor = UI_CURSOR_NO; | 687 | mCursor = UI_CURSOR_NO; |
724 | if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) | 688 | if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) |
725 | { | 689 | { |
@@ -766,14 +730,14 @@ void LLToolDragAndDrop::beginMultiDrag( | |||
766 | 730 | ||
767 | void LLToolDragAndDrop::endDrag() | 731 | void LLToolDragAndDrop::endDrag() |
768 | { | 732 | { |
769 | gSelectMgr->unhighlightAll(); | 733 | LLSelectMgr::getInstance()->unhighlightAll(); |
770 | setMouseCapture(FALSE); | 734 | setMouseCapture(FALSE); |
771 | } | 735 | } |
772 | 736 | ||
773 | void LLToolDragAndDrop::onMouseCaptureLost() | 737 | void LLToolDragAndDrop::onMouseCaptureLost() |
774 | { | 738 | { |
775 | // Called whenever the drag ends or if mouse captue is simply lost | 739 | // Called whenever the drag ends or if mouse captue is simply lost |
776 | gToolMgr->clearTransientTool(); | 740 | LLToolMgr::getInstance()->clearTransientTool(); |
777 | mCargoTypes.clear(); | 741 | mCargoTypes.clear(); |
778 | mCargoIDs.clear(); | 742 | mCargoIDs.clear(); |
779 | mSource = SOURCE_AGENT; | 743 | mSource = SOURCE_AGENT; |
@@ -1045,7 +1009,7 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) | |||
1045 | S32 hit_face = -1; | 1009 | S32 hit_face = -1; |
1046 | 1010 | ||
1047 | LLViewerObject* hit_obj = gViewerWindow->lastNonFloraObjectHit(); | 1011 | LLViewerObject* hit_obj = gViewerWindow->lastNonFloraObjectHit(); |
1048 | gSelectMgr->unhighlightAll(); | 1012 | LLSelectMgr::getInstance()->unhighlightAll(); |
1049 | 1013 | ||
1050 | // Treat attachments as part of the avatar they are attached to. | 1014 | // Treat attachments as part of the avatar they are attached to. |
1051 | if (hit_obj) | 1015 | if (hit_obj) |
@@ -1055,9 +1019,9 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) | |||
1055 | LLVOAvatar* avatar = LLVOAvatar::findAvatarFromAttachment( hit_obj ); | 1019 | LLVOAvatar* avatar = LLVOAvatar::findAvatarFromAttachment( hit_obj ); |
1056 | if( !avatar ) | 1020 | if( !avatar ) |
1057 | { | 1021 | { |
1058 | gToolDragAndDrop->mLastAccept = ACCEPT_NO; | 1022 | LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_NO; |
1059 | gToolDragAndDrop->mCursor = UI_CURSOR_NO; | 1023 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO; |
1060 | gViewerWindow->getWindow()->setCursor( gToolDragAndDrop->mCursor ); | 1024 | gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor ); |
1061 | return; | 1025 | return; |
1062 | } | 1026 | } |
1063 | 1027 | ||
@@ -1083,11 +1047,11 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) | |||
1083 | hit_face = gLastHitNonFloraObjectFace; | 1047 | hit_face = gLastHitNonFloraObjectFace; |
1084 | // if any item being dragged will be applied to the object under our cursor | 1048 | // if any item being dragged will be applied to the object under our cursor |
1085 | // highlight that object | 1049 | // highlight that object |
1086 | for (S32 i = 0; i < (S32)gToolDragAndDrop->mCargoIDs.size(); i++) | 1050 | for (S32 i = 0; i < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); i++) |
1087 | { | 1051 | { |
1088 | if (gToolDragAndDrop->mCargoTypes[i] != DAD_OBJECT || (mask & MASK_CONTROL)) | 1052 | if (LLToolDragAndDrop::getInstance()->mCargoTypes[i] != DAD_OBJECT || (mask & MASK_CONTROL)) |
1089 | { | 1053 | { |
1090 | gSelectMgr->highlightObjectAndFamily(hit_obj); | 1054 | LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj); |
1091 | break; | 1055 | break; |
1092 | } | 1056 | } |
1093 | } | 1057 | } |
@@ -1099,78 +1063,78 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) | |||
1099 | hit_face = -1; | 1063 | hit_face = -1; |
1100 | } | 1064 | } |
1101 | 1065 | ||
1102 | gToolDragAndDrop->mLastAccept = ACCEPT_YES_MULTI; | 1066 | LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_YES_MULTI; |
1103 | 1067 | ||
1104 | for (gToolDragAndDrop->mCurItemIndex = 0; gToolDragAndDrop->mCurItemIndex < (S32)gToolDragAndDrop->mCargoIDs.size(); | 1068 | for (LLToolDragAndDrop::getInstance()->mCurItemIndex = 0; LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); |
1105 | gToolDragAndDrop->mCurItemIndex++) | 1069 | LLToolDragAndDrop::getInstance()->mCurItemIndex++) |
1106 | { | 1070 | { |
1107 | // Call the right implementation function | 1071 | // Call the right implementation function |
1108 | gToolDragAndDrop->mLastAccept = (EAcceptance)llmin( | 1072 | LLToolDragAndDrop::getInstance()->mLastAccept = (EAcceptance)llmin( |
1109 | (U32)gToolDragAndDrop->mLastAccept, | 1073 | (U32)LLToolDragAndDrop::getInstance()->mLastAccept, |
1110 | (U32)callMemberFunction((*gToolDragAndDrop), | 1074 | (U32)callMemberFunction((*LLToolDragAndDrop::getInstance()), |
1111 | gToolDragAndDrop->sDragAndDrop3d[gToolDragAndDrop->mCargoTypes[gToolDragAndDrop->mCurItemIndex]][target]) | 1075 | LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target]) |
1112 | (hit_obj, hit_face, mask, FALSE)); | 1076 | (hit_obj, hit_face, mask, FALSE)); |
1113 | } | 1077 | } |
1114 | 1078 | ||
1115 | if (gToolDragAndDrop->mDrop && (U32)gToolDragAndDrop->mLastAccept >= ACCEPT_YES_COPY_SINGLE) | 1079 | if (LLToolDragAndDrop::getInstance()->mDrop && (U32)LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_SINGLE) |
1116 | { | 1080 | { |
1117 | // if target allows multi-drop, go ahead and start iteration at beginning of cargo list | 1081 | // if target allows multi-drop, go ahead and start iteration at beginning of cargo list |
1118 | if (gToolDragAndDrop->mLastAccept >= ACCEPT_YES_COPY_MULTI) | 1082 | if (LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_MULTI) |
1119 | { | 1083 | { |
1120 | gToolDragAndDrop->mCurItemIndex = 0; | 1084 | LLToolDragAndDrop::getInstance()->mCurItemIndex = 0; |
1121 | } | 1085 | } |
1122 | // otherwise start at end, to follow selection rules (last selected item is most current) | 1086 | // otherwise start at end, to follow selection rules (last selected item is most current) |
1123 | else | 1087 | else |
1124 | { | 1088 | { |
1125 | gToolDragAndDrop->mCurItemIndex = gToolDragAndDrop->mCargoIDs.size() - 1; | 1089 | LLToolDragAndDrop::getInstance()->mCurItemIndex = LLToolDragAndDrop::getInstance()->mCargoIDs.size() - 1; |
1126 | } | 1090 | } |
1127 | 1091 | ||
1128 | for (; gToolDragAndDrop->mCurItemIndex < (S32)gToolDragAndDrop->mCargoIDs.size(); | 1092 | for (; LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); |
1129 | gToolDragAndDrop->mCurItemIndex++) | 1093 | LLToolDragAndDrop::getInstance()->mCurItemIndex++) |
1130 | { | 1094 | { |
1131 | // Call the right implementation function | 1095 | // Call the right implementation function |
1132 | (U32)callMemberFunction((*gToolDragAndDrop), | 1096 | (U32)callMemberFunction((*LLToolDragAndDrop::getInstance()), |
1133 | gToolDragAndDrop->sDragAndDrop3d[gToolDragAndDrop->mCargoTypes[gToolDragAndDrop->mCurItemIndex]][target]) | 1097 | LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target]) |
1134 | (hit_obj, hit_face, mask, TRUE); | 1098 | (hit_obj, hit_face, mask, TRUE); |
1135 | } | 1099 | } |
1136 | } | 1100 | } |
1137 | 1101 | ||
1138 | switch( gToolDragAndDrop->mLastAccept ) | 1102 | switch( LLToolDragAndDrop::getInstance()->mLastAccept ) |
1139 | { | 1103 | { |
1140 | case ACCEPT_YES_MULTI: | 1104 | case ACCEPT_YES_MULTI: |
1141 | if (gToolDragAndDrop->mCargoIDs.size() > 1) | 1105 | if (LLToolDragAndDrop::getInstance()->mCargoIDs.size() > 1) |
1142 | { | 1106 | { |
1143 | gToolDragAndDrop->mCursor = UI_CURSOR_ARROWDRAGMULTI; | 1107 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWDRAGMULTI; |
1144 | } | 1108 | } |
1145 | else | 1109 | else |
1146 | { | 1110 | { |
1147 | gToolDragAndDrop->mCursor = UI_CURSOR_ARROWDRAG; | 1111 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWDRAG; |
1148 | } | 1112 | } |
1149 | break; | 1113 | break; |
1150 | case ACCEPT_YES_SINGLE: | 1114 | case ACCEPT_YES_SINGLE: |
1151 | gToolDragAndDrop->mCursor = UI_CURSOR_ARROWDRAG; | 1115 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWDRAG; |
1152 | break; | 1116 | break; |
1153 | 1117 | ||
1154 | case ACCEPT_NO_LOCKED: | 1118 | case ACCEPT_NO_LOCKED: |
1155 | gToolDragAndDrop->mCursor = UI_CURSOR_NOLOCKED; | 1119 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NOLOCKED; |
1156 | break; | 1120 | break; |
1157 | 1121 | ||
1158 | case ACCEPT_NO: | 1122 | case ACCEPT_NO: |
1159 | gToolDragAndDrop->mCursor = UI_CURSOR_NO; | 1123 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO; |
1160 | break; | 1124 | break; |
1161 | 1125 | ||
1162 | case ACCEPT_YES_COPY_MULTI: | 1126 | case ACCEPT_YES_COPY_MULTI: |
1163 | if (gToolDragAndDrop->mCargoIDs.size() > 1) | 1127 | if (LLToolDragAndDrop::getInstance()->mCargoIDs.size() > 1) |
1164 | { | 1128 | { |
1165 | gToolDragAndDrop->mCursor = UI_CURSOR_ARROWCOPYMULTI; | 1129 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWCOPYMULTI; |
1166 | } | 1130 | } |
1167 | else | 1131 | else |
1168 | { | 1132 | { |
1169 | gToolDragAndDrop->mCursor = UI_CURSOR_ARROWCOPY; | 1133 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWCOPY; |
1170 | } | 1134 | } |
1171 | break; | 1135 | break; |
1172 | case ACCEPT_YES_COPY_SINGLE: | 1136 | case ACCEPT_YES_COPY_SINGLE: |
1173 | gToolDragAndDrop->mCursor = UI_CURSOR_ARROWCOPY; | 1137 | LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWCOPY; |
1174 | break; | 1138 | break; |
1175 | case ACCEPT_POSTPONED: | 1139 | case ACCEPT_POSTPONED: |
1176 | break; | 1140 | break; |
@@ -1178,10 +1142,10 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) | |||
1178 | llassert( FALSE ); | 1142 | llassert( FALSE ); |
1179 | } | 1143 | } |
1180 | 1144 | ||
1181 | gToolDragAndDrop->mLastHitPos = gLastHitPosGlobal + gLastHitObjectOffset; | 1145 | LLToolDragAndDrop::getInstance()->mLastHitPos = gLastHitPosGlobal + gLastHitObjectOffset; |
1182 | gToolDragAndDrop->mLastCameraPos = gAgent.getCameraPositionGlobal(); | 1146 | LLToolDragAndDrop::getInstance()->mLastCameraPos = gAgent.getCameraPositionGlobal(); |
1183 | 1147 | ||
1184 | gViewerWindow->getWindow()->setCursor( gToolDragAndDrop->mCursor ); | 1148 | gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor ); |
1185 | } | 1149 | } |
1186 | 1150 | ||
1187 | // static | 1151 | // static |
@@ -1294,7 +1258,7 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, | |||
1294 | return; | 1258 | return; |
1295 | } | 1259 | } |
1296 | LLViewerImage* image = gImageList.getImage(asset_id); | 1260 | LLViewerImage* image = gImageList.getImage(asset_id); |
1297 | gViewerStats->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); | 1261 | LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); |
1298 | S32 num_faces = hit_obj->getNumTEs(); | 1262 | S32 num_faces = hit_obj->getNumTEs(); |
1299 | for( S32 face = 0; face < num_faces; face++ ) | 1263 | for( S32 face = 0; face < num_faces; face++ ) |
1300 | { | 1264 | { |
@@ -1337,7 +1301,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, | |||
1337 | } | 1301 | } |
1338 | // update viewer side image in anticipation of update from simulator | 1302 | // update viewer side image in anticipation of update from simulator |
1339 | LLViewerImage* image = gImageList.getImage(asset_id); | 1303 | LLViewerImage* image = gImageList.getImage(asset_id); |
1340 | gViewerStats->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); | 1304 | LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); |
1341 | hit_obj->setTEImage(hit_face, image); | 1305 | hit_obj->setTEImage(hit_face, image); |
1342 | dialog_refresh_all(); | 1306 | dialog_refresh_all(); |
1343 | 1307 | ||
@@ -1354,8 +1318,8 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj, | |||
1354 | { | 1318 | { |
1355 | // *HACK: In order to resolve SL-22177, we need to block drags | 1319 | // *HACK: In order to resolve SL-22177, we need to block drags |
1356 | // from notecards and objects onto other objects. | 1320 | // from notecards and objects onto other objects. |
1357 | if((SOURCE_WORLD == gToolDragAndDrop->mSource) | 1321 | if((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource) |
1358 | || (SOURCE_NOTECARD == gToolDragAndDrop->mSource)) | 1322 | || (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource)) |
1359 | { | 1323 | { |
1360 | llwarns << "Call to LLToolDragAndDrop::dropScript() from world" | 1324 | llwarns << "Call to LLToolDragAndDrop::dropScript() from world" |
1361 | << " or notecard." << llendl; | 1325 | << " or notecard." << llendl; |
@@ -1394,7 +1358,7 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj, | |||
1394 | gFloaterTools->dirty(); | 1358 | gFloaterTools->dirty(); |
1395 | 1359 | ||
1396 | // VEFFECT: SetScript | 1360 | // VEFFECT: SetScript |
1397 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); | 1361 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); |
1398 | effectp->setSourceObject(gAgent.getAvatarObject()); | 1362 | effectp->setSourceObject(gAgent.getAvatarObject()); |
1399 | effectp->setTargetObject(hit_obj); | 1363 | effectp->setTargetObject(hit_obj); |
1400 | effectp->setDuration(LL_HUD_DUR_SHORT); | 1364 | effectp->setDuration(LL_HUD_DUR_SHORT); |
@@ -1407,7 +1371,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, | |||
1407 | BOOL from_task_inventory, | 1371 | BOOL from_task_inventory, |
1408 | BOOL remove_from_inventory) | 1372 | BOOL remove_from_inventory) |
1409 | { | 1373 | { |
1410 | LLViewerRegion* regionp = gWorldp->getRegionFromPosGlobal(mLastHitPos); | 1374 | LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(mLastHitPos); |
1411 | if (!regionp) | 1375 | if (!regionp) |
1412 | { | 1376 | { |
1413 | llwarns << "Couldn't find region to rez object" << llendl; | 1377 | llwarns << "Couldn't find region to rez object" << llendl; |
@@ -1463,8 +1427,21 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, | |||
1463 | LLUUID source_id = from_task_inventory ? mSourceID : LLUUID::null; | 1427 | LLUUID source_id = from_task_inventory ? mSourceID : LLUUID::null; |
1464 | 1428 | ||
1465 | // Select the object only if we're editing. | 1429 | // Select the object only if we're editing. |
1466 | BOOL rez_selected = gToolMgr->inEdit(); | 1430 | BOOL rez_selected = LLToolMgr::getInstance()->inEdit(); |
1467 | 1431 | ||
1432 | |||
1433 | LLVector3 ray_start = regionp->getPosRegionFromGlobal(mLastCameraPos); | ||
1434 | LLVector3 ray_end = regionp->getPosRegionFromGlobal(mLastHitPos); | ||
1435 | // currently the ray's end point is an approximation, | ||
1436 | // and is sometimes too short (causing failure.) so we | ||
1437 | // double the ray's length: | ||
1438 | if (bypass_sim_raycast == FALSE) | ||
1439 | { | ||
1440 | LLVector3 ray_direction = ray_start - ray_end; | ||
1441 | ray_end = ray_end - ray_direction; | ||
1442 | } | ||
1443 | |||
1444 | |||
1468 | // Message packing code should be it's own uninterrupted block | 1445 | // Message packing code should be it's own uninterrupted block |
1469 | LLMessageSystem* msg = gMessageSystem; | 1446 | LLMessageSystem* msg = gMessageSystem; |
1470 | if (mSource == SOURCE_NOTECARD) | 1447 | if (mSource == SOURCE_NOTECARD) |
@@ -1488,8 +1465,8 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, | |||
1488 | // optimization. | 1465 | // optimization. |
1489 | msg->addUUIDFast(_PREHASH_FromTaskID, source_id); | 1466 | msg->addUUIDFast(_PREHASH_FromTaskID, source_id); |
1490 | msg->addU8Fast(_PREHASH_BypassRaycast, (U8) bypass_sim_raycast); | 1467 | msg->addU8Fast(_PREHASH_BypassRaycast, (U8) bypass_sim_raycast); |
1491 | msg->addVector3Fast(_PREHASH_RayStart, regionp->getPosRegionFromGlobal(mLastCameraPos)); | 1468 | msg->addVector3Fast(_PREHASH_RayStart, ray_start); |
1492 | msg->addVector3Fast(_PREHASH_RayEnd, regionp->getPosRegionFromGlobal(mLastHitPos)); | 1469 | msg->addVector3Fast(_PREHASH_RayEnd, ray_end); |
1493 | msg->addUUIDFast(_PREHASH_RayTargetID, ray_target_id ); | 1470 | msg->addUUIDFast(_PREHASH_RayTargetID, ray_target_id ); |
1494 | msg->addBOOLFast(_PREHASH_RayEndIsIntersection, FALSE); | 1471 | msg->addBOOLFast(_PREHASH_RayEndIsIntersection, FALSE); |
1495 | msg->addBOOLFast(_PREHASH_RezSelected, rez_selected); | 1472 | msg->addBOOLFast(_PREHASH_RezSelected, rez_selected); |
@@ -1529,7 +1506,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, | |||
1529 | // selected object. | 1506 | // selected object. |
1530 | if (rez_selected) | 1507 | if (rez_selected) |
1531 | { | 1508 | { |
1532 | gSelectMgr->deselectAll(); | 1509 | LLSelectMgr::getInstance()->deselectAll(); |
1533 | gViewerWindow->getWindow()->incBusyCount(); | 1510 | gViewerWindow->getWindow()->incBusyCount(); |
1534 | } | 1511 | } |
1535 | 1512 | ||
@@ -1543,13 +1520,13 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, | |||
1543 | } | 1520 | } |
1544 | 1521 | ||
1545 | // VEFFECT: DropObject | 1522 | // VEFFECT: DropObject |
1546 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); | 1523 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); |
1547 | effectp->setSourceObject(gAgent.getAvatarObject()); | 1524 | effectp->setSourceObject(gAgent.getAvatarObject()); |
1548 | effectp->setPositionGlobal(mLastHitPos); | 1525 | effectp->setPositionGlobal(mLastHitPos); |
1549 | effectp->setDuration(LL_HUD_DUR_SHORT); | 1526 | effectp->setDuration(LL_HUD_DUR_SHORT); |
1550 | effectp->setColor(LLColor4U(gAgent.getEffectColor())); | 1527 | effectp->setColor(LLColor4U(gAgent.getEffectColor())); |
1551 | 1528 | ||
1552 | gViewerStats->incStat(LLViewerStats::ST_REZ_COUNT); | 1529 | LLViewerStats::getInstance()->incStat(LLViewerStats::ST_REZ_COUNT); |
1553 | } | 1530 | } |
1554 | 1531 | ||
1555 | void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, | 1532 | void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, |
@@ -1559,8 +1536,8 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, | |||
1559 | { | 1536 | { |
1560 | // *HACK: In order to resolve SL-22177, we need to block drags | 1537 | // *HACK: In order to resolve SL-22177, we need to block drags |
1561 | // from notecards and objects onto other objects. | 1538 | // from notecards and objects onto other objects. |
1562 | if((SOURCE_WORLD == gToolDragAndDrop->mSource) | 1539 | if((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource) |
1563 | || (SOURCE_NOTECARD == gToolDragAndDrop->mSource)) | 1540 | || (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource)) |
1564 | { | 1541 | { |
1565 | llwarns << "Call to LLToolDragAndDrop::dropInventory() from world" | 1542 | llwarns << "Call to LLToolDragAndDrop::dropInventory() from world" |
1566 | << " or notecard." << llendl; | 1543 | << " or notecard." << llendl; |
@@ -1606,7 +1583,7 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, | |||
1606 | } | 1583 | } |
1607 | 1584 | ||
1608 | // VEFFECT: AddToInventory | 1585 | // VEFFECT: AddToInventory |
1609 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); | 1586 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); |
1610 | effectp->setSourceObject(gAgent.getAvatarObject()); | 1587 | effectp->setSourceObject(gAgent.getAvatarObject()); |
1611 | effectp->setTargetObject(hit_obj); | 1588 | effectp->setTargetObject(hit_obj); |
1612 | effectp->setDuration(LL_HUD_DUR_SHORT); | 1589 | effectp->setDuration(LL_HUD_DUR_SHORT); |
@@ -1710,7 +1687,7 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, | |||
1710 | gAgent.sendReliableMessage(); | 1687 | gAgent.sendReliableMessage(); |
1711 | 1688 | ||
1712 | // VEFFECT: giveInventory | 1689 | // VEFFECT: giveInventory |
1713 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); | 1690 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); |
1714 | effectp->setSourceObject(gAgent.getAvatarObject()); | 1691 | effectp->setSourceObject(gAgent.getAvatarObject()); |
1715 | effectp->setTargetObject(gObjectList.findObject(to_agent)); | 1692 | effectp->setTargetObject(gObjectList.findObject(to_agent)); |
1716 | effectp->setDuration(LL_HUD_DUR_SHORT); | 1693 | effectp->setDuration(LL_HUD_DUR_SHORT); |
@@ -1912,7 +1889,7 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent, | |||
1912 | delete[] bucket; | 1889 | delete[] bucket; |
1913 | 1890 | ||
1914 | // VEFFECT: giveInventoryCategory | 1891 | // VEFFECT: giveInventoryCategory |
1915 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); | 1892 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); |
1916 | effectp->setSourceObject(gAgent.getAvatarObject()); | 1893 | effectp->setSourceObject(gAgent.getAvatarObject()); |
1917 | effectp->setTargetObject(gObjectList.findObject(to_agent)); | 1894 | effectp->setTargetObject(gObjectList.findObject(to_agent)); |
1918 | effectp->setDuration(LL_HUD_DUR_SHORT); | 1895 | effectp->setDuration(LL_HUD_DUR_SHORT); |
@@ -2365,7 +2342,7 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject( | |||
2365 | } | 2342 | } |
2366 | 2343 | ||
2367 | // VEFFECT: SetTexture | 2344 | // VEFFECT: SetTexture |
2368 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); | 2345 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); |
2369 | effectp->setSourceObject(gAgent.getAvatarObject()); | 2346 | effectp->setSourceObject(gAgent.getAvatarObject()); |
2370 | effectp->setTargetObject(obj); | 2347 | effectp->setTargetObject(obj); |
2371 | effectp->setDuration(LL_HUD_DUR_SHORT); | 2348 | effectp->setDuration(LL_HUD_DUR_SHORT); |