From 251224533281d9f77010eaaa269c7ea09614c087 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 18 Dec 2003 21:16:43 +0000 Subject: [PATCH] add ScreenTestMode --- stepmania/src/PrefsManager.cpp | 3 + stepmania/src/PrefsManager.h | 1 + stepmania/src/ScreenNameEntryTraditional.cpp | 68 ++++++++++---------- stepmania/src/StepMania.cpp | 7 +- 4 files changed, 43 insertions(+), 36 deletions(-) diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 361e97a1ae..8d3f81ac08 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -194,6 +194,7 @@ PrefsManager::PrefsManager() m_bAllowUnacceleratedRenderer = false; m_bThreadedInput = true; + m_bScreenTestMode = false; m_sIgnoredMessageWindows = ""; m_sCoursesToShowRanking = ""; @@ -318,6 +319,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk() ini.GetValue( "Options", "ShowSongOptions", (int&)m_ShowSongOptions ); ini.GetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer ); ini.GetValue( "Options", "ThreadedInput", m_bThreadedInput ); + ini.GetValue( "Options", "ScreenTestMode", m_bScreenTestMode ); ini.GetValue( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows ); ini.GetValue( "Options", "SoloSingle", m_bSoloSingle ); ini.GetValue( "Options", "DancePointsForOni", m_bDancePointsForOni ); @@ -478,6 +480,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "ShowSongOptions", m_ShowSongOptions ); ini.SetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer ); ini.SetValue( "Options", "ThreadedInput", m_bThreadedInput ); + ini.SetValue( "Options", "ScreenTestMode", m_bScreenTestMode ); ini.SetValue( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows ); ini.SetValue( "Options", "SoloSingle", m_bSoloSingle ); ini.SetValue( "Options", "DancePointsForOni", m_bDancePointsForOni ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 685c3001f3..a4a72e9870 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -162,6 +162,7 @@ public: int m_iSoundResampleQuality; bool m_bAllowUnacceleratedRenderer; bool m_bThreadedInput; + bool m_bScreenTestMode; CString m_sIgnoredMessageWindows; diff --git a/stepmania/src/ScreenNameEntryTraditional.cpp b/stepmania/src/ScreenNameEntryTraditional.cpp index 83706bbd3a..76203458c3 100644 --- a/stepmania/src/ScreenNameEntryTraditional.cpp +++ b/stepmania/src/ScreenNameEntryTraditional.cpp @@ -61,44 +61,42 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S LOG->Trace( "ScreenNameEntryTraditional::ScreenNameEntryTraditional()" ); - - // DEBUGGING STUFF - if(0) + if( PREFSMAN->m_bScreenTestMode ) { - GAMESTATE->m_bSideIsJoined[PLAYER_1] = true; - GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; - GAMESTATE->m_MasterPlayerNumber = PLAYER_1; - GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; - GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS; - StageStats st; - for( int z = 0; z < 3; ++z ) - { - st.pSong = SONGMAN->GetRandomSong(); - ASSERT( st.pSong ); - ASSERT( st.pSong->m_apNotes.size() ); - for( int i = 0; i < 2; ++i ) - { - GAMESTATE->m_pCurNotes[i] = st.pSteps[i] = st.pSong->m_apNotes[0]; - st.iPossibleDancePoints[i] = 1000; - st.iActualDancePoints[i] = 985; - - Steps::MemCardData::HighScore hs; - hs.grade = GRADE_A; - hs.iScore = 42; - int a, b; - GAMESTATE->m_pCurNotes[i]->AddHighScore( (PlayerNumber)i, hs, a,b ); - - if( i == 0 ) + GAMESTATE->m_bSideIsJoined[PLAYER_1] = true; + GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; + GAMESTATE->m_MasterPlayerNumber = PLAYER_1; + GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; + GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS; + StageStats st; + for( int z = 0; z < 3; ++z ) { - ProfileManager::CategoryData::HighScore hs; - hs.iScore = 1234567; - StepsType nt = GAMESTATE->GetCurrentStyleDef()->m_StepsType; - PROFILEMAN->AddHighScore( nt, RANKING_A, (PlayerNumber)i, hs, a ); - } - } + st.pSong = SONGMAN->GetRandomSong(); + ASSERT( st.pSong ); + ASSERT( st.pSong->m_apNotes.size() ); + for( int i = 0; i < 2; ++i ) + { + GAMESTATE->m_pCurNotes[i] = st.pSteps[i] = st.pSong->m_apNotes[0]; + st.iPossibleDancePoints[i] = 1000; + st.iActualDancePoints[i] = 985; - GAMESTATE->m_vPlayedStageStats.push_back( st ); - } + Steps::MemCardData::HighScore hs; + hs.grade = GRADE_A; + hs.iScore = 42; + int a, b; + GAMESTATE->m_pCurNotes[i]->AddHighScore( (PlayerNumber)i, hs, a,b ); + + if( i == 0 ) + { + ProfileManager::CategoryData::HighScore hs; + hs.iScore = 1234567; + StepsType nt = GAMESTATE->GetCurrentStyleDef()->m_StepsType; + PROFILEMAN->AddHighScore( nt, RANKING_A, (PlayerNumber)i, hs, a ); + } + } + + GAMESTATE->m_vPlayedStageStats.push_back( st ); + } } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index fdbf262e1c..57db08cbce 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1079,7 +1079,12 @@ bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput Gam BOOKKEEPER->WriteToDisk(); PROFILEMAN->SaveMachineScoresToDisk(); - SCREENMAN->SystemMessage( "Reloaded metrics and textures" ); + /* If we're in screen test mode, reload the screen. */ + if( PREFSMAN->m_bScreenTestMode ) + ResetGame( true ); + else + SCREENMAN->SystemMessage( "Reloaded metrics and textures" ); + return true; } #ifndef DARWIN