From 733fd55d384eef1c89e0ad2a44beaee066182b50 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Fri, 28 Feb 2020 20:51:54 +0100 Subject: Right but not perfect --- src/ft_warp_level.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/ft_warp_level.c') diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index 03302bd..8739550 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -18,6 +18,24 @@ static void ft_memdel((void**)&ml); } +static void + ft_del_some(t_cub *cl) +{ + cl->plist->pos_x = 0; + cl->plist->pos_y = 0; + cl->wlist->x_size = 0; + cl->wlist->y_size = 0; + cl->f_rgb = ft_init_rgb(); + cl->c_rgb = ft_init_rgb(); + cl->plist->start_x = 0; + cl->plist->start_y = 0; + cl->plist->cam_x = 0; + cl->plist->dir_x = -1; + cl->plist->dir_y = 0; + cl->plist->plane_x = 0; + cl->plist->plane_y = 0.66666666; +} + int8_t ft_warp_level(t_cub *cl) { @@ -31,6 +49,7 @@ int8_t return (-1); ft_sprintf(next_path, "%s", cl->mlist->nlevel_path); ft_del_map(cl->mlist); + ft_del_some(cl); if (!(cl->mlist = ft_init_map())) return (-1); ft_parse_map(next_path, cl); -- cgit v1.2.3