From 0c5125522daff4e189f30386a55e36e1569d764b Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 24 Nov 2011 09:49:30 +0000 Subject: [PATCH] Fixed --log=file/terminal (the stdout/err files were opened before the command line flag was tested, so the behaviour depended on the setting in the previous runs, which were saved). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/physics@10249 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/main.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b560cba02..5c6042372 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -456,6 +456,15 @@ int handleCmdLinePreliminary(int argc, char **argv) { UserConfigParams::m_verbosity |= UserConfigParams::LOG_MISC; } + else if( !strcmp(argv[i], "--log=terminal")) + { + UserConfigParams::m_log_errors=false; + } + else if( !strcmp(argv[i], "--log=file")) + { + UserConfigParams::m_log_errors=true; + } + else if ( !strcmp(argv[i], "--debug=all") ) { UserConfigParams::m_verbosity |= UserConfigParams::LOG_ALL; @@ -863,14 +872,7 @@ int handleCmdLine(int argc, char **argv) race_manager->setNumLaps(atoi(argv[i+1])); i++; } - else if( !strcmp(argv[i], "--log=terminal")) - { - UserConfigParams::m_log_errors=false; - } - else if( !strcmp(argv[i], "--log=file")) - { - UserConfigParams::m_log_errors=true; - } else if( sscanf(argv[i], "--profile-laps=%d", &n)==1) + else if( sscanf(argv[i], "--profile-laps=%d", &n)==1) { printf("Profiling %d laps\n",n); UserConfigParams::m_no_start_screen = true; @@ -927,6 +929,8 @@ int handleCmdLine(int argc, char **argv) else if( !strcmp(argv[i], "--debug=flyable") ) {} else if( !strcmp(argv[i], "--debug=misc" ) ) {} else if( !strcmp(argv[i], "--debug=all" ) ) {} + else if( !strcmp(argv[i], "--log=terminal" ) ) {} + else if( !strcmp(argv[i], "--log=file" ) ) {} else if( !strcmp(argv[i], "--screensize") || !strcmp(argv[i], "-s") ) {i++;} else if( !strcmp(argv[i], "--fullscreen") || !strcmp(argv[i], "-f")) {}