From 810586ff09de19602a9f3d1233143e79356f4dcc Mon Sep 17 00:00:00 2001 From: hikerstk Date: Wed, 11 Jul 2012 22:02:56 +0000 Subject: [PATCH] Added --type [0,1,2] command line option to allow setting the race type (0=normal, 1=time trial, 2=FTL). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11384 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/main.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 944eb73d0..3daf2ae92 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -365,6 +365,7 @@ void cmdLineHelp (char* invocation) " --list-karts Show available karts.\n" " --laps N Define number of laps to N.\n" " --mode N N=1 novice, N=2 driver, N=3 racer.\n" + " --type N N=0 Normal, N=1 Time trial, N=2 FTL\n" " --reverse Play track in reverse (if allowed)\n" // TODO: add back "--players" switch // " --players n Define number of players to between 1 and 4.\n" @@ -782,6 +783,24 @@ int handleCmdLine(int argc, char **argv) } i++; } + else if( (!strcmp(argv[i], "--type") && i+1setMinorMode(RaceManager::MINOR_MODE_NORMAL_RACE); + break; + case 1: race_manager + ->setMinorMode(RaceManager::MINOR_MODE_TIME_TRIAL); + break; + case 2: race_manager + ->setMinorMode(RaceManager::MINOR_MODE_FOLLOW_LEADER); + break; + default: + printf("Invalid race type '%d' - ignored.\n", atoi(argv[i+1])); + } + i++; + } else if( !strcmp(argv[i], "--reverse")) { race_manager->setReverseTrack(true); @@ -1412,7 +1431,6 @@ int main(int argc, char *argv[] ) // Profiling // ========= race_manager->setMajorMode (RaceManager::MAJOR_MODE_SINGLE); - race_manager->setMinorMode (RaceManager::MINOR_MODE_NORMAL_RACE); race_manager->setDifficulty(RaceManager::RD_HARD); network_manager->setupPlayerKartInfo(); race_manager->startNew(false);