From 35dd23cea816adff3891d62ea47aec6aa0aba990 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 27 Jul 2006 01:31:18 +0200 Subject: [PATCH] rnd-20060727-1-src --- src/conftime.h | 2 +- src/init.c | 39 +++++++++++++++++++++++++++++++++++++++ src/libgame/misc.c | 39 --------------------------------------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index 2ceed3b0..6b2512d6 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-07-26 21:19]" +#define COMPILE_DATE_STRING "[2006-07-27 00:18]" diff --git a/src/init.c b/src/init.c index 79e183ed..a73dec0e 100644 --- a/src/init.c +++ b/src/init.c @@ -4221,6 +4221,45 @@ void Execute_Command(char *command) global.convert_level_nr = atoi(str_ptr); /* get level_nr value */ } } + +#if DEBUG +#if defined(TARGET_SDL) + else if (strEqual(command, "SDL_ListModes")) + { + SDL_Rect **modes; + int i; + + SDL_Init(SDL_INIT_VIDEO); + + /* get available fullscreen/hardware modes */ + modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE); + + /* check if there are any modes available */ + if (modes == NULL) + { + printf("No modes available!\n"); + + exit(-1); + } + + /* check if our resolution is restricted */ + if (modes == (SDL_Rect **)-1) + { + printf("All resolutions available.\n"); + } + else + { + /* print valid modes */ + printf("Available Modes:\n"); + for(i = 0; modes[i]; i++) + printf(" %d x %d\n", modes[i]->w, modes[i]->h); + } + + exit(0); + } +#endif +#endif + else { Error(ERR_EXIT_HELP, "unrecognized command '%s'", command); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index c671d4b7..26c338ca 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -843,45 +843,6 @@ void GetOptions(char *argv[], void (*print_usage_function)(void)) /* when doing batch processing, always enable verbose mode (warnings) */ options.verbose = TRUE; } -#if 1 -#if DEBUG -#if defined(TARGET_SDL) - else if (strncmp(option, "-SDL_ListModes", option_len) == 0) - { - SDL_Rect **modes; - int i; - - SDL_Init(SDL_INIT_VIDEO); - - /* get available fullscreen/hardware modes */ - modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); - - /* check if there are any modes available */ - if (modes == (SDL_Rect **)0) - { - printf("No modes available!\n"); - - exit(-1); - } - - /* check if our resolution is restricted */ - if (modes == (SDL_Rect **)-1) - { - printf("All resolutions available.\n"); - } - else - { - /* print valid modes */ - printf("Available Modes:\n"); - for(i = 0; modes[i]; i++) - printf(" %d x %d\n", modes[i]->w, modes[i]->h); - } - - exit(0); - } -#endif -#endif -#endif else if (*option == '-') { Error(ERR_EXIT_HELP, "unrecognized option '%s'", option_str); -- 2.34.1