diff options
Diffstat (limited to 'src/ft_floor_cast.c')
-rw-r--r-- | src/ft_floor_cast.c | 128 |
1 files changed, 10 insertions, 118 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index b00792e..f371359 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -69,8 +69,8 @@ void cl = (t_cub *)vargp; y = (cl->wlist.y_size / 2); - y += 0 * (cl->wlist.y_size / 2 / 8); - while (y < (cl->wlist.y_size / 2) + (1 * (cl->wlist.y_size / 2 / 8))) + y += 0 * (cl->wlist.y_size / 2 / 4); + while (y < (cl->wlist.y_size / 2) + (1 * (cl->wlist.y_size / 2 / 4))) { x = 0; while (x < cl->wlist.x_size) @@ -94,8 +94,8 @@ void cl = (t_cub *)vargp; y = (cl->wlist.y_size / 2); - y += 1 * (cl->wlist.y_size / 2 / 8); - while (y < (cl->wlist.y_size / 2) + (2 * (cl->wlist.y_size / 2 / 8))) + y += 1 * (cl->wlist.y_size / 2 / 4); + while (y < (cl->wlist.y_size / 2) + (2 * (cl->wlist.y_size / 2 / 4))) { x = 0; while (x < cl->wlist.x_size) @@ -119,8 +119,8 @@ void cl = (t_cub *)vargp; y = (cl->wlist.y_size / 2); - y += (2 * (cl->wlist.y_size / 2 / 8)); - while (y < (cl->wlist.y_size / 2) + (3 * (cl->wlist.y_size / 2 / 8))) + y += (2 * (cl->wlist.y_size / 2 / 4)); + while (y < (cl->wlist.y_size / 2) + (3 * (cl->wlist.y_size / 2 / 4))) { x = 0; while (x < cl->wlist.x_size) @@ -144,108 +144,8 @@ void cl = (t_cub *)vargp; y = (cl->wlist.y_size / 2); - y += (3 * (cl->wlist.y_size / 2 / 8)); - while (y < (cl->wlist.y_size / 2) + (4 * (cl->wlist.y_size / 2 / 8))) - { - x = 0; - while (x < cl->wlist.x_size) - { - if (cl->rlist.wall_bz[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); - y += (4 * (cl->wlist.y_size / 2 / 8)); - while (y < (cl->wlist.y_size / 2) + (5 * (cl->wlist.y_size / 2 / 8))) - { - x = 0; - while (x < cl->wlist.x_size) - { - if (cl->rlist.wall_bz[x] <= y) - ft_floor_cast_loop(y, x, cl); - x++; - } - y++; - } - pthread_exit(0x0); - return (0x0); -} - -void -*ft_floor_six(void *vargp) -{ - uint16_t x; - uint16_t y; - t_cub *cl; - - cl = (t_cub *)vargp; - y = (cl->wlist.y_size / 2); - y += (5 * (cl->wlist.y_size / 2 / 8)); - while (y < (cl->wlist.y_size / 2) + (6 * (cl->wlist.y_size / 2 / 8))) - { - x = 0; - while (x < cl->wlist.x_size) - { - if (cl->rlist.wall_bz[x] <= y) - ft_floor_cast_loop(y, x, cl); - x++; - } - y++; - } - pthread_exit(0x0); - return (0x0); -} - -void -*ft_floor_seven(void *vargp) -{ - uint16_t x; - uint16_t y; - t_cub *cl; - - cl = (t_cub *)vargp; - y = (cl->wlist.y_size / 2); - y += (6 * (cl->wlist.y_size / 2 / 8)); - while (y < (cl->wlist.y_size / 2) + (7 * (cl->wlist.y_size / 2 / 8))) - { - x = 0; - while (x < cl->wlist.x_size) - { - if (cl->rlist.wall_bz[x] <= y) - ft_floor_cast_loop(y, x, cl); - x++; - } - y++; - } - pthread_exit(0x0); - return (0x0); -} - -void -*ft_floor_eight(void *vargp) -{ - uint16_t x; - uint16_t y; - t_cub *cl; - - cl = (t_cub *)vargp; - y = (cl->wlist.y_size / 2); - y += (7 * (cl->wlist.y_size / 2 / 8)); - while (y < (cl->wlist.y_size / 2) + (8 * (cl->wlist.y_size / 2 / 8))) + y += (3 * (cl->wlist.y_size / 2 / 4)); + while (y < (cl->wlist.y_size / 2) + (4 * (cl->wlist.y_size / 2 / 4))) { x = 0; while (x < cl->wlist.x_size) @@ -263,7 +163,7 @@ void void *ft_floor_cast(void *vargp) { - pthread_t tid[8]; + pthread_t tid[4]; t_cub *cl; cl = (t_cub *)vargp; @@ -271,18 +171,10 @@ 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_create(&tid[4], 0x0, ft_floor_five, (void*)cl); - pthread_create(&tid[5], 0x0, ft_floor_six, (void*)cl); - pthread_create(&tid[6], 0x0, ft_floor_seven, (void*)cl); - pthread_create(&tid[7], 0x0, ft_floor_eight, (void*)cl); pthread_join(tid[0], 0x0); pthread_join(tid[1], 0x0); pthread_join(tid[2], 0x0); pthread_join(tid[3], 0x0); - pthread_join(tid[4], 0x0); - pthread_join(tid[5], 0x0); - pthread_join(tid[6], 0x0); - pthread_join(tid[7], 0x0); - pthread_exit(0x0); + /* pthread_exit(0x0); */ return (0x0); } |