diff options
Diffstat (limited to 'src/ft_select_get.c')
-rw-r--r-- | src/ft_select_get.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/ft_select_get.c b/src/ft_select_get.c index 25320d7..7b1b524 100644 --- a/src/ft_select_get.c +++ b/src/ft_select_get.c @@ -9,19 +9,34 @@ ft_get_id(char **words) return (0); if (!ft_strcmp(words[0], "NO")) return (1); + if (!ft_strcmp(words[0], "SO")) + return (2); + if (!ft_strcmp(words[0], "EA")) + return (3); + if (!ft_strcmp(words[0], "WE")) + return (4); + if (!ft_strcmp(words[0], "S")) + return (5); return (12); } uint8_t ft_select_get(char **words, t_cub *clist) { - int (*fun_ptr[4])(char**, t_cub*); + int (*fun_ptr[6])(char**, t_cub*); uint8_t id; fun_ptr[0] = ft_get_res; - fun_ptr[1] = ft_get_tex; + fun_ptr[1] = ft_get_tex_no; + fun_ptr[2] = ft_get_tex_so; + fun_ptr[3] = ft_get_tex_ea; + fun_ptr[4] = ft_get_tex_we; + fun_ptr[5] = ft_get_sprite; if ((id = ft_get_id(words)) == 12) + { + ft_free_words(words); return (12); + } if ((*fun_ptr[id])(words, clist) < 0) { ft_free_words(words); |