diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-02-05 01:29:44 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-02-05 01:29:44 +0100 |
| commit | af747497060d8a311204ec58b3ac87cc585462fc (patch) | |
| tree | 2022e10ac93243772f22f281071a4e0fd5c55f1d /src/parse/parse_textures.c | |
| parent | 3b224458a5d539bbe00318d939c9a099f3f158e1 (diff) | |
| download | cub3d-af747497060d8a311204ec58b3ac87cc585462fc.tar.gz cub3d-af747497060d8a311204ec58b3ac87cc585462fc.tar.bz2 cub3d-af747497060d8a311204ec58b3ac87cc585462fc.zip | |
better parsing
Diffstat (limited to 'src/parse/parse_textures.c')
| -rw-r--r-- | src/parse/parse_textures.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/parse/parse_textures.c b/src/parse/parse_textures.c index f6ba1a0..e048bd5 100644 --- a/src/parse/parse_textures.c +++ b/src/parse/parse_textures.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/11 09:47:53 by cacharle #+# #+# */ -/* Updated: 2020/02/02 19:21:39 by cacharle ### ########.fr */ +/* Updated: 2020/02/05 00:06:18 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,35 +14,50 @@ t_bool parse_north_texture(t_state *state, char *line) { + if (state->pflags & PFLAGS_NO) + return (FALSE); if ((state->textures_path[TEX_NORTH] = ft_strdup(line)) == NULL) return (FALSE); + state->pflags |= PFLAGS_NO; return (TRUE); } t_bool parse_south_texture(t_state *state, char *line) { + if (state->pflags & PFLAGS_SO) + return (FALSE); if ((state->textures_path[TEX_SOUTH] = ft_strdup(line)) == NULL) return (FALSE); + state->pflags |= PFLAGS_SO; return (TRUE); } t_bool parse_west_texture(t_state *state, char *line) { + if (state->pflags & PFLAGS_WE) + return (FALSE); if ((state->textures_path[TEX_WEST] = ft_strdup(line)) == NULL) return (FALSE); + state->pflags |= PFLAGS_WE; return (TRUE); } t_bool parse_east_texture(t_state *state, char *line) { + if (state->pflags & PFLAGS_EA) + return (FALSE); if ((state->textures_path[TEX_EAST] = ft_strdup(line)) == NULL) return (FALSE); + state->pflags |= PFLAGS_EA; return (TRUE); } t_bool parse_sprite_texture(t_state *state, char *line) { + if (state->pflags & PFLAGS_S) + return (FALSE); if ((state->textures_path[TEX_SPRITE] = ft_strdup(line)) == NULL) return (FALSE); + state->pflags |= PFLAGS_S; return (TRUE); } |
