aboutsummaryrefslogtreecommitdiff
path: root/src/parse/parse_textures.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/parse_textures.c')
-rw-r--r--src/parse/parse_textures.c17
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);
}