aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpaneldisplay.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-12-01 17:39:58 -0600
committerJacek Antonelli2008-12-01 17:40:06 -0600
commit7abecb48babe6a6f09bf6692ba55076546cfced9 (patch)
tree8d18a88513fb97adf32c10aae78f4be1984942db /linden/indra/newview/llpaneldisplay.cpp
parentSecond Life viewer sources 1.21.6 (diff)
downloadmeta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz
Second Life viewer sources 1.22.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpaneldisplay.cpp66
1 files changed, 4 insertions, 62 deletions
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)
753 753
754void LLPanelDisplay::applyResolution() 754void LLPanelDisplay::applyResolution()
755{ 755{
756
757 gGL.flush();
756 char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/ 758 char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/
757 if (mCtrlAspectRatio->getCurrentIndex() == -1) 759 if (mCtrlAspectRatio->getCurrentIndex() == -1)
758 { 760 {
@@ -787,75 +789,15 @@ void LLPanelDisplay::applyResolution()
787 { 789 {
788 mAspectRatio = (F32)mCtrlAspectRatio->getValue().asReal(); 790 mAspectRatio = (F32)mCtrlAspectRatio->getValue().asReal();
789 } 791 }
790 792
791 // presumably, user entered a non-numeric value if aspect_ratio == 0.f 793 // presumably, user entered a non-numeric value if aspect_ratio == 0.f
792 if (mAspectRatio != 0.f) 794 if (mAspectRatio != 0.f)
793 { 795 {
794 mAspectRatio = llclamp(mAspectRatio, 0.2f, 5.f); 796 mAspectRatio = llclamp(mAspectRatio, 0.2f, 5.f);
795 gSavedSettings.setF32("FullScreenAspectRatio", mAspectRatio); 797 gSavedSettings.setF32("FullScreenAspectRatio", mAspectRatio);
796 if (gSavedSettings.getBOOL("FullScreenAutoDetectAspectRatio"))
797 {
798 gViewerWindow->getWindow()->setNativeAspectRatio(0.f);
799 }
800 else
801 {
802 gViewerWindow->getWindow()->setNativeAspectRatio(mAspectRatio);
803 }
804 } 798 }
805 gViewerWindow->reshape(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
806
807 // Screen resolution
808 S32 num_resolutions;
809 LLWindow::LLWindowResolution* supported_resolutions = gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions);
810
811 // switching to windowed
812 BOOL fullscreen = !mCtrlWindowed->get();
813
814 // check if resolution has changed
815 BOOL targetFullscreen;
816 S32 targetWidth;
817 S32 targetHeight;
818 799
819 gViewerWindow->getTargetWindow(targetFullscreen, targetWidth, targetHeight); 800 gViewerWindow->requestResolutionUpdate(!mCtrlWindowed->get(), mCtrlFullScreen->getCurrentIndex());
820
821 if ((fullscreen != targetFullscreen) ||
822 (fullscreen &&
823 (supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mWidth != targetWidth ||
824 supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mHeight != targetHeight)
825 ))
826 {
827 // change fullscreen resolution or switch in/out of windowed mode
828 BOOL result;
829
830 BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED);
831 if (fullscreen)
832 {
833 result = gViewerWindow->changeDisplaySettings(TRUE,
834 LLCoordScreen( supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mWidth,
835 supported_resolutions[mCtrlFullScreen->getCurrentIndex()].mHeight),
836 gSavedSettings.getBOOL("DisableVerticalSync"),
837 logged_in);
838 }
839 else
840 {
841 result = gViewerWindow->changeDisplaySettings(FALSE,
842 LLCoordScreen(gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight")),
843 TRUE,
844 logged_in);
845 }
846 if (!result)
847 {
848
849 // GL is non-existent at this point, so we can't continue.
850 llerrs << "LLPanelDisplay::apply() failed" << llendl;
851 }
852 }
853
854 // force aspect ratio
855 if (fullscreen)
856 {
857 LLViewerCamera::getInstance()->setAspect( gViewerWindow->getDisplayAspectRatio() );
858 }
859 801
860 send_agent_update(TRUE); 802 send_agent_update(TRUE);
861 803