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
This commit is contained in:
hrydgard
2009-02-20 22:04:52 +00:00
parent f992dae50d
commit 6cd34b318f
47 changed files with 685 additions and 1088 deletions

View File

@ -14,17 +14,12 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Include
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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