From 36e46e00735af24fc4df8e41ff7741fdad3c45f0 Mon Sep 17 00:00:00 2001 From: aortigos Date: Tue, 25 Nov 2025 19:52:19 +0100 Subject: [PATCH] Created parsing.c --- includes/cub3d.h | 17 +++++++++++++++ src/parsing/parsing.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 src/parsing/parsing.c diff --git a/includes/cub3d.h b/includes/cub3d.h index 3701349..38eb004 100644 --- a/includes/cub3d.h +++ b/includes/cub3d.h @@ -1,3 +1,14 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* cub3d.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: aortigos fd = open(av, O_RDONLY); + if (map->fd == -1) + return (ft_putstr_fd(ERR_INV_FILE, 2), 0); + map->line = get_next_line(map->fd); + if (map->line == NULL) + return (ft_putstr_fd(ERR_EMPTY_FILE, 2), 0); + map->ture = ft_strdup(""); + process_map(map, count); + if (!check_count_textures(map, *count)) + return (freetl(map->ture, map->line, map->fd), 0); + map->ture2d = ft_split(map->ture, '\n'); + if (!map->ture2d) + return (freetl(map->ture, map->line, map->fd), 0); + if (!read_map_(map, *count)) + return (freetl(map->ture, map->line, map->fd), free2d(map->ture2d), 0); + return (freetl(map->ture, map->line, map->fd), 1); +} + +void get_x_y_player(t_data *data) +{ + +} + +int check_extension_map(char *file) +{ + char *str; + + str = ft_strrchr(file, '.'); + return (str && !ft_strcmp(str, ".cub")); +} + +int parsing(int ac, char **av, t_data *data) +{ + +} \ No newline at end of file