aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalaaad2 <arthudurant263@gmail.com>2020-03-16 19:43:16 +0100
committersalaaad2 <arthudurant263@gmail.com>2020-03-16 19:43:16 +0100
commit0cde149ec5e478c3d6283136065ff0129231c25d (patch)
tree36f13a15446b9335b342f742a2e186ad5a4c28a8
parentfix norme2 (diff)
download42-cub3d-0cde149ec5e478c3d6283136065ff0129231c25d.tar.gz
42-cub3d-0cde149ec5e478c3d6283136065ff0129231c25d.tar.bz2
42-cub3d-0cde149ec5e478c3d6283136065ff0129231c25d.tar.xz
42-cub3d-0cde149ec5e478c3d6283136065ff0129231c25d.tar.zst
42-cub3d-0cde149ec5e478c3d6283136065ff0129231c25d.zip
bunchoshit
-rw-r--r--Makefile1
-rw-r--r--inc/cub3d.h1
-rw-r--r--src/ft_draw_sprite_extra.c2
-rw-r--r--src/ft_sort_s_t.c36
4 files changed, 39 insertions, 1 deletions
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 <libft.h>
#include <cub3d.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@@ -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 <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/24 20:22:45 by rbousset #+# #+# */
+/* Updated: 2020/03/09 18:56:01 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <libft.h>
+#include <cub3d.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <math.h>
+
+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++;
+ }
+}