diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_floor_cast.c | 19 |
1 files changed, 9 insertions, 10 deletions
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 |