diff options
Diffstat (limited to 'src/ft_init_funptr.c')
-rw-r--r-- | src/ft_init_funptr.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/ft_init_funptr.c b/src/ft_init_funptr.c new file mode 100644 index 0000000..f95e020 --- /dev/null +++ b/src/ft_init_funptr.c @@ -0,0 +1,55 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_init_funptr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:28:53 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:28:53 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> +#include <cub3d.h> + +void + ft_init_ref(t_cub *clist) +{ + ft_sprintf(clist->ref[0], "R"); + ft_sprintf(clist->ref[1], "NO"); + ft_sprintf(clist->ref[2], "SO"); + ft_sprintf(clist->ref[3], "EA"); + ft_sprintf(clist->ref[4], "WE"); + ft_sprintf(clist->ref[5], "S"); + ft_sprintf(clist->ref[6], "F"); + ft_sprintf(clist->ref[7], "C"); + ft_sprintf(clist->ref[8], "L"); + ft_sprintf(clist->ref[9], "LT"); + ft_sprintf(clist->ref[10], "MU"); + ft_sprintf(clist->ref[11], "SH"); + ft_bzero(clist->ref[12], 3); +} + +void + ft_init_funptr(t_cub *clist) +{ + clist->key_ptr[0] = ft_w_key; + clist->key_ptr[1] = ft_a_key; + clist->key_ptr[2] = ft_s_key; + clist->key_ptr[3] = ft_d_key; + clist->key_ptr[4] = ft_left_key; + clist->key_ptr[5] = ft_right_key; + clist->get_ptr[0] = ft_get_res; + clist->get_ptr[1] = ft_get_tex_no; + clist->get_ptr[2] = ft_get_tex_so; + clist->get_ptr[3] = ft_get_tex_ea; + clist->get_ptr[4] = ft_get_tex_we; + clist->get_ptr[5] = ft_get_sprite; + clist->get_ptr[6] = ft_get_f_color; + clist->get_ptr[7] = ft_get_c_color; + clist->get_ptr[8] = ft_get_path_nl; + clist->get_ptr[9] = ft_get_tex_nl; + clist->get_ptr[10] = ft_get_music; + clist->get_ptr[11] = ft_get_darkness; +} |