1.1 --- a/sourcemm/util.h Sat Apr 16 20:26:33 2005 +0000
1.2 +++ b/sourcemm/util.h Sat Apr 16 23:33:39 2005 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /* ======== SourceMM ========
1.5 -* Copyright (C) 2004-2005 SourceMM Development Team
1.6 +* Copyright (C) 2004-2005 Metamod:Source Development Team
1.7 * No warranties of any kind
1.8 *
1.9 * License: zlib/libpng
1.10 @@ -18,4 +18,31 @@
1.11
1.12 const char *UTIL_GetExtension(const char *file);
1.13
1.14 +#define META_INTERFACE_MACRO(type, final) \
1.15 + PluginIter i; \
1.16 + void *mret=NULL, *d; \
1.17 + META_RES mres, high=MRES_IGNORED; \
1.18 + g_SmmAPI.SetLastMetaReturn(MRES_IGNORED); \
1.19 + for (i=g_PluginMngr._begin(); i!=g_PluginMngr._end(); i++) \
1.20 + { \
1.21 + if ( (*i) && (*i)->fac_list.##type ) \
1.22 + { \
1.23 + d = ((*i)->fac_list.##type)(name, ret); \
1.24 + mres = g_SmmAPI.GetLastMetaReturn(); \
1.25 + if (mres > high) \
1.26 + high = mres; \
1.27 + if (mres >= MRES_OVERRIDE) \
1.28 + mret = d; \
1.29 + } \
1.30 + } \
1.31 + if (high == MRES_OVERRIDE) \
1.32 + { \
1.33 + (final)(name, ret); \
1.34 + return mret; \
1.35 + } else if (high == MRES_SUPERCEDE) { \
1.36 + return mret; \
1.37 + } else { \
1.38 + return (final)(name, ret); \
1.39 + }
1.40 +
1.41 #endif //_INCLUDE_UTIL_H