37 lines
1.3 KiB
C
37 lines
1.3 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* add_spot.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbrochar <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2019/02/06 18:10:46 by gbrochar #+# #+# */
|
|
/* Updated: 2019/02/13 19:02:05 by gbrochar ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "rtv1.h"
|
|
|
|
void init_spot(t_spot *spot)
|
|
{
|
|
spot->o = vec(0, 0, 0);
|
|
spot->i = 1;
|
|
}
|
|
|
|
int add_spot(char **data, t_env *e)
|
|
{
|
|
int i;
|
|
t_spot spot;
|
|
|
|
i = 0;
|
|
ft_putendl("Adding spot");
|
|
init_spot(&spot);
|
|
while (data[i] && i < 5)
|
|
i++;
|
|
if (i > 3)
|
|
spot.o = vec(ft_atof(data[1]), ft_atof(data[2]), ft_atof(data[3]));
|
|
if (i > 4)
|
|
spot.i = ft_atof(data[4]);
|
|
return (add_spot_node(e, spot));
|
|
}
|