From e970628538a7a9e4a417ce53f4a3facb7fda57ce Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 21 Jul 2008 11:11:55 +0000 Subject: [PATCH] Fall back on a known good resolution rather than 640 x 480. Some displays do not support 640 x 480 and on the first run this causes problems. Fixes bug 1894682. --- stepmania/src/RageDisplay.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 1a49f1bb04..02737eca3c 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -11,6 +11,7 @@ #include "RageSurface.h" #include "Preference.h" #include "LocalizedString.h" +#include "DisplayResolutions.h" #include "arch/ArchHooks/ArchHooks.h" // @@ -97,8 +98,18 @@ RString RageDisplay::SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures return RString(); vs.push_back( err ); - p.width = 640; - p.height = 480; + // Fall back on a known resolution good rather than 640 x 480. + DisplayResolutions dr; + this->GetDisplayResolutions( dr ); + if( dr.empty() ) + { + vs.push_back( "No display resolutions" ); + return SETVIDEOMODE_FAILED.GetValue() + " " + join(";",vs); + } + + const DisplayResolution &d = *dr.begin(); + p.width = d.iWidth; + p.height = d.iHeight; if( err = this->TryVideoMode(p,bNeedReloadTextures) == "" ) return RString(); vs.push_back( err );