aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_verline.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_draw_verline.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c
index 6fa0d1e..d32ac38 100644
--- a/src/ft_draw_verline.c
+++ b/src/ft_draw_verline.c
@@ -33,6 +33,7 @@ static void
i = 0;
while (i <= y)
{
+ ft_floor_cast(i, cl);
*(int*)(cl->img.ptr +
(x * 4 + (i * cl->img.sizeline)))
= ft_darken_ceil(cl->c_rgb, i, cl);
@@ -40,18 +41,14 @@ static void
}
}
-#include <stdio.h>
-static void
- ft_calc_ceil_dist(int32_t y, t_ray *rl, t_cub *cl)
-{
- int16_t p;
+/* #include <stdio.h> */
+/* static void */
+/* ft_calc_ceil_dist(int32_t y, t_ray *rl, t_cub *cl) */
+/* { */
+/* int16_t p; */
- p = y - cl->wlist.y_size / 2;
- cl->plist.pos_z = 0.5 * cl->wlist.y_size;
- rl->ceil_dist = cl->plist.pos_z / p;
- rl->ceil_dist = (rl->ceil_dist > 0) ? (rl->ceil_dist) : (-rl->ceil_dist);
- printf("%f\n", rl->ceil_dist);
-}
+/* printf("%f\n", rl->ceil_dist); */
+/* } */
int8_t
ft_draw_verline(t_cub *cl, int32_t x, int32_t y, int32_t y2)
@@ -61,7 +58,6 @@ int8_t
(y < 0) ? (y = 0) : 0;
(y2 < 0) ? (y2 = 0) : 0;
- ft_calc_ceil_dist(y, &cl->rlist, cl);
ft_draw_ceil(cl, y, x);
(cl->rlist.line_h <= 0) ? (cl->rlist.line_h = 1) : 0;
while (y < y2)