コード例 #1
0
ファイル: game.c プロジェクト: albheim/AchtungDieKurve
void event()
{
	int a = 0;
	while(1)
	{
		a = get_event();
		if (a == 3)
		{
			p->dir = p->dir-90;
			if(p->dir<0)
			{
				p->dir += 360;
			}
		}
		if (a == 4)
		{
			p->dir += 90;
			if(p->dir>=360)
			{
				p->dir -= 360;
			}
		}
		if (a == -1)
		{
			end = 1;
			WaitForSingleObject(play, INFINITE);
			quit_sdl();
			break;
		}
	}
}
コード例 #2
0
ファイル: gui_main.c プロジェクト: zielmicha/freeciv-mirror
/**************************************************************************
  Do any necessary UI-specific cleanup
**************************************************************************/
void ui_exit()
{

#if defined UNDER_CE && defined SMALL_SCREEN
    /* change back to window mode to restore the title bar */
    set_video_mode(320, 240, SDL_SWSURFACE | SDL_ANYFORMAT);
#endif

    free_mapcanvas_and_overview();

    free_auxiliary_tech_icons();
    free_intro_radar_sprites();

    diplomacy_dialog_done();
    intel_dialog_done();

    callback_list_destroy(callbacks);

    unload_cursors();

    FC_FREE(button_behavior.event);

    meswin_dialog_popdown();

    del_main_list();

    free_font_system();
    theme_free(theme);

    quit_sdl();
}
コード例 #3
0
int main(int argc, char *argv[])
{
	bool running = false;
	
	// Two verbosity levels
	myPrintf[QUIET] = quietprint;
	myPrintf[VERBOSE] = printf;
	
	// Before continuing, read the arguments
	running = readArguments( argc, argv );

	// If the arguments are correct, start a simulation
	while ( running ) {
		myPrintf[ verbosemode ] ( "main : running is true\n" );

		// Init graphics
		SDL_Surface * screen = NULL;
		screen = init_sdl();

		// Simulates
		simulation ( screen );

		// End of graphics
		SDL_FreeSurface(screen);
		quit_sdl();

		// Quit running mode
		running = false;
	};

	return 0;
}
コード例 #4
0
ファイル: 15min.c プロジェクト: tnzk/15min
int main( int argc, char** argv)
{
  Game15min game;
  SDL_Surface* screen;
  SDL_Event event;
  int done = 0;

  game.mode = 0;
  game.x = 0;
  game.status = MINUTE_STAT_MAIN;

  init_sdl( &screen);
  game.screen = screen;
  game.ctrl[0] = samplectrl;
  game.draw[0] = sampledraw;

  while( !done){
    clear_screen( screen);

    game.ctrl[game.status](&game);
    game.draw[game.status](&game);

    while( SDL_PollEvent(&event)){
      switch( event.type){
      case SDL_KEYDOWN:
	if( event.key.keysym.sym == SDLK_ESCAPE){
	  done = 1;
	}
	break;
      case SDL_QUIT:
	done = 1;
	break;
      }
    }
  }

  quit_sdl();
  return 0;
}
コード例 #5
0
ファイル: framework.c プロジェクト: BackupTheBerlios/sfox-svn
void
framework_exit(int ret)
{
    quit_sdl();
    exit(ret);
}