From a3bf4bfe328a198abfc290c2bfa158156bba5d5a Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 28 Sep 2011 07:04:42 +0000 Subject: [PATCH] - modified the following commands so they don't required SDL video mode: --help --version --show-ini-settings --- .../include/platform/sdl/platform_main.h | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/source/shared_lib/include/platform/sdl/platform_main.h b/source/shared_lib/include/platform/sdl/platform_main.h index e6d60d110..5fc75140c 100644 --- a/source/shared_lib/include/platform/sdl/platform_main.h +++ b/source/shared_lib/include/platform/sdl/platform_main.h @@ -265,19 +265,22 @@ bool hasCommandArgument(int argc, char** argv,const string argName, int *foundIn return result; } -#define MAIN_FUNCTION(X) int main(int argc, char **argv) \ -{ \ - if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_MASTERSERVER_MODE])) == true) { \ - if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) { \ - std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \ - return 1; \ - } \ - } \ - else { \ - if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { \ - std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \ - return 1; \ - } \ +#define MAIN_FUNCTION(X) int main(int argc, char **argv) \ +{ \ + if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_HELP])) == true || \ + hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_VERSION])) == true || \ + hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_SHOW_INI_SETTINGS])) == true || \ + hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_MASTERSERVER_MODE])) == true) { \ + if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) { \ + std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \ + return 1; \ + } \ + } \ + else { \ + if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { \ + std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \ + return 1; \ + } \ } \ SDL_EnableUNICODE(1); \ int result = X(argc, argv); \