aboutsummaryrefslogtreecommitdiff
path: root/src/parse/parse_color.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/parse_color.c')
-rw-r--r--src/parse/parse_color.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parse/parse_color.c b/src/parse/parse_color.c
index d3cee05..b939076 100644
--- a/src/parse/parse_color.c
+++ b/src/parse/parse_color.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/11 09:52:34 by cacharle #+# #+# */
-/* Updated: 2020/02/04 05:12:42 by cacharle ### ########.fr */
+/* Updated: 2020/02/05 00:04:53 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,6 +16,8 @@ t_bool parse_ceilling_color(t_state *state, char *line)
{
long tmp;
+ if (state->pflags & PFLAGS_C)
+ return (FALSE);
errno = 0;
state->ceilling_color.hexcode = 0x0;
if ((tmp = ft_strtol(line, &line, 10)) > 255 || tmp < 0)
@@ -33,6 +35,7 @@ t_bool parse_ceilling_color(t_state *state, char *line)
state->ceilling_color.rgb.b = (t_byte)tmp;
if (errno != 0)
return (FALSE);
+ state->pflags |= PFLAGS_C;
return (TRUE);
}
@@ -40,6 +43,8 @@ t_bool parse_floor_color(t_state *state, char *line)
{
long tmp;
+ if (state->pflags & PFLAGS_F)
+ return (FALSE);
errno = 0;
state->floor_color.hexcode = 0x0;
if ((tmp = ft_strtol(line, &line, 10)) > 255 || tmp < 0)
@@ -57,5 +62,6 @@ t_bool parse_floor_color(t_state *state, char *line)
state->floor_color.rgb.b = (t_byte)tmp;
if (errno != 0)
return (FALSE);
+ state->pflags |= PFLAGS_F;
return (TRUE);
}