aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolpipette.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lltoolpipette.cpp')
-rw-r--r--linden/indra/newview/lltoolpipette.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/linden/indra/newview/lltoolpipette.cpp b/linden/indra/newview/lltoolpipette.cpp
index eaae390..5bafc0a 100644
--- a/linden/indra/newview/lltoolpipette.cpp
+++ b/linden/indra/newview/lltoolpipette.cpp
@@ -51,8 +51,8 @@
51// 51//
52 52
53LLToolPipette::LLToolPipette() 53LLToolPipette::LLToolPipette()
54: LLTool("Pipette"), 54: LLTool(std::string("Pipette")),
55mSuccess(TRUE) 55 mSuccess(TRUE)
56{ 56{
57 mSelectCallback = NULL; 57 mSelectCallback = NULL;
58 mUserData = NULL; 58 mUserData = NULL;
@@ -67,9 +67,8 @@ BOOL LLToolPipette::handleMouseDown(S32 x, S32 y, MASK mask)
67{ 67{
68 mSuccess = TRUE; 68 mSuccess = TRUE;
69 mTooltipMsg.clear(); 69 mTooltipMsg.clear();
70 gPickFaces = TRUE;
71 setMouseCapture(TRUE); 70 setMouseCapture(TRUE);
72 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, pickCallback); 71 gViewerWindow->pickAsync(x, y, mask, pickCallback);
73 return TRUE; 72 return TRUE;
74} 73}
75 74
@@ -88,14 +87,13 @@ BOOL LLToolPipette::handleHover(S32 x, S32 y, MASK mask)
88 gViewerWindow->setCursor(mSuccess ? UI_CURSOR_PIPETTE : UI_CURSOR_NO); 87 gViewerWindow->setCursor(mSuccess ? UI_CURSOR_PIPETTE : UI_CURSOR_NO);
89 if (hasMouseCapture()) // mouse button is down 88 if (hasMouseCapture()) // mouse button is down
90 { 89 {
91 gPickFaces = TRUE; 90 gViewerWindow->pickAsync(x, y, mask, pickCallback);
92 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, pickCallback);
93 return TRUE; 91 return TRUE;
94 } 92 }
95 return FALSE; 93 return FALSE;
96} 94}
97 95
98BOOL LLToolPipette::handleToolTip(S32 x, S32 y, LLString& msg, LLRect *sticky_rect_screen) 96BOOL LLToolPipette::handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen)
99{ 97{
100 if (mTooltipMsg.empty()) 98 if (mTooltipMsg.empty())
101 { 99 {
@@ -107,19 +105,19 @@ BOOL LLToolPipette::handleToolTip(S32 x, S32 y, LLString& msg, LLRect *sticky_re
107 return TRUE; 105 return TRUE;
108} 106}
109 107
110void LLToolPipette::pickCallback(S32 x, S32 y, MASK mask) 108void LLToolPipette::pickCallback(const LLPickInfo& pick_info)
111{ 109{
112 LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); 110 LLViewerObject* hit_obj = pick_info.getObject();
113 LLSelectMgr::getInstance()->unhighlightAll(); 111 LLSelectMgr::getInstance()->unhighlightAll();
114 112
115 // if we clicked on a face of a valid prim, save off texture entry data 113 // if we clicked on a face of a valid prim, save off texture entry data
116 if (hit_obj && 114 if (hit_obj &&
117 hit_obj->getPCode() == LL_PCODE_VOLUME && 115 hit_obj->getPCode() == LL_PCODE_VOLUME &&
118 gLastHitObjectFace != -1) 116 pick_info.mObjectFace != -1)
119 { 117 {
120 //TODO: this should highlight the selected face only 118 //TODO: this should highlight the selected face only
121 LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj); 119 LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj);
122 LLToolPipette::getInstance()->mTextureEntry = *hit_obj->getTE(gLastHitObjectFace); 120 LLToolPipette::getInstance()->mTextureEntry = *hit_obj->getTE(pick_info.mObjectFace);
123 if (LLToolPipette::getInstance()->mSelectCallback) 121 if (LLToolPipette::getInstance()->mSelectCallback)
124 { 122 {
125 LLToolPipette::getInstance()->mSelectCallback(LLToolPipette::getInstance()->mTextureEntry, LLToolPipette::getInstance()->mUserData); 123 LLToolPipette::getInstance()->mSelectCallback(LLToolPipette::getInstance()->mTextureEntry, LLToolPipette::getInstance()->mUserData);
@@ -133,7 +131,7 @@ void LLToolPipette::setSelectCallback(select_callback callback, void* user_data)
133 mUserData = user_data; 131 mUserData = user_data;
134} 132}
135 133
136void LLToolPipette::setResult(BOOL success, const LLString& msg) 134void LLToolPipette::setResult(BOOL success, const std::string& msg)
137{ 135{
138 mTooltipMsg = msg; 136 mTooltipMsg = msg;
139 mSuccess = success; 137 mSuccess = success;