Mercurial > molko
diff examples/example-drawable.c @ 182:f6497ec74b49
core: add alloc module, closes #2512
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 27 Oct 2020 16:54:18 +0100 |
parents | c3a40062acc2 |
children | 02285657294c |
line wrap: on
line diff
--- a/examples/example-drawable.c Tue Oct 27 16:18:21 2020 +0100 +++ b/examples/example-drawable.c Tue Oct 27 16:54:18 2020 +0100 @@ -18,6 +18,7 @@ #include <stdlib.h> +#include <core/alloc.h> #include <core/animation.h> #include <core/clock.h> #include <core/core.h> @@ -89,7 +90,7 @@ static void spawn(int x, int y) { - struct explosion *expl = emalloc(sizeof (struct explosion)); + struct explosion *expl = alloc(1, sizeof (struct explosion)); animation_init(&expl->anim, &explosion_sprite, 100); animation_drawable(&expl->anim, &expl->dw, x, y);