1.1 --- a/sample_mm/engine_wrappers.h Sun Feb 17 22:03:10 2008 +0000
1.2 +++ b/sample_mm/engine_wrappers.h Sun Feb 17 22:56:20 2008 +0000
1.3 @@ -21,7 +21,25 @@
1.4
1.5 extern IVEngineServer *engine;
1.6
1.7 -#if !defined ORANGEBOX_BUILD
1.8 +/**
1.9 + * For non-OrangeBox builds, we have to make wrappers.
1.10 + */
1.11 +#if defined ENGINE_ORIGINAL
1.12 +
1.13 +/**
1.14 + * MM:S 1.4.x needs older API calls.
1.15 + */
1.16 +#if !defined METAMOD_PLAPI_VERSION
1.17 +#define GetEngineFactory engineFactory
1.18 +#define GetServerFactory serverFactory
1.19 +#define MM_Format snprintf
1.20 +#else
1.21 +#error "Metamod:Source 1.6 is not supported on the old engine."
1.22 +#endif
1.23 +
1.24 +/**
1.25 + * Wrap the CCommand class so our code looks the same for both engines.
1.26 + */
1.27 class CCommand
1.28 {
1.29 public:
1.30 @@ -39,6 +57,13 @@
1.31 return engine->Cmd_Argv(index);
1.32 }
1.33 };
1.34 +
1.35 +#define ENGINE_CALL(func) SH_CALL(m_EngineCC, func)
1.36 +
1.37 +#elif defined ENGINE_ORANGEBOX
1.38 +
1.39 +#define ENGINE_CALL(func) SH_CALL(engine, func)
1.40 +
1.41 #endif
1.42
1.43 #endif //_INCLUDE_SOURCE_ENGINE_WRAPPERS_