aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalad <salad@saladesk.desktop>2020-03-25 16:02:09 +0100
committersalad <salad@saladesk.desktop>2020-03-25 16:02:09 +0100
commit30d5ae61f527a6cf606e6ca8546311fde678579a (patch)
tree86e381d63fe2cf1ed7a825aadb56d2c5346d266c
parentwhat the fuck les amis (diff)
download42-cub3d-30d5ae61f527a6cf606e6ca8546311fde678579a.tar.gz
42-cub3d-30d5ae61f527a6cf606e6ca8546311fde678579a.tar.bz2
42-cub3d-30d5ae61f527a6cf606e6ca8546311fde678579a.tar.xz
42-cub3d-30d5ae61f527a6cf606e6ca8546311fde678579a.tar.zst
42-cub3d-30d5ae61f527a6cf606e6ca8546311fde678579a.zip
j'aime trier
Diffstat (limited to '')
-rw-r--r--Makefile2
-rw-r--r--map/map_two.cub10
-rw-r--r--src/ft_sort_s_t.c19
3 files changed, 13 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index f28ecf9..4e51445 100644
--- a/Makefile
+++ b/Makefile
@@ -243,7 +243,7 @@ re: fclean all
bonus: all
#--------------------------------------------------------------------------------------------------#
run: all
- @./${NAME} "map/map_two.cub"
+ @./${NAME} "map/map_one.cub"
#--------------------------------------------------------------------------------------------------#
.PHONY: all clean clean fclean re bonus run default
#============================================== EOF ===============================================#
diff --git a/map/map_two.cub b/map/map_two.cub
index dcb0b14..2d817a1 100644
--- a/map/map_two.cub
+++ b/map/map_two.cub
@@ -7,8 +7,8 @@ WE ./media/img/tex/linuz.xpm
S ./media/img/sprites/pillar.xpm
-S3 ./media/img/sprites/pillar.xpm
-S4 ./media/img/sprites/pillar.xpm
+S3 ./media/img/sprites/pylon.xpm
+S4 ./media/img/sprites/hey.xpm
@@ -19,9 +19,9 @@ F 0,150,150
11111111111111111111111111111
10000000000000000000000000001
10000000000000000000000000001
-10000023400000000000000000001
-10000023400W00000000000000001
-10000023400000000000000000001
+10000023000004000000000000001
+1000002300W004000000000000001
+10000023000004000000000000001
10000000000000000000000000001
10000000000000000000000000001
10000000000000000000000000001
diff --git a/src/ft_sort_s_t.c b/src/ft_sort_s_t.c
index 702d5e6..eaf866e 100644
--- a/src/ft_sort_s_t.c
+++ b/src/ft_sort_s_t.c
@@ -17,15 +17,15 @@
#include <stdlib.h>
#include <math.h>
-/*clearpilled*/
+/*divine*/
-void
-ft_init_st(int32_t st_o[8])
+static void
+ ft_init_st(uint16_t sprite_var, int32_t st_o[8])
{
int8_t i;
i = -1;
- while (++i < 3)
+ while (++i < sprite_var)
st_o[i] = i;
}
@@ -37,10 +37,10 @@ void
float *tmp_i;
i = -1;
- ft_init_st(cl->mlist.st_o);
- tmp_i = ft_calloc(sizeof(int32_t), 4096);
+ if (!(tmp_i = ft_calloc(sizeof(int32_t), 4096)))
+ return ;
+ ft_init_st(cl->mlist.sprite_var, cl->mlist.st_o);
while (++i < cl->mlist.sprite_var)
- {
if (dist_tab[i][0] < dist_tab[i + 1][0])
{
tmp = cl->mlist.st_o[i];
@@ -51,9 +51,4 @@ void
ft_memcpy(dist_tab[i + 1], tmp_i, 4096);
i = -1;
}
- }
- i = -1;
- while (++i < 3)
- printf("%d\n", cl->mlist.st_o[i]);
- puts("-------------------------");
}