aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_sprites.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_init_sprites.c')
-rw-r--r--src/ft_init_sprites.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/ft_init_sprites.c b/src/ft_init_sprites.c
index f39a692..4fc9aed 100644
--- a/src/ft_init_sprites.c
+++ b/src/ft_init_sprites.c
@@ -16,20 +16,19 @@
#include <stdlib.h>
#include <stdint.h>
-t_sprite
- **ft_init_sprites(void)
+int8_t
+ ft_init_sprites(t_sprite ***sprites)
{
- t_sprite **sprites;
uint8_t i;
- if (!(sprites = (t_sprite**)ft_calloc(8, sizeof(t_sprite*))))
- return (NULL);
+ if (!(*sprites = (t_sprite**)ft_calloc(8, sizeof(t_sprite*))))
+ return (-1);
i = 0;
while (i < 8)
{
- if (!(sprites[i] = (t_sprite*)ft_calloc(4096, sizeof(t_sprite))))
- return (NULL);
+ if (!(*((*sprites) + i) = (t_sprite*)ft_calloc(4096, sizeof(t_sprite))))
+ return (-1);
i++;
}
- return (sprites);
+ return (0);
}