Преглед на файлове

Prefer display modes that exactly match the desired format or refresh rate

Cameron Cawley преди 1 година
родител
ревизия
6c6b497f89
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      src/video/SDL_video.c

+ 2 - 2
src/video/SDL_video.c

@@ -994,7 +994,7 @@ static SDL_DisplayMode *SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay *di
             match = current;
             continue;
         }
-        if (current->format != match->format) {
+        if (current->format != match->format && match->format != target_format) {
             /* Sorted highest depth to lowest */
             if (current->format == target_format ||
                 (SDL_BITSPERPIXEL(current->format) >=
@@ -1005,7 +1005,7 @@ static SDL_DisplayMode *SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay *di
             }
             continue;
         }
-        if (current->refresh_rate != match->refresh_rate) {
+        if (current->refresh_rate != match->refresh_rate && match->refresh_rate != target_refresh_rate) {
             /* Sorted highest refresh to lowest */
             if (current->refresh_rate >= target_refresh_rate) {
                 match = current;