Fixed bug #605, per Martin's suggestion
authorSam Lantinga <slouken@libsdl.org>
Tue, 25 Nov 2008 20:06:27 +0000
changeset 2789985001797115
parent 2788 44be910366a9
child 2790 8c9fa61a521c
Fixed bug #605, per Martin's suggestion
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Tue Nov 25 08:40:52 2008 +0000
     1.2 +++ b/src/video/SDL_video.c	Tue Nov 25 20:06:27 2008 +0000
     1.3 @@ -488,11 +488,20 @@
     1.4      for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
     1.5          current = &SDL_CurrentDisplay.display_modes[i];
     1.6  
     1.7 -        if ((current->w && current->h) &&
     1.8 -            (current->w < mode->w || current->h < mode->h)) {
     1.9 +        if (current->w && (current->w < mode->w)) {
    1.10              /* Out of sorted modes large enough here */
    1.11              break;
    1.12          }
    1.13 +        if (current->h && (current->h < mode->h)) {
    1.14 +            if (current->w && (current->w == mode->w)) {
    1.15 +                /* Out of sorted modes large enough here */
    1.16 +                break;
    1.17 +            }
    1.18 +            /* Wider, but not tall enough, due to a different
    1.19 +               aspect ratio. This mode must be skipped, but closer
    1.20 +               modes may still follow. */
    1.21 +            continue;
    1.22 +        }
    1.23          if (!match || current->w < match->w || current->h < match->h) {
    1.24              match = current;
    1.25              continue;