Ejemplo n.º 1
0
/* --- OK, now we have eight. --- */
void setup(int argc, char * argv[])
{
    /* Read debugging args from command line */
    handle_debug_args(argc, argv);
    /* initialize locale from system settings: */
    initialize_locale("");      
    /* initialize settings and read in config files: */
    /* Note this now only does the global settings   */
    initialize_options();
    /* Command-line code now in own function: */
    handle_command_args(argc, argv);
    /* initialize default user's options (for resolution)*/
    initialize_options_user();
    /* SDL setup in own function:*/
    initialize_SDL();
    /* Read image and sound files: */
    load_data_files();
    /* Generate flipped versions of walking images */
    generate_flipped_images();
    /* Generate blended images (e.g., igloos) */
    generate_blended_images();
    /* Note that the per-user options will be set after the call to
       titlescreen, to allow for user-login to occur. 

       FIXME this means that command-line args will be overridden!
       Is this desirable? */
}
Ejemplo n.º 2
0
/** Lida com todos os argumentos passados atraves da linha de comando.
 *
 *  O principal aqui e' que essa funcao precisa lidar de formas diferentes
 *  com os argumentos de comando (que comecam com '-') e com os argumentos
 *  normais (que sao a URI e o nome do arquivo destino).
 *  @see handle_command_args()
 */
void arg_handle(int argc, char *argv[])
{
  int normal_args_handled  = 0;
  int i;


  if (argc < 2)
  {
    print_usage();
    exit(EXIT_FAILURE);
  }

  for (i = 1; i < argc; i++)
  {
    if (argv[i][0] == '-')
      handle_command_args(argc, argv);
    else
      handle_normal_args(&normal_args_handled, argv[i]);
  }

  if(*data.local_file_name == '\0')
    arg_abort_exec("Error! No local file name specified! Use -u for options.");
}