summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp75
1 files changed, 27 insertions, 48 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8529a93527..966aeba25c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -259,19 +259,21 @@ public:
virtual void recordMessage(LLError::ELevel level,
const std::string& message)
{
- // only log warnings to chat console
- if (level == LLError::LEVEL_WARN)
- {
- LLFloaterChat* chat_floater = LLFloaterReg::findTypedInstance<LLFloaterChat>("chat");
- if (chat_floater && gSavedSettings.getBOOL("WarningsAsChat"))
- {
- LLChat chat;
- chat.mText = message;
- chat.mSourceType = CHAT_SOURCE_SYSTEM;
+ //FIXME: this is NOT thread safe, and will do bad things when a warning is issued from a non-UI thread
- chat_floater->addChat(chat, FALSE, FALSE);
- }
- }
+ // only log warnings to chat console
+ //if (level == LLError::LEVEL_WARN)
+ //{
+ //LLFloaterChat* chat_floater = LLFloaterReg::findTypedInstance<LLFloaterChat>("chat");
+ //if (chat_floater && gSavedSettings.getBOOL("WarningsAsChat"))
+ //{
+ // LLChat chat;
+ // chat.mText = message;
+ // chat.mSourceType = CHAT_SOURCE_SYSTEM;
+
+ // chat_floater->addChat(chat, FALSE, FALSE);
+ //}
+ //}
}
};
@@ -3140,7 +3142,6 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback
return;
}
- // push back pick info object
BOOL in_build_mode = LLFloaterReg::instanceVisible("build");
if (in_build_mode || LLDrawPoolAlpha::sShowDebugAlpha)
{
@@ -3149,27 +3150,8 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback
pick_transparent = TRUE;
}
- // center initial pick frame buffer region under mouse cursor
- // since that area is guaranteed to be onscreen and hence a valid
- // part of the framebuffer
- if (mPicks.empty())
- {
- mPickScreenRegion.setCenterAndSize(x, y_from_bot, PICK_DIAMETER, PICK_DIAMETER);
-
- if (mPickScreenRegion.mLeft < mWorldViewRectScaled.mLeft) mPickScreenRegion.translate(mWorldViewRectScaled.mLeft - mPickScreenRegion.mLeft, 0);
- if (mPickScreenRegion.mBottom < mWorldViewRectScaled.mBottom) mPickScreenRegion.translate(0, mWorldViewRectScaled.mBottom - mPickScreenRegion.mBottom);
- if (mPickScreenRegion.mRight > mWorldViewRectScaled.mRight ) mPickScreenRegion.translate(mWorldViewRectScaled.mRight - mPickScreenRegion.mRight, 0);
- if (mPickScreenRegion.mTop > mWorldViewRectScaled.mTop ) mPickScreenRegion.translate(0, mWorldViewRectScaled.mTop - mPickScreenRegion.mTop);
- }
-
- // set frame buffer region for picking results
- // stack multiple picks left to right
- LLRect screen_region = mPickScreenRegion;
- screen_region.translate(mPicks.size() * PICK_DIAMETER, 0);
-
- LLPickInfo pick(LLCoordGL(x, y_from_bot), screen_region, mask, pick_transparent, TRUE, callback);
-
- schedulePick(pick);
+ LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, TRUE, callback);
+ schedulePick(pick_info);
}
void LLViewerWindow::schedulePick(LLPickInfo& pick_info)
@@ -3184,10 +3166,11 @@ void LLViewerWindow::schedulePick(LLPickInfo& pick_info)
return;
}
- llassert_always(pick_info.mScreenRegion.notEmpty());
mPicks.push_back(pick_info);
// delay further event processing until we receive results of pick
+ // only do this for async picks so that handleMouseUp won't be called
+ // until the pick triggered in handleMouseDown has been processed, for example
mWindow->delayInputProcessing();
}
@@ -3235,20 +3218,18 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans
return LLPickInfo();
}
- pickAsync(x, y_from_bot, gKeyboard->currentMask(TRUE), NULL, pick_transparent);
- // assume that pickAsync put the results in the back of the mPicks list
- if(mPicks.size() != 0)
- {
- mLastPick = mPicks.back();
- mLastPick.fetchResults();
- mPicks.pop_back();
- }
- else
+ BOOL in_build_mode = LLFloaterReg::instanceVisible("build");
+ if (in_build_mode || LLDrawPoolAlpha::sShowDebugAlpha)
{
- lldebugs << "List of last picks is empty: Using stub pick" << llendl;
- mLastPick = LLPickInfo();
+ // build mode allows interaction with all transparent objects
+ // "Show Debug Alpha" means no object actually transparent
+ pick_transparent = TRUE;
}
+ // shortcut queueing in mPicks and just update mLastPick in place
+ mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), gKeyboard->currentMask(TRUE), pick_transparent, TRUE, NULL);
+ mLastPick.fetchResults();
+
return mLastPick;
}
@@ -4895,13 +4876,11 @@ LLPickInfo::LLPickInfo()
}
LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos,
- const LLRect& screen_region,
MASK keyboard_mask,
BOOL pick_transparent,
BOOL pick_uv_coords,
void (*pick_callback)(const LLPickInfo& pick_info))
: mMousePt(mouse_pos),
- mScreenRegion(screen_region),
mKeyMask(keyboard_mask),
mPickCallback(pick_callback),
mPickType(PICK_INVALID),