コード例 #1
0
ファイル: aff_loading.c プロジェクト: Geod24/Raytracer
void		advance_indice(t_glob *glob, int y)
{
  static int    count_part = 0;
  char		*tmp;

  if (CALC_SIZEY / 100 * count_part == y)
    {
      aff_kikoo(glob, count_part);
      if (count_part <= 100 &&
	  !(count_part > 42 && count_part < 48) &&
	  !(count_part > 69 && count_part < 75))
        {
	  clean_percent(glob);
          mlx_string_put(glob->graph->mlx_ptr, glob->graph->win_ptr,
                         AFF_SIZEX / 2 - 10, AFF_SIZEY / 2 + 15, AFF_COLOR,
                         (tmp = my_putnbr_in_str((count_part))));
          free(tmp);
        }
      mlx_string_put(glob->graph->mlx_ptr, glob->graph->win_ptr,
                     AFF_SIZEX / 2 + 10, AFF_SIZEY / 2 + 15, AFF_COLOR, "%");
      mlx_string_put(glob->graph->mlx_ptr, glob->graph->win_ptr,
		     AFF_SIZEX * count_part / 100, AFF_SIZEY / 2,
                     CHARG_COLOR, "|");
      count_part++;
    }
}
コード例 #2
0
ファイル: end_of_game.c プロジェクト: sandra-laduranti/UPMC
int	finish(t_game *gaming, int **grid)
{
  int	res;

  if (gaming->turn == (grid_size*grid_size))
    {
      res = aff_all_players_point(gaming);
      if (res == NUL){
	printf("\nSorry it was a draw :( \n");
	return (OK);
      }
      else if (res == LOSE){
	printf("\noooooooow nobody wins :( \n");
	return (OK);
      }
      else{
	aff_kikoo(res,grid,gaming);
	return (OK);
      }
    }
return (NOK);
}