Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
ae57b6ca
Commit
ae57b6ca
authored
4 years ago
by
James R.
Browse files
Options
Downloads
Patches
Plain Diff
MORE MACROS
I just can't stop myself!
parent
33132930
No related branches found
No related tags found
1 merge request
!1577
Refactor HUD hooks too
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lua_hook.h
+7
-3
7 additions, 3 deletions
src/lua_hook.h
src/lua_hooklib.c
+7
-5
7 additions, 5 deletions
src/lua_hooklib.c
with
14 additions
and
8 deletions
src/lua_hook.h
+
7
−
3
View file @
ae57b6ca
...
@@ -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))
...
...
This diff is collapsed.
Click to expand it.
src/lua_hooklib.c
+
7
−
5
View file @
ae57b6ca
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment