Пример #1
0
int main(int argc, char **argv) {
    cliopts_t opts;
    parse_options(argc, argv, &opts);
    if (opts.show_version) {
        print_version();
        return 0;
    }
    srand(time(NULL));
    return initialize_and_run();
}
Пример #2
0
int main(int argc, char **argv) {
    cliopts_t opts;
    parse_options(argc, argv, &opts);
    if (opts.show_version) {
        print_version();
        return 0;
    }

    return initialize_and_run(opts.launch_editor);
}
Пример #3
0
/**
 * The main function is where the program starts execution.
 */
Sint32
main (Sint32 args_count, char **arguments)
{
#if defined(POWERMANGA_LOG_ENABLED)
  LOG_LEVELS log_level = LOG_NOTHING;
#endif
  /* GP2X or PSP port */
#ifdef POWERMANGA_HANDHELD_CONSOLE
  /* Use atexit() to call the return-to-menu function,
   * in case of crashes, etc. */
  atexit (returnToMenu);
#endif


  /* allocate memory table */
#if defined (USE_MALLOC_WRAPPER)
  if (!memory_init (22000))
    {
      exit (0);
    }
#endif
#if defined(POWERMANGA_LOG_ENABLED)
  log_initialize (LOG_INFO);
#endif

  /* load config file */
  if (!configfile_load ())
    {
#if defined (USE_MALLOC_WRAPPER)
      memory_releases_all ();
#endif
      exit (0);
    }
#ifdef _WIN32_WCE
  power_conf->verbose = 1;
  display_windows_ce_infos ();
#endif
  if (configfile_scan_arguments (args_count, arguments))
    {
#if defined(POWERMANGA_LOG_ENABLED)
      switch (power_conf->verbose)
        {
        case 1:
          log_level = LOG_WARNING;
          break;
        case 2:
          log_level = LOG_DEBUG;
          break;
        default:
          log_level = LOG_ERROR;
          break;
        }
      log_set_level (log_level);
#endif
#if defined(POWERMANGA_HANDHELD_CONSOLE) || defined(_WIN32_WCE)
      /* We require a 320x200 output size to fit on
       * the GP2X or PSP's display */
      power_conf->scale_x = 1;
      power_conf->resolution = 320;
      power_conf->fullscreen = 1;
      pixel_size = 1;
#endif
      if (power_conf->extract_to_png)
        {
          power_conf->scale_x = 1;
          power_conf->resolution = 320;
          power_conf->fullscreen = 0;
          power_conf->nosound = TRUE;
          pixel_size = 1;
        }
      if (power_conf->resolution == 320)
        {
          vmode = 0;
        }
      else
        {
          if (power_conf->scale_x > 1)
            {
              vmode = 2;
            }
          else
            {
              vmode = 1;
            }
        }
      initialize_and_run ();
    }
  release_game ();

#if defined(POWERMANGA_LOG_ENABLED)
  log_close ();
#endif

  /* releases all memory allocated */
#if defined (USE_MALLOC_WRAPPER)
  memory_releases_all ();
#endif

  /* launch html donation page before leaving */
#if !defined(_WIN32_WCE) && defined(_WIN32)
  ShellExecute (0, "open", ".\\html\\ar01s06s02.html", 0, 0, SW_SHOWNORMAL);
#endif
  return 0;
}