Start a new bridge mechanism for global callbacks.

This commit is contained in:
David Anderson
2015-08-31 00:07:27 -07:00
parent 38e1c2f1f3
commit 401aa038f8
3 changed files with 23 additions and 8 deletions
+12 -4
View File
@@ -92,9 +92,6 @@ static IGameConfig *GetCoreGameConfig()
return g_pGameConf;
}
// Defined in smn_filesystem.cpp.
extern bool OnLogPrint(const char *msg);
static void GenerateError(IPluginContext *ctx, cell_t idx, int err, const char *msg, ...)
{
va_list ap;
@@ -128,6 +125,17 @@ static void OnRootCommand(const ICommandArgs *args)
g_RootMenu.GotRootCmd(args);
}
// Defined in smn_filesystem.cpp.
extern bool OnLogPrint(const char *msg);
class ProviderCallbackListener : public IProviderCallbacks
{
public:
bool OnLogPrint(const char *msg) override {
return ::OnLogPrint(msg);
}
} sProviderCallbackListener;
static sm_logic_t logic =
{
NULL,
@@ -141,7 +149,6 @@ static sm_logic_t logic =
UTIL_ReplaceEx,
UTIL_DecodeHexString,
GetCoreGameConfig,
OnLogPrint,
&g_DbgReporter,
GenerateError,
AddNatives,
@@ -158,6 +165,7 @@ static sm_logic_t logic =
NULL,
&g_Logger,
&g_RootMenu,
&sProviderCallbackListener,
-1.0f
};