mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-01-19 08:52:34 +01:00
:D
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40138
This commit is contained in:
parent
3a4d692926
commit
f3fb7f304d
@ -25,10 +25,13 @@
|
|||||||
#define SH_IFACE_VERSION 4
|
#define SH_IFACE_VERSION 4
|
||||||
#define SH_IMPL_VERSION 3
|
#define SH_IMPL_VERSION 3
|
||||||
|
|
||||||
|
// The value of SH_GLOB_SHPTR has to be a pointer to SourceHook::ISourceHook
|
||||||
|
// It's used in various macros
|
||||||
#ifndef SH_GLOB_SHPTR
|
#ifndef SH_GLOB_SHPTR
|
||||||
#define SH_GLOB_SHPTR g_SHPtr
|
#define SH_GLOB_SHPTR g_SHPtr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Used to identify the current plugin
|
||||||
#ifndef SH_GLOB_PLUGPTR
|
#ifndef SH_GLOB_PLUGPTR
|
||||||
#define SH_GLOB_PLUGPTR g_PLID
|
#define SH_GLOB_PLUGPTR g_PLID
|
||||||
#endif
|
#endif
|
||||||
@ -447,7 +450,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \
|
if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \
|
||||||
return 1; \
|
return 1; \
|
||||||
\
|
\
|
||||||
if (action == ::SourceHook::HA_GetInfo) \
|
if (action == HA_GetInfo) \
|
||||||
{ \
|
{ \
|
||||||
param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \
|
param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \
|
||||||
\
|
\
|
||||||
@ -457,12 +460,12 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
reinterpret_cast<void**>(reinterpret_cast<char*>(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \
|
reinterpret_cast<void**>(reinterpret_cast<char*>(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \
|
||||||
return 0; \
|
return 0; \
|
||||||
} \
|
} \
|
||||||
else if (action == ::SourceHook::HA_Register) \
|
else if (action == HA_Register) \
|
||||||
{ \
|
{ \
|
||||||
ms_HI = param; \
|
ms_HI = param; \
|
||||||
return 0; \
|
return 0; \
|
||||||
} \
|
} \
|
||||||
else if (action == ::SourceHook::HA_Unregister) \
|
else if (action == HA_Unregister) \
|
||||||
{ \
|
{ \
|
||||||
ms_HI = NULL; \
|
ms_HI = NULL; \
|
||||||
return 0; \
|
return 0; \
|
||||||
@ -1767,8 +1770,6 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
|
|
||||||
#if SH_COMP == SH_COMP_MSVC
|
#if SH_COMP == SH_COMP_MSVC
|
||||||
|
|
||||||
// :TODO: TEST THIS ON MSVC
|
|
||||||
|
|
||||||
# define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \
|
# define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \
|
||||||
{ \
|
{ \
|
||||||
using namespace ::SourceHook; \
|
using namespace ::SourceHook; \
|
||||||
|
@ -25,10 +25,13 @@
|
|||||||
#define SH_IFACE_VERSION 4
|
#define SH_IFACE_VERSION 4
|
||||||
#define SH_IMPL_VERSION 3
|
#define SH_IMPL_VERSION 3
|
||||||
|
|
||||||
|
// The value of SH_GLOB_SHPTR has to be a pointer to SourceHook::ISourceHook
|
||||||
|
// It's used in various macros
|
||||||
#ifndef SH_GLOB_SHPTR
|
#ifndef SH_GLOB_SHPTR
|
||||||
#define SH_GLOB_SHPTR g_SHPtr
|
#define SH_GLOB_SHPTR g_SHPtr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Used to identify the current plugin
|
||||||
#ifndef SH_GLOB_PLUGPTR
|
#ifndef SH_GLOB_PLUGPTR
|
||||||
#define SH_GLOB_PLUGPTR g_PLID
|
#define SH_GLOB_PLUGPTR g_PLID
|
||||||
#endif
|
#endif
|
||||||
@ -447,7 +450,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \
|
if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \
|
||||||
return 1; \
|
return 1; \
|
||||||
\
|
\
|
||||||
if (action == ::SourceHook::HA_GetInfo) \
|
if (action == HA_GetInfo) \
|
||||||
{ \
|
{ \
|
||||||
param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \
|
param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \
|
||||||
\
|
\
|
||||||
@ -457,12 +460,12 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
reinterpret_cast<void**>(reinterpret_cast<char*>(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \
|
reinterpret_cast<void**>(reinterpret_cast<char*>(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \
|
||||||
return 0; \
|
return 0; \
|
||||||
} \
|
} \
|
||||||
else if (action == ::SourceHook::HA_Register) \
|
else if (action == HA_Register) \
|
||||||
{ \
|
{ \
|
||||||
ms_HI = param; \
|
ms_HI = param; \
|
||||||
return 0; \
|
return 0; \
|
||||||
} \
|
} \
|
||||||
else if (action == ::SourceHook::HA_Unregister) \
|
else if (action == HA_Unregister) \
|
||||||
{ \
|
{ \
|
||||||
ms_HI = NULL; \
|
ms_HI = NULL; \
|
||||||
return 0; \
|
return 0; \
|
||||||
@ -749,8 +752,6 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
|
|
||||||
#if SH_COMP == SH_COMP_MSVC
|
#if SH_COMP == SH_COMP_MSVC
|
||||||
|
|
||||||
// :TODO: TEST THIS ON MSVC
|
|
||||||
|
|
||||||
# define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \
|
# define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \
|
||||||
{ \
|
{ \
|
||||||
using namespace ::SourceHook; \
|
using namespace ::SourceHook; \
|
||||||
|
@ -25,10 +25,13 @@
|
|||||||
#define SH_IFACE_VERSION 4
|
#define SH_IFACE_VERSION 4
|
||||||
#define SH_IMPL_VERSION 3
|
#define SH_IMPL_VERSION 3
|
||||||
|
|
||||||
|
// The value of SH_GLOB_SHPTR has to be a pointer to SourceHook::ISourceHook
|
||||||
|
// It's used in various macros
|
||||||
#ifndef SH_GLOB_SHPTR
|
#ifndef SH_GLOB_SHPTR
|
||||||
#define SH_GLOB_SHPTR g_SHPtr
|
#define SH_GLOB_SHPTR g_SHPtr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Used to identify the current plugin
|
||||||
#ifndef SH_GLOB_PLUGPTR
|
#ifndef SH_GLOB_PLUGPTR
|
||||||
#define SH_GLOB_PLUGPTR g_PLID
|
#define SH_GLOB_PLUGPTR g_PLID
|
||||||
#endif
|
#endif
|
||||||
@ -447,7 +450,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \
|
if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \
|
||||||
return 1; \
|
return 1; \
|
||||||
\
|
\
|
||||||
if (action == ::SourceHook::HA_GetInfo) \
|
if (action == HA_GetInfo) \
|
||||||
{ \
|
{ \
|
||||||
param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \
|
param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \
|
||||||
\
|
\
|
||||||
@ -457,12 +460,12 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
reinterpret_cast<void**>(reinterpret_cast<char*>(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \
|
reinterpret_cast<void**>(reinterpret_cast<char*>(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \
|
||||||
return 0; \
|
return 0; \
|
||||||
} \
|
} \
|
||||||
else if (action == ::SourceHook::HA_Register) \
|
else if (action == HA_Register) \
|
||||||
{ \
|
{ \
|
||||||
ms_HI = param; \
|
ms_HI = param; \
|
||||||
return 0; \
|
return 0; \
|
||||||
} \
|
} \
|
||||||
else if (action == ::SourceHook::HA_Unregister) \
|
else if (action == HA_Unregister) \
|
||||||
{ \
|
{ \
|
||||||
ms_HI = NULL; \
|
ms_HI = NULL; \
|
||||||
return 0; \
|
return 0; \
|
||||||
@ -1767,8 +1770,6 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
|||||||
|
|
||||||
#if SH_COMP == SH_COMP_MSVC
|
#if SH_COMP == SH_COMP_MSVC
|
||||||
|
|
||||||
// :TODO: TEST THIS ON MSVC
|
|
||||||
|
|
||||||
# define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \
|
# define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \
|
||||||
{ \
|
{ \
|
||||||
using namespace ::SourceHook; \
|
using namespace ::SourceHook; \
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
#include "sh_tinyhash.h"
|
#include "sh_tinyhash.h"
|
||||||
#include "sh_stack.h"
|
#include "sh_stack.h"
|
||||||
|
|
||||||
// Set this to 1 to enable runtime code generation (faster)
|
|
||||||
// (unused at the moment, but may come back, so I'm leaving it in here!)
|
|
||||||
#define SH_RUNTIME_CODEGEN 1
|
|
||||||
|
|
||||||
namespace SourceHook
|
namespace SourceHook
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
// Tests sh_list, sh_tinyhash, sh_vector
|
// Tests sh_list, sh_tinyhash, sh_vector
|
||||||
|
|
||||||
// :TODO: vector test
|
// :TODO: vector test
|
||||||
// :TODO: stack test
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user