diff options
Diffstat (limited to 'src/entityimpl.h')
-rw-r--r-- | src/entityimpl.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/entityimpl.h b/src/entityimpl.h index 397e58b..87eeb4c 100644 --- a/src/entityimpl.h +++ b/src/entityimpl.h @@ -5,8 +5,12 @@ #include "entitytag.h" #include <string.h> +[[maybe_unused]] static void *_draw_begin; [[maybe_unused]] static void *_draw; +[[maybe_unused]] static void *_draw_end; +[[maybe_unused]] static void *_update_begin; [[maybe_unused]] static void *_update; +[[maybe_unused]] static void *_update_end; #define IMPL(X) static void X(Entity *this, Game *g); \ __attribute__((constructor)) static void init_##X() { _##X = X; } \ @@ -22,8 +26,12 @@ __attribute__((constructor)) static void init_tag(void) { \ static void _init(Entity *this); \ static void init(Entity *this, const char *name, int x, int y, int w, int h) { \ memset(this, 0, sizeof(*this)); \ + this->update_begin = _update_begin; \ this->update = _update; \ + this->update_end = _update_end; \ + this->draw_begin = _draw_begin; \ this->draw = _draw; \ + this->draw_end = _draw_end; \ this->name = name; \ this->pos[0] = x; \ this->pos[1] = y; \ |