aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--inc/cub3d_structs.h1
-rw-r--r--map/map_one.cub2
-rw-r--r--src/ft_draw_scene.c2
-rw-r--r--src/ft_draw_verline.c3
-rw-r--r--src/ft_raycasting.c1
-rw-r--r--src/main.c1
6 files changed, 6 insertions, 4 deletions
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h
index 908b007..e2d5100 100644
--- a/inc/cub3d_structs.h
+++ b/inc/cub3d_structs.h
@@ -85,6 +85,7 @@ typedef struct s_ray
double wall_hit_x;
int tex_x;
int tex_y;
+ double step_tex_v;
} t_ray;
typedef struct s_map
diff --git a/map/map_one.cub b/map/map_one.cub
index fec57b0..34db6b6 100644
--- a/map/map_one.cub
+++ b/map/map_one.cub
@@ -1,4 +1,4 @@
-R 1600 1060
+R 1080 720
NO ./map/img/crapaud.xpm
SO ./map/img/linus.xpm
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);