diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-08 02:47:01 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-08 02:47:01 +0100 |
commit | de7d432e18f4363e73b11f23885d7afd002a99f0 (patch) | |
tree | b2321f6c77d19147892541b2de619681372beeb0 /src/ft_darken_rgb.c | |
parent | Not great (diff) | |
download | 42-cub3d-de7d432e18f4363e73b11f23885d7afd002a99f0.tar.gz 42-cub3d-de7d432e18f4363e73b11f23885d7afd002a99f0.tar.bz2 42-cub3d-de7d432e18f4363e73b11f23885d7afd002a99f0.tar.xz 42-cub3d-de7d432e18f4363e73b11f23885d7afd002a99f0.tar.zst 42-cub3d-de7d432e18f4363e73b11f23885d7afd002a99f0.zip |
I'm close af
Diffstat (limited to 'src/ft_darken_rgb.c')
-rw-r--r-- | src/ft_darken_rgb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ft_darken_rgb.c b/src/ft_darken_rgb.c index 5edfd89..90188b4 100644 --- a/src/ft_darken_rgb.c +++ b/src/ft_darken_rgb.c @@ -12,8 +12,8 @@ #include <cub3d.h> #include <stdint.h> -#include <stdio.h> +#include <stdio.h> uint32_t ft_darken_ceil(t_rgb rgb, int32_t y, t_cub *cl) { @@ -31,7 +31,7 @@ uint32_t } uint32_t - ft_darken_floor(t_rgb rgb, int32_t y, t_cub *cl) + ft_darken_floor(t_rgb rgb, float dist, t_cub *cl) { t_rgb darker; float calc; @@ -39,8 +39,9 @@ uint32_t /* calc = ((float)(y + (75000.0 / cl->wlist.y_size)) */ /* / (cl->wlist.y_size / 2)) - 1.0; */ /* calc = (calc < 0) ? (0) : (calc); */ - (void)y; - calc = (cl->rlist.row_dist * 0.4); + printf("%f\n", dist); + (void)cl; + calc = (dist * 0.4); calc = (calc >= 255) ? (255) : (calc); calc = (calc < 1) ? (1) : (calc); darker = rgb; |