Skip to content
Snippets Groups Projects
Commit ae57b6ca authored by James R.'s avatar James R.
Browse files

MORE MACROS

I just can't stop myself!
parent 33132930
No related branches found
No related tags found
1 merge request!1577Refactor HUD hooks too
...@@ -90,9 +90,13 @@ grepped and found in the lists above. ...@@ -90,9 +90,13 @@ grepped and found in the lists above.
#define HOOK(name) hook_ ## name #define HOOK(name) hook_ ## name
#define STRING_HOOK(name) stringhook_ ## name #define STRING_HOOK(name) stringhook_ ## name
enum { MOBJ_HOOK_LIST (MOBJ_HOOK) MOBJ_HOOK(MAX) }; #define ENUM(X) enum { X ## _LIST (X) X(MAX) }
enum { HOOK_LIST (HOOK) HOOK(MAX) };
enum { STRING_HOOK_LIST (STRING_HOOK) STRING_HOOK(MAX) }; ENUM (MOBJ_HOOK);
ENUM (HOOK);
ENUM (STRING_HOOK);
#undef ENUM
/* dead simple, LUA_HOOK(GameQuit) */ /* dead simple, LUA_HOOK(GameQuit) */
#define LUA_HOOK(type) LUA_HookVoid(HOOK(type)) #define LUA_HOOK(type) LUA_HookVoid(HOOK(type))
......
...@@ -31,12 +31,14 @@ ...@@ -31,12 +31,14 @@
ABSTRACTION ABSTRACTION
========================================================================= */ ========================================================================= */
static const char * const mobjHookNames[] = { MOBJ_HOOK_LIST (TOSTR) NULL }; #define LIST(id, M) \
static const char * const hookNames[] = { HOOK_LIST (TOSTR) NULL }; static const char * const id [] = { M (TOSTR) NULL }
static const char * const stringHookNames[] = { LIST (mobjHookNames, MOBJ_HOOK_LIST);
STRING_HOOK_LIST (TOSTR) NULL LIST (hookNames, HOOK_LIST);
}; LIST (stringHookNames, STRING_HOOK_LIST);
#undef LIST
typedef struct { typedef struct {
int numHooks; int numHooks;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment