From c7b399f143c5df061860c2d2b45d6855b2c12db3 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Thu, 5 Mar 2020 20:58:15 +0100 Subject: cool cool --- src/ft_darken_rgb.c | 9 +++------ src/ft_draw_verline.c | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ft_darken_rgb.c b/src/ft_darken_rgb.c index 6993891..97d0c0e 100644 --- a/src/ft_darken_rgb.c +++ b/src/ft_darken_rgb.c @@ -15,15 +15,12 @@ #include uint32_t - ft_darken_rgb(t_rgb rgb, t_cub *cl) + ft_darken_rgb(t_rgb rgb, int32_t y, t_cub *cl) { t_rgb darker; - float dist; - float calc; + uint8_t calc; - if ((dist = cl->rlist.ceil_dist) <= 0) - dist = 0.0001; - calc = (dist * 0.4); + calc = (((cl->wlist.y_size / 2) + y)), calc = (calc >= 255) ? (255) : (calc); calc = (calc < 1) ? (1) : (calc); darker = rgb; diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index f01ddc8..eeccc42 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -20,7 +20,7 @@ static void { *(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) - = ft_darken_rgb(cl->f_rgb, cl); + = ft_darken_rgb(cl->f_rgb, y, cl); y++; } } @@ -35,7 +35,7 @@ static void { *(int*)(cl->img.ptr + (x * 4 + (i * cl->img.sizeline))) - = ft_darken_rgb(cl->c_rgb, cl); + = ft_darken_rgb(cl->c_rgb, i, cl); i++; } } -- cgit v1.2.3