X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=a810b6d11072c89d0389712014ae6b54cfb3063f;hb=4dba06ad2079d7f9df56ec5512c6d27a0cf8c18e;hp=c04c256dd4989c54d363fb06fb958e90732f581b;hpb=f2d0f3fed679ea3573f51aa298adce2d9a78d8be;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index c04c256d..a810b6d1 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -470,7 +470,7 @@ static char *getLastPathSeparatorPtr(char *filename) return last_separator; } -static char *getBaseNamePtr(char *filename) +char *getBaseNamePtr(char *filename) { char *last_separator = getLastPathSeparatorPtr(filename); @@ -750,6 +750,45 @@ 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);