Fixed bug #605, per Martin's suggestion

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403250
This commit is contained in:
Sam Lantinga 2008-11-25 20:06:27 +00:00
parent 22598bbc06
commit 39969245f8

View file

@ -488,11 +488,20 @@ SDL_GetClosestDisplayMode(const SDL_DisplayMode * mode,
for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
current = &SDL_CurrentDisplay.display_modes[i];
if ((current->w && current->h) &&
(current->w < mode->w || current->h < mode->h)) {
if (current->w && (current->w < mode->w)) {
/* Out of sorted modes large enough here */
break;
}
if (current->h && (current->h < mode->h)) {
if (current->w && (current->w == mode->w)) {
/* Out of sorted modes large enough here */
break;
}
/* Wider, but not tall enough, due to a different
aspect ratio. This mode must be skipped, but closer
modes may still follow. */
continue;
}
if (!match || current->w < match->w || current->h < match->h) {
match = current;
continue;