summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-04-02 12:27:34 -0700
committerGraham Linden <graham@lindenlab.com>2019-04-02 12:27:34 -0700
commitd78ed764b538cf0fa0eba3e39fbbf99ef059660a (patch)
tree5f19fcdd4826e15c39ca70f3f6b3a7aee22e4a69 /indra/newview/llviewerwindow.cpp
parent14629ca3d661c8ec798ad072c4e739571d9c1196 (diff)
parent5cf18cb867be567bf921f0b94a78fd822e4112ad (diff)
Merge 6.1.2 LoveMeRender new hotness
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp72
1 files changed, 19 insertions, 53 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 3421b99ba4..996d140805 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1622,8 +1622,6 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32
{
if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE)
{
- gSavedSettings.setF32("LastSystemUIScaleFactor", ui_scale_factor);
- gSavedSettings.setF32("UIScaleFactor", ui_scale_factor);
LLViewerWindow::reshape(window_width, window_height);
mResDirty = true;
return TRUE;
@@ -1635,6 +1633,14 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32
}
}
+BOOL LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window)
+{
+ LLCoordScreen window_rect;
+ mWindow->getSize(&window_rect);
+ reshape(window_rect.mX, window_rect.mY);
+ return TRUE;
+}
+
void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg)
{
LLAppViewer::instance()->pingMainloopTimeout(msg);
@@ -1697,8 +1703,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
mResDirty(false),
mStatesDirty(false),
mCurrResolutionIndex(0),
- mProgressView(NULL),
- mSystemUIScaleFactorChanged(false)
+ mProgressView(NULL)
{
// gKeyboard is still NULL, so it doesn't do LLWindowListener any good to
// pass its value right now. Instead, pass it a nullary function that
@@ -1730,7 +1735,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
U32 fsaa_samples)
*/
// create window
- mWindow = LLWindowManager::createWindow(this,
+ mWindow = LLWindowManager::createWindow(this,
p.title, p.name, p.x, p.y, p.width, p.height, 0,
p.fullscreen,
gHeadlessClient,
@@ -1774,31 +1779,9 @@ LLViewerWindow::LLViewerWindow(const Params& p)
LLCoordScreen scr;
mWindow->getSize(&scr);
- if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height))
- {
- LL_WARNS() << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<LL_ENDL;
- gSavedSettings.setS32("FullScreenWidth",scr.mX);
- gSavedSettings.setS32("FullScreenHeight",scr.mY);
- }
-
-
- F32 system_scale_factor = mWindow->getSystemUISize();
- if (system_scale_factor < MIN_UI_SCALE || system_scale_factor > MAX_UI_SCALE)
- {
- // reset to default;
- system_scale_factor = 1.f;
- }
- if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor)
- {
- mSystemUIScaleFactorChanged = !p.first_run;
- gSavedSettings.setF32("LastSystemUIScaleFactor", system_scale_factor);
- gSavedSettings.setF32("UIScaleFactor", system_scale_factor);
- }
-
-
// Get the real window rect the window was created with (since there are various OS-dependent reasons why
// the size of a window or fullscreen context may have been adjusted slightly...)
- F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE);
+ F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize();
mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f));
mDisplayScale *= ui_scale_factor;
@@ -1839,6 +1822,11 @@ LLViewerWindow::LLViewerWindow(const Params& p)
LLFeatureManager::getInstance()->applyRecommendedSettings();
gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE);
}
+
+ if (!gGLManager.mHasDepthClamp)
+ {
+ LL_INFOS("RenderInit") << "Missing feature GL_ARB_depth_clamp. Void water might disappear in rare cases." << LL_ENDL;
+ }
// If we crashed while initializng GL stuff last time, disable certain features
if (gSavedSettings.getBOOL("RenderInitError"))
@@ -1886,33 +1874,11 @@ LLViewerWindow::LLViewerWindow(const Params& p)
mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale);
}
-//static
-void LLViewerWindow::showSystemUIScaleFactorChanged()
-{
- LLNotificationsUtil::add("SystemUIScaleFactorChanged", LLSD(), LLSD(), onSystemUIScaleFactorChanged);
-}
-
std::string LLViewerWindow::getLastSnapshotDir()
{
return sSnapshotDir;
}
-//static
-bool LLViewerWindow::onSystemUIScaleFactorChanged(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if(option == 0)
- {
- LLFloaterReg::toggleInstanceOrBringToFront("preferences");
- LLFloater* pref_floater = LLFloaterReg::getInstance("preferences");
- LLTabContainer* tab_container = pref_floater->getChild<LLTabContainer>("pref core");
- tab_container->selectTabByName("advanced1");
-
- }
- return false;
-}
-
-
void LLViewerWindow::initGLDefaults()
{
gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -3039,12 +3005,12 @@ void LLViewerWindow::moveCursorToCenter()
S32 x = getWorldViewWidthScaled() / 2;
S32 y = getWorldViewHeightScaled() / 2;
+ LLUI::setMousePositionScreen(x, y);
+
//on a forced move, all deltas get zeroed out to prevent jumping
mCurrentMousePoint.set(x,y);
mLastMousePoint.set(x,y);
mCurrentMouseDelta.set(0,0);
-
- LLUI::setMousePositionScreen(x, y);
}
}
@@ -5388,7 +5354,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const
void LLViewerWindow::calcDisplayScale()
{
- F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE);
+ F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize();
LLVector2 display_scale;
display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f));
display_scale *= ui_scale_factor;