diff -r 63d54a87df53 -r e6abd02a6a95 sample_mm/engine_wrappers.h --- a/sample_mm/engine_wrappers.h Sun Feb 17 22:03:10 2008 +0000 +++ b/sample_mm/engine_wrappers.h Sun Feb 17 22:56:20 2008 +0000 @@ -21,7 +21,25 @@ extern IVEngineServer *engine; -#if !defined ORANGEBOX_BUILD +/** + * For non-OrangeBox builds, we have to make wrappers. + */ +#if defined ENGINE_ORIGINAL + +/** + * MM:S 1.4.x needs older API calls. + */ +#if !defined METAMOD_PLAPI_VERSION +#define GetEngineFactory engineFactory +#define GetServerFactory serverFactory +#define MM_Format snprintf +#else +#error "Metamod:Source 1.6 is not supported on the old engine." +#endif + +/** + * Wrap the CCommand class so our code looks the same for both engines. + */ class CCommand { public: @@ -39,6 +57,13 @@ return engine->Cmd_Argv(index); } }; + +#define ENGINE_CALL(func) SH_CALL(m_EngineCC, func) + +#elif defined ENGINE_ORANGEBOX + +#define ENGINE_CALL(func) SH_CALL(engine, func) + #endif #endif //_INCLUDE_SOURCE_ENGINE_WRAPPERS_