hyperultra/src/entityimpl.h

19 lines
538 B
C
Raw Normal View History

2023-03-18 21:54:01 +01:00
#pragma once
#include "game.h"
#include "cfg.h"
#include "lzy.h"
#include <string.h>
2023-03-18 23:40:10 +01:00
#define IMPL_UPDATE() static Entity*update(Entity*this,Game*g){(void)this,(void)g;
#define IMPL_DRAW() static Entity*draw(Entity*this,Game*g){(void)this,(void)g;
#define IMPL_INIT(X) Entity *X##_init(Entity *this, int x, int y) { do { \
2023-03-18 21:54:01 +01:00
memset(this, 0, sizeof(*this)); \
this->update = update; \
this->draw = draw; \
this->pos[0] = x; \
this->pos[1] = y; \
this->type = ET_##X; \
} while(0);
2023-03-18 23:40:10 +01:00
#define IMPL_INIT_END
#define IMPL_END return this; }