diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-27 15:44:12 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-27 15:44:33 +0100 |
commit | a4342816383dd39666bb6007210eb38b6819469a (patch) | |
tree | 7f7f07dd5e4777bcea1720f91377ff239f7aa80b /src/ft_floor_threads.c | |
parent | test map update (diff) | |
download | 42-cub3d-a4342816383dd39666bb6007210eb38b6819469a.tar.gz 42-cub3d-a4342816383dd39666bb6007210eb38b6819469a.tar.bz2 42-cub3d-a4342816383dd39666bb6007210eb38b6819469a.tar.xz 42-cub3d-a4342816383dd39666bb6007210eb38b6819469a.tar.zst 42-cub3d-a4342816383dd39666bb6007210eb38b6819469a.zip |
Five threads for compat
Diffstat (limited to '')
-rw-r--r-- | src/ft_floor_threads.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/ft_floor_threads.c b/src/ft_floor_threads.c index 476bd8e..05f75aa 100644 --- a/src/ft_floor_threads.c +++ b/src/ft_floor_threads.c @@ -26,7 +26,7 @@ void while (y < (cl->wlist.y_size)) { x = 0; - while (x < cl->wlist.x_size / 4) + while (x < cl->wlist.x_size / 5) { if (cl->rlist.wall_b_tab[x] <= y) ft_floor_cast_loop(y, x, cl); @@ -49,8 +49,8 @@ void y = (cl->wlist.y_size / 2); while (y < (cl->wlist.y_size)) { - x = cl->wlist.x_size / 4; - while (x < 2 * (cl->wlist.x_size / 4)) + x = cl->wlist.x_size / 5; + while (x < 2 * (cl->wlist.x_size / 5)) { if (cl->rlist.wall_b_tab[x] <= y) ft_floor_cast_loop(y, x, cl); @@ -73,8 +73,8 @@ void y = (cl->wlist.y_size / 2); while (y < (cl->wlist.y_size)) { - x = 2 * (cl->wlist.x_size / 4); - while (x < 3 * (cl->wlist.x_size / 4)) + x = 2 * (cl->wlist.x_size / 5); + while (x < 3 * (cl->wlist.x_size / 5)) { if (cl->rlist.wall_b_tab[x] <= y) ft_floor_cast_loop(y, x, cl); @@ -97,8 +97,32 @@ void y = (cl->wlist.y_size / 2); while (y < (cl->wlist.y_size)) { - x = 3 * (cl->wlist.x_size / 4); - while (x < 4 * (cl->wlist.x_size / 4)) + x = 3 * (cl->wlist.x_size / 5); + while (x < 4 * (cl->wlist.x_size / 5)) + { + if (cl->rlist.wall_b_tab[x] <= y) + ft_floor_cast_loop(y, x, cl); + x++; + } + y++; + } + pthread_exit(0x0); + return (0x0); +} + +void + *ft_floor_five(void *vargp) +{ + uint16_t x; + uint16_t y; + t_cub *cl; + + cl = (t_cub *)vargp; + y = (cl->wlist.y_size / 2); + while (y < (cl->wlist.y_size)) + { + x = 4 * (cl->wlist.x_size / 5); + while (x < 5 * (cl->wlist.x_size / 5)) { if (cl->rlist.wall_b_tab[x] <= y) ft_floor_cast_loop(y, x, cl); |