SDL_GetVideoMode, part 3: pixel count compare was failing when only 1 video mode was present

This commit is contained in:
Patrice Mandin 2006-01-25 18:11:56 +00:00
parent cefbe73b27
commit f9db8339c3

View File

@ -489,7 +489,7 @@ static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags)
/* Mode with any dimension smaller or equal than current best ? */
if ((sizes[i]->w <= sizes[best]->w) || (sizes[i]->h <= sizes[best]->h)) {
/* Now choose the mode that has less pixels */
if ((sizes[i]->w * sizes[i]->h) < (sizes[best]->w * sizes[best]->h)) {
if ((sizes[i]->w * sizes[i]->h) <= (sizes[best]->w * sizes[best]->h)) {
best=i;
supported = 1;
}