Пример #1
0
int		see_lists(t_all *all)
{
  t_object	*objects;
  t_spot	*spots;

  objects = all->objects;
  spots = all->spots;
  if (print_global(all) < 0 || printf("\nObjects:\n\n") < 0 ||
      print_object(objects) < 0 || printf("\nSpots:\n\n") < 0)
    return (-1);
  while (spots != NULL)
    {
      if (printf("Spots pos : x = %f, y = %f, z = %f\n",
		 spots->pos.x, spots->pos.y, spots->pos.z) < 0 ||
	  printf("Spots color : r = %f, g = %f, b = %f\n",
		 spots->color.r, spots->color.g, spots->color.b) < 0 ||
	  printf("Orientation = %f\nIntensity = %f\nRadius = %f\n\n",
		 spots->orientation, spots->intensity, spots->radius) < 0)
	return (-1);
      spots = spots->next;
    }
  return ((printf("\n") < 0) ? -1 : 0);
}
Пример #2
0
/* 用于处理当下按ctrl-c时的处理函数 */
void sig_int( int sig )
{
	print_global( global );
	exit( 0 );
}