Merge pull request #1085 from waddlesplash/refactoring

Migrate global init stuff into UICommon.
This commit is contained in:
Lioncash
2014-10-05 21:25:44 -04:00
12 changed files with 170 additions and 60 deletions

View File

@ -52,6 +52,8 @@
#include "DolphinWX/Debugger/CodeWindow.h"
#include "DolphinWX/Debugger/JitWindow.h"
#include "UICommon/UICommon.h"
#include "VideoCommon/VideoBackendBase.h"
#if defined HAVE_X11 && HAVE_X11
@ -83,15 +85,6 @@
class wxFrame;
// Nvidia drivers >= v302 will check if the application exports a global
// variable named NvOptimusEnablement to know if it should run the app in high
// performance graphics mode or using the IGP.
#ifdef WIN32
extern "C" {
__declspec(dllexport) DWORD NvOptimusEnablement = 1;
}
#endif
// ------------
// Main window
@ -263,32 +256,8 @@ bool DolphinApp::OnInit()
}
#endif
// Copy initial Wii NAND data from Sys to User.
File::CopyDir(File::GetSysDirectory() + WII_USER_DIR DIR_SEP,
File::GetUserPath(D_WIIUSER_IDX));
File::CreateFullPath(File::GetUserPath(D_USER_IDX));
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
File::CreateFullPath(File::GetUserPath(D_CONFIG_IDX));
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX));
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
File::CreateFullPath(File::GetUserPath(D_GAMESETTINGS_IDX));
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + USA_DIR DIR_SEP);
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + EUR_DIR DIR_SEP);
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + JAP_DIR DIR_SEP);
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX));
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX));
File::CreateFullPath(File::GetUserPath(D_MAPS_IDX));
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX));
File::CreateFullPath(File::GetUserPath(D_SHADERS_IDX));
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX));
File::CreateFullPath(File::GetUserPath(D_THEMES_IDX));
LogManager::Init();
SConfig::Init();
VideoBackend::PopulateList();
WiimoteReal::LoadSettings();
UICommon::CreateDirectories();
UICommon::Init();
if (selectVideoBackend && videoBackendName != wxEmptyString)
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoBackend =
@ -307,8 +276,6 @@ bool DolphinApp::OnInit()
// Enable the PNG image handler for screenshots
wxImage::AddHandler(new wxPNGHandler);
SetEnableAlert(SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers);
int x = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX;
int y = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosY;
int w = SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth;
@ -451,10 +418,7 @@ void DolphinApp::OnEndSession(wxCloseEvent& event)
int DolphinApp::OnExit()
{
Core::Shutdown();
WiimoteReal::Shutdown();
VideoBackend::ClearList();
SConfig::Shutdown();
LogManager::Shutdown();
UICommon::Shutdown();
delete m_locale;