Esempio n. 1
0
// switch between gamestates
void switchgs(enum GameState newgs)
{
	FastClearScreen_R(lightbuffer);
	FastClearScreen_R(darkbuffer);

	birdframe = 0;
	// deinitialize
	switch (gs)
	{
		case GS_MENU:
			menu_deinit(newgs);
			break;
		case GS_GAME:
			game_deinit(newgs);
			break;
		case GS_GAMEOVER:
			gameover_deinit(newgs);
			break;
		default:
			break;
	}
	// initialize
	switch (newgs)
	{
		case GS_MENU:
			menu_init(gs);
			break;
		case GS_GAME:
			game_init(gs);
			break;
		case GS_GAMEOVER:
			gameover_init(gs);
			break;
		default:
			break;
	}
	gs = newgs;
}
Esempio n. 2
0
void retro_deinit(void)
{
   char *savedir;
   environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &savedir);

   if (savedir)
   {
      FILE *fp;
#ifdef _WIN32
      char slash = '\\';
#else
      char slash = '/';
#endif
      char filename[1024] = {0};

      sprintf(filename, "%s%c2048.srm", savedir, slash);
      fp = fopen(filename, "wb");

      if (fp)
      {
         fwrite(game_save_data(), game_data_size(), 1, fp);
         fclose(fp);
      }
      else
      {
         if (log_cb)
            log_cb(RETRO_LOG_WARN, "[2048] unable to save game data: %s.\n", strerror(errno));
      }
   }
   else
   {
      if (log_cb)
         log_cb(RETRO_LOG_WARN, "[2048] unable to save game data: save directory not set.\n");
   }


   game_deinit();
}
Esempio n. 3
0
void handle_deinit(void) {
	game_deinit();
}
Esempio n. 4
0
static void deinit(void) {
  game_deinit();
  high_score_deinit();
  entry_deinit();
}