# HG changeset patch # User atmos4 # Date 1008762605 0 # Node ID c9876f5f4ac539984a5b76c1a06371655abb1de2 # Parent 2dcd90d9a2461c9c814c5360d3b878d34f8ad48b better fullscreen-mode selection, patch by dunno :) diff -r 2dcd90d9a246 -r c9876f5f4ac5 libvo/vo_sdl.c --- a/libvo/vo_sdl.c Wed Dec 19 11:45:04 2001 +0000 +++ b/libvo/vo_sdl.c Wed Dec 19 11:50:05 2001 +0000 @@ -135,6 +135,7 @@ }; #include +//#include #if defined(sun) && defined(__svr4__) /* setenv is missing on solaris */ @@ -557,8 +558,19 @@ SDL_Surface *newsurface = NULL; /* if we haven't set a fullmode yet, default to the lowest res fullmode first */ - if(mode < 0) - mode = priv->fullmode = findArrayEnd(priv->fullmodes) - 1; + /* But select a mode where the full video enter */ + if (mode < 0) { + int i; + mode = 0; // Default to the biggest mode avaible + for(i = findArrayEnd(priv->fullmodes) - 1; i >=0; i--) { + if( (priv->fullmodes[i]->w >= priv->width) && + (priv->fullmodes[i]->h >= priv->height) ) { + mode = i; + break; + } + } + priv->fullmode = mode; + } aspect_save_screenres(priv->fullmodes[mode]->w, priv->fullmodes[mode]->h);