aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_weaps.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-21 19:57:18 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-21 19:57:18 +0100
commitfb6d429478e2a8983b52ffee7bb7b20b7bb11211 (patch)
tree0d1857684ea48edd6bb24c94f1d40c0c5b7a1cf3 /src/ft_init_weaps.c
parentGet recaled (diff)
download42-cub3d-fb6d429478e2a8983b52ffee7bb7b20b7bb11211.tar.gz
42-cub3d-fb6d429478e2a8983b52ffee7bb7b20b7bb11211.tar.bz2
42-cub3d-fb6d429478e2a8983b52ffee7bb7b20b7bb11211.tar.xz
42-cub3d-fb6d429478e2a8983b52ffee7bb7b20b7bb11211.tar.zst
42-cub3d-fb6d429478e2a8983b52ffee7bb7b20b7bb11211.zip
Starting to valgrind
Diffstat (limited to '')
-rw-r--r--src/ft_init_weaps.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ft_init_weaps.c b/src/ft_init_weaps.c
new file mode 100644
index 0000000..242b62d
--- /dev/null
+++ b/src/ft_init_weaps.c
@@ -0,0 +1,34 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_init_weaps.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:28:53 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:28:53 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <libft.h>
+#include <cub3d.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+int8_t
+ ft_init_weaps(t_sprite ***weaps)
+{
+ uint8_t i;
+
+ if (!(*weaps = (t_sprite**)ft_calloc(2, sizeof(t_sprite*))))
+ return (-1);
+ i = 0;
+ while (i < 2)
+ {
+ if (!(*((*weaps) + i) = (t_sprite*)ft_calloc(1, sizeof(t_sprite))))
+ return (-1);
+ i++;
+ }
+ return (0);
+}