aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_verline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_verline.c')
-rw-r--r--src/ft_draw_verline.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c
index 17d754a..f7e5a1c 100644
--- a/src/ft_draw_verline.c
+++ b/src/ft_draw_verline.c
@@ -1,13 +1,13 @@
#include <cub3d.h>
static void
-ft_draw_floor(t_cub *cl, int32_t y, int32_t x, int16_t i)
+ft_draw_floor(t_cub *cl, int32_t y, int32_t x)
{
- while (i <= y)
+ while (y <= cl->wlist->y_size)
{
*(int*)(cl->img.ptr +
- (x * 4 + (i * cl->img.sizeline))) = ft_rgb_to_hex(cl->f_rgb);
- i++;
+ (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(cl->f_rgb);
+ y++;
}
}
@@ -50,6 +50,6 @@ ft_draw_verline(t_cub *cl, int32_t x, int32_t y1, int32_t y2, int32_t color)
*(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = color;
y++;
}
- ft_draw_floor(cl, x, cl->wlist->y_size, y);
+ ft_draw_floor(cl, y, x);
return (0);
}