diff options
-rw-r--r-- | inc/cub3d_structs.h | 2 | ||||
-rw-r--r-- | map/map_one.cub | 10 | ||||
-rw-r--r-- | src/ft_draw_sprite.c | 3 | ||||
-rw-r--r-- | src/ft_draw_sprite_extra.c | 5 | ||||
-rw-r--r-- | src/ft_get_sprite_spawns.c | 2 | ||||
-rw-r--r-- | src/ft_init_map.c | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 1b46312..caf4964 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -202,7 +202,7 @@ typedef struct s_map size_t map_w; size_t map_h; size_t mapl_len; - int32_t sprite_nbr[4096]; + int32_t sprite_nbr[8]; uint8_t sprite_var; uint8_t weapon_var; int32_t sprite_order[8][4096]; diff --git a/map/map_one.cub b/map/map_one.cub index 7526283..5f0c67a 100644 --- a/map/map_one.cub +++ b/map/map_one.cub @@ -23,11 +23,11 @@ SH 2 1111111111111111111 1000000000000000001 - 1020304050607080001 - 1000000000000000001 -111111111111020304050607080001 -100000000000000000000000000001 -100000000000020304050607080001 + 1020304050607080901 + 1000000050607080901 +111111111111020304050607080901 +100000000000000000050607080901 +100000000000020304050607080901 100000000000000000000000000001 1001000000T0000000000000000001 10110+0+0111000001110000000111 diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c index 19ceb9f..615bbd3 100644 --- a/src/ft_draw_sprite.c +++ b/src/ft_draw_sprite.c @@ -56,13 +56,12 @@ void } it = -1; } - it = -1; jt = -1; while (++jt < cl->mlist.sprite_var) { + it = -1; while (++it < cl->mlist.sprite_nbr[jt] - 1) ft_sort_sprites_norme(dist_tab[jt], &it, jt, cl); - it = -1; } ft_sort_s_t(cl, dist_tab); } diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index 0830d2c..e592da0 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -61,8 +61,9 @@ void { while (++i < cl->mlist.sprite_nbr[j]) { - sprite = cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[cl->mlist - .st_o[j]][i]]; + sprite = + cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[ + cl->mlist.st_o[j]][i]]; sprite.current_sprite = (cl->mlist.st_o[j] == 0) ? 4 : cl->mlist.st_o[j] + 7; sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5); diff --git a/src/ft_get_sprite_spawns.c b/src/ft_get_sprite_spawns.c index f4d7e1e..e8eafa9 100644 --- a/src/ft_get_sprite_spawns.c +++ b/src/ft_get_sprite_spawns.c @@ -38,7 +38,7 @@ void x = 0; } if (clist->sprites[s_n][(i - 1 < 0) ? (0) : (i - 1)].s_pos_x != 0 - && s_n + 1 < 7) + && s_n + 1 <= 7) { ft_get_next_sprite(clist, s_n + 1, c + 1, 0); } diff --git a/src/ft_init_map.c b/src/ft_init_map.c index d252f2e..fb03bfd 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -64,7 +64,7 @@ int8_t mlist->sprite_var = 0; mlist->weapon_var = 0; mlist->topsp = 0; - ft_bzero(mlist->sprite_nbr, 4096); + ft_bzero(mlist->sprite_nbr, 8); ft_bzero(mlist->sprite_order, 4096); ft_bzero(mlist->st_o, 4096); ft_bzero(mlist->traps_order, 512); |