# HG changeset patch # User henry # Date 1036263376 0 # Node ID 3d2ec2568659cae8537102481b4f20482f13c296 # Parent e550de4bd477b3fb506f1db08aad7cea4b00ca97 fix for fs modes on widescreen displays diff -r e550de4bd477 -r 3d2ec2568659 libvo/vo_sdl.c --- a/libvo/vo_sdl.c Sat Nov 02 18:32:11 2002 +0000 +++ b/libvo/vo_sdl.c Sat Nov 02 18:56:16 2002 +0000 @@ -700,15 +700,24 @@ screen_surface_h = priv->XHeight; } else if (mode < 0) { - int i; + int i,j,imax; mode = 0; // Default to the biggest mode avaible + if (verbose) for(i=0;priv->fullmodes[i];++i) + printf("SDL Mode: %d: %d x %d\n", i, priv->fullmodes[i]->w, priv->fullmodes[i]->h); for(i = findArrayEnd(priv->fullmodes) - 1; i >=0; i--) { if( (priv->fullmodes[i]->w >= priv->dstwidth) && (priv->fullmodes[i]->h >= priv->dstheight) ) { - mode = i; - break; + imax = i; + for (j = findArrayEnd(priv->fullmodes) - 1; j >=0; j--) { + if (priv->fullmodes[j]->w > priv->fullmodes[imax]->w + && priv->fullmodes[j]->h == priv->fullmodes[imax]->h) + imax = j; + } + mode = imax; + break; + } } - } + if (verbose) printf("SET SDL Mode: %d: %d x %d\n", mode, priv->fullmodes[mode]->w, priv->fullmodes[mode]->h); priv->fullmode = mode; screen_surface_h = priv->fullmodes[mode]->h; screen_surface_w = priv->fullmodes[mode]->w;