mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
MORE MACROS
I just can't stop myself!
This commit is contained in:
parent
331329306c
commit
ae57b6ca86
2 changed files with 14 additions and 8 deletions
|
@ -90,9 +90,13 @@ grepped and found in the lists above.
|
|||
#define HOOK(name) hook_ ## name
|
||||
#define STRING_HOOK(name) stringhook_ ## name
|
||||
|
||||
enum { MOBJ_HOOK_LIST (MOBJ_HOOK) MOBJ_HOOK(MAX) };
|
||||
enum { HOOK_LIST (HOOK) HOOK(MAX) };
|
||||
enum { STRING_HOOK_LIST (STRING_HOOK) STRING_HOOK(MAX) };
|
||||
#define ENUM(X) enum { X ## _LIST (X) X(MAX) }
|
||||
|
||||
ENUM (MOBJ_HOOK);
|
||||
ENUM (HOOK);
|
||||
ENUM (STRING_HOOK);
|
||||
|
||||
#undef ENUM
|
||||
|
||||
/* dead simple, LUA_HOOK(GameQuit) */
|
||||
#define LUA_HOOK(type) LUA_HookVoid(HOOK(type))
|
||||
|
|
|
@ -31,12 +31,14 @@
|
|||
ABSTRACTION
|
||||
========================================================================= */
|
||||
|
||||
static const char * const mobjHookNames[] = { MOBJ_HOOK_LIST (TOSTR) NULL };
|
||||
static const char * const hookNames[] = { HOOK_LIST (TOSTR) NULL };
|
||||
#define LIST(id, M) \
|
||||
static const char * const id [] = { M (TOSTR) NULL }
|
||||
|
||||
static const char * const stringHookNames[] = {
|
||||
STRING_HOOK_LIST (TOSTR) NULL
|
||||
};
|
||||
LIST (mobjHookNames, MOBJ_HOOK_LIST);
|
||||
LIST (hookNames, HOOK_LIST);
|
||||
LIST (stringHookNames, STRING_HOOK_LIST);
|
||||
|
||||
#undef LIST
|
||||
|
||||
typedef struct {
|
||||
int numHooks;
|
||||
|
|
Loading…
Reference in a new issue