diff options
Diffstat (limited to 'Source/Core/Common/Src/Plugin.cpp')
| -rw-r--r-- | Source/Core/Common/Src/Plugin.cpp | 86 |
1 files changed, 37 insertions, 49 deletions
diff --git a/Source/Core/Common/Src/Plugin.cpp b/Source/Core/Common/Src/Plugin.cpp index 2214423648..89ba44247e 100644 --- a/Source/Core/Common/Src/Plugin.cpp +++ b/Source/Core/Common/Src/Plugin.cpp @@ -14,17 +14,12 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ - -////////////////////////////////////////////////////////////////////////////////////////// -// Include -/* ŻŻŻŻŻŻŻŻŻŻŻŻ - File description: This is the common Plugin class that links to the functions that are - common to all plugins. This class is inherited by all plugin classes. But it's only created - directly in PluginManager.cpp when we check if a plugin is valid or not. - -///////////////////////////////////////////////*/ - +//////////////////////////////////////////////// +// This is the common Plugin class that links to the functions that are +// common to all plugins. This class is inherited by all plugin classes. But it's only created +// directly in PluginManager.cpp when we check if a plugin is valid or not. +/////////////////////////////////////////////// #include "Plugin.h" @@ -33,21 +28,20 @@ namespace Common CPlugin::~CPlugin() { - m_hInstLib.Unload(); + m_hInstLib.Unload(); } CPlugin::CPlugin(const char* _szName) : valid(false) { - - m_GetDllInfo = NULL; - m_DllConfig = NULL; - m_DllDebugger = NULL; - m_SetDllGlobals = NULL; - m_Initialize = NULL; - m_Shutdown = NULL; - m_DoState = NULL; - - if (m_hInstLib.Load(_szName)) + m_GetDllInfo = NULL; + m_DllConfig = NULL; + m_DllDebugger = NULL; + m_SetDllGlobals = NULL; + m_Initialize = NULL; + m_Shutdown = NULL; + m_DoState = NULL; + + if (m_hInstLib.Load(_szName)) { m_GetDllInfo = reinterpret_cast<TGetDllInfo> (m_hInstLib.Get("GetDllInfo")); @@ -66,7 +60,7 @@ CPlugin::CPlugin(const char* _szName) : valid(false) } // Check if the plugin has all the functions it shold have - if (m_GetDllInfo != 0 && + if (m_GetDllInfo != 0 && m_DllConfig != 0 && m_DllDebugger != 0 && m_SetDllGlobals != 0 && @@ -81,63 +75,57 @@ CPlugin::CPlugin(const char* _szName) : valid(false) void *CPlugin::LoadSymbol(const char *sym) { - return m_hInstLib.Get(sym); + return m_hInstLib.Get(sym); } - - // GetInfo: Get DLL info bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo) { - if (m_GetDllInfo != NULL) { - m_GetDllInfo(&_pluginInfo); - return(true); - } - return(false); + if (m_GetDllInfo != NULL) { + m_GetDllInfo(&_pluginInfo); + return(true); + } + return(false); } - // Config: Open the Config window void CPlugin::Config(HWND _hwnd) { - if (m_DllConfig != NULL) - m_DllConfig(_hwnd); + if (m_DllConfig != NULL) + m_DllConfig(_hwnd); } - - // Debug: Open the Debugging window void CPlugin::Debug(HWND _hwnd, bool Show) { - if (m_DllDebugger != NULL) - m_DllDebugger(_hwnd, Show); - + if (m_DllDebugger != NULL) + m_DllDebugger(_hwnd, Show); } void CPlugin::SetGlobals(PLUGIN_GLOBALS* _pluginGlobals) { - if (m_SetDllGlobals != NULL) - m_SetDllGlobals(_pluginGlobals); - + if (m_SetDllGlobals != NULL) + m_SetDllGlobals(_pluginGlobals); } void CPlugin::DoState(unsigned char **ptr, int mode) { - if (m_DoState != NULL) - m_DoState(ptr, mode); + if (m_DoState != NULL) + m_DoState(ptr, mode); } // Run Initialize() in the plugin void CPlugin::Initialize(void *init) { - /* We first check that we have found the Initialize() function, but there - is no restriction on running this several times */ - if (m_Initialize != NULL) - m_Initialize(init); + /* We first check that we have found the Initialize() function, but there + is no restriction on running this several times */ + // Uh, the above comment sounds extremely dubious. + if (m_Initialize != NULL) + m_Initialize(init); } void CPlugin::Shutdown() { - if (m_Shutdown != NULL) - m_Shutdown(); + if (m_Shutdown != NULL) + m_Shutdown(); } } // end of namespace Common |
