From 7abecb48babe6a6f09bf6692ba55076546cfced9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Dec 2008 17:39:58 -0600 Subject: Second Life viewer sources 1.22.0-RC --- linden/indra/newview/llpaneldisplay.cpp | 66 ++------------------------------- 1 file changed, 4 insertions(+), 62 deletions(-) (limited to 'linden/indra/newview/llpaneldisplay.cpp') diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index 3e60745..26e6fda 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp @@ -753,6 +753,8 @@ void LLPanelDisplay::onApplyResolution(LLUICtrl* src, void* user_data) void LLPanelDisplay::applyResolution() { + + gGL.flush(); char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/ if (mCtrlAspectRatio->getCurrentIndex() == -1) { @@ -787,75 +789,15 @@ void LLPanelDisplay::applyResolution() { mAspectRatio = (F32)mCtrlAspectRatio->getValue().asReal(); } - + // presumably, user entered a non-numeric value if aspect_ratio == 0.f if (mAspectRatio != 0.f) { mAspectRatio = llclamp(mAspectRatio, 0.2f, 5.f); gSavedSettings.setF32("FullScreenAspectRatio", mAspectRatio); - if (gSavedSettings.getBOOL("FullScreenAutoDetectAspectRatio")) - { - gViewerWindow->getWindow()->setNativeAspectRatio(0.f); - } - else - { - gViewerWindow->getWindow()->setNativeAspectRatio(mAspectRatio); - } } - gViewerWindow->reshape(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); - - // Screen resolution - S32 num_resolutions; - LLWindow::LLWindowResolution* supported_resolutions = gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions); - - // switching to windowed - BOOL fullscreen = !mCtrlWindowed->get(); - - // check if resolution has changed - BOOL targetFullscreen; - S32 targetWidth; - S32 targetHeight; - gViewerWindow->getTargetWindow(targetFullscreen, targetWidth, targetHeight); - - if ((fullscreen != targetFullscreen) || - (fullscreen && - (supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mWidth != targetWidth || - supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mHeight != targetHeight) - )) - { - // change fullscreen resolution or switch in/out of windowed mode - BOOL result; - - BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED); - if (fullscreen) - { - result = gViewerWindow->changeDisplaySettings(TRUE, - LLCoordScreen( supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mWidth, - supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mHeight), - gSavedSettings.getBOOL("DisableVerticalSync"), - logged_in); - } - else - { - result = gViewerWindow->changeDisplaySettings(FALSE, - LLCoordScreen(gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight")), - TRUE, - logged_in); - } - if (!result) - { - - // GL is non-existent at this point, so we can't continue. - llerrs << "LLPanelDisplay::apply() failed" << llendl; - } - } - - // force aspect ratio - if (fullscreen) - { - LLViewerCamera::getInstance()->setAspect( gViewerWindow->getDisplayAspectRatio() ); - } + gViewerWindow->requestResolutionUpdate(!mCtrlWindowed->get(), mCtrlFullScreen->getCurrentIndex()); send_agent_update(TRUE); -- cgit v1.1 From a87e38229921b48c32187c672a942516722f1b52 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 11 Jan 2009 16:10:39 -0600 Subject: Second Life viewer sources 1.22.5-RC --- linden/indra/newview/llpaneldisplay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra/newview/llpaneldisplay.cpp') diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index 26e6fda..0d7caac 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab -- cgit v1.1 From 0ef11cf31364456ec247b0fc7ad8f6d1de408400 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Wed, 28 Jan 2009 20:04:52 -0600 Subject: Second Life viewer sources 1.22.6-RC --- linden/indra/newview/llpaneldisplay.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'linden/indra/newview/llpaneldisplay.cpp') diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index 0d7caac..d510775 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp @@ -797,7 +797,15 @@ void LLPanelDisplay::applyResolution() gSavedSettings.setF32("FullScreenAspectRatio", mAspectRatio); } - gViewerWindow->requestResolutionUpdate(!mCtrlWindowed->get(), mCtrlFullScreen->getCurrentIndex()); + // Screen resolution + S32 num_resolutions; + LLWindow::LLWindowResolution* supported_resolutions = + gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions); + U32 resIndex = mCtrlFullScreen->getCurrentIndex(); + gSavedSettings.setS32("FullScreenWidth", supported_resolutions[resIndex].mWidth); + gSavedSettings.setS32("FullScreenHeight", supported_resolutions[resIndex].mHeight); + + gViewerWindow->requestResolutionUpdate(!mCtrlWindowed->get()); send_agent_update(TRUE); -- cgit v1.1