diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-01-28 16:32:37 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-01-28 16:32:37 +0100 |
commit | c1f91998d9cf530d86b6e8d2ddfecf06cae43664 (patch) | |
tree | c4b8ce0838786c9b487f36e3282c606ec93d5066 /src/ft_select_get.c | |
parent | Got tex (diff) | |
download | 42-cub3d-c1f91998d9cf530d86b6e8d2ddfecf06cae43664.tar.gz 42-cub3d-c1f91998d9cf530d86b6e8d2ddfecf06cae43664.tar.bz2 42-cub3d-c1f91998d9cf530d86b6e8d2ddfecf06cae43664.tar.xz 42-cub3d-c1f91998d9cf530d86b6e8d2ddfecf06cae43664.tar.zst 42-cub3d-c1f91998d9cf530d86b6e8d2ddfecf06cae43664.zip |
Got sprite
Diffstat (limited to '')
-rw-r--r-- | src/ft_select_get.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ft_select_get.c b/src/ft_select_get.c index 7b1b524..d44fa88 100644 --- a/src/ft_select_get.c +++ b/src/ft_select_get.c @@ -5,17 +5,17 @@ static uint8_t ft_get_id(char **words) { - if (!ft_strcmp(words[0], "R")) + if (!ft_strncmp(words[0], "R", 1)) return (0); - if (!ft_strcmp(words[0], "NO")) + if (!ft_strncmp(words[0], "NO", 2)) return (1); - if (!ft_strcmp(words[0], "SO")) + if (!ft_strncmp(words[0], "SO", 2)) return (2); - if (!ft_strcmp(words[0], "EA")) + if (!ft_strncmp(words[0], "EA", 2)) return (3); - if (!ft_strcmp(words[0], "WE")) + if (!ft_strncmp(words[0], "WE", 2)) return (4); - if (!ft_strcmp(words[0], "S")) + if (!ft_strncmp(words[0], "S", 1)) return (5); return (12); } @@ -23,7 +23,7 @@ ft_get_id(char **words) uint8_t ft_select_get(char **words, t_cub *clist) { - int (*fun_ptr[6])(char**, t_cub*); + int (*fun_ptr[7])(char**, t_cub*); uint8_t id; fun_ptr[0] = ft_get_res; @@ -32,6 +32,7 @@ ft_select_get(char **words, t_cub *clist) fun_ptr[3] = ft_get_tex_ea; fun_ptr[4] = ft_get_tex_we; fun_ptr[5] = ft_get_sprite; + fun_ptr[6] = ft_get_colors; if ((id = ft_get_id(words)) == 12) { ft_free_words(words); @@ -42,5 +43,6 @@ ft_select_get(char **words, t_cub *clist) ft_free_words(words); return (ft_map_error(clist)); } + ft_free_words(words); return (id); } |