Esempio n. 1
0
void		get_coord(t_scene *sc, t_img_buff *cl)
{
  double	x;
  double	y;
  double	xend;
  int		i;

  x = cl->cli_num * (800 / cl->cli_max);
  xend = cl->cli_num + 1;
  xend = xend * (800 / cl->cli_max);
  cl->img = xmalloc_and_set(NULL, sizeof(int) * (200 * 600));
  i = 0;
  fprintf(stdout, "Calculating...\n");
  while (x <= xend)
    {
      y = 0;
      while (y <= 600)
  	{
  	  reset_eye(sc, x, y);
  	  render_pixel(sc, x, y);
  	  (cl->img)[i++] = sc->eye->intersection.color.value;
  	  y++;
  	}
      x++;
    }
  cl->size = i;
}
Esempio n. 2
0
void
reset_game_state(void)
{
	extern int last_highscore;

	SDL_ShowCursor(SDL_DISABLE);

	last_highscore = -1;
	gc.score = 0;
	gc.ships_left = 2;
	gc.level_tics = 0;
	gc.multiplier = 1;

	gc.cur_level = settings.static_settings->start_level;

	ship.is_alive = 0;
	gc.tics_remaining = 0;

	/* last_death_tic = -70; */

	memset(&game_stat_counters, 0, sizeof(game_stat_counters));

	ships_text_width = string_width_in_pixels(font_small, "ships");

	reset_level();
	reset_eye();
	reset_water();
	reset_background();
	reset_arena();
	reset_particles();
	reset_explosions();
	reset_missiles();
	reset_bombs();
	reset_lasers();
	reset_foes();
	reset_powerups();
	reset_in_game_texts();
	reset_ship_powerups();

	set_inner_state(IS_WAVE_TITLE);

	play_music(MUS_STAGE_1);
}