aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_floor_cast.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-23 18:04:38 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-23 18:04:38 +0100
commit50759fcc4f3b939ad35254ce220c206056f3f31e (patch)
treefd28f91d64ccefe142927eeaf9dc85e5719c3666 /src/ft_floor_cast.c
parentGood tweak (diff)
download42-cub3d-50759fcc4f3b939ad35254ce220c206056f3f31e.tar.gz
42-cub3d-50759fcc4f3b939ad35254ce220c206056f3f31e.tar.bz2
42-cub3d-50759fcc4f3b939ad35254ce220c206056f3f31e.tar.xz
42-cub3d-50759fcc4f3b939ad35254ce220c206056f3f31e.tar.zst
42-cub3d-50759fcc4f3b939ad35254ce220c206056f3f31e.zip
Fixed
Diffstat (limited to 'src/ft_floor_cast.c')
-rw-r--r--src/ft_floor_cast.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index 160a2c1..9166147 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -16,8 +16,11 @@
static void
ft_draw_plain_horizontal(t_rgb rgb, t_cub *cl, int32_t y, int32_t x)
{
+ float dist;
+
+ dist = (cl->rlist.row_dist > 0) ? (cl->rlist.row_dist) : (0.0001);
*(int*)(cl->img.ptr +
- (x * 4 + (y * cl->img.sizeline))) = ft_darken(rgb, cl);
+ (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(dist, rgb, cl);
}
static void