aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_darken_rgb.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-07 20:32:17 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-07 20:32:17 +0100
commit9336d5812fc107127215bbfcf1bf86e128c9586c (patch)
treec77d632f32c6e12d913a7984cdd9d249c5ed50ff /src/ft_darken_rgb.c
parentqwe (diff)
download42-cub3d-9336d5812fc107127215bbfcf1bf86e128c9586c.tar.gz
42-cub3d-9336d5812fc107127215bbfcf1bf86e128c9586c.tar.bz2
42-cub3d-9336d5812fc107127215bbfcf1bf86e128c9586c.tar.xz
42-cub3d-9336d5812fc107127215bbfcf1bf86e128c9586c.tar.zst
42-cub3d-9336d5812fc107127215bbfcf1bf86e128c9586c.zip
DIVINE INTELLECT
Diffstat (limited to '')
-rw-r--r--src/ft_darken_rgb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ft_darken_rgb.c b/src/ft_darken_rgb.c
index fe69fa2..564dfbd 100644
--- a/src/ft_darken_rgb.c
+++ b/src/ft_darken_rgb.c
@@ -15,13 +15,13 @@
#include <stdio.h>
uint32_t
- ft_darken_ceil(t_rgb rgb, t_cub *cl)
+ ft_darken_ceil(t_rgb rgb, int32_t y, t_cub *cl)
{
t_rgb darker;
float calc;
darker = rgb;
- calc = ((float)(cl->y - (75000.0 / cl->wlist.y_size))
+ calc = ((float)(y - (75000.0 / cl->wlist.y_size))
/ (cl->wlist.y_size / 2));
calc = (calc < 0) ? (0) : (calc);
darker.r *= 1 - calc;
@@ -31,12 +31,12 @@ uint32_t
}
uint32_t
- ft_darken_floor(t_rgb rgb, t_cub *cl)
+ ft_darken_floor(t_rgb rgb, int32_t y, t_cub *cl)
{
t_rgb darker;
float calc;
- calc = ((float)(cl->y + (75000.0 / cl->wlist.y_size))
+ calc = ((float)(y + (75000.0 / cl->wlist.y_size))
/ (cl->wlist.y_size / 2)) - 1.0;
calc = (calc < 0) ? (0) : (calc);
darker = rgb;