aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-02-29 00:29:17 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-02-29 00:29:17 +0100
commit4fccd597e3c5c97144e4324c1371db9f7f039967 (patch)
tree25cb40e9a022ca66fa038864b771e6b0fb15fc05 /src/ft_warp_level.c
parentAll works but one thing is not ok (diff)
download42-cub3d-4fccd597e3c5c97144e4324c1371db9f7f039967.tar.gz
42-cub3d-4fccd597e3c5c97144e4324c1371db9f7f039967.tar.bz2
42-cub3d-4fccd597e3c5c97144e4324c1371db9f7f039967.tar.xz
42-cub3d-4fccd597e3c5c97144e4324c1371db9f7f039967.tar.zst
42-cub3d-4fccd597e3c5c97144e4324c1371db9f7f039967.zip
Works fine, preparing small map
Diffstat (limited to '')
-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))))