1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_init_funptr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: joelecle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 17:28:53 by joelecle #+# #+# */
/* Updated: 2020/02/14 17:28:53 by joelecle ### ########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_sprintf(clist->ref[12], "C");
ft_sprintf(clist->ref[13], "T");
ft_sprintf(clist->ref[14], "S3");
ft_sprintf(clist->ref[15], "S4");
ft_sprintf(clist->ref[16], "S5");
ft_sprintf(clist->ref[17], "S6");
ft_sprintf(clist->ref[18], "S7");
ft_sprintf(clist->ref[19], "S8");
ft_sprintf(clist->ref[20], "S9");
ft_sprintf(clist->ref[21], "E2");
ft_bzero(clist->ref[22], 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;
clist->get_ptr[12] = ft_get_c_color;
clist->get_ptr[13] = ft_get_traps;
}
|