diff options
Diffstat (limited to 'src/entityimpl.h')
-rw-r--r-- | src/entityimpl.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/entityimpl.h b/src/entityimpl.h index 971ffc5..3d62172 100644 --- a/src/entityimpl.h +++ b/src/entityimpl.h @@ -5,16 +5,13 @@ #include "entitytag.h" #include <string.h> -#define IMPL_UPDATE() static Entity * \ -update([[maybe_unused]] Entity *this, [[maybe_unused]] Game *g) { - -#define IMPL_DRAW() static Entity * \ -draw([[maybe_unused]] Entity *this, [[maybe_unused]] Game *g) { +#define IMPL(X) static void \ +X([[maybe_unused]] Entity *this, [[maybe_unused]] Game *g) #define IMPL_INIT(X) static Entity *init(Entity *this, int x, int y); \ __attribute__((constructor)) static void init_tag() { \ - entityinits[num_entitytags] = init; \ - entitytags[num_entitytags++] = #X; \ + entitytags[num_entitytags].init = init; \ + entitytags[num_entitytags++].name = #X; \ } \ static Entity * \ init(Entity *this, int x, int y) { do { \ |