From 8bda12bcfdb20324cd5a764ea814b176b36a4687 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Wed, 23 Dec 2015 00:35:19 +0100 Subject: [PATCH] Revert "Merge pull request #3076 from void-ghost/stereo3d_presets" This reverts commit 81414b4fa2edadf0b2a2bb0bd4df61dd59165eec, reversing changes made to b926061f641692ae31bacbeba304f5941db7d3bc. Conflicts: Source/Core/DolphinWX/Frame.cpp Source/Core/VideoCommon/VideoConfig.cpp Source/Core/VideoCommon/VideoConfig.h --- Source/Core/Core/HotkeyManager.cpp | 6 --- Source/Core/Core/HotkeyManager.h | 5 -- Source/Core/DolphinWX/Frame.cpp | 51 ++----------------- Source/Core/VideoBackends/D3D/VideoBackend.h | 1 - Source/Core/VideoBackends/D3D/main.cpp | 9 +--- Source/Core/VideoBackends/OGL/VideoBackend.h | 1 - Source/Core/VideoBackends/OGL/main.cpp | 9 +--- Source/Core/VideoBackends/Software/SWmain.cpp | 9 +--- .../VideoBackends/Software/VideoBackend.h | 1 - Source/Core/VideoCommon/VideoBackendBase.h | 1 - Source/Core/VideoCommon/VideoConfig.cpp | 21 -------- Source/Core/VideoCommon/VideoConfig.h | 10 ---- 12 files changed, 10 insertions(+), 114 deletions(-) diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp index a00327d21c..e6f5c27732 100644 --- a/Source/Core/Core/HotkeyManager.cpp +++ b/Source/Core/Core/HotkeyManager.cpp @@ -126,12 +126,6 @@ const std::string hotkey_labels[] = _trans("Undo Save State"), _trans("Save State"), _trans("Load State"), - - _trans("Toggle 3D Preset"), - _trans("Use 3D Preset 1"), - _trans("Use 3D Preset 2"), - _trans("Use 3D Preset 3"), - }; static_assert(NUM_HOTKEYS == sizeof(hotkey_labels) / sizeof(hotkey_labels[0]), "Wrong count of hotkey_labels"); diff --git a/Source/Core/Core/HotkeyManager.h b/Source/Core/Core/HotkeyManager.h index 00df1f0e90..c4c94235cc 100644 --- a/Source/Core/Core/HotkeyManager.h +++ b/Source/Core/Core/HotkeyManager.h @@ -126,11 +126,6 @@ enum Hotkey HK_SAVE_STATE_FILE, HK_LOAD_STATE_FILE, - HK_SWITCH_STEREOSCOPY_PRESET, - HK_USE_STEREOSCOPY_PRESET_0, - HK_USE_STEREOSCOPY_PRESET_1, - HK_USE_STEREOSCOPY_PRESET_2, - NUM_HOTKEYS, }; diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index eb775534ba..c8604f07ae 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -1482,72 +1482,29 @@ void CFrame::ParseHotkeys() } } - auto savePreset = [](const std::string& param, int value) - { - IniFile localIni = SConfig::GetInstance().LoadLocalGameIni(); - localIni.GetOrCreateSection("Enhancements")->Set( - StringFromFormat("Stereo%s_%d", param.c_str(), g_Config.iStereoActivePreset), - value); - std::string iniFileName = File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().GetUniqueID() + ".ini"; - OSD::AddMessage(StringFromFormat("%s: %d", param.c_str(), value) , 1000); - localIni.Save(iniFileName); - }; - - if (IsHotkey(HK_DECREASE_DEPTH)) + if (IsHotkey(HK_DECREASE_DEPTH, true)) { if (--g_Config.iStereoDepth < 0) g_Config.iStereoDepth = 0; - g_Config.oStereoPresets[g_Config.iStereoActivePreset].depth = g_Config.iStereoDepth; - savePreset("Depth", g_Config.iStereoDepth); } - if (IsHotkey(HK_INCREASE_DEPTH)) + if (IsHotkey(HK_INCREASE_DEPTH, true)) { if (++g_Config.iStereoDepth > 100) g_Config.iStereoDepth = 100; - g_Config.oStereoPresets[g_Config.iStereoActivePreset].depth = g_Config.iStereoDepth; - savePreset("Depth", g_Config.iStereoDepth); } - if (IsHotkey(HK_DECREASE_CONVERGENCE)) + if (IsHotkey(HK_DECREASE_CONVERGENCE, true)) { g_Config.iStereoConvergence -= 5; if (g_Config.iStereoConvergence < 0) g_Config.iStereoConvergence = 0; - g_Config.oStereoPresets[g_Config.iStereoActivePreset].convergence = g_Config.iStereoConvergence; - savePreset("Convergence", g_Config.iStereoConvergence); } - if (IsHotkey(HK_INCREASE_CONVERGENCE)) + if (IsHotkey(HK_INCREASE_CONVERGENCE, true)) { g_Config.iStereoConvergence += 5; if (g_Config.iStereoConvergence > 500) g_Config.iStereoConvergence = 500; - g_Config.oStereoPresets[g_Config.iStereoActivePreset].convergence = g_Config.iStereoConvergence; - savePreset("Convergence", g_Config.iStereoConvergence); } - if (IsHotkey(HK_SWITCH_STEREOSCOPY_PRESET)) - { - g_Config.iStereoActivePreset = !g_Config.iStereoActivePreset; - g_Config.iStereoConvergence = g_Config.oStereoPresets[g_Config.iStereoActivePreset].convergence; - g_Config.iStereoDepth = g_Config.oStereoPresets[g_Config.iStereoActivePreset].depth; - } - if (IsHotkey(HK_USE_STEREOSCOPY_PRESET_0)) - { - g_Config.iStereoActivePreset = 0; - g_Config.iStereoConvergence = g_Config.oStereoPresets[g_Config.iStereoActivePreset].convergence; - g_Config.iStereoDepth = g_Config.oStereoPresets[g_Config.iStereoActivePreset].depth; - } - if (IsHotkey(HK_USE_STEREOSCOPY_PRESET_1)) - { - g_Config.iStereoActivePreset = 1; - g_Config.iStereoConvergence = g_Config.oStereoPresets[g_Config.iStereoActivePreset].convergence; - g_Config.iStereoDepth = g_Config.oStereoPresets[g_Config.iStereoActivePreset].depth; - } - if (IsHotkey(HK_USE_STEREOSCOPY_PRESET_2)) - { - g_Config.iStereoActivePreset = 2; - g_Config.iStereoConvergence = g_Config.oStereoPresets[g_Config.iStereoActivePreset].convergence; - g_Config.iStereoDepth = g_Config.oStereoPresets[g_Config.iStereoActivePreset].depth; - } static float debugSpeed = 1.0f; if (IsHotkey(HK_FREELOOK_DECREASE_SPEED, true)) debugSpeed /= 1.1f; diff --git a/Source/Core/VideoBackends/D3D/VideoBackend.h b/Source/Core/VideoBackends/D3D/VideoBackend.h index 117b2ef8ef..7ab12f7d9d 100644 --- a/Source/Core/VideoBackends/D3D/VideoBackend.h +++ b/Source/Core/VideoBackends/D3D/VideoBackend.h @@ -17,7 +17,6 @@ class VideoBackend : public VideoBackendHardware std::string GetName() const override; std::string GetDisplayName() const override; - std::string GetConfigName() const override; void Video_Prepare() override; void Video_Cleanup() override; diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp index 22af42c5d9..35e4978c9b 100644 --- a/Source/Core/VideoBackends/D3D/main.cpp +++ b/Source/Core/VideoBackends/D3D/main.cpp @@ -65,11 +65,6 @@ std::string VideoBackend::GetDisplayName() const return "Direct3D"; } -std::string VideoBackend::GetConfigName() const -{ - return "gfx_dx11"; -} - void InitBackendInfo() { HRESULT hr = DX11::D3D::LoadDXGI(); @@ -148,7 +143,7 @@ void InitBackendInfo() void VideoBackend::ShowConfig(void *hParent) { InitBackendInfo(); - Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName()); + Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_dx11"); } bool VideoBackend::Initialize(void *window_handle) @@ -161,7 +156,7 @@ bool VideoBackend::Initialize(void *window_handle) frameCount = 0; - g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + GetConfigName() + ".ini"); + g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini"); g_Config.GameIniLoad(); g_Config.UpdateProjectionHack(); g_Config.VerifyValidity(); diff --git a/Source/Core/VideoBackends/OGL/VideoBackend.h b/Source/Core/VideoBackends/OGL/VideoBackend.h index 9226f3dbe9..e42813c3cb 100644 --- a/Source/Core/VideoBackends/OGL/VideoBackend.h +++ b/Source/Core/VideoBackends/OGL/VideoBackend.h @@ -17,7 +17,6 @@ class VideoBackend : public VideoBackendHardware std::string GetName() const override; std::string GetDisplayName() const override; - std::string GetConfigName() const override; void Video_Prepare() override; void Video_Cleanup() override; diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp index e1bd630356..2e14a3643a 100644 --- a/Source/Core/VideoBackends/OGL/main.cpp +++ b/Source/Core/VideoBackends/OGL/main.cpp @@ -103,11 +103,6 @@ std::string VideoBackend::GetDisplayName() const return "OpenGL"; } -std::string VideoBackend::GetConfigName() const -{ - return "gfx_opengl"; -} - static std::vector GetShaders(const std::string &sub_dir = "") { std::vector paths = DoFileSearch({".glsl"}, { @@ -148,7 +143,7 @@ void VideoBackend::ShowConfig(void *_hParent) { if (!s_BackendInitialized) InitBackendInfo(); - Host_ShowVideoConfig(_hParent, GetDisplayName(), GetConfigName()); + Host_ShowVideoConfig(_hParent, GetDisplayName(), "gfx_opengl"); } bool VideoBackend::Initialize(void *window_handle) @@ -158,7 +153,7 @@ bool VideoBackend::Initialize(void *window_handle) frameCount = 0; - g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + GetConfigName() + ".ini"); + g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini"); g_Config.GameIniLoad(); g_Config.UpdateProjectionHack(); g_Config.VerifyValidity(); diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index 7b55bb0971..c891542d8a 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -65,19 +65,14 @@ std::string VideoSoftware::GetDisplayName() const return "Software Renderer"; } -std::string VideoSoftware::GetConfigName() const -{ - return "gfx_software"; -} - void VideoSoftware::ShowConfig(void *hParent) { - Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName()); + Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_software"); } bool VideoSoftware::Initialize(void *window_handle) { - g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + GetConfigName() + ".ini").c_str()); + g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str()); SWOGLWindow::Init(window_handle); diff --git a/Source/Core/VideoBackends/Software/VideoBackend.h b/Source/Core/VideoBackends/Software/VideoBackend.h index 6b4c79a5c7..e34ae07f9a 100644 --- a/Source/Core/VideoBackends/Software/VideoBackend.h +++ b/Source/Core/VideoBackends/Software/VideoBackend.h @@ -19,7 +19,6 @@ class VideoSoftware : public VideoBackend std::string GetName() const override; std::string GetDisplayName() const override; - std::string GetConfigName() const override; void EmuStateChange(EMUSTATE_CHANGE newState) override; diff --git a/Source/Core/VideoCommon/VideoBackendBase.h b/Source/Core/VideoCommon/VideoBackendBase.h index 8a8a48f1bd..f6cd1d12bf 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.h +++ b/Source/Core/VideoCommon/VideoBackendBase.h @@ -72,7 +72,6 @@ public: virtual std::string GetName() const = 0; virtual std::string GetDisplayName() const { return GetName(); } - virtual std::string GetConfigName() const = 0; virtual void ShowConfig(void*) = 0; diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 2db0cc7633..f29377f714 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -98,16 +98,6 @@ void VideoConfig::Load(const std::string& ini_file) stereoscopy->Get("StereoConvergencePercentage", &iStereoConvergencePercentage, 100); stereoscopy->Get("StereoSwapEyes", &bStereoSwapEyes, false); - //currently these settings are not saved in global config, so we could've initialized them directly - for (size_t i = 0; i < oStereoPresets.size(); ++i) - { - stereoscopy->Get(StringFromFormat("StereoConvergencePercentage_%zu", i), &oStereoPresets[i].convergence, iStereoConvergencePercentage); - stereoscopy->Get(StringFromFormat("StereoDepth_%zu", i), &oStereoPresets[i].depth, iStereoDepth); - } - stereoscopy->Get("StereoActivePreset", &iStereoActivePreset, 0); - iStereoConvergencePercentage = oStereoPresets[iStereoActivePreset].convergence; - iStereoDepth = oStereoPresets[iStereoActivePreset].depth; - IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks"); hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true); hacks->Get("BBoxEnable", &bBBoxEnable, false); @@ -208,17 +198,6 @@ void VideoConfig::GameIniLoad() CHECK_SETTING("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x) CHECK_SETTING("Video_Enhancements", "PostProcessingShader", sPostProcessingShader); - //these are not overrides, they are per-game settings, hence no warning - IniFile::Section* stereoscopy = iniFile.GetOrCreateSection("Stereoscopy"); - for (size_t i = 0; i < oStereoPresets.size(); ++i) - { - stereoscopy->Get(StringFromFormat("StereoConvergencePercentage_%zu", i), &oStereoPresets[i].convergence, iStereoConvergencePercentage); - stereoscopy->Get(StringFromFormat("StereoDepth_%zu", i), &oStereoPresets[i].depth, iStereoDepth); - } - stereoscopy->Get("StereoActivePreset", &iStereoActivePreset, 0); - iStereoConvergencePercentage = oStereoPresets[iStereoActivePreset].convergence; - iStereoDepth = oStereoPresets[iStereoActivePreset].depth; - CHECK_SETTING("Video_Stereoscopy", "StereoMode", iStereoMode); CHECK_SETTING("Video_Stereoscopy", "StereoDepth", iStereoDepth); CHECK_SETTING("Video_Stereoscopy", "StereoConvergence", iStereoConvergence); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 4995e7d0ab..5b88e64c2f 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -51,14 +51,6 @@ enum StereoMode STEREO_3DVISION }; -constexpr int STEREOSCOPY_PRESETS_NUM = 3; - -struct StereoscopyPreset final -{ - int depth; - int convergence; -}; - // NEVER inherit from this class. struct VideoConfig final { @@ -88,8 +80,6 @@ struct VideoConfig final bool bForceFiltering; int iMaxAnisotropy; std::string sPostProcessingShader; - std::array oStereoPresets; - int iStereoActivePreset; // Information bool bShowFPS;