From 0cde149ec5e478c3d6283136065ff0129231c25d Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Mon, 16 Mar 2020 19:43:16 +0100 Subject: bunchoshit --- Makefile | 1 + inc/cub3d.h | 1 + src/ft_draw_sprite_extra.c | 2 +- src/ft_sort_s_t.c | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/ft_sort_s_t.c diff --git a/Makefile b/Makefile index c310c87..09a995d 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,7 @@ SRCS_NAME += ft_sfx_trap.c SRCS_NAME += ft_sfx_new_level.c SRCS_NAME += ft_death_screen.c SRCS_NAME += ft_death_hooks.c +SRCS_NAME += ft_sort_s_t.c #--------------------------------------------------------------------------------------------------# SRCS = $(addprefix ${SRCS_DIR},${SRCS_NAME}) #--------------------------------------------------------------------------------------------------# diff --git a/inc/cub3d.h b/inc/cub3d.h index 348d82b..4b52aab 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -79,6 +79,7 @@ int8_t ft_draw_verline(t_cub *cl, int32_t x, void ft_sprite_width(t_cub *cl, t_sprite *sprite); void ft_sprite_height(t_cub *cl, t_sprite *sprite); void ft_sort_sprites(t_cub *cl); +void ft_sort_s_t(t_cub *cl, t_sprite *sprites[4096]); void ft_calc_sprite(t_cub *cl); void ft_draw_sprite(t_cub *cl, t_sprite *sprite); void ft_calc_trap(t_cub *cl); diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index 523bf3d..6096522 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -64,6 +63,7 @@ void i = 0; j = 0; ft_sort_sprites(cl); + ft_sort_s_t(cl, cl->sprites); while (j < cl->mlist.sprite_var) { while (i < cl->mlist.sprite_nbr) diff --git a/src/ft_sort_s_t.c b/src/ft_sort_s_t.c new file mode 100644 index 0000000..f91804b --- /dev/null +++ b/src/ft_sort_s_t.c @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_sort_s_t.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/24 20:22:45 by rbousset #+# #+# */ +/* Updated: 2020/03/09 18:56:01 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include +#include + +void + ft_sort_s_t(cl, t_sprite *s[4096]) +{ + uint16_t i; + uint16_t j; + t_sprite tmp_s; + + i = 0; + j = 0; + while (i < cl->sprite_var) + { + if (s[i][0].) + { + + } + i++; + } +} -- cgit v1.2.3