-
Notifications
You must be signed in to change notification settings - Fork 0
/
cone.c
46 lines (40 loc) · 1.43 KB
/
cone.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cone.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sboeuf <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/02/16 19:17:47 by sboeuf #+# #+# */
/* Updated: 2014/02/16 21:02:25 by sboeuf ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/rtv1.h"
t_cone *new_cone(t_vect *center, double alpha, t_color *color)
{
t_cone *c;
c = (t_cone*)malloc(sizeof(t_cone));
c->center = center;
c->alpha = alpha;
c->color = color;
return (c);
}
void add_cone(t_cone *start, t_cone *new)
{
while (start->next != NULL)
start = start->next;
start->next = new;
}
void delete_cones(t_cone **start)
{
t_cone *tmp;
while (*start != NULL)
{
tmp = (*start)->next;
delete_vect((*start)->center);
delete_color((*start)->color);
(*start)->next = NULL;
free(*start);
*start = tmp;
}
}