X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=a73dec0e9d0042f8e042e4b551094732abfe2ab6;hb=35dd23cea816adff3891d62ea47aec6aa0aba990;hp=c975ec616a5d194cf485ef238d3027fd15c7f362;hpb=bc76bd63993e350f699d1420ebd9ae3ac573f407;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index c975ec61..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); @@ -4874,5 +4913,8 @@ void CloseAllAndExit(int exit_value) CloseVideoDisplay(); ClosePlatformDependentStuff(); + if (exit_value != 0) + NotifyUserAboutErrorFile(); + exit(exit_value); }