Fixed bug #605, per Martin's suggestion
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403250
This commit is contained in:
parent
22598bbc06
commit
39969245f8
1 changed files with 11 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue