iOS/libraries/allegro/allegro/src/modesel.c
/* create_driver_list:
 *  Fills the list of video cards with info about the available drivers.
 *  Returns -1 on failure.
 */
Fills the list of video cards with info about the available drivers.
Returns -1 on failure.
Fills the list of video cards with info about the available drivers . Returns - 1 on failure .
static int create_driver_list(FILTER_FUNCTION filter)
{
   _DRIVER_INFO *driver_info;
   GFX_DRIVER *gfx_driver;
   int i;
   int list_pos;
   if (system_driver->gfx_drivers)
      driver_info = system_driver->gfx_drivers();
   else
      driver_info = _gfx_driver_list;
   driver_list = _AL_MALLOC(sizeof(DRIVER_LIST) * 3);
   if (!driver_list) return -1;
   list_pos = 0;
   driver_list[list_pos].id = GFX_AUTODETECT;
   ustrzcpy(driver_list[list_pos].name, DRVNAME_SIZE, get_config_text("Autodetect"));
   create_mode_list(&driver_list[list_pos], filter);
   if (driver_list[list_pos].mode_count > 0)
      list_pos++;
   driver_list[list_pos].id = GFX_AUTODETECT_FULLSCREEN;
   ustrzcpy(driver_list[list_pos].name, DRVNAME_SIZE, get_config_text("Auto fullscreen"));
   create_mode_list(&driver_list[list_pos], filter);
   if (driver_list[list_pos].mode_count > 0)
      list_pos++;
   driver_list[list_pos].id = GFX_AUTODETECT_WINDOWED;
   ustrzcpy(driver_list[list_pos].name, DRVNAME_SIZE, get_config_text("Auto windowed"));
   create_mode_list(&driver_list[list_pos], filter);
   if (driver_list[list_pos].mode_count > 0)
      list_pos++;
   for (i = 0; driver_info[i].driver; i++) {
      driver_list = _al_sane_realloc(driver_list, sizeof(DRIVER_LIST) * (list_pos + 1));
      if (!driver_list) return -1;
      driver_list[list_pos].id = driver_info[i].id;
      gfx_driver = driver_info[i].driver;
      do_uconvert(gfx_driver->ascii_name, U_ASCII, driver_list[list_pos].name, U_CURRENT, DRVNAME_SIZE);
      create_mode_list(&driver_list[list_pos], filter);
      if (driver_list[list_pos].mode_count > 0) {
	 list_pos++;
      }
      else {
	 ASSERT(driver_list[list_pos].mode_list == NULL);
      }
   }
   driver_count = list_pos;
   return 0;
}
static int create_driver_list ( FILTER_FUNCTION filter ) { _DRIVER_INFO * driver_info ; GFX_DRIVER * gfx_driver ; int i ; int list_pos ; if ( system_driver -> gfx_drivers ) driver_info = system_driver -> gfx_drivers ( ) ; else driver_info = _gfx_driver_list ; driver_list = _AL_MALLOC ( sizeof ( DRIVER_LIST ) * 3 ) ; if ( ! driver_list ) return -1 ; list_pos = 0 ; driver_list [ list_pos ] . id = GFX_AUTODETECT ; ustrzcpy ( driver_list [ list_pos ] . name , DRVNAME_SIZE , get_config_text ( " " ) ) ; create_mode_list ( & driver_list [ list_pos ] , filter ) ; if ( driver_list [ list_pos ] . mode_count > 0 ) list_pos ++ ; driver_list [ list_pos ] . id = GFX_AUTODETECT_FULLSCREEN ; ustrzcpy ( driver_list [ list_pos ] . name , DRVNAME_SIZE , get_config_text ( " " ) ) ; create_mode_list ( & driver_list [ list_pos ] , filter ) ; if ( driver_list [ list_pos ] . mode_count > 0 ) list_pos ++ ; driver_list [ list_pos ] . id = GFX_AUTODETECT_WINDOWED ; ustrzcpy ( driver_list [ list_pos ] . name , DRVNAME_SIZE , get_config_text ( " " ) ) ; create_mode_list ( & driver_list [ list_pos ] , filter ) ; if ( driver_list [ list_pos ] . mode_count > 0 ) list_pos ++ ; for ( i = 0 ; driver_info [ i ] . driver ; i ++ ) { driver_list = _al_sane_realloc ( driver_list , sizeof ( DRIVER_LIST ) * ( list_pos + 1 ) ) ; if ( ! driver_list ) return -1 ; driver_list [ list_pos ] . id = driver_info [ i ] . id ; gfx_driver = driver_info [ i ] . driver ; do_uconvert ( gfx_driver -> ascii_name , U_ASCII , driver_list [ list_pos ] . name , U_CURRENT , DRVNAME_SIZE ) ; create_mode_list ( & driver_list [ list_pos ] , filter ) ; if ( driver_list [ list_pos ] . mode_count > 0 ) { list_pos ++ ; } else { ASSERT ( driver_list [ list_pos ] . mode_list == NULL ) ; } } driver_count = list_pos ; return 0 ; }
create_driver_list:
  Fills the list of video cards with info about the available drivers.
create_driver_list : Fills the list of video cards with info about the available drivers .
/* update global variable */