On first run, run a gameplay benchmark and adjusts graphic options automatically for 60 fps.

This commit is contained in:
Chris Danford
2003-05-26 09:18:44 +00:00
parent 56b79a197d
commit c54214c1d2
13 changed files with 116 additions and 48 deletions
+29 -16
View File
@@ -104,7 +104,16 @@ void ApplyGraphicOptions()
PREFSMAN->m_iMaxTextureResolution );
if( bNeedReload )
TEXTUREMAN->ReloadAll();
TEXTUREMAN->ReloadAll();
SCREENMAN->SystemMessage( ssprintf("%s %dx%d %d color %d texture %dHz %s",
PREFSMAN->m_bWindowed ? "Windowed" : "Fullscreen",
PREFSMAN->m_iDisplayWidth,
PREFSMAN->m_iDisplayHeight,
PREFSMAN->m_iDisplayColorDepth,
PREFSMAN->m_iTextureColorDepth,
PREFSMAN->m_iRefreshRate,
PREFSMAN->m_bVsync ? "Vsync" : "NoSync" ) );
}
void ExitGame()
@@ -142,7 +151,11 @@ void ResetGame()
}
PREFSMAN->SaveGamePrefsToDisk();
SCREENMAN->SetNewScreen( THEME->GetMetric("Common","InitialScreen") );
if( PREFSMAN->m_bFirstRun )
SCREENMAN->SetNewScreen( "ScreenAutoGraphicDetail" );
else
SCREENMAN->SetNewScreen( THEME->GetMetric("Common","InitialScreen") );
PREFSMAN->m_bFirstRun = false;
}
static void GameLoop();
@@ -492,22 +505,22 @@ static void HandleSDLEvents()
break;
case SDL_ACTIVEEVENT:
{
/* We don't care about mouse focus. */
if(event.active.state == SDL_APPMOUSEFOCUS)
break;
{
/* We don't care about mouse focus. */
if(event.active.state == SDL_APPMOUSEFOCUS)
break;
Uint8 i = SDL_GetAppState();
g_bHasFocus = i&SDL_APPINPUTFOCUS && i&SDL_APPACTIVE;
LOG->Trace("App %s focus (%i%i)", g_bHasFocus? "has":"doesn't have",
i&SDL_APPINPUTFOCUS, i&SDL_APPACTIVE);
Uint8 i = SDL_GetAppState();
g_bHasFocus = i&SDL_APPINPUTFOCUS && i&SDL_APPACTIVE;
LOG->Trace("App %s focus (%i%i)", g_bHasFocus? "has":"doesn't have",
i&SDL_APPINPUTFOCUS, i&SDL_APPACTIVE);
if(g_bHasFocus)
BoostAppPri();
else
RestoreAppPri();
}
if(g_bHasFocus)
BoostAppPri();
else
RestoreAppPri();
}
}
}
}