aboutsummaryrefslogtreecommitdiff
path: root/parse/parse_color.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-30 14:18:41 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-30 14:18:41 +0100
commit679b5dced1d73d9284bab8965e2f3bf37b3056f4 (patch)
tree1ec6a302f6ceb63296322b3b8f03107290157450 /parse/parse_color.c
parent01e713026d462f3adf5b3e6f0b2785d0fa7c9bc2 (diff)
downloadcub3d-679b5dced1d73d9284bab8965e2f3bf37b3056f4.tar.gz
cub3d-679b5dced1d73d9284bab8965e2f3bf37b3056f4.tar.bz2
cub3d-679b5dced1d73d9284bab8965e2f3bf37b3056f4.zip
fixed ceilling/floor color
Diffstat (limited to 'parse/parse_color.c')
-rw-r--r--parse/parse_color.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/parse/parse_color.c b/parse/parse_color.c
index f602706..fd482e5 100644
--- a/parse/parse_color.c
+++ b/parse/parse_color.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/11 09:52:34 by cacharle #+# #+# */
-/* Updated: 2020/01/11 10:14:29 by cacharle ### ########.fr */
+/* Updated: 2020/01/30 14:17:37 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,8 +16,8 @@ t_bool parse_ceilling_color(t_state *state, char *line)
{
int tmp;
- line++;
- if ((tmp = ft_atoi(line)) > 255 || tmp < 0)
+ state->ceilling_color.hexcode = 0x0;
+ if ((tmp = ft_atoi(line)) > 255 || tmp < 0) // cant do atoi due to overflow stuff, use ft_strtol
return (FALSE);
state->ceilling_color.rgb.r = (t_byte)tmp;
if ((line = ft_strchr(line, ',') + 1) == NULL)
@@ -37,7 +37,7 @@ t_bool parse_floor_color(t_state *state, char *line)
{
int tmp;
- line++;
+ state->floor_color.hexcode = 0x0;
if ((tmp = ft_atoi(line)) > 255 || tmp < 0)
return (FALSE);
state->floor_color.rgb.r = (t_byte)tmp;