From f88e763c7c9f603a814c8b10d44763ea80c1e1e8 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 27 Jun 2010 16:49:21 -0500 Subject: [PATCH] add --game= command line parameter --- Docs/Changelog_sm-ssc.txt | 1 + src/StepMania.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 9bc40e0a53..23e2584cfa 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -13,6 +13,7 @@ _____________________________________________________________________________ -------- * [NotesLoaderKSF] Support reading of #PLAYER and #MUSICINTRO/#INTRO tags in KSF files. [based on code by Aldo_MX] +* Added --game= command line option. 20100626 -------- diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 4fddeb013a..560678dba6 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -1147,7 +1147,17 @@ int main(int argc, char* argv[]) INPUTFILTER = new InputFilter; INPUTMAPPER = new InputMapper; - StepMania::ChangeCurrentGame( GAMESTATE->GetCurrentGame() ); + // allow the player to pass in a gametype via command line. -aj + RString argGame; + const Game* g = GAMESTATE->GetCurrentGame(); + if( GetCommandlineArgument( "game",&argGame) ) + { + // we need to perform some conversion surgery + const Game* newG = GAMEMAN->StringToGame(argGame); + if(newG && newG != g) + g = newG; + } + StepMania::ChangeCurrentGame( g ); INPUTQUEUE = new InputQueue; SONGINDEX = new SongCacheIndex;