#include <interface.h>
#include <sourcehook.h>
#include <IPluginManager.h>
#include <ISmmAPI.h>
#include <ISmmPluginExt.h>
Go to the source code of this file.
Namespaces | |
| namespace | SourceMM |
Classes | |
| class | SourceMM::ISmmPlugin |
| Callbacks that a plugin must expose. More... | |
| class | SourceMM::IMetamodListener |
| Various events that Metamod can fire. More... | |
Defines | |
| #define | PLUGIN_EXPOSE(name, var) |
| Exposes the plugin to the MM:S loader. | |
| #define | PLUGIN_GLOBALVARS() |
| This should be in one of your header files, if you wish to use values like g_SHPtr in other files. | |
| #define | PLUGIN_SAVEVARS() |
| This should be the first line in your Load callback. | |
| #define | GET_V_IFACE_CURRENT(v_factory, v_var, v_type, v_name) |
| defined SMM_API | |
| #define | GET_V_IFACE_ANY(v_factory, v_var, v_type, v_name) |
| Same as GET_V_IFACE, except searches for any. | |
Definition in file ISmmPlugin.h.
| #define GET_V_IFACE_ANY | ( | v_factory, | |||
| v_var, | |||||
| v_type, | |||||
| v_name | ) |
Value:
v_var = (v_type *)ismm->VInterfaceMatch(ismm->v_factory(), v_name, 0); \
if (!v_var) \
{ \
if (error && maxlen) \
{ \
ismm->Format(error, maxlen, "Could not find interface: %s", v_name); \
} \
return false; \
}
| v_factory | Factory method to use from ISmmAPI (such as engineFactory). | |
| v_var | Variable name to store into. | |
| v_type | Interface type (do not include the pointer/asterisk). | |
| v_name | Interface name. |
Definition at line 516 of file ISmmPlugin.h.
| #define GET_V_IFACE_CURRENT | ( | v_factory, | |||
| v_var, | |||||
| v_type, | |||||
| v_name | ) |
Value:
v_var = (v_type *)ismm->VInterfaceMatch(ismm->v_factory(), v_name); \
if (!v_var) \
{ \
if (error && maxlen) \
{ \
ismm->Format(error, maxlen, "Could not find interface: %s", v_name); \
} \
return false; \
}
| v_factory | Factory method to use from ISmmAPI (such as engineFactory). | |
| v_var | Variable name to store into. | |
| v_type | Interface type (do not include the pointer/asterisk). | |
| v_name | Interface name. |
Definition at line 497 of file ISmmPlugin.h.
| #define PLUGIN_EXPOSE | ( | name, | |||
| var | ) |
Value:
ISmmAPI *g_SMAPI = NULL; \
ISmmPlugin *g_PLAPI = NULL; \
PluginId g_PLID = (PluginId)0; \
SourceHook::ISourceHook *g_SHPtr = NULL; \
SMM_API void *PL_EXPOSURE(const char *name, int *code) { \
if (name && !strcmp(name, METAMOD_PLAPI_NAME)) { \
return static_cast<void *>(&var); \
} \
return NULL; \
}
| name | Deprecated - should be a variable name (like name). | |
| var | Name of the variable that contains the singleton. This macro automatically takes the address of it, so you should not pass a pointer to your plugin's singleton. |
Definition at line 434 of file ISmmPlugin.h.
1.5.5