示例#1
0
文件: main.cpp 项目: jurting/jurtris
//int main (int argc, char const* argv[])
int main(int argc, char* argv[])
{
    srand(time(NULL));

	opt_preview=5;
	opt[OPT_HOLD]=1;
	opt[OPT_NUDGE]=1;
	opt[OPT_EASYSPIN]=1;
	opt[OPT_SHADOW]=1;
	opt[OPT_SLIDE]=1;
	opt[OPT_ALTHOLD]=0;
	opt[OPT_GHOST]=0;
	opt[OPT_DARK]=0;
	opt[OPT_FLASHLIGHT]=0;
	opt[OPT_THUNDER]=0;
	opt[OPT_FLARE]=0;
	opt[OPT_TRAINING]=0;
	opt[OPT_BAG]=0;

	if (argc>1) {if (str_match((char*)argv[1],(char*)"reset-cfg")) generate_config(1);}
	else generate_config(0);

	game_init();
	#ifdef caanoo
	SDL_ShowCursor(0);
	#elif dingux
	SDL_ShowCursor(0);
	#else
	SDL_ShowCursor(1);
	#endif


	//if (main_menu(0)==0) {clearSDL(); return 0;}
	main_menu(0);

	clearSDL();

	#ifdef caanoo
	chdir("/usr/gp2x");
	execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
	#endif
	return 0;
}
static void
run_measurement (unsigned long long p1_quota_in,
                 unsigned long long p1_quota_out,
                 unsigned long long p2_quota_in,
                 unsigned long long p2_quota_out)
{
  die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);

  /* setting ATS quota */
  quota_out_p1 = p1_quota_out;
  gen_cfg_p1 = generate_config (cfg_file_p1, p1_quota_in, p1_quota_out);
  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Generated config file `%s'\n",
              gen_cfg_p1);

  quota_in_p2 = p2_quota_in;
  gen_cfg_p2 = generate_config (cfg_file_p2, p2_quota_in, p2_quota_out);
  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Generated config file `%s'\n",
              gen_cfg_p2);

  p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, gen_cfg_p1, 1, &notify_receive,
                                            &notify_connect, &notify_disconnect,
                                            &start_cb, NULL);

  p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, gen_cfg_p2, 2, &notify_receive,
                                            &notify_connect, &notify_disconnect,
                                            &start_cb, NULL);

  if ((p1 == NULL) || (p2 == NULL))
  {
    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
    if (die_task != GNUNET_SCHEDULER_NO_TASK)
      GNUNET_SCHEDULER_cancel (die_task);
    die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
    return;
  }
}