From d248cde2309e9aa3f14a10ce2db0019afdf9f0f1 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 8 Mar 2020 00:56:36 +0100 Subject: Collision fixed, still galering --- src/ft_draw_verline.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/ft_draw_verline.c') diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index 6fa0d1e..d32ac38 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -33,6 +33,7 @@ static void i = 0; while (i <= y) { + ft_floor_cast(i, cl); *(int*)(cl->img.ptr + (x * 4 + (i * cl->img.sizeline))) = ft_darken_ceil(cl->c_rgb, i, cl); @@ -40,18 +41,14 @@ static void } } -#include -static void - ft_calc_ceil_dist(int32_t y, t_ray *rl, t_cub *cl) -{ - int16_t p; +/* #include */ +/* static void */ +/* ft_calc_ceil_dist(int32_t y, t_ray *rl, t_cub *cl) */ +/* { */ +/* int16_t p; */ - p = y - cl->wlist.y_size / 2; - cl->plist.pos_z = 0.5 * cl->wlist.y_size; - rl->ceil_dist = cl->plist.pos_z / p; - rl->ceil_dist = (rl->ceil_dist > 0) ? (rl->ceil_dist) : (-rl->ceil_dist); - printf("%f\n", rl->ceil_dist); -} +/* printf("%f\n", rl->ceil_dist); */ +/* } */ int8_t ft_draw_verline(t_cub *cl, int32_t x, int32_t y, int32_t y2) @@ -61,7 +58,6 @@ int8_t (y < 0) ? (y = 0) : 0; (y2 < 0) ? (y2 = 0) : 0; - ft_calc_ceil_dist(y, &cl->rlist, cl); ft_draw_ceil(cl, y, x); (cl->rlist.line_h <= 0) ? (cl->rlist.line_h = 1) : 0; while (y < y2) -- cgit v1.2.3