From fe29469eee3a78905e05ab95ea20e1c9ed7045fe Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 29 Mar 2020 16:05:58 +0200 Subject: I must be close --- src/ft_draw_sprite.c | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src/ft_draw_sprite.c') diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c index dc6f54f..fcc2a8b 100644 --- a/src/ft_draw_sprite.c +++ b/src/ft_draw_sprite.c @@ -16,25 +16,25 @@ #include #include -static void - ft_sort_sprites_norme(float *dist_tab, int16_t *i, uint16_t j, t_cub *cl) -{ - uint32_t tmp; - uint32_t it; +/* static void */ +/* ft_sort_sprites_norme(float *dist_tab, int16_t *i, uint16_t j, t_cub *cl) */ +/* { */ +/* uint32_t tmp; */ +/* uint32_t it; */ - it = *i; - tmp = 0; - if (dist_tab[it] < dist_tab[it + 1]) - { - tmp = dist_tab[it]; - dist_tab[it] = dist_tab[it + 1]; - dist_tab[it + 1] = tmp; - tmp = cl->mlist.sprite_order[j][it]; - cl->mlist.sprite_order[j][it] = cl->mlist.sprite_order[j][it + 1]; - cl->mlist.sprite_order[j][it + 1] = tmp; - *i = -1; - } -} +/* it = *i; */ +/* tmp = 0; */ +/* if (dist_tab[it] < dist_tab[it + 1]) */ +/* { */ +/* tmp = dist_tab[it]; */ +/* dist_tab[it] = dist_tab[it + 1]; */ +/* dist_tab[it + 1] = tmp; */ +/* tmp = cl->mlist.sprite_order[j][it]; */ +/* cl->mlist.sprite_order[j][it] = cl->mlist.sprite_order[j][it + 1]; */ +/* cl->mlist.sprite_order[j][it + 1] = tmp; */ +/* *i = -1; */ +/* } */ +/* } */ void ft_sort_sprites(t_cub *cl, int16_t it, int16_t jt) @@ -52,17 +52,17 @@ void (cl->plist.pos_x - cl->sprites[jt][it].s_pos_x) + (cl->plist.pos_y - cl->sprites[jt][it].s_pos_y) * (cl->plist.pos_y - cl->sprites[jt][it].s_pos_y)); - cl->mlist.sprite_order[jt][it] = it; + /* cl->mlist.sprite_order[jt][it] = it; */ } it = -1; } - jt = -1; - while (++jt < FT_TOTAL_SPRT) - { - it = -1; - while (++it < cl->mlist.sprite_nbr[jt] - 1) - ft_sort_sprites_norme(dist_tab[jt], &it, jt, cl); - } + /* jt = -1; */ + /* while (++jt < FT_TOTAL_SPRT) */ + /* { */ + /* it = -1; */ + /* while (++it < cl->mlist.sprite_nbr[jt] - 1) */ + /* ft_sort_sprites_norme(dist_tab[jt], &it, jt, cl); */ + /* } */ ft_sort_s_t(cl, dist_tab); } -- cgit v1.2.3