From 4387f6bce98ea0ea4c75a61ba45eb1cae9d35320 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 3 Aug 2006 09:23:10 +0000 Subject: [PATCH] fall back to 32 bpp - "Intel(R) 82810E Graphics Controller" won't accept a 16 bpp surface if the desktop is 32 bpp, so try 32 bpp as well. --- stepmania/src/RageDisplay.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index f9cc63a06e..ca22dabc0f 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -75,23 +75,33 @@ static LocalizedString SETVIDEOMODE_FAILED ( "RageDisplay", "SetVideoMode failed RString RageDisplay::SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures ) { RString err; - err = this->TryVideoMode(p,bNeedReloadTextures); - if( err == "" ) + vector vs; + + if( err = this->TryVideoMode(p,bNeedReloadTextures) == "" ) return RString(); LOG->Trace( "TryVideoMode failed: %s", err.c_str() ); + vs.push_back( err ); - // fall back - if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) - return RString(); + // fall back to settings that will most likely work p.bpp = 16; - if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) + if( err = this->TryVideoMode(p,bNeedReloadTextures) == "" ) return RString(); + vs.push_back( err ); + + // "Intel(R) 82810E Graphics Controller" won't accept a 16 bpp surface if + // the desktop is 32 bpp, so try 32 bpp as well. + p.bpp = 32; + if( err = this->TryVideoMode(p,bNeedReloadTextures) == "" ) + return RString(); + vs.push_back( err ); + p.width = 640; p.height = 480; - if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) + if( err = this->TryVideoMode(p,bNeedReloadTextures) == "" ) return RString(); + vs.push_back( err ); - return SETVIDEOMODE_FAILED.GetValue() + " " + err; + return SETVIDEOMODE_FAILED.GetValue() + " " + join(";",vs); } void RageDisplay::ProcessStatsOnFlip()