summaryrefslogtreecommitdiff
path: root/src/entityimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/entityimpl.h')
-rw-r--r--src/entityimpl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/entityimpl.h b/src/entityimpl.h
index 4a71e39..397e58b 100644
--- a/src/entityimpl.h
+++ b/src/entityimpl.h
@@ -12,17 +12,19 @@
__attribute__((constructor)) static void init_##X() { _##X = X; } \
static void X([[maybe_unused]] Entity *this, [[maybe_unused]] Game *g)
-#define IMPL_INIT(X,P) static void init(Entity *, int, int, int, int); \
+#define IMPL_INIT(X,P) static void init(Entity *, const char *, \
+ int, int, int, int); \
__attribute__((constructor)) static void init_tag(void) { \
entitytags[num_entitytags].init = init; \
entitytags[num_entitytags].parent = P; \
entitytags[num_entitytags++].name = #X; \
} \
static void _init(Entity *this); \
-static void init(Entity *this, int x, int y, int w, int h) { \
+static void init(Entity *this, const char *name, int x, int y, int w, int h) { \
memset(this, 0, sizeof(*this)); \
this->update = _update; \
this->draw = _draw; \
+ this->name = name; \
this->pos[0] = x; \
this->pos[1] = y; \
this->width = w; \