From a25845a1e0c96111f42e96c9c87d33f0c42180bc Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Tue, 18 Feb 2020 16:18:09 +0100 Subject: hmmmmmmmmmmm --- src/ft_draw_scene.c | 2 +- src/ft_draw_verline.c | 3 ++- src/ft_raycasting.c | 1 - src/main.c | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c index ec2cc89..60198e9 100644 --- a/src/ft_draw_scene.c +++ b/src/ft_draw_scene.c @@ -18,7 +18,7 @@ void ft_draw_scene(t_cub *clist) { - mlx_clear_window(clist->wlist->wlx, clist->wlist->winptr); + /*mlx_clear_window(clist->wlist->wlx, clist->wlist->winptr);*/ clist->img.img = mlx_new_image(clist->wlist->wlx, clist->wlist->x_size, clist->wlist->y_size); clist->img.ptr = mlx_get_data_addr(clist->img.img, &clist->img.bpp, diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index 0fad33a..0b97cc5 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -60,7 +60,8 @@ int8_t ft_choose_tex(cl); while (y <= y2) { - *(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = (cl->rlist.side) ? 0x0000eeaa : 0x0000ffaa; + cl->rlist.step_tex_v = 1.0 * cl->tlist[clist->w_side].img_w - cl->rlist.line_h; + /**(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = (cl->rlist.side) ? 0x2200ffaa : 0x0000ffaa;*/ y++; } ft_draw_floor(cl, y, x); diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index ff73893..9a89dc4 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -71,7 +71,6 @@ void i = 0; wl = cl->wlist; - ft_wall_tex_init(cl); while (i < wl->x_size) { ft_initray(cl, i); diff --git a/src/main.c b/src/main.c index d102838..52bb211 100644 --- a/src/main.c +++ b/src/main.c @@ -31,6 +31,7 @@ int ft_parse_map(argv[1], clist); if (ft_init_winlx(clist) < 0) return (ft_exit(3, clist)); + ft_wall_tex_init(clist); ft_draw_scene(clist); ft_hooks_and_loops(clist->wlist, clist); return (0); -- cgit v1.2.3