X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=a1b92d253eb63a7cd292fa64459d6b72574cecfa;hb=6fd606e95cceca17c82e2f97e2ca2832b238f96d;hp=e3bdd9c8f33fe0ca3f351f13cc0e9a294ecc5ada;hpb=d6a1a6cb31174ac804f9ad54a919d65478da588f;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index e3bdd9c8..a1b92d25 100644 --- a/src/init.c +++ b/src/init.c @@ -5213,8 +5213,56 @@ void Execute_Command(char *command) } #if DEBUG -#if defined(TARGET_SDL) -#if !defined(TARGET_SDL2) +#if defined(TARGET_SDL2) + else if (strEqual(command, "SDL_ListModes")) + { + SDL_Init(SDL_INIT_VIDEO); + + int num_displays = SDL_GetNumVideoDisplays(); + + // check if there are any displays available + if (num_displays < 0) + { + printf("No displays available: %s\n", SDL_GetError()); + + exit(-1); + } + + for (i = 0; i < num_displays; i++) + { + int num_modes = SDL_GetNumDisplayModes(i); + int j; + + printf("Available display modes for display %d:\n", i); + + // check if there are any display modes available for this display + if (num_modes < 0) + { + printf("No display modes available for display %d: %s\n", + i, SDL_GetError()); + + exit(-1); + } + + for (j = 0; j < num_modes; j++) + { + SDL_DisplayMode mode; + + if (SDL_GetDisplayMode(i, j, &mode) < 0) + { + printf("Cannot get display mode %d for display %d: %s\n", + j, i, SDL_GetError()); + + exit(-1); + } + + printf("- %d x %d\n", mode.w, mode.h); + } + } + + exit(0); + } +#elif defined(TARGET_SDL) else if (strEqual(command, "SDL_ListModes")) { SDL_Rect **modes; @@ -5240,16 +5288,15 @@ void Execute_Command(char *command) } else { - printf("Available Modes:\n"); + printf("Available display modes:\n"); - for(i = 0; modes[i]; i++) - printf(" %d x %d\n", modes[i]->w, modes[i]->h); + for (i = 0; modes[i]; i++) + printf("- %d x %d\n", modes[i]->w, modes[i]->h); } exit(0); } #endif -#endif #endif else @@ -5546,14 +5593,15 @@ void InitGfx() font_height = getFontHeight(FC_RED); #if 1 - DrawInitText(getWindowTitleString(), 20, FC_YELLOW); + DrawInitTextAlways(getWindowTitleString(), 20, FC_YELLOW); #else - DrawInitText(getProgramInitString(), 20, FC_YELLOW); + DrawInitTextAlways(getProgramInitString(), 20, FC_YELLOW); #endif - DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED); - DrawInitText(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, FC_RED); + DrawInitTextAlways(PROGRAM_COPYRIGHT_STRING, 50, FC_RED); + DrawInitTextAlways(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, + FC_RED); - DrawInitText("Loading graphics", 120, FC_GREEN); + DrawInitTextAlways("Loading graphics", 120, FC_GREEN); #if 1 #if 1 @@ -6169,6 +6217,8 @@ void ReloadCustomArtwork(int force_reload) #endif print_timestamp_done("ReloadCustomArtwork"); + + LimitScreenUpdates(FALSE); } void KeyboardAutoRepeatOffUnlessAutoplay()