From 57867bbbdc24b734d85f8d3569c7ad27dcd9504d Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 30 Jan 2020 15:52:16 +0100 Subject: files restructuration --- parse/parse_color.c | 55 ----------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 parse/parse_color.c (limited to 'parse/parse_color.c') diff --git a/parse/parse_color.c b/parse/parse_color.c deleted file mode 100644 index fd482e5..0000000 --- a/parse/parse_color.c +++ /dev/null @@ -1,55 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* parse_color.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: cacharle +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/01/11 09:52:34 by cacharle #+# #+# */ -/* Updated: 2020/01/30 14:17:37 by cacharle ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "cub3d.h" - -t_bool parse_ceilling_color(t_state *state, char *line) -{ - int tmp; - - 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) - return (FALSE); - if ((tmp = ft_atoi(line)) > 255 || tmp < 0) - return (FALSE); - state->ceilling_color.rgb.g = (t_byte)tmp; - if ((line = ft_strchr(line, ',') + 1) == NULL) - return (FALSE); - if ((tmp = ft_atoi(line)) > 255 || tmp < 0) - return (FALSE); - state->ceilling_color.rgb.b = (t_byte)tmp; - return (TRUE); -} - -t_bool parse_floor_color(t_state *state, char *line) -{ - int tmp; - - state->floor_color.hexcode = 0x0; - if ((tmp = ft_atoi(line)) > 255 || tmp < 0) - return (FALSE); - state->floor_color.rgb.r = (t_byte)tmp; - if ((line = ft_strchr(line, ',') + 1) == NULL) - return (FALSE); - if ((tmp = ft_atoi(line)) > 255 || tmp < 0) - return (FALSE); - state->floor_color.rgb.g = (t_byte)tmp; - if ((line = ft_strchr(line, ',') + 1) == NULL) - return (FALSE); - if ((tmp = ft_atoi(line)) > 255 || tmp < 0) - return (FALSE); - state->floor_color.rgb.b = (t_byte)tmp; - return (TRUE); -} -- cgit