X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Finit.c;h=48cd370b9e97de60ce37975d78d72fe00261d7ac;hb=c7683196af3c8f1845a72dec66c1246d561b35f7;hp=79e183edea5ba353dd878b24524a4636b06421b3;hpb=3b0023fd3eacaecffa0ae6c9107c11d3abd4ac6c;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 79e183ed..48cd370b 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 + { + 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); @@ -4416,6 +4455,7 @@ void InitGfx() { char *filename_font_initial = NULL; Bitmap *bitmap_font_initial = NULL; + int font_height; int i, j; /* determine settings for initial font (for displaying startup messages) */ @@ -4475,8 +4515,11 @@ void InitGfx() InitFontGraphicInfo(); + font_height = getFontHeight(FC_RED); + DrawInitText(getProgramInitString(), 20, FC_YELLOW); DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED); + DrawInitText(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, FC_RED); DrawInitText("Loading graphics:", 120, FC_GREEN); }