feat: advancement on map parse

This commit is contained in:
B.Goulard 2024-11-18 17:25:27 +01:00
parent 7321db26d9
commit d586acba8f
11 changed files with 257 additions and 123 deletions

View file

@ -6,14 +6,14 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/09 01:12:16 by bgoulard #+# #+# */
/* Updated: 2024/11/09 01:36:19 by bgoulard ### ########.fr */
/* Updated: 2024/11/15 09:08:34 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d_struct.h"
#include "ft_string.h"
void c3_set_file(void *usr_control_struct, const char *arg)
void c3_set_file(void *usr_control_struct, const char *arg)
{
t_cli *cli_ctx;
@ -21,7 +21,7 @@ void c3_set_file(void *usr_control_struct, const char *arg)
cli_ctx->file = ft_strdup(arg);
}
void c3_set_debug(void *usr_control_struct)
void c3_set_debug(void *usr_control_struct)
{
t_cli *cli_ctx;
@ -29,7 +29,7 @@ void c3_set_debug(void *usr_control_struct)
cli_ctx->debug = true;
}
void c3_set_save(void *usr_control_struct)
void c3_set_save(void *usr_control_struct)
{
t_cli *cli_ctx;
@ -37,16 +37,17 @@ void c3_set_save(void *usr_control_struct)
cli_ctx->save = true;
}
void c3_print_help(void *usr_control_struct)
void c3_print_help(void *usr_control_struct)
{
t_cli *cli_ctx;
t_cli *cli_ctx;
const char *help_str = \
"Usage: cub3d [options] <file>\nOptions:\n" \
"\t-f, --file <file> : specify the file to load\n" \
"\t-d, --debug : enable debug mode\n" \
"\t-s, --save : save the state of the 'game' when closing\n" \
"\t-h, --help : print this help\n";
cli_ctx = (t_cli *)usr_control_struct;
cli_ctx->help = true;
ft_putstr_fd("Usage: cub3d [options] <file>\n", STDOUT_FILENO);
ft_putstr_fd("Options:\n", STDOUT_FILENO);
ft_putstr_fd("\t-f, --file <file> : specify the file to load\n", STDOUT_FILENO);
ft_putstr_fd("\t-d, --debug : enable debug mode\n", STDOUT_FILENO);
ft_putstr_fd("\t-s, --save : save the state of the 'game' when closing\n", STDOUT_FILENO);
ft_putstr_fd("\t-h, --help : print this help\n", STDOUT_FILENO);
ft_putstr_fd(help_str, STDOUT_FILENO);
}