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.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c
index 4e2a258..cfacd81 100644
--- a/src/ft_warp_level.c
+++ b/src/ft_warp_level.c
@@ -13,6 +13,7 @@
#include <libft.h>
#include <cub3d.h>
#include <stdlib.h>
+#include <stddef.h>
#include <stdint.h>
#include <mlx.h>
@@ -36,10 +37,6 @@ static void
{
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;
@@ -47,12 +44,21 @@ static void
cl->plist->dir_y = 0;
cl->plist->plane_x = 0;
cl->plist->plane_y = 0.66666666;
+ cl->f_rgb = ft_init_rgb();
+ cl->c_rgb = ft_init_rgb();
+ cl->rlist = ft_init_s_ray();
mlx_destroy_image(cl->wlist->wlx, cl->tlist[0].img);
mlx_destroy_image(cl->wlist->wlx, cl->tlist[1].img);
mlx_destroy_image(cl->wlist->wlx, cl->tlist[2].img);
mlx_destroy_image(cl->wlist->wlx, cl->tlist[3].img);
mlx_destroy_image(cl->wlist->wlx, cl->tlist[4].img);
mlx_destroy_image(cl->wlist->wlx, cl->tlist[5].img);
+ cl->tlist[0].img = NULL;
+ cl->tlist[1].img = NULL;
+ cl->tlist[2].img = NULL;
+ cl->tlist[3].img = NULL;
+ cl->tlist[4].img = NULL;
+ cl->tlist[5].img = NULL;
}
int8_t
@@ -60,8 +66,8 @@ int8_t
{
char *next_path;
- if ((uint32_t)cl->plist->pos_x == cl->mlist->nlx
- && (uint32_t)cl->plist->pos_y == cl->mlist->nly)
+ if ((uint32_t)cl->plist->pos_x == cl->mlist->nlx &&
+ (uint32_t)cl->plist->pos_y == cl->mlist->nly)
{
if (!(next_path = (char *)malloc((ft_strlen(
cl->mlist->nlevel_path) + 1) * sizeof(char))))