Oops, actually use the timings in the modes db. :)
authorSam Lantinga <slouken@libsdl.org>
Mon, 02 Jan 2006 09:32:54 +0000
changeset 1217ae9981987c2f
parent 1216 f8fc6fdd589d
child 1218 057d313e36a2
Oops, actually use the timings in the modes db. :)
FIXME: Add some way of specifying the refresh rate we want to select!
src/video/fbcon/SDL_fbvideo.c
     1.1 --- a/src/video/fbcon/SDL_fbvideo.c	Mon Jan 02 09:13:16 2006 +0000
     1.2 +++ b/src/video/fbcon/SDL_fbvideo.c	Mon Jan 02 09:32:54 2006 +0000
     1.3 @@ -770,10 +770,19 @@
     1.4  	if ( modesdb ) {
     1.5  		/* Parse the mode definition file */
     1.6  		while ( read_fbmodes_mode(modesdb, &cinfo) ) {
     1.7 -			if ( vinfo->xres == cinfo.xres &&
     1.8 -			     vinfo->yres == cinfo.yres ) {
     1.9 +			if ( (vinfo->xres == cinfo.xres && vinfo->yres == cinfo.yres) &&
    1.10 +			     (!matched || (vinfo->bits_per_pixel == cinfo.bits_per_pixel)) ) {
    1.11 +				vinfo->pixclock = cinfo.pixclock;
    1.12 +				vinfo->left_margin = cinfo.left_margin;
    1.13 +				vinfo->right_margin = cinfo.right_margin;
    1.14 +				vinfo->upper_margin = cinfo.upper_margin;
    1.15 +				vinfo->lower_margin = cinfo.lower_margin;
    1.16 +				vinfo->hsync_len = cinfo.hsync_len;
    1.17 +				vinfo->vsync_len = cinfo.vsync_len;
    1.18 +				if ( matched ) {
    1.19 +					break;
    1.20 +				}
    1.21  				matched = 1;
    1.22 -				break;
    1.23  			}
    1.24  		}
    1.25  		fclose(modesdb);