summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Plugin.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-02-20 22:04:52 +0000
committerhrydgard <hrydgard@gmail.com>2009-02-20 22:04:52 +0000
commit6cd34b318fc46620ea85991dd1e03ea390960da3 (patch)
tree0a20c064660b03e8d440a517daa76c8707b7f514 /Source/Core/Common/Src/Plugin.cpp
parentf992dae50ddbd7c20d63e6d48d5051fc1d6b392b (diff)
The Mega Change Of Doom - or, fixing Stop. Almost. At least it's better than before. However, the OpenGL plugin seems to lose textures a lot between game restarts :P I think the GL plugin needs to do a lot more cleanup.
This change also includes tons of minor code formatting cleanup. Yeah, should've separated it ... sorry :( Kills the old CPUCompare support. I'll resurrect it if I need it again, right now it mostly clutters the code. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2321 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/Plugin.cpp')
-rw-r--r--Source/Core/Common/Src/Plugin.cpp86
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