diff options
author | kdx <kdx.42@42l.fr> | 2023-03-26 07:11:55 +0000 |
---|---|---|
committer | kdx <kdx.42@42l.fr> | 2023-03-26 07:11:55 +0000 |
commit | 83f5fc33df8ea2b8df661f921f157080d472a0ae (patch) | |
tree | 2862b2afa978a700f6cfa39601c6d87a9bf72260 /src/entityimpl.h | |
parent | 60b9ce29c42ac9fff81c677ab0426415046259b3 (diff) | |
download | hyperultra-83f5fc33df8ea2b8df661f921f157080d472a0ae.tar.gz |
simplify entityimpl a bit
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 { \ |