From 01452ecca0c75ebb4f48260b33687ca05b66435a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 5 Oct 2006 00:48:32 +0000 Subject: [PATCH] split SwitchToLastPlayedGame and ReadGamePrefsFromDisk --- stepmania/src/StepMania.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 61edd4bb33..fda01bf1d2 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -768,13 +768,9 @@ void StepMania::ChangeCurrentGame( const Game* g ) } } -static void ReadGamePrefsFromDisk() +static void SwitchToLastPlayedGame() { - ASSERT( GAMESTATE ); - ASSERT( ANNOUNCER ); - ASSERT( THEME ); ASSERT( GAMEMAN ); - const Game *pGame = GAMEMAN->StringToGameType( PREFSMAN->GetCurrentGame() ); /* If the active game type isn't actually available, revert to the default. */ @@ -793,6 +789,13 @@ static void ReadGamePrefsFromDisk() RageException::Throw( "Default NoteSkin for \"%s\" missing", pGame->m_szName ); StepMania::ChangeCurrentGame( pGame ); +} + +static void ReadGamePrefsFromDisk() +{ + ASSERT( GAMESTATE ); + ASSERT( ANNOUNCER ); + ASSERT( THEME ); RString sAnnouncer = PREFSMAN->m_sAnnouncer; RString sTheme = PREFSMAN->m_sTheme; @@ -1010,7 +1013,8 @@ int main(int argc, char* argv[]) ANNOUNCER = new AnnouncerManager; NOTESKIN = new NoteSkinManager; - /* Set up the theme and announcer, and switch to the last game type. */ + /* Switch to the last used game type, and set up the theme and announcer. */ + SwitchToLastPlayedGame(); ReadGamePrefsFromDisk(); {