aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_warp_level.c')
-rw-r--r--src/ft_warp_level.c19
1 files changed, 19 insertions, 0 deletions
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);