diff options
Diffstat (limited to 'src/ft_init_lists.c')
-rw-r--r-- | src/ft_init_lists.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/ft_init_lists.c b/src/ft_init_lists.c index 291ef7b..ec46713 100644 --- a/src/ft_init_lists.c +++ b/src/ft_init_lists.c @@ -18,6 +18,30 @@ #include <stdlib.h> #include <limits.h> +static t_rgb + ft_init_rgb(void) +{ + t_rgb rgb; + + rgb.r = -1; + rgb.g = -1; + rgb.b = -1; + return (rgb); +} + +static t_player + *ft_init_player(void) +{ + t_player *plist; + + if (!(plist = (t_player*)malloc(sizeof(t_player)))) + return (NULL); + plist->pos_x = 0; + plist->pos_y = 0; + plist->view_side = 0; + return (plist); +} + t_win *ft_init_win(void) { @@ -36,19 +60,6 @@ t_win return (wlist); } -static t_player - *ft_init_player(void) -{ - t_player *plist; - - if (!(plist = (t_player*)malloc(sizeof(t_player)))) - return (NULL); - plist->pos_x = 0; - plist->pos_y = 0; - plist->view_side = 0; - return (plist); -} - t_cub *ft_init_cub(void) { @@ -67,12 +78,12 @@ t_cub !(clist->plist = ft_init_player())) return (NULL); clist->map[1] = 0; - clist->f_color = -1; - clist->c_color = -1; clist->map_w = 0; clist->map_h = 0; clist->line_chk = 0; clist->map_start = 0; clist->isspawn = 0; + clist->f_rgb = ft_init_rgb(); + clist->c_rgb = ft_init_rgb(); return (clist); } |