Exemple #1
0
int
main(int argc, char **argv)
{
  Lib3dsFile *f=0;

  parse_args(argc, argv);
  f=lib3ds_file_load(filename);
  if (!f) {
    fprintf(stderr, "***ERROR***\nLoading file %s failed\n", filename);
    exit(1);
  }
  if (output) {
    FILE *o=fopen(output, "w+");
    if (!o) {
      fprintf(stderr, "***ERROR***\nCan't open %s for writing\n", output);
      exit(1);
    }
    dump_m_file(f,o);
    fclose(o);
  }
  else {
    dump_m_file(f,stdout);
  }

  lib3ds_file_free(f);
  return(0);
}
Exemple #2
0
int
main(int argc, char **argv)
{
  Lib3dsFile *f=0;

  parse_args(argc, argv);
  f=lib3ds_file_load(filename);
  if (!f)
  {
    fprintf(stderr, "***ERROR***\nLoading file %s failed\n", filename);
    exit(1);
  }
  if (output)
  {
    dump_m_file(f,output);
  }
  else
  {
    fprintf(stderr, "***ERROR***\nNo output file specified.\n");
    exit(1);
  }

  lib3ds_file_free(f);
  return(0);
}