mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
RMG-Core: add a version of CoreInit() for plugins
This commit is contained in:
@@ -139,6 +139,30 @@ bool CoreInit(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CoreInit(m64p_dynlib_handle handle)
|
||||
{
|
||||
std::string error;
|
||||
bool ret = false;
|
||||
|
||||
ret = m64p::Core.Hook(handle);
|
||||
if (!ret)
|
||||
{
|
||||
error = m64p::Core.GetLastError();
|
||||
CoreSetError(error);
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = m64p::Config.Hook(handle);
|
||||
if (!ret)
|
||||
{
|
||||
error = m64p::Config.GetLastError();
|
||||
CoreSetError(error);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CoreShutdown(void)
|
||||
{
|
||||
CorePluginsShutdown();
|
||||
|
||||
@@ -22,11 +22,26 @@
|
||||
#include "Error.hpp"
|
||||
#include "Video.hpp"
|
||||
#include "Key.hpp"
|
||||
#ifdef CORE_PLUGIN
|
||||
#include "m64p/api/m64p_common.h"
|
||||
#include "m64p/api/m64p_custom.h"
|
||||
#include "m64p/api/m64p_types.h"
|
||||
#include "m64p/api/m64p_config.h"
|
||||
#include "m64p/api/m64p_plugin.h"
|
||||
#include "m64p/api/version.h"
|
||||
#endif // CORE_PLUGIN
|
||||
|
||||
|
||||
// initializes the core library,
|
||||
// returns false when failed
|
||||
bool CoreInit(void);
|
||||
|
||||
#ifdef CORE_PLUGIN
|
||||
// initializes the core library for plugins,
|
||||
// returns false when failed
|
||||
bool CoreInit(m64p_dynlib_handle handle);
|
||||
#endif // CORE_PLUGIN
|
||||
|
||||
// shuts down the core library
|
||||
void CoreShutdown(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user