From 311fd70573845d52845b7fa15baf72f8c93c75b0 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 10 Nov 2005 18:55:03 +0000 Subject: [PATCH] when resetting the D3D device, use the preferred video mode and not the current desktop mode. This fixes "Win98, full-screen, alt-tab away, alt-tab back and the game is running fullscreen at the desktop video mode" --- stepmania/src/RageDisplay_D3D.cpp | 18 +++++++++--------- stepmania/src/StepMania.cpp | 6 +++--- stepmania/src/StepMania.h | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index c7ccfef709..de1d4d3873 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -669,16 +669,16 @@ bool RageDisplay_D3D::BeginFrame() case D3DERR_DEVICELOST: return false; case D3DERR_DEVICENOTRESET: - { - bool bIgnore = false; - VideoModeParams params; - GraphicsWindow::GetParams( params ); + { + bool bIgnore = false; + VideoModeParams params; + GetPreferredVideoModeParams( params ); - CString sError = SetVideoMode( params, bIgnore ); - if( sError != "" ) - RageException::Throw( sError ); - break; - } + CString sError = SetVideoMode( params, bIgnore ); + if( sError != "" ) + RageException::Throw( sError ); + break; + } } #endif diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 59d30b3287..8ecf5d5c77 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -88,7 +88,7 @@ static bool g_bHasFocus = true; void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame ); -void GetCurVideoModeParams( VideoModeParams ¶msOut ) +void GetPreferredVideoModeParams( VideoModeParams ¶msOut ) { paramsOut = VideoModeParams( PREFSMAN->m_bWindowed, @@ -174,7 +174,7 @@ void ApplyGraphicOptions() bool bNeedReload = false; VideoModeParams params; - GetCurVideoModeParams( params ); + GetPreferredVideoModeParams( params ); CString sError = DISPLAY->SetVideoMode( params, bNeedReload ); if( sError != "" ) RageException::Throw( sError ); @@ -693,7 +693,7 @@ RageDisplay *CreateDisplay() CheckVideoDefaultSettings(); VideoModeParams params; - GetCurVideoModeParams( params ); + GetPreferredVideoModeParams( params ); CString error = "There was an error while initializing your video card.\n\n" "Please do not file this error as a bug! Use the web page below to troubleshoot this problem.\n\n" diff --git a/stepmania/src/StepMania.h b/stepmania/src/StepMania.h index fff2b551a6..9f5eb6e3a6 100644 --- a/stepmania/src/StepMania.h +++ b/stepmania/src/StepMania.h @@ -27,7 +27,7 @@ extern char **g_argv; bool GetCommandlineArgument( const CString &option, CString *argument=NULL, int iIndex=0 ); struct VideoModeParams; -void GetCurVideoModeParams( VideoModeParams ¶msOut ); +void GetPreferredVideoModeParams( VideoModeParams ¶msOut ); #endif