iOS/libraries/allegro/allegro/src/modesel.c
/* add_mode:
 *  Helper function for adding a mode to a mode list.
 *  Returns 0 on success and -1 on failure.
 */
Helper function for adding a mode to a mode list.
Returns 0 on success and -1 on failure.
Helper function for adding a mode to a mode list . Returns 0 on success and - 1 on failure .
static int add_mode(MODE_LIST **list, int *size, int w, int h, int bpp)
{
   int mode, n;
   for (mode = 0; mode < *size; mode++) {
      if ((w == (*list)[mode].w) && (h == (*list)[mode].h)) {
	 (*list)[mode].has_bpp[bpp_index(bpp)] = TRUE;
	 return 0;
      }
   }
   *list = _al_sane_realloc(*list, sizeof(MODE_LIST) * ++(*size));
   if (!list)
      return -1;
   mode = *size - 1;
   (*list)[mode].w = w;
   (*list)[mode].h = h;
   for (n = 0; n < N_COLOR_DEPTH; n++)
      (*list)[mode].has_bpp[n] = (bpp == bpp_value(n));
   return 0;
}
static int add_mode ( MODE_LIST * * list , int * size , int w , int h , int bpp ) { int mode , n ; for ( mode = 0 ; mode < * size ; mode ++ ) { if ( ( w == ( * list ) [ mode ] . w ) && ( h == ( * list ) [ mode ] . h ) ) { ( * list ) [ mode ] . has_bpp [ bpp_index ( bpp ) ] = TRUE ; return 0 ; } } * list = _al_sane_realloc ( * list , sizeof ( MODE_LIST ) * ++ ( * size ) ) ; if ( ! list ) return -1 ; mode = * size - 1 ; ( * list ) [ mode ] . w = w ; ( * list ) [ mode ] . h = h ; for ( n = 0 ; n < N_COLOR_DEPTH ; n ++ ) ( * list ) [ mode ] . has_bpp [ n ] = ( bpp == bpp_value ( n ) ) ; return 0 ; }
add_mode:
  Helper function for adding a mode to a mode list.
add_mode : Helper function for adding a mode to a mode list .
/* Resolution already there? */ /* Add new resolution. */