diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-05 17:26:10 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-05 17:26:10 +0100 |
commit | 08dce587032f08c5bfbc2790bdb2d668ca1990c1 (patch) | |
tree | a927bf674dfa6d1d3efd03ef06dfacb115ae238f /src/ft_init_lists.c | |
parent | map fix (diff) | |
download | 42-cub3d-08dce587032f08c5bfbc2790bdb2d668ca1990c1.tar.gz 42-cub3d-08dce587032f08c5bfbc2790bdb2d668ca1990c1.tar.bz2 42-cub3d-08dce587032f08c5bfbc2790bdb2d668ca1990c1.tar.xz 42-cub3d-08dce587032f08c5bfbc2790bdb2d668ca1990c1.tar.zst 42-cub3d-08dce587032f08c5bfbc2790bdb2d668ca1990c1.zip |
int16_tamer
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); } |