/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_sort_s_t.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: joelecle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/24 20:22:45 by joelecle #+# #+# */ /* Updated: 2020/03/09 18:56:01 by joelecle ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include #include static void ft_init_st(int32_t *st_o) { int8_t i; i = 0; while (i < FT_TOTAL_SPRT) { st_o[i] = i; i++; } } void ft_sort_s_t(t_cub *cl, float **dist_tab) { int32_t i; ft_init_st(cl->mlist.st_o); i = -1; while (++i < cl->big_t_val) ft_memdel((void*)&cl->big_t[i]); ft_memdel((void*)&cl->big_t); i = -1; cl->big_t_val = 0; while (++i < FT_TOTAL_SPRT) cl->big_t_val += cl->mlist.sprite_nbr[i]; ft_alloc_big_t(cl); ft_fill_big_t(dist_tab, cl); ft_sort_big_t(cl); i = -1; while (++i < FT_TOTAL_SPRT + 1) ft_memdel((void*)&dist_tab[i]); ft_memdel((void*)&dist_tab); }