diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-13 23:12:32 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-13 23:12:32 +0100 |
commit | 97c08dd3043ee55724bba86c46804fd78a319df6 (patch) | |
tree | 3e033363a59ba28cdcc3e449e2e2f455ba1a9605 /src/ft_draw_verline.c | |
parent | In progress (diff) | |
download | 42-cub3d-97c08dd3043ee55724bba86c46804fd78a319df6.tar.gz 42-cub3d-97c08dd3043ee55724bba86c46804fd78a319df6.tar.bz2 42-cub3d-97c08dd3043ee55724bba86c46804fd78a319df6.tar.xz 42-cub3d-97c08dd3043ee55724bba86c46804fd78a319df6.tar.zst 42-cub3d-97c08dd3043ee55724bba86c46804fd78a319df6.zip |
Colors
Diffstat (limited to 'src/ft_draw_verline.c')
-rw-r--r-- | src/ft_draw_verline.c | 10 |
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); } |