summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2020-06-15 15:29:04 -0400
committerOz Linden <oz@lindenlab.com>2020-06-15 15:29:04 -0400
commit86009f885efc796850d3e5b612c896a9d737fb86 (patch)
tree404923800dbc6d09ea72b10de0c7f4bb103d1e62 /indra/newview/llviewerwindow.cpp
parent17598f936bb6b099f21fc32aa80b68258cdfd0b9 (diff)
parent1702a65665879d0c68df4c6b4fdb60f815ab7abb (diff)
SL-10297: merge up to master at 6.4.3
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp89
1 files changed, 83 insertions, 6 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b0f5b550e6..f49d7f7c54 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -360,6 +360,8 @@ public:
static const std::string beacon_scripted_touch = LLTrans::getString("BeaconScriptedTouch");
static const std::string beacon_sound = LLTrans::getString("BeaconSound");
static const std::string beacon_media = LLTrans::getString("BeaconMedia");
+ static const std::string beacon_sun = LLTrans::getString("BeaconSun");
+ static const std::string beacon_moon = LLTrans::getString("BeaconMoon");
static const std::string particle_hiding = LLTrans::getString("ParticleHiding");
// Draw the statistics in a light gray
@@ -604,7 +606,7 @@ public:
addText(xpos, ypos, llformat("%d Unique Textures", LLImageGL::sUniqueCount));
ypos += y_inc;
- addText(xpos, ypos, llformat("%d Render Calls", last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize)));
+ addText(xpos, ypos, llformat("%d Render Calls", (U32)last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize)));
ypos += y_inc;
addText(xpos, ypos, llformat("%d/%d Objects Active", gObjectList.getNumActiveObjects(), gObjectList.getNumObjects()));
@@ -794,6 +796,20 @@ public:
}
}
+ static LLUICachedControl<bool> show_sun_beacon("sunbeacon", false);
+ static LLUICachedControl<bool> show_moon_beacon("moonbeacon", false);
+
+ if (show_sun_beacon)
+ {
+ addText(xpos, ypos, beacon_sun);
+ ypos += y_inc;
+ }
+ if (show_moon_beacon)
+ {
+ addText(xpos, ypos, beacon_moon);
+ ypos += y_inc;
+ }
+
if(log_texture_traffic)
{
U32 old_y = ypos ;
@@ -1587,6 +1603,11 @@ void LLViewerWindow::handleScrollWheel(LLWindow *window, S32 clicks)
handleScrollWheel( clicks );
}
+void LLViewerWindow::handleScrollHWheel(LLWindow *window, S32 clicks)
+{
+ handleScrollHWheel(clicks);
+}
+
void LLViewerWindow::handleWindowBlock(LLWindow *window)
{
send_agent_pause();
@@ -1988,6 +2009,11 @@ void LLViewerWindow::initBase()
LLPanel* panel_holder = main_view->getChild<LLPanel>("toolbar_view_holder");
// Load the toolbar view from file
gToolBarView = LLUICtrlFactory::getInstance()->createFromFile<LLToolBarView>("panel_toolbar_view.xml", panel_holder, LLDefaultChildRegistry::instance());
+ if (!gToolBarView)
+ {
+ LL_ERRS() << "Failed to initialize viewer: Viewer couldn't process file panel_toolbar_view.xml, "
+ << "if this problem happens again, please validate your installation." << LL_ENDL;
+ }
gToolBarView->setShape(panel_holder->getLocalRect());
// Hide the toolbars for the moment: we'll make them visible after logging in world (see LLViewerWindow::initWorldUI())
gToolBarView->setVisible(FALSE);
@@ -2873,7 +2899,8 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// If "Pressing letter keys starts local chat" option is selected, we are not in mouselook,
// no view has keyboard focus, this is a printable character key (and no modifier key is
// pressed except shift), then give focus to nearby chat (STORM-560)
- if ( gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() &&
+ if ( LLStartUp::getStartupState() >= STATE_STARTED &&
+ gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() &&
!keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) )
{
// Initialize nearby chat if it's missing
@@ -3003,6 +3030,49 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
return;
}
+void LLViewerWindow::handleScrollHWheel(S32 clicks)
+{
+ LLUI::getInstance()->resetMouseIdleTimer();
+
+ LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture();
+ if (mouse_captor)
+ {
+ S32 local_x;
+ S32 local_y;
+ mouse_captor->screenPointToLocal(mCurrentMousePoint.mX, mCurrentMousePoint.mY, &local_x, &local_y);
+ mouse_captor->handleScrollHWheel(local_x, local_y, clicks);
+ if (LLView::sDebugMouseHandling)
+ {
+ LL_INFOS() << "Scroll Horizontal Wheel handled by captor " << mouse_captor->getName() << LL_ENDL;
+ }
+ return;
+ }
+
+ LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
+ if (top_ctrl)
+ {
+ S32 local_x;
+ S32 local_y;
+ top_ctrl->screenPointToLocal(mCurrentMousePoint.mX, mCurrentMousePoint.mY, &local_x, &local_y);
+ if (top_ctrl->handleScrollHWheel(local_x, local_y, clicks)) return;
+ }
+
+ if (mRootView->handleScrollHWheel(mCurrentMousePoint.mX, mCurrentMousePoint.mY, clicks))
+ {
+ if (LLView::sDebugMouseHandling)
+ {
+ LL_INFOS() << "Scroll Horizontal Wheel" << LLView::sMouseHandlerMessage << LL_ENDL;
+ }
+ return;
+ }
+ else if (LLView::sDebugMouseHandling)
+ {
+ LL_INFOS() << "Scroll Horizontal Wheel not handled by view" << LL_ENDL;
+ }
+
+ return;
+}
+
void LLViewerWindow::addPopup(LLView* popup)
{
if (mPopupView)
@@ -3808,7 +3878,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
F32 scale = vovolume->getLightRadius();
gGL.scalef(scale, scale, scale);
- LLColor4 color(vovolume->getLightColor(), .5f);
+ LLColor4 color(vovolume->getLightSRGBColor(), .5f);
gGL.color4fv(color.mV);
//F32 pixel_area = 100000.f;
@@ -4670,7 +4740,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
if ((image_width <= gGLManager.mGLMaxTextureSize && image_height <= gGLManager.mGLMaxTextureSize) &&
(image_width > window_width || image_height > window_height) && LLPipeline::sRenderDeferred && !show_ui)
{
- if (scratch_space.allocate(image_width, image_height, GL_DEPTH_COMPONENT, true, true))
+ U32 color_fmt = type == LLSnapshotModel::SNAPSHOT_TYPE_DEPTH ? GL_DEPTH_COMPONENT : GL_RGBA;
+ if (scratch_space.allocate(image_width, image_height, color_fmt, true, true))
{
original_width = gPipeline.mDeferredScreen.getWidth();
original_height = gPipeline.mDeferredScreen.getHeight();
@@ -4784,7 +4855,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
{
// Required for showing the GUI in snapshots and performing bloom composite overlay
// Call even if show_ui is FALSE
- LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
render_ui(scale_factor, subfield);
swap();
}
@@ -5050,6 +5120,14 @@ void LLViewerWindow::revealIntroPanel()
}
}
+void LLViewerWindow::initTextures(S32 location_id)
+{
+ if (mProgressView)
+ {
+ mProgressView->initTextures(location_id, LLGridManager::getInstance()->isInProductionGrid());
+ }
+}
+
void LLViewerWindow::setShowProgress(const BOOL show)
{
if (mProgressView)
@@ -5103,7 +5181,6 @@ void LLViewerWindow::setProgressCancelButtonVisible( BOOL b, const std::string&
}
}
-
LLProgressView *LLViewerWindow::getProgressView() const
{
return mProgressView;