diff options
author | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-27 19:20:28 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-27 19:20:28 +0100 |
commit | 0c2bb0f610c0af0680b46fc4566a207d59781e4d (patch) | |
tree | 986d6dd6a19416593c9b2c043312ffa5d4f0be73 /src/ft_get_colors.c | |
parent | in progress (diff) | |
download | 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.gz 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.bz2 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.xz 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.zst 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.zip |
Switched lists entierly
Diffstat (limited to 'src/ft_get_colors.c')
-rw-r--r-- | src/ft_get_colors.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/ft_get_colors.c b/src/ft_get_colors.c index 2e09fc6..750ebed 100644 --- a/src/ft_get_colors.c +++ b/src/ft_get_colors.c @@ -16,7 +16,7 @@ ft_check_digits(const char *word) } static int -ft_get_f_color(char *line, char **words, t_win *wlist) +ft_get_f_color(char *line, char **words, t_cub *clist) { char **num; @@ -32,18 +32,18 @@ ft_get_f_color(char *line, char **words, t_win *wlist) ft_free_words(num, NULL); return (-1); } - wlist->clist->f_color = ft_atoi(num[0]); - wlist->clist->f_color *= 1000; - wlist->clist->f_color += ft_atoi(num[1]); - wlist->clist->f_color *= 1000; - wlist->clist->f_color += ft_atoi(num[2]); + clist->f_color = ft_atoi(num[0]); + clist->f_color *= 1000; + clist->f_color += ft_atoi(num[1]); + clist->f_color *= 1000; + clist->f_color += ft_atoi(num[2]); ft_free_words(num, NULL); ft_free_words(words, line); return (0); } static int -ft_get_c_color(char *line, char **words, t_win *wlist) +ft_get_c_color(char *line, char **words, t_cub *clist) { char **num; @@ -59,18 +59,18 @@ ft_get_c_color(char *line, char **words, t_win *wlist) ft_free_words(num, NULL); return (-1); } - wlist->clist->c_color = ft_atoi(num[0]); - wlist->clist->c_color *= 1000; - wlist->clist->c_color += ft_atoi(num[1]); - wlist->clist->c_color *= 1000; - wlist->clist->c_color += ft_atoi(num[2]); + clist->c_color = ft_atoi(num[0]); + clist->c_color *= 1000; + clist->c_color += ft_atoi(num[1]); + clist->c_color *= 1000; + clist->c_color += ft_atoi(num[2]); ft_free_words(num, NULL); ft_free_words(words, line); return (0); } int -ft_get_colors(int fd, t_win *wlist) +ft_get_colors(int fd, t_cub *clist) { char *line; char **words; @@ -78,22 +78,22 @@ ft_get_colors(int fd, t_win *wlist) if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(8, wlist)); + return (ft_map_error(8, clist)); } - if (ft_get_f_color(line, words, wlist) < 0) + if (ft_get_f_color(line, words, clist) < 0) { ft_free_words(words, line); - return (ft_map_error(8, wlist)); + return (ft_map_error(8, clist)); } if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(9, wlist)); + return (ft_map_error(9, clist)); } - if (ft_get_c_color(line, words, wlist) < 0) + if (ft_get_c_color(line, words, clist) < 0) { ft_free_words(words, line); - return (ft_map_error(9, wlist)); + return (ft_map_error(9, clist)); } return (0); } |