[ create a new paste ] login | about

Link: http://codepad.org/Zp48vJXK    [ raw code | fork ]

C++, pasted on Nov 23:
diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp
index 0c4fa04..3d39076 100644
--- a/Source/Core/Core/Src/ConfigManager.cpp
+++ b/Source/Core/Core/Src/ConfigManager.cpp
@@ -172,6 +172,7 @@ void SConfig::SaveSettings()
 	ini.Set("Interface", "ShowLogWindow",		m_InterfaceLogWindow);
 	ini.Set("Interface", "ShowLogConfigWindow",	m_InterfaceLogConfigWindow);
 	ini.Set("Interface", "ShowConsole",			m_InterfaceConsole);
+	ini.Set("Interface", "KeepGameSettings",	m_KeepGameSettings);
 
 	// Hotkeys
 	for (int i = 0; i < NUM_HOTKEYS; i++)
@@ -301,6 +302,7 @@ void SConfig::LoadSettings()
 		ini.Get("Interface", "ShowLogWindow",		&m_InterfaceLogWindow,							false);
 		ini.Get("Interface", "ShowLogConfigWindow",	&m_InterfaceLogConfigWindow,					false);
 		ini.Get("Interface", "ShowConsole",			&m_InterfaceConsole,							false);
+		ini.Get("Interface", "KeepGameSettings",	&m_KeepGameSettings,							false);
 
 		// Hotkeys
 		for (int i = 0; i < NUM_HOTKEYS; i++)
diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h
index 0c8f3f1..43542fa 100644
--- a/Source/Core/Core/Src/ConfigManager.h
+++ b/Source/Core/Core/Src/ConfigManager.h
@@ -75,6 +75,7 @@ struct SConfig : NonCopyable
 	bool m_ListKorea;
 	bool m_ListTaiwan;
 	bool m_ListUnknown;
+	bool m_KeepGameSettings;
 
 	SysConf* m_SYSCONF;
 
diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp
index ef82810..8447f45 100644
--- a/Source/Core/DolphinWX/Src/ConfigMain.cpp
+++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp
@@ -125,6 +125,7 @@ EVT_SLIDER(ID_VOLUME, CConfigMain::AudioSettingsChanged)
 
 EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::DisplaySettingsChanged)
 EVT_CHECKBOX(ID_INTERFACE_USEPANICHANDLERS, CConfigMain::DisplaySettingsChanged)
+EVT_CHECKBOX(ID_INTERFACE_KEEPGAMESETTINGS, CConfigMain::DisplaySettingsChanged)
 EVT_RADIOBOX(ID_INTERFACE_THEME, CConfigMain::DisplaySettingsChanged)
 EVT_CHOICE(ID_INTERFACE_LANG, CConfigMain::DisplaySettingsChanged)
 EVT_BUTTON(ID_HOTKEY_CONFIG, CConfigMain::DisplaySettingsChanged)
@@ -337,6 +338,7 @@ void CConfigMain::InitializeGUIValues()
 	// Display - Interface
 	ConfirmStop->SetValue(startup_params.bConfirmStop);
 	UsePanicHandlers->SetValue(startup_params.bUsePanicHandlers);
+	KeepGameSettings->SetValue(SConfig::GetInstance().m_KeepGameSettings);
 	Theme->SetSelection(startup_params.iTheme);
 	// need redesign
 	for (unsigned int i = 0; i < sizeof(langIds) / sizeof(wxLanguage); i++)
@@ -490,6 +492,7 @@ void CConfigMain::InitializeGUITooltips()
 	// Display - Interface
 	ConfirmStop->SetToolTip(_("Show a confirmation box before stopping a game."));
 	UsePanicHandlers->SetToolTip(_("Show a message box when a potentially serious error has occured.\nDisabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin suddenly crashes without any explanation at all."));
+	KeepGameSettings->SetToolTip(_("Prevents Game Specific graphics settings from being overridden when opening the graphics config."));
 
 	// Display - Themes: Copyright notice
 	Theme->SetItemToolTip(0, _("Created by Milosz Wlazlo [miloszwl@miloszwl.com, miloszwl.deviantart.com]"));
@@ -579,6 +582,8 @@ void CConfigMain::CreateGUIControls()
 			wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
 	UsePanicHandlers = new wxCheckBox(DisplayPage, ID_INTERFACE_USEPANICHANDLERS,
 			_("Use Panic Handlers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
+	KeepGameSettings = new wxCheckBox(DisplayPage, ID_INTERFACE_KEEPGAMESETTINGS,
+			_("Don't override game settings"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
 
 	wxBoxSizer* sInterface = new wxBoxSizer(wxHORIZONTAL);
 	sInterface->Add(TEXT_BOX(DisplayPage, _("Language:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
@@ -588,6 +593,7 @@ void CConfigMain::CreateGUIControls()
 	sbInterface = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Interface Settings"));
 	sbInterface->Add(ConfirmStop, 0, wxALL, 5);
 	sbInterface->Add(UsePanicHandlers, 0, wxALL, 5);
+	sbInterface->Add(KeepGameSettings, 0, wxALL, 5);
 	sbInterface->Add(Theme, 0, wxEXPAND | wxALL, 5);
 	sbInterface->Add(sInterface, 0, wxEXPAND | wxALL, 5);
 
@@ -865,6 +871,9 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event)
 		SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers = UsePanicHandlers->IsChecked();
 		SetEnableAlert(UsePanicHandlers->IsChecked());
 		break;
+	case ID_INTERFACE_KEEPGAMESETTINGS:
+		SConfig::GetInstance().m_KeepGameSettings = KeepGameSettings->IsChecked();
+		break;
 	case ID_INTERFACE_THEME:
 		SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme = Theme->GetSelection();
 		main_frame->InitBitmaps();
diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h
index eae9f89..109396e 100644
--- a/Source/Core/DolphinWX/Src/ConfigMain.h
+++ b/Source/Core/DolphinWX/Src/ConfigMain.h
@@ -86,6 +86,7 @@ private:
 		// Interface settings
 		ID_INTERFACE_CONFIRMSTOP,
 		ID_INTERFACE_USEPANICHANDLERS,
+		ID_INTERFACE_KEEPGAMESETTINGS,
 		ID_INTERFACE_THEME,
 		ID_INTERFACE_LANG,
 		ID_HOTKEY_CONFIG,
@@ -166,6 +167,7 @@ private:
 	wxRadioBox* Theme;
 	wxChoice* InterfaceLang;
 	wxButton* HotkeyConfig;
+	wxCheckBox* KeepGameSettings;
 
 
 	wxBoxSizer* sGamecubePage; // GC settings
diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
index 20bd4df..db71a16 100644
--- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
+++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
@@ -4,6 +4,7 @@
 #include "TextureCacheBase.h"
 #include "Core.h"
 #include "Frame.h"
+#include "../../Core/Src/ConfigManager.h"
 
 #include <wx/intl.h>
 
@@ -189,7 +190,10 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
 	, vconfig(g_Config)
 	, ininame(_ininame)
 {
-	vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
+	if (SConfig::GetInstance().m_KeepGameSettings && Core::GetState() != Core::CORE_UNINITIALIZED)
+		vconfig.GameIniLoad((File::GetUserPath(D_GAMECONFIG_IDX) + Core::g_CoreStartupParameter.GetUniqueID() + ".ini").c_str());
+	else
+		vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
 
 	Connect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(VideoConfigDiag::OnUpdateUI), NULL, this);
 


Create a new paste based on this one


Comments: