From fffd37b3423720af58c416221ffbdbc5960b1439 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Mon, 9 Mar 2020 17:41:08 +0100 Subject: Norme --- src/ft_floor_cast.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/ft_floor_cast.c') diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index 715eacc..6111eca 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -17,8 +17,7 @@ static void ft_draw_plain_horizontal(t_rgb rgb, t_cub *cl, int32_t y, int32_t x) { *(int*)(cl->img.ptr + - (x * 4 + (y * cl->img.sizeline))) - = ft_darken(rgb, cl); + (x * 4 + (y * cl->img.sizeline))) = ft_darken(rgb, cl); } static void @@ -47,14 +46,14 @@ static void static void ft_set_tex_xy(uint8_t tid, t_ray *rl, t_cub *cl) { - cl->tlist[tid].tex_y = (int32_t)(cl->tlist[tid].img_w - * (rl->x_floor - rl->x_cell)) % (cl->tlist[tid].img_w); - cl->tlist[tid].tex_x = (int32_t)(cl->tlist[tid].img_h - * (rl->y_floor - rl->y_cell)) % (cl->tlist[tid].img_h); - cl->tlist[tid].tex_x = (cl->tlist[tid].tex_x > 0) - ? (cl->tlist[tid].tex_x) : (-cl->tlist[tid].tex_x); - cl->tlist[tid].tex_y = (cl->tlist[tid].tex_y > 0) - ? (cl->tlist[tid].tex_y) : (-cl->tlist[tid].tex_y); + cl->tlist[tid].tex_y = (int32_t)(cl->tlist[tid].img_w + * (rl->x_floor - rl->x_cell)) % (cl->tlist[tid].img_w); + cl->tlist[tid].tex_x = (int32_t)(cl->tlist[tid].img_h + * (rl->y_floor - rl->y_cell)) % (cl->tlist[tid].img_h); + cl->tlist[tid].tex_x = (cl->tlist[tid].tex_x > 0) + ? (cl->tlist[tid].tex_x) : (-cl->tlist[tid].tex_x); + cl->tlist[tid].tex_y = (cl->tlist[tid].tex_y > 0) + ? (cl->tlist[tid].tex_y) : (-cl->tlist[tid].tex_y); } static void -- cgit v1.2.3