Commit 39969245 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #605, per Martin's suggestion

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403250
parent 22598bbc
...@@ -488,11 +488,20 @@ SDL_GetClosestDisplayMode(const SDL_DisplayMode * mode, ...@@ -488,11 +488,20 @@ SDL_GetClosestDisplayMode(const SDL_DisplayMode * mode,
for (i = 0; i < SDL_GetNumDisplayModes(); ++i) { for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
current = &SDL_CurrentDisplay.display_modes[i]; current = &SDL_CurrentDisplay.display_modes[i];
if ((current->w && current->h) && if (current->w && (current->w < mode->w)) {
(current->w < mode->w || current->h < mode->h)) {
/* Out of sorted modes large enough here */ /* Out of sorted modes large enough here */
break; 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) { if (!match || current->w < match->w || current->h < match->h) {
match = current; match = current;
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment