aboutsummaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-01 12:33:55 +0100
committerCharles <sircharlesaze@gmail.com>2020-02-01 12:33:55 +0100
commita0f26d0407a2e514e9dcfd2baeef5ccd98f7b3dd (patch)
treefc919296727d6a6dc4eda868d143cb86017ed2bc /src/parse
parent57867bbbdc24b734d85f8d3569c7ad27dcd9504d (diff)
downloadcub3d-a0f26d0407a2e514e9dcfd2baeef5ccd98f7b3dd.tar.gz
cub3d-a0f26d0407a2e514e9dcfd2baeef5ccd98f7b3dd.tar.bz2
cub3d-a0f26d0407a2e514e9dcfd2baeef5ccd98f7b3dd.zip
texture selector, collision detection
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/parse.c10
-rw-r--r--src/parse/parse_color.c2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/parse/parse.c b/src/parse/parse.c
index f4b5b66..581056a 100644
--- a/src/parse/parse.c
+++ b/src/parse/parse.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/15 09:29:21 by cacharle #+# #+# */
-/* Updated: 2020/01/30 12:03:54 by cacharle ### ########.fr */
+/* Updated: 2020/02/01 11:35:32 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -32,8 +32,8 @@ t_state *parse(char *filename)
"parse configuration", state, lines));
}
if ((state = parse_map(state, lines + i)) == NULL)
- return (error_put_return_lines_state_destroy(
- "parse map", state, lines));
+ return (error_put_return_lines_state_destroy("parse map",
+ state, lines));
helper_free_splited(lines);
return (state);
}
@@ -73,8 +73,6 @@ static t_option_parser g_option_parsers[] =
{"C", parse_ceilling_color}
};
-#define OPTIONS_PARSERS_SIZE (sizeof(g_option_parsers) / sizeof(t_option_parser))
-
t_bool parse_line(t_state *state, char *line)
{
int i;
@@ -82,7 +80,7 @@ t_bool parse_line(t_state *state, char *line)
if (!*line)
return (TRUE);
i = -1;
- while (++i < (int)OPTIONS_PARSERS_SIZE)
+ while (++i < (int)(sizeof(g_option_parsers) / sizeof(t_option_parser)))
if (ft_strncmp(g_option_parsers[i].id, line,
ft_strlen(g_option_parsers[i].id)) == 0)
return (g_option_parsers[i].func(
diff --git a/src/parse/parse_color.c b/src/parse/parse_color.c
index fd482e5..3c025de 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/01/30 14:17:37 by cacharle ### ########.fr */
+/* Updated: 2020/02/01 11:32:33 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */