diff --git a/includes/cub3d.h b/includes/cub3d.h index 23e25d7..c906a3d 100644 --- a/includes/cub3d.h +++ b/includes/cub3d.h @@ -6,7 +6,7 @@ /* By: aortigos name = ft_substr(line, 0, 2); + list->value = ft_substr(line, get_index(line, 2), ft_strlen(line)); + } + else if ((!ft_strncmp(line, "F", 1) || !ft_strncmp(line, "C", 1))) + { + list->name = ft_substr(line, 0, 1); + list->value = ft_substr(line, get_index(line, 1), ft_strlen(line)); + } + list->next = NULL; + return (list); +} + +void lst_back_ture(t_turelist **l_ture, t_turelist *new) +{ + t_turelist *tmp; + + if (!*l_ture) + { + (*l_ture) = new; + return ; + } + tmp = *l_ture; + while (tmp->next) + tmp = tmp->next; + tmp->next = new; +} + +int lst_ture(t_data *m, t_turelist **l_ture) +{ + int i; + t_turelist *tmp; + + i = 0; + while (m->ture2d[i]) + { + tmp = new_texture(m->ture2d[i++]); + if (!tmp) + return (0); + lst_back_ture(l_ture, tmp); + } + return (1); +}