diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-28 13:59:29 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-28 13:59:29 +0100 |
commit | 4bcf56150b67f9e8ac21180cbe62cd64102a5f8f (patch) | |
tree | 44007b988eb756616f259fd08e11dc471b4f492d /src/ft_floor_cast.c | |
parent | Five threads for compat (diff) | |
download | 42-cub3d-4bcf56150b67f9e8ac21180cbe62cd64102a5f8f.tar.gz 42-cub3d-4bcf56150b67f9e8ac21180cbe62cd64102a5f8f.tar.bz2 42-cub3d-4bcf56150b67f9e8ac21180cbe62cd64102a5f8f.tar.xz 42-cub3d-4bcf56150b67f9e8ac21180cbe62cd64102a5f8f.tar.zst 42-cub3d-4bcf56150b67f9e8ac21180cbe62cd64102a5f8f.zip |
Fixed floor segv
Diffstat (limited to '')
-rw-r--r-- | src/ft_floor_cast.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index 874a398..aae1e90 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -25,6 +25,7 @@ static void (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(dist, rgb, cl); } +#include <libft.h> static void ft_draw_extra_tex(uint8_t tid, uint16_t y, uint16_t x, t_cub *cl) { @@ -34,11 +35,14 @@ static void if ((dist = cl->rlist.row_dist_tab[y]) <= 0) dist = 0.0001; rgb.b = (uint8_t)cl->tlist[tid].ptr[cl->rlist.fc_tex_x_tab[tid - 6][y][x] - * 4 + 4 * cl->tlist[tid].img_h * cl->rlist.fc_tex_y_tab[tid - 6][y][x]]; + * 4 + 4 * cl->tlist[tid].img_h * + cl->rlist.fc_tex_y_tab[tid - 6][y][x]]; rgb.g = (uint8_t)cl->tlist[tid].ptr[cl->rlist.fc_tex_x_tab[tid - 6][y][x] - * 4 + 4 * cl->tlist[tid].img_h * cl->rlist.fc_tex_y_tab[tid - 6][y][x] + 1]; + * 4 + 4 * cl->tlist[tid].img_h * + cl->rlist.fc_tex_y_tab[tid - 6][y][x] + 1]; rgb.r = (uint8_t)cl->tlist[tid].ptr[cl->rlist.fc_tex_x_tab[tid - 6][y][x] - * 4 + 4 * cl->tlist[tid].img_h * cl->rlist.fc_tex_y_tab[tid - 6][y][x] + 2]; + * 4 + 4 * cl->tlist[tid].img_h * + cl->rlist.fc_tex_y_tab[tid - 6][y][x] + 2]; *(int*)(cl->img.ptr + ((uint16_t)x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(dist, rgb, cl); } |