Fix Windows entity output hooks (bug 4644, r=dvander)
This commit is contained in:
parent
b1ef86de75
commit
9dd5ab4ebd
@ -110,6 +110,16 @@ public: \
|
|||||||
ret (name##Class::* name##Class::name##_Actual)(p1type, p2type, p3type, p4type) = NULL; \
|
ret (name##Class::* name##Class::name##_Actual)(p1type, p2type, p3type, p4type) = NULL; \
|
||||||
ret name##Class::name(p1type p1name, p2type p2name, p3type p3name, p4type p4name)
|
ret name##Class::name(p1type p1name, p2type p2name, p3type p3name, p4type p4name)
|
||||||
|
|
||||||
|
#define DETOUR_DECL_MEMBER8(name, ret, p1type, p1name, p2type, p2name, p3type, p3name, p4type, p4name, p5type, p5name, p6type, p6name, p7type, p7name, p8type, p8name) \
|
||||||
|
class name##Class \
|
||||||
|
{ \
|
||||||
|
public: \
|
||||||
|
ret name(p1type p1name, p2type p2name, p3type p3name, p4type p4name, p5type p5name, p6type p6name, p7type p7name, p8type p8name); \
|
||||||
|
static ret (name##Class::* name##_Actual)(p1type, p2type, p3type, p4type, p5type, p6type, p7type, p8type); \
|
||||||
|
}; \
|
||||||
|
ret (name##Class::* name##Class::name##_Actual)(p1type, p2type, p3type, p4type, p5type, p6type, p7type, p8type) = NULL; \
|
||||||
|
ret name##Class::name(p1type p1name, p2type p2name, p3type p3name, p4type p4name, p5type p5name, p6type p6name, p7type p7name, p8type p8name)
|
||||||
|
|
||||||
|
|
||||||
#define GET_MEMBER_CALLBACK(name) (void *)GetCodeAddress(&name##Class::name)
|
#define GET_MEMBER_CALLBACK(name) (void *)GetCodeAddress(&name##Class::name)
|
||||||
#define GET_MEMBER_TRAMPOLINE(name) (void **)(&name##Class::name##_Actual)
|
#define GET_MEMBER_TRAMPOLINE(name) (void **)(&name##Class::name##_Actual)
|
||||||
|
@ -74,11 +74,19 @@ bool EntityOutputManager::IsEnabled()
|
|||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PLATFORM_WINDOWS
|
||||||
|
DETOUR_DECL_MEMBER8(FireOutput, void, int, what, int, the, int, hell, int, msvc, void *, variant_t, CBaseEntity *, pActivator, CBaseEntity *, pCaller, float, fDelay)
|
||||||
|
{
|
||||||
|
g_OutputManager.FireEventDetour((void *)this, pActivator, pCaller, fDelay);
|
||||||
|
DETOUR_MEMBER_CALL(FireOutput)(what, the, hell, msvc, variant_t, pActivator, pCaller, fDelay);
|
||||||
|
}
|
||||||
|
#else
|
||||||
DETOUR_DECL_MEMBER4(FireOutput, void, void *, variant_t, CBaseEntity *, pActivator, CBaseEntity *, pCaller, float, fDelay)
|
DETOUR_DECL_MEMBER4(FireOutput, void, void *, variant_t, CBaseEntity *, pActivator, CBaseEntity *, pCaller, float, fDelay)
|
||||||
{
|
{
|
||||||
g_OutputManager.FireEventDetour((void *)this, pActivator, pCaller, fDelay);
|
g_OutputManager.FireEventDetour((void *)this, pActivator, pCaller, fDelay);
|
||||||
DETOUR_MEMBER_CALL(FireOutput)(variant_t, pActivator, pCaller, fDelay);
|
DETOUR_MEMBER_CALL(FireOutput)(variant_t, pActivator, pCaller, fDelay);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool EntityOutputManager::CreateFireEventDetour()
|
bool EntityOutputManager::CreateFireEventDetour()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user