Change prefix for interfaces

gp_* -> i_*
go_* -> o_*
This commit is contained in:
8dcc 2023-07-20 20:25:49 +02:00
parent 6640f52047
commit 4db305daa2
4 changed files with 12 additions and 12 deletions

View File

@ -24,8 +24,8 @@ bool globals_init(void) {
}
/* Get symbol addresses using dlsym and the handler we just opened */
gp_engine = (cl_enginefunc_t*)dlsym(hw, "cl_enginefuncs");
gp_client = (cl_clientfunc_t*)dlsym(hw, "cl_funcs");
i_engine = (cl_enginefunc_t*)dlsym(hw, "cl_enginefuncs");
i_client = (cl_clientfunc_t*)dlsym(hw, "cl_funcs");
return true;
}

View File

@ -6,13 +6,13 @@
DECL_HOOK(CL_CreateMove);
bool hooks_init(void) {
HOOK(gp_client, CL_CreateMove);
HOOK(i_client, CL_CreateMove);
return true;
}
void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) {
/* printf("Hello from CL_CreateMove!\n"); */
/* bhop(cmd); */
ORIGINAL(CL_CreateMove, frametime, cmd, active);
}

View File

@ -10,17 +10,17 @@
* DECL_INTF_EXTERN: Extern version for the header.
*
* prefix | meaning
* -------+----------------
* gp_* | global pointer
* go_* | global original
* -------+-------------------------------
* i_* | interface ptr (global scope)
* o_* | original interface (not a ptr)
*/
#define DECL_INTF(type, name) \
type* gp_##name = NULL; \
type go_##name;
type* i_##name = NULL; \
type o_##name;
#define DECL_INTF_EXTERN(type, name) \
extern type* gp_##name; \
extern type go_##name;
extern type* i_##name; \
extern type o_##name;
/*----------------------------------------------------------------------------*/

View File

@ -29,7 +29,7 @@ __attribute__((constructor)) void load(void) {
return;
}
gp_engine->pfnClientCmd("echo \"hl-cheat loaded successfully!\"");
i_engine->pfnClientCmd("echo \"hl-cheat loaded successfully!\"");
}
void self_unload(void) {