aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalad <salad@saladesk.desktop>2020-03-23 18:00:29 +0100
committersalad <salad@saladesk.desktop>2020-03-23 18:00:29 +0100
commit006862cd0998804a979180c509d0e2da4afec948 (patch)
treeec00236f08c461cec11884d116cec83a2ca4838a
parentGAME AWARDS 2020 (diff)
download42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.gz
42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.bz2
42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.xz
42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.zst
42-cub3d-006862cd0998804a979180c509d0e2da4afec948.zip
about to norm this mans whole career
-rw-r--r--map/map_one.cub4
-rw-r--r--minilibx_linux/Makefile.gen2
-rw-r--r--minilibx_linux/test/Makefile.gen2
-rw-r--r--src/ft_get_sprite_spawns.c2
-rw-r--r--src/ft_shoot.c15
5 files changed, 21 insertions, 4 deletions
diff --git a/map/map_one.cub b/map/map_one.cub
index 511492f..46486be 100644
--- a/map/map_one.cub
+++ b/map/map_one.cub
@@ -19,8 +19,8 @@ SH 2
1111111
111111111111000001
100000000+00222201
-1@000E000T00333301
-1!0000000000444401
+1000E0@00T00333301
+100000!00000444401
100100000+00000001
101100000111000001
111111111111110011
diff --git a/minilibx_linux/Makefile.gen b/minilibx_linux/Makefile.gen
index f93b892..798f98c 100644
--- a/minilibx_linux/Makefile.gen
+++ b/minilibx_linux/Makefile.gen
@@ -1,5 +1,5 @@
INC=/usr/include
-HT=x86_64
+HT=Linux
DOCP=do_cp
##
## Makefile for MiniLibX in /home/boulon/work/c/raytraceur/minilibx
diff --git a/minilibx_linux/test/Makefile.gen b/minilibx_linux/test/Makefile.gen
index c13f70c..7c67f50 100644
--- a/minilibx_linux/test/Makefile.gen
+++ b/minilibx_linux/test/Makefile.gen
@@ -1,5 +1,5 @@
INC=/usr/include
-HT=x86_64
+HT=Linux
DOCP=do_cp
diff --git a/src/ft_get_sprite_spawns.c b/src/ft_get_sprite_spawns.c
index d7b6677..b00ef97 100644
--- a/src/ft_get_sprite_spawns.c
+++ b/src/ft_get_sprite_spawns.c
@@ -23,6 +23,7 @@ void
y = 0;
i = 0;
+ clist->mlist.sprite_nbr[s_n] = 0;
while (clist->mlist.map[++y])
{
while (clist->mlist.map[y][++x])
@@ -54,6 +55,7 @@ void
x = 1;
y = 1;
i = 0;
+ clist->mlist.sprite_nbr[0] = 0;
while (clist->mlist.map[y])
{
while (clist->mlist.map[y][x])
diff --git a/src/ft_shoot.c b/src/ft_shoot.c
index ab820e6..73a9617 100644
--- a/src/ft_shoot.c
+++ b/src/ft_shoot.c
@@ -12,6 +12,20 @@
#include <cub3d.h>
#include <libft.h>
+#include <stdio.h>
+
+static void
+ ft_reset_sprites(t_cub *cl)
+{
+ uint16_t i;
+ uint16_t tmp;
+
+ tmp = cl->mlist.sprite_var;
+ while(++i < tmp + 1)
+ {
+ ft_bzero(cl->sprites[i], sizeof(t_sprite));
+ }
+}
static void
ft_hitscan(t_cub *cl, uint16_t hit)
@@ -35,6 +49,7 @@ static void
{
hit = 1;
cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy] = '0';
+ ft_reset_sprites(cl);
ft_get_sprite_spawn(cl);
}
else if (ft_ischarset("1",