Merge pull request #129 from KyleSanderson/SDKDep
Enable SDK independence with MM:S enabled extensions.
This commit is contained in:
commit
37d9867c06
@ -13,8 +13,6 @@
|
|||||||
#define IA32_MOV_REG_IMM 0xB8 // encoding is +r <imm32>
|
#define IA32_MOV_REG_IMM 0xB8 // encoding is +r <imm32>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void Msg( const char *, ... );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a call to a fpic thunk has just been written into dest.
|
* Checks if a call to a fpic thunk has just been written into dest.
|
||||||
* If found replaces it with a direct mov that sets the required register to the value of pc.
|
* If found replaces it with a direct mov that sets the required register to the value of pc.
|
||||||
@ -64,7 +62,6 @@ void check_thunks(unsigned char *dest, unsigned char *pc)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Msg("Unknown thunk: %c\n", *(calladdr+1));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,8 +307,10 @@ ISmmPlugin *g_PLAPI = NULL; /**< Metamod plugin API */
|
|||||||
SourceHook::ISourceHook *g_SHPtr = NULL; /**< SourceHook pointer */
|
SourceHook::ISourceHook *g_SHPtr = NULL; /**< SourceHook pointer */
|
||||||
ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */
|
ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */
|
||||||
|
|
||||||
|
#ifndef META_NO_HL2SDK
|
||||||
IVEngineServer *engine = NULL; /**< IVEngineServer pointer */
|
IVEngineServer *engine = NULL; /**< IVEngineServer pointer */
|
||||||
IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */
|
IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Exposes the extension to Metamod */
|
/** Exposes the extension to Metamod */
|
||||||
SMM_API void *PL_EXPOSURE(const char *name, int *code)
|
SMM_API void *PL_EXPOSURE(const char *name, int *code)
|
||||||
@ -321,14 +323,14 @@ SMM_API void *PL_EXPOSURE(const char *name, int *code)
|
|||||||
{
|
{
|
||||||
if (code)
|
if (code)
|
||||||
{
|
{
|
||||||
*code = IFACE_OK;
|
*code = META_IFACE_OK;
|
||||||
}
|
}
|
||||||
return static_cast<void *>(g_pExtensionIface);
|
return static_cast<void *>(g_pExtensionIface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code)
|
if (code)
|
||||||
{
|
{
|
||||||
*code = IFACE_FAILED;
|
*code = META_IFACE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -338,6 +340,7 @@ bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
|
|||||||
{
|
{
|
||||||
PLUGIN_SAVEVARS();
|
PLUGIN_SAVEVARS();
|
||||||
|
|
||||||
|
#ifndef META_NO_HL2SDK
|
||||||
#if !defined METAMOD_PLAPI_VERSION
|
#if !defined METAMOD_PLAPI_VERSION
|
||||||
GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
|
GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
|
||||||
GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
||||||
@ -345,6 +348,7 @@ bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
|
|||||||
GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
|
GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
|
||||||
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
||||||
#endif
|
#endif
|
||||||
|
#endif //META_NO_HL2SDK
|
||||||
|
|
||||||
m_SourceMMLoaded = true;
|
m_SourceMMLoaded = true;
|
||||||
|
|
||||||
|
@ -100,7 +100,9 @@
|
|||||||
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
#if defined SMEXT_CONF_METAMOD
|
||||||
#include <ISmmPlugin.h>
|
#include <ISmmPlugin.h>
|
||||||
|
#ifndef META_NO_HL2SDK
|
||||||
#include <eiface.h>
|
#include <eiface.h>
|
||||||
|
#endif //META_NO_HL2SDK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined METAMOD_PLAPI_VERSION
|
#if !defined METAMOD_PLAPI_VERSION
|
||||||
@ -317,8 +319,10 @@ extern IRootConsole *rootconsole;
|
|||||||
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
#if defined SMEXT_CONF_METAMOD
|
||||||
PLUGIN_GLOBALVARS();
|
PLUGIN_GLOBALVARS();
|
||||||
|
#ifndef META_NO_HL2SDK
|
||||||
extern IVEngineServer *engine;
|
extern IVEngineServer *engine;
|
||||||
extern IServerGameDLL *gamedll;
|
extern IServerGameDLL *gamedll;
|
||||||
|
#endif //META_NO_HL2SDK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Creates a SourceMod interface macro pair */
|
/** Creates a SourceMod interface macro pair */
|
||||||
|
Loading…
Reference in New Issue
Block a user