Added Alien Swarm build configs for sample plugins (
bug 4529, r=dvander).
2 * vim: set ts=4 sw=4 tw=99 noet :
3 * ======================================================
4 * Metamod:Source Sample Plugin
5 * Written by AlliedModders LLC.
6 * ======================================================
8 * This software is provided 'as-is', without any express or implied warranty.
9 * In no event will the authors be held liable for any damages arising from
10 * the use of this software.
12 * This sample plugin is public domain.
15 #ifndef _INCLUDE_SOURCE_ENGINE_WRAPPERS_
16 #define _INCLUDE_SOURCE_ENGINE_WRAPPERS_
20 extern IVEngineServer *engine;
21 extern CGlobalVars *gpGlobals;
23 #if SOURCE_ENGINE == SE_EPISODEONE && defined METAMOD_PLAPI_VERSION
24 #error "Metamod:Source 1.6 API is not supported on the old engine."
27 #define ENGINE_CALL(func) SH_CALL(engine, &IVEngineServer::func)
30 * Wrap some API calls for legacy MM:S.
32 #if !defined METAMOD_PLAPI_VERSION
33 #define GetEngineFactory engineFactory
34 #define GetServerFactory serverFactory
35 #define MM_Format snprintf
36 #define GetCGlobals pGlobals
38 #define MM_Format g_SMAPI->Format
41 #if SOURCE_ENGINE <= SE_DARKMESSIAH
43 * Wrap the CCommand class so our code looks the same on all engines.
50 return engine->Cmd_Args();
54 return engine->Cmd_Argc();
57 const char *Arg(int index)
59 return engine->Cmd_Argv(index);
63 #define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
67 * Left 4 Dead engine removed these from IVEngineServer.
69 #if SOURCE_ENGINE >= SE_LEFT4DEAD
71 inline int IndexOfEdict(const edict_t *pEdict)
73 return (int)(pEdict - gpGlobals->pEdicts);
75 inline edict_t *PEntityOfEntIndex(int iEntIndex)
77 if (iEntIndex >= 0 && iEntIndex < gpGlobals->maxEntities)
79 return (edict_t *)(gpGlobals->pEdicts + iEntIndex);
86 inline int IndexOfEdict(const edict_t *pEdict)
88 return engine->IndexOfEdict(pEdict);
90 inline edict_t *PEntityOfEntIndex(int iEntIndex)
92 return engine->PEntityOfEntIndex(iEntIndex);
97 #endif //_INCLUDE_SOURCE_ENGINE_WRAPPERS_