aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_floor_cast.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-09 17:41:08 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-09 17:41:08 +0100
commitfffd37b3423720af58c416221ffbdbc5960b1439 (patch)
treed5f8c2946fff86e5bcc533484cf886bfd92c048e /src/ft_floor_cast.c
parentPerf (diff)
download42-cub3d-fffd37b3423720af58c416221ffbdbc5960b1439.tar.gz
42-cub3d-fffd37b3423720af58c416221ffbdbc5960b1439.tar.bz2
42-cub3d-fffd37b3423720af58c416221ffbdbc5960b1439.tar.xz
42-cub3d-fffd37b3423720af58c416221ffbdbc5960b1439.tar.zst
42-cub3d-fffd37b3423720af58c416221ffbdbc5960b1439.zip
Norme
Diffstat (limited to '')
-rw-r--r--src/ft_floor_cast.c19
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