From 8fdf439c9a0e8606235e658ab87784917a97db75 Mon Sep 17 00:00:00 2001 From: nakeee Date: Sun, 18 Jan 2009 00:45:48 +0000 Subject: [PATCH] Core now uses SConfig and not startup params Please check everything is working well git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1911 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 5 +- Source/Core/Core/Src/PluginManager.cpp | 112 ++++++++-------------- Source/Core/Core/Src/PluginManager.h | 3 +- Source/Core/DolphinWX/Src/BootManager.cpp | 10 +- 4 files changed, 52 insertions(+), 78 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 57e3def809..da4e23a7eb 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -53,6 +53,7 @@ #include "PowerPC/PowerPC.h" #include "PluginManager.h" +#include "ConfigManager.h" #include "MemTools.h" #include "Host.h" @@ -173,10 +174,10 @@ bool Init(const SCoreStartupParameter _CoreParameter) // start the thread again _dbg_assert_(HLE, g_pThread == NULL); - if (!pManager.InitPlugins(_CoreParameter)) + if (!pManager.InitPlugins()) return false; - g_CoreStartupParameter = _CoreParameter; + g_CoreStartupParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; emuThreadGoing.Init(); // This will execute EmuThread() further down in this file diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp index b10aa4b0ea..1da69bf1b3 100644 --- a/Source/Core/Core/Src/PluginManager.cpp +++ b/Source/Core/Core/Src/PluginManager.cpp @@ -22,18 +22,22 @@ #include "FileSearch.h" #include "FileUtil.h" #include "PluginManager.h" +#include "ConfigManager.h" +#include "LogManager.h" #include "StringUtil.h" CPluginManager CPluginManager::m_Instance; -CPluginManager::CPluginManager() +CPluginManager::CPluginManager() : + m_params(SConfig::GetInstance().m_LocalCoreStartupParameter) { m_PluginGlobals = new PLUGIN_GLOBALS; m_PluginGlobals->eventHandler = EventHandler::GetInstance(); - m_PluginGlobals->config = NULL; + m_PluginGlobals->config = (void *)&SConfig::GetInstance(); m_PluginGlobals->messageLogger = NULL; + } @@ -48,54 +52,57 @@ CPluginManager::~CPluginManager() if (m_video) delete m_video; - for (int i=0;i<1;i++) { + for (int i=0;iDebug((HWND)_Parent, Show); } - /* if (Type) - { - //Common::CPlugin::Debug((HWND)_Parent); - if (!PluginVideo::IsLoaded()) - PluginVideo::LoadPlugin(_rFilename); - - //PluginVideo::SetDllGlobals(m_PluginGlobals); - PluginVideo::Debug((HWND)_Parent, Show); - } - else - { - if(!PluginDSP::IsLoaded()) - PluginDSP::LoadPlugin(_rFilename); - - //PluginDSP::SetDllGlobals(m_PluginGlobals); - PluginDSP::Debug((HWND)_Parent, Show); - }*/ - //Common::CPlugin::Release(); // this is only if the wx dialog is called with ShowModal() - - //m_DllDebugger = (void (__cdecl*)(HWND))PluginVideo::plugin.Get("DllDebugger"); - //m_DllDebugger(NULL); } // ---------------------------------------- @@ -294,17 +277,6 @@ CPluginInfo::CPluginInfo(const char *_rFileName) delete plugin; } - /* - The DLL loading code provides enough error messages already. Possibly make some return codes - and handle messages here instead? - else - { - if (!File::Exists(_rFileName)) { - PanicAlert("Could not load plugin %s - file does not exist", _rFileName); - } else { - PanicAlert("Failed to load plugin %s - unknown error.\n", _rFileName); - } - }*/ } diff --git a/Source/Core/Core/Src/PluginManager.h b/Source/Core/Core/Src/PluginManager.h index 85123b880d..2b0eb3da83 100644 --- a/Source/Core/Core/Src/PluginManager.h +++ b/Source/Core/Core/Src/PluginManager.h @@ -51,7 +51,7 @@ public: Common::PluginDSP *GetDSP(); Common::PluginVideo *GetVideo(); - bool InitPlugins(SCoreStartupParameter scsp); + bool InitPlugins(); void ShutdownPlugins(); void ScanForPlugins(); void OpenConfig(void* _Parent, const char *_rFilename); @@ -69,6 +69,7 @@ private: Common::PluginWiimote *m_wiimote[4]; Common::PluginDSP *m_dsp; + SCoreStartupParameter& m_params; CPluginManager(); ~CPluginManager(); void *LoadPlugin(const char *_rFilename); diff --git a/Source/Core/DolphinWX/Src/BootManager.cpp b/Source/Core/DolphinWX/Src/BootManager.cpp index 5bab67003c..03e0a6bdb9 100644 --- a/Source/Core/DolphinWX/Src/BootManager.cpp +++ b/Source/Core/DolphinWX/Src/BootManager.cpp @@ -78,7 +78,7 @@ extern "C" HINSTANCE wxGetInstance(); bool BootCore(const std::string& _rFilename) { - SCoreStartupParameter StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter; + SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter; // Use custom settings for debugging mode #if defined(HAVE_WX) && HAVE_WX @@ -100,7 +100,7 @@ bool BootCore(const std::string& _rFilename) StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO; StartUp.m_strFilename = _rFilename; - SConfig::GetInstance().m_LastFilename = StartUp.m_strFilename; + // SConfig::GetInstance().m_LastFilename = StartUp.m_strFilename; StartUp.bRunCompareClient = false; StartUp.bRunCompareServer = false; std::string BaseDataPath; @@ -184,9 +184,9 @@ bool BootCore(const std::string& _rFilename) // --------- // Save some values to our local version of SCoreStartupParameter - SConfig::GetInstance().m_LocalCoreStartupParameter.bWii = StartUp.bWii; - SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC = StartUp.bNTSC; - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID = StartUp.m_strUniqueID; + // SConfig::GetInstance().m_LocalCoreStartupParameter.bWii = StartUp.bWii; + // SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC = StartUp.bNTSC; + // SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID = StartUp.m_strUniqueID; #if defined(HAVE_WX) && HAVE_WX if(main_frame)