aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_darken_rgb.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-07 19:03:53 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-07 19:03:53 +0100
commit4218ab8ee1a50c83a60c86a454f21d43146b46a0 (patch)
treef1f1926219786626f936b6f9ceeddd4e89062d91 /src/ft_darken_rgb.c
parentRemoved one remaining POWER (diff)
download42-cub3d-4218ab8ee1a50c83a60c86a454f21d43146b46a0.tar.gz
42-cub3d-4218ab8ee1a50c83a60c86a454f21d43146b46a0.tar.bz2
42-cub3d-4218ab8ee1a50c83a60c86a454f21d43146b46a0.tar.xz
42-cub3d-4218ab8ee1a50c83a60c86a454f21d43146b46a0.tar.zst
42-cub3d-4218ab8ee1a50c83a60c86a454f21d43146b46a0.zip
The sky is nice
Diffstat (limited to '')
-rw-r--r--src/ft_darken_rgb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ft_darken_rgb.c b/src/ft_darken_rgb.c
index 97d0c0e..3587d72 100644
--- a/src/ft_darken_rgb.c
+++ b/src/ft_darken_rgb.c
@@ -15,12 +15,15 @@
#include <stdio.h>
uint32_t
- ft_darken_rgb(t_rgb rgb, int32_t y, t_cub *cl)
+ ft_darken_rgb(t_rgb rgb, t_cub *cl)
{
t_rgb darker;
- uint8_t calc;
+ float dist;
+ float calc;
- calc = (((cl->wlist.y_size / 2) + y)),
+ if ((dist = cl->rlist.wall_dist) <= 0)
+ dist = 0.0001;
+ calc = (dist * 0.2);
calc = (calc >= 255) ? (255) : (calc);
calc = (calc < 1) ? (1) : (calc);
darker = rgb;