461 |
461 |
462 /* Query for the list of available video modes */ |
462 /* Query for the list of available video modes */ |
463 current_w = vinfo.xres; |
463 current_w = vinfo.xres; |
464 current_h = vinfo.yres; |
464 current_h = vinfo.yres; |
465 current_index = ((vinfo.bits_per_pixel+7)/8)-1; |
465 current_index = ((vinfo.bits_per_pixel+7)/8)-1; |
466 #ifdef BROKEN_MODES |
466 if ( getenv("SDL_FB_BROKEN_MODES") != NULL ) { |
467 FB_AddMode(this, current_index, current_w, current_h); |
467 FB_AddMode(this, current_index, current_w, current_h); |
468 #else |
468 } else { |
469 for ( i=0; i<NUM_MODELISTS; ++i ) { |
469 for ( i=0; i<NUM_MODELISTS; ++i ) { |
470 SDL_nummodes[i] = 0; |
470 SDL_nummodes[i] = 0; |
471 SDL_modelist[i] = NULL; |
471 SDL_modelist[i] = NULL; |
472 for ( j=0; j<(sizeof(checkres)/sizeof(checkres[0])); ++j ) { |
472 for ( j=0; j<(sizeof(checkres)/sizeof(checkres[0])); ++j ) { |
473 unsigned int w, h; |
473 unsigned int w, h; |
474 |
474 |
475 /* See if we are querying for the current mode */ |
475 /* See if we are querying for the current mode */ |
476 w = checkres[j].w; |
476 w = checkres[j].w; |
477 h = checkres[j].h; |
477 h = checkres[j].h; |
478 if ( i == current_index ) { |
478 if ( i == current_index ) { |
479 if ( (current_w > w) || (current_h > h) ) { |
479 if ( (current_w > w) || (current_h > h) ) { |
480 /* Only check once */ |
480 /* Only check once */ |
481 FB_AddMode(this, i, current_w, current_h); |
481 FB_AddMode(this, i, current_w, current_h); |
482 current_index = -1; |
482 current_index = -1; |
|
483 } |
|
484 } |
|
485 if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) { |
|
486 FB_AddMode(this, i, w, h); |
483 } |
487 } |
484 } |
488 } |
485 if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) { |
489 } |
486 FB_AddMode(this, i, w, h); |
490 } |
487 } |
|
488 } |
|
489 } |
|
490 #endif /* BROKEN_MODES */ |
|
491 |
491 |
492 /* Fill in our hardware acceleration capabilities */ |
492 /* Fill in our hardware acceleration capabilities */ |
493 this->info.wm_available = 0; |
493 this->info.wm_available = 0; |
494 this->info.hw_available = 1; |
494 this->info.hw_available = 1; |
495 this->info.video_mem = finfo.smem_len/1024; |
495 this->info.video_mem = finfo.smem_len/1024; |