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