From 57867bbbdc24b734d85f8d3569c7ad27dcd9504d Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 30 Jan 2020 15:52:16 +0100 Subject: files restructuration --- src/parse/parse_textures.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/parse/parse_textures.c (limited to 'src/parse/parse_textures.c') diff --git a/src/parse/parse_textures.c b/src/parse/parse_textures.c new file mode 100644 index 0000000..a0fb8f6 --- /dev/null +++ b/src/parse/parse_textures.c @@ -0,0 +1,48 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* parse_textures.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/01/11 09:47:53 by cacharle #+# #+# */ +/* Updated: 2020/01/11 09:51:03 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "cub3d.h" + +t_bool parse_north_texture(t_state *state, char *line) +{ + if ((state->textures_path[TEX_NORTH] = ft_strdup(line)) == NULL) + return (FALSE); + return (TRUE); +} + +t_bool parse_south_texture(t_state *state, char *line) +{ + if ((state->textures_path[TEX_SOUTH] = ft_strdup(line)) == NULL) + return (FALSE); + return (TRUE); +} + +t_bool parse_west_texture(t_state *state, char *line) +{ + if ((state->textures_path[TEX_WEST] = ft_strdup(line)) == NULL) + return (FALSE); + return (TRUE); +} + +t_bool parse_east_texture(t_state *state, char *line) +{ + if ((state->textures_path[TEX_EAST] = ft_strdup(line)) == NULL) + return (FALSE); + return (TRUE); +} + +t_bool parse_sprite_texture(t_state *state, char *line) +{ + if ((state->textures_path[TEX_SPRITE] = ft_strdup(line)) == NULL) + return (FALSE); + return (TRUE); +} -- cgit