src/video/SDL_video.c
changeset 1257 448a9a64537b
parent 1254 c2ee0f7fa711
child 1266 a7bea6db3c3e
--- a/src/video/SDL_video.c	Thu Jan 19 18:08:28 2006 +0000
+++ b/src/video/SDL_video.c	Thu Jan 19 21:28:52 2006 +0000
@@ -488,8 +488,11 @@
 			if ((sizes[i]->w >= *w) && (sizes[i]->h >= *h)) {
 				/* Mode with any dimension smaller or equal than current best ? */
 				if ((sizes[i]->w <= sizes[best]->w) || (sizes[i]->h <= sizes[best]->h)) {
-					best=i;
-					supported = 1;
+					/* Now choose the mode that has less pixels */
+					if ((sizes[i]->w * sizes[i]->h) < (sizes[best]->w * sizes[best]->h)) {
+						best=i;
+						supported = 1;
+					}
 				}
 			}
 		}