diff options
| author | Rudy Bousset <rbousset@z2r4p1.le-101.fr> | 2020-03-08 17:59:07 +0100 | 
|---|---|---|
| committer | Rudy Bousset <rbousset@z2r4p1.le-101.fr> | 2020-03-08 17:59:07 +0100 | 
| commit | 427d1819c0991b1fb94708a5b8580828c8462d2a (patch) | |
| tree | 340d6eacc04aea3730b8bc056a1a21ebcc5b4ed3 /src | |
| parent | Psychedelic (diff) | |
| download | 42-cub3d-427d1819c0991b1fb94708a5b8580828c8462d2a.tar.gz 42-cub3d-427d1819c0991b1fb94708a5b8580828c8462d2a.tar.bz2 42-cub3d-427d1819c0991b1fb94708a5b8580828c8462d2a.tar.xz 42-cub3d-427d1819c0991b1fb94708a5b8580828c8462d2a.tar.zst 42-cub3d-427d1819c0991b1fb94708a5b8580828c8462d2a.zip | |
We close
Diffstat (limited to '')
| -rw-r--r-- | src/ft_draw_verline.c | 10 | ||||
| -rw-r--r-- | src/ft_floor_cast.c | 1 | ||||
| -rw-r--r-- | src/ft_raycasting.c | 1 | 
3 files changed, 6 insertions, 6 deletions
| diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index dd7697a..8e71457 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -28,6 +28,7 @@ static void  	cl->img.ptr[x * 4 + cl->wlist.x_size * y + 3] = (int8_t)0;  } +#include <stdio.h>  static void  	ft_draw_floor(t_cub *cl, int32_t y, int32_t x)  { @@ -40,7 +41,6 @@ static void  	dist_player = 0.0;  	while ((uint32_t)y < cl->wlist.y_size)  	{ -		ft_floor_cast(cl);  		curr_dist = cl->wlist.y_size / (2.0 * y - cl->wlist.y_size);  		weight = (curr_dist - dist_player)  				/ (cl->rlist.wall_dist - dist_player); @@ -52,10 +52,10 @@ static void  							* cl->tlist[6].img_w) % cl->tlist[6].img_w;  		cl->tlist[6].tex_y = (int32_t)(curr_floor_y  							* cl->tlist[6].img_h) % cl->tlist[6].img_h; -		cl->tlist[6].tex_x = (cl->tlist[6].tex_x > 0) -			? (cl->tlist[6].tex_x) : (-cl->tlist[6].tex_x); -		cl->tlist[6].tex_y = (cl->tlist[6].tex_y > 0) -			? (cl->tlist[6].tex_y) : (-cl->tlist[6].tex_y); +		/* cl->tlist[6].tex_x = (cl->tlist[6].tex_x > 0) */ +		/* 	? (cl->tlist[6].tex_x) : (-cl->tlist[6].tex_x); */ +		/* cl->tlist[6].tex_y = (cl->tlist[6].tex_y > 0) */ +		/* 	? (cl->tlist[6].tex_y) : (-cl->tlist[6].tex_y); */  		ft_draw_floor_tex(cl, y, x, cl->tlist[6].tex_y);  		/* *(int*)(cl->img.ptr + */  		/* 		(x * 4 + (y * cl->img.sizeline))) */ diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index d9afa5a..fe2734a 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -13,7 +13,6 @@  #include <cub3d.h>  #include <stdint.h> -#include <stdio.h>  void  	ft_floor_cast(t_cub *cl)  { diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index c83604f..0a4b8b5 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -117,6 +117,7 @@ void  	while (i < wl->x_size)  	{  		ft_initray(i, cl); +		ft_floor_cast(cl);  		cl->rlist.line_h = (int16_t)(wl->y_size / cl->rlist.wall_dist);  		cl->rlist.wall_t = -cl->rlist.line_h / 2 + wl->y_size / 2;  		if (cl->rlist.wall_t < 0) | 
