diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_floor_cast.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index 3962431..13a0b54 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -34,11 +34,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); } @@ -50,20 +53,20 @@ void { ft_draw_extra_tex(6, y, x, cl); } - else + else if (!cl->mlist.isftex) ft_draw_plain_horizontal(cl->f_rgb, cl, y, x); - if (cl->mlist.isctex && !cl->mlist.isskybox) + if (cl->mlist.isctex) { ft_draw_extra_tex(7, cl->wlist.y_size - y - 1, x, cl); } - else if (!cl->mlist.isctex && !cl->mlist.isskybox) + else if (!cl->mlist.isctex) ft_draw_plain_horizontal(cl->c_rgb, cl, cl->wlist.y_size - y - 1, x); } void *ft_floor_cast(void *vargp) { - pthread_t tid[4]; + pthread_t tid[5]; t_cub *cl; cl = (t_cub *)vargp; @@ -71,10 +74,12 @@ void pthread_create(&tid[1], 0x0, ft_floor_two, (void*)cl); pthread_create(&tid[2], 0x0, ft_floor_three, (void*)cl); pthread_create(&tid[3], 0x0, ft_floor_four, (void*)cl); - pthread_join(tid[0], 0x0); - pthread_join(tid[1], 0x0); - pthread_join(tid[2], 0x0); + pthread_create(&tid[4], 0x0, ft_floor_five, (void*)cl); + pthread_join(tid[4], 0x0); pthread_join(tid[3], 0x0); + pthread_join(tid[2], 0x0); + pthread_join(tid[1], 0x0); + pthread_join(tid[0], 0x0); pthread_exit(0x0); return (0x0); } |