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
+8 -2
View File
@@ -1912,8 +1912,8 @@ NextScreen=ScreenHowToPlay
[ScreenHowToPlay]
NextScreen=ScreenDemonstration
ScrollBPM=100
SecondsToShow=40
SongBPM=100
SecondsToShow=60
[ScreenDemonstration]
SecondsToShow=30
@@ -1991,6 +1991,7 @@ AppearanceOptions=
SoundOptions=
AutogenOptions=
BackgroundOptions=
AutoAdjustGraphicDetail=
[TextBanner]
Width=180
@@ -2131,3 +2132,8 @@ IconsSpacingY=32
HelpText=Use &LEFT; &RIGHT; to select, then press START
TimerSeconds=40
NextScreen=ScreenSelectMusic
[ScreenAutoGraphicDetail]
NextScreen=ScreenTitleMenu
SongBPM=100
SecondsToShow=7
+5 -1
View File
@@ -139,7 +139,11 @@ void BGAnimationLayer::LoadFromVisualization( CString sMoviePath )
void BGAnimationLayer::LoadFromAniLayerFile( CString sPath )
{
Song* pSong = GAMESTATE->m_pCurSong;
CString sSongBGPath = pSong && pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathToG("Common fallback background");
CString sSongBGPath;
if( pSong && pSong->HasBackground() )
sSongBGPath = pSong->GetBackgroundPath();
else
sSongBGPath = THEME->GetPathToG("Common fallback background");
Init();
CString lcPath = sPath;
+1
View File
@@ -153,6 +153,7 @@ void GameState::UpdateSongPosition(float fPositionSeconds)
m_fMusicSeconds = fPositionSeconds;
m_pCurSong->GetBeatAndBPSFromElapsedTime( m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
LOG->Trace( "m_fMusicSeconds = %f, m_fSongBeat = %f, m_fCurBPS = %f, m_bFreeze = %f", m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
}
int GameState::GetStageIndex()
+3
View File
@@ -95,6 +95,7 @@ PrefsManager::PrefsManager()
m_BannerCacheType = preload_none;
m_fDancePointsAccumulated = 0;
m_bUseUnlockSystem = false;
m_bFirstRun = true;
/* DDR Extreme-style extra stage support.
* Default off so people used to the current behavior (or those with extra
@@ -201,6 +202,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
/* XXX: This belongs in the memcard code, not prefs. */
ini.GetValueF( "Options", "DancePointsAccumulated", m_fDancePointsAccumulated );
ini.GetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
ini.GetValueB( "Options", "FirstRun", m_bFirstRun );
m_asAdditionalSongFolders.clear();
CString sAdditionalSongFolders;
@@ -286,6 +288,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
ini.SetValueI( "Options", "BannerCacheType", m_BannerCacheType );
ini.SetValueF( "Options", "DancePointsAccumulated", m_fDancePointsAccumulated );
ini.SetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem );
ini.SetValueB( "Options", "FirstRun", m_bFirstRun );
/* Only write these if they aren't the default. This ensures that we can change
+1
View File
@@ -78,6 +78,7 @@ public:
bool m_bShowDancingCharacters;
float m_fDancePointsAccumulated;
bool m_bUseUnlockSystem;
bool m_bFirstRun;
/* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */
int m_iBoostAppPriority;
+2
View File
@@ -294,6 +294,7 @@ void Screen::ClearMessageQueue( const ScreenMessage SM )
#include "ScreenRaveOptions.h"
#include "ScreenSelectMode.h"
#include "ScreenBackgroundOptions.h"
#include "ScreenAutoGraphicDetail.h"
Screen* Screen::Create( CString sClassName )
{
@@ -359,6 +360,7 @@ Screen* Screen::Create( CString sClassName )
IF_RETURN( ScreenSelectCharacter );
IF_RETURN( ScreenRaveOptions );
IF_RETURN( ScreenBackgroundOptions );
IF_RETURN( ScreenAutoGraphicDetail );
RageException::Throw( "Invalid Screen class name '%s'", sClassName.c_str() );
}
+27 -15
View File
@@ -17,29 +17,29 @@
#include "RageLog.h"
#include "SongManager.h"
#include "NoteFieldPositioning.h"
#include "GameManager.h"
#define BPMSPEED THEME->GetMetricF("ScreenHowToPlay","ScrollBPM")
#define SONG_BPM THEME->GetMetricF("ScreenHowToPlay","SongBPM")
#define SECONDS_TO_SHOW THEME->GetMetricF("ScreenHowToPlay","SecondsToShow")
ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
{
int iNumOfTracks = 0;
switch(GAMESTATE->m_CurGame) // which style should we use to demonstrate?
{
case GAME_DANCE: GAMESTATE->m_CurStyle = STYLE_DANCE_SINGLE; iNumOfTracks = 4; break;
case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_SINGLE; iNumOfTracks = 5; break;
case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE; iNumOfTracks = 5; break;
case GAME_PARA: GAMESTATE->m_CurStyle = STYLE_PARA_SINGLE; iNumOfTracks = 5; break;
case GAME_DS3DDX: GAMESTATE->m_CurStyle = STYLE_DS3DDX_SINGLE; iNumOfTracks = 8; break;
case GAME_BM: GAMESTATE->m_CurStyle = STYLE_BM_SINGLE; iNumOfTracks = 6; break;
default: ASSERT(0); break; // we should cover all gametypes....
}
if(iNumOfTracks < 1)
{
ASSERT(0); // crazy to have less than 1 track....
case GAME_DANCE: GAMESTATE->m_CurStyle = STYLE_DANCE_SINGLE; break;
case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_SINGLE; break;
case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE; break;
case GAME_PARA: GAMESTATE->m_CurStyle = STYLE_PARA_SINGLE; break;
case GAME_DS3DDX: GAMESTATE->m_CurStyle = STYLE_DS3DDX_SINGLE; break;
case GAME_BM: GAMESTATE->m_CurStyle = STYLE_BM_SINGLE; break;
default: ASSERT(0); // we should cover all gametypes....
}
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
int iNumOfTracks = GAMEMAN->NotesTypeToNumTracks( nt );
ASSERT(iNumOfTracks > 0); // crazy to have less than 1 track....
m_LifeMeter.Load( PLAYER_1 );
m_LifeMeter.SetXY( 480, 40 );
this->AddChild( &m_LifeMeter );
@@ -64,7 +64,8 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
pND->SetTapNote( 2, ROWS_PER_BEAT*46, TAP_TAP );
m_pSong = new Song;
m_pSong->AddBPMSegment( BPMSegment(0.0,BPMSPEED) );
float fSongBPM = SONG_BPM; // need this on a separate line, otherwise VC6 release build screws up and returns 0
m_pSong->AddBPMSegment( BPMSegment(0.0,fSongBPM) );
m_pSong->AddStopSegment( StopSegment(15,2) );
m_pSong->AddStopSegment( StopSegment(16,2) );
m_pSong->AddStopSegment( StopSegment(20,2) );
@@ -99,3 +100,14 @@ void ScreenHowToPlay::Update( float fDelta )
ScreenAttract::Update( fDelta );
}
void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
{
case SM_BeginFadingOut:
GAMESTATE->m_pCurSong = NULL;
break;
}
ScreenAttract::HandleScreenMessage( SM );
}
+1
View File
@@ -21,6 +21,7 @@ public:
~ScreenHowToPlay();
virtual void Update( float fDelta );
virtual void HandleScreenMessage( const ScreenMessage SM );
protected:
LifeMeterBar m_LifeMeter;
+2 -2
View File
@@ -137,10 +137,10 @@ void ScreenSystemLayer::SystemMessage( CString sMessage )
m_textSystemMessage.SetText( sMessage );
m_textSystemMessage.SetDiffuse( RageColor(1,1,1,1) );
m_textSystemMessage.SetX( -640 );
m_textSystemMessage.BeginTweening( 0.3f );
m_textSystemMessage.BeginTweening( 0.5f );
m_textSystemMessage.SetX( 4 );
m_textSystemMessage.BeginTweening( 5 );
m_textSystemMessage.BeginTweening( 0.3f );
m_textSystemMessage.BeginTweening( 0.5f );
m_textSystemMessage.SetDiffuse( RageColor(1,1,1,0) );
}
+4
View File
@@ -28,6 +28,7 @@
enum {
OM_APPEARANCE,
OM_AUTO_GRAPHIC,
OM_AUTOGEN,
OM_BACKGROUND,
OM_CONFIG_KEY_JOY,
@@ -41,6 +42,7 @@ enum {
OptionRow g_OptionsMenuLines[NUM_OPTIONS_MENU_LINES] = {
OptionRow( "", "Appearance Options" ),
OptionRow( "", "Auto Adjust Graphic Detail" ),
OptionRow( "", "Autogen Options" ),
OptionRow( "", "Background Options" ),
OptionRow( "", "Config Key/Joy Mappings" ),
@@ -57,6 +59,7 @@ ScreenOptionsMenu::ScreenOptionsMenu() :
LOG->Trace( "ScreenOptionsMenu::ScreenOptionsMenu()" );
/* We might have been entered from anywhere; make sure all players are enabled. */
GAMESTATE->m_pCurSong = NULL;
for( int p=0; p<NUM_PLAYERS; p++ )
GAMESTATE->m_bSideIsJoined[p] = true;
GAMESTATE->m_MasterPlayerNumber = PlayerNumber(0);
@@ -95,6 +98,7 @@ void ScreenOptionsMenu::GoToNextState()
switch( this->m_iCurrentRow[0] )
{
case OM_APPEARANCE: SCREENMAN->SetNewScreen("ScreenAppearanceOptions"); break;
case OM_AUTO_GRAPHIC: SCREENMAN->SetNewScreen("ScreenAutoGraphicDetail"); break;
case OM_AUTOGEN: SCREENMAN->SetNewScreen("ScreenAutogenOptions"); break;
case OM_BACKGROUND: SCREENMAN->SetNewScreen("ScreenBackgroundOptions"); break;
case OM_CONFIG_KEY_JOY: SCREENMAN->SetNewScreen("ScreenMapControllers"); break;
+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();
}
}
}
}
+32 -11
View File
@@ -63,10 +63,10 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# Begin Special Build Tool
IntDir=.\Win32_Debug_OGL_VC6
TargetDir=\projects\stepmania\stepmania
TargetDir=\stepmania\stepmania
TargetName=StepMania-debug-ogl
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -103,10 +103,10 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# Begin Special Build Tool
IntDir=.\Win32_Debug_D3D_VC6
TargetDir=\projects\stepmania\stepmania
TargetDir=\stepmania\stepmania
TargetName=StepMania-debug-d3d
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -142,7 +142,7 @@ CPP=cl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
# Begin Special Build Tool
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -175,14 +175,14 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../release6/StepMania.pdb" /map /debug /machine:I386
# SUBTRACT BASE LINK32 /verbose /pdb:none
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"Win32_Release_D3D_VC6/StepMania.pdb" /map /debug /machine:I386 /out:"../StepMania-d3d.exe"
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../StepMania-d3d.exe"
# SUBTRACT LINK32 /verbose /pdb:none
# Begin Special Build Tool
IntDir=.\Win32_Release_D3D_VC6
TargetDir=\projects\stepmania\stepmania
TargetDir=\stepmania\stepmania
TargetName=StepMania-d3d
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -215,14 +215,14 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../release6/StepMania.pdb" /map /debug /machine:I386
# SUBTRACT BASE LINK32 /verbose /pdb:none
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"Win32_Release_OGL_VC6/StepMania.pdb" /map /debug /machine:I386 /out:"../StepMania-ogl.exe"
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../StepMania-ogl.exe"
# SUBTRACT LINK32 /verbose /pdb:none
# Begin Special Build Tool
IntDir=.\Win32_Release_OGL_VC6
TargetDir=\projects\stepmania\stepmania
TargetDir=\stepmania\stepmania
TargetName=StepMania-ogl
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -3943,6 +3943,27 @@ SOURCE=.\ScreenAutogenOptions.h
# End Source File
# Begin Source File
SOURCE=.\ScreenAutoGraphicDetail.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug OGL"
!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ScreenAutoGraphicDetail.h
# End Source File
# Begin Source File
SOURCE=.\ScreenBackgroundOptions.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug OGL"
@@ -67,7 +67,7 @@ bool LowLevelWindow_SDL::SetVideoMode( bool windowed, int width, int height, int
SDL_InitSubSystem(SDL_INIT_VIDEO);
/* Put them back. */
for( int i = 0; i < SDL_NUMEVENTS; ++i)
for( i = 0; i < SDL_NUMEVENTS; ++i)
mySDL_EventState((Uint8) i, EventEnabled[i]);
mySDL_PushEvents(events);