diff --git a/Data/Sys/GameSettings/GZL.ini b/Data/Sys/GameSettings/GZL.ini index f06be50ac0..0d0835cbba 100644 --- a/Data/Sys/GameSettings/GZL.ini +++ b/Data/Sys/GameSettings/GZL.ini @@ -25,4 +25,4 @@ EFBToTextureEnable = False FastDepthCalc = False [Video_Stereoscopy] -StereoConvergenceMinimum = 115 +StereoConvergence = 115 diff --git a/Data/Sys/GameSettings/RSB.ini b/Data/Sys/GameSettings/RSB.ini index aa966b28ce..783cc4770b 100644 --- a/Data/Sys/GameSettings/RSB.ini +++ b/Data/Sys/GameSettings/RSB.ini @@ -18,4 +18,4 @@ EmulationIssues = Classic mode score report needs real xfb. Nes masterpieces and # Add action replay cheats here. [Video_Stereoscopy] -StereoConvergenceMinimum = 136 +StereoConvergence = 136 diff --git a/Data/Sys/GameSettings/SF8.ini b/Data/Sys/GameSettings/SF8.ini index ebea7f5dcf..68d1902e93 100644 --- a/Data/Sys/GameSettings/SF8.ini +++ b/Data/Sys/GameSettings/SF8.ini @@ -22,4 +22,4 @@ FastDepthCalc = False SafeTextureCacheColorSamples = 512 [Video_Stereoscopy] -StereoConvergenceMinimum = 26 +StereoConvergence = 26 diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index de206ab4fe..f4c37a2b6a 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -439,7 +439,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Depth:")), 1, wxALIGN_CENTER_VERTICAL, 0); szr_stereo->Add(sep_slider, 0, wxEXPAND | wxRIGHT); - wxSlider* const conv_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoConvergence, 0, 500, wxDefaultPosition, wxDefaultSize); + conv_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoConvergencePercentage, 0, 200, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS); + conv_slider->ClearTicks(); + conv_slider->SetTick(100); conv_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoConvergence, this); RegisterControl(conv_slider, wxGetTranslation(stereo_convergence_desc)); diff --git a/Source/Core/DolphinWX/VideoConfigDiag.h b/Source/Core/DolphinWX/VideoConfigDiag.h index eb4d7f583a..89d5736b55 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.h +++ b/Source/Core/DolphinWX/VideoConfigDiag.h @@ -168,7 +168,12 @@ protected: void Event_StereoConvergence(wxCommandEvent &ev) { - vconfig.iStereoConvergence = ev.GetInt(); + // Snap the slider + int value = ev.GetInt(); + if (90 < value && value < 110) + conv_slider->SetValue(100); + + vconfig.iStereoConvergencePercentage = conv_slider->GetValue(); ev.Skip(); } @@ -256,6 +261,7 @@ protected: wxStaticText* text_aamode; wxChoice* choice_aamode; + wxSlider* conv_slider; wxStaticText* label_display_resolution; diff --git a/Source/Core/VideoCommon/GeometryShaderManager.cpp b/Source/Core/VideoCommon/GeometryShaderManager.cpp index 19a480692f..c5eb4fb256 100644 --- a/Source/Core/VideoCommon/GeometryShaderManager.cpp +++ b/Source/Core/VideoCommon/GeometryShaderManager.cpp @@ -63,7 +63,7 @@ void GeometryShaderManager::SetConstants() constants.stereoparams[0] = constants.stereoparams[1] = 0; } - constants.stereoparams[2] = (float)(g_ActiveConfig.iStereoConvergenceMinimum + g_ActiveConfig.iStereoConvergence); + constants.stereoparams[2] = (float)(g_ActiveConfig.iStereoConvergence * (g_ActiveConfig.iStereoConvergencePercentage / 100.0f)); dirty = true; } diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 874e8f2ddb..8c682af39c 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -44,7 +44,7 @@ VideoConfig::VideoConfig() // Game-specific stereoscopy settings bStereoEFBMonoDepth = false; iStereoDepthPercentage = 100; - iStereoConvergenceMinimum = 0; + iStereoConvergence = 20; } void VideoConfig::Load(const std::string& ini_file) @@ -92,7 +92,7 @@ void VideoConfig::Load(const std::string& ini_file) enhancements->Get("PostProcessingShader", &sPostProcessingShader, ""); enhancements->Get("StereoMode", &iStereoMode, 0); enhancements->Get("StereoDepth", &iStereoDepth, 20); - enhancements->Get("StereoConvergence", &iStereoConvergence, 20); + enhancements->Get("StereoConvergencePercentage", &iStereoConvergencePercentage, 100); enhancements->Get("StereoSwapEyes", &bStereoSwapEyes, false); //currently these settings are not saved in global config, so we could've initialized them directly @@ -222,7 +222,6 @@ void VideoConfig::GameIniLoad() CHECK_SETTING("Video_Stereoscopy", "StereoEFBMonoDepth", bStereoEFBMonoDepth); CHECK_SETTING("Video_Stereoscopy", "StereoDepthPercentage", iStereoDepthPercentage); - CHECK_SETTING("Video_Stereoscopy", "StereoConvergenceMinimum", iStereoConvergenceMinimum); CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable); CHECK_SETTING("Video_Hacks", "BBoxEnable", bBBoxEnable); @@ -309,7 +308,7 @@ void VideoConfig::Save(const std::string& ini_file) enhancements->Set("PostProcessingShader", sPostProcessingShader); enhancements->Set("StereoMode", iStereoMode); enhancements->Set("StereoDepth", iStereoDepth); - enhancements->Set("StereoConvergence", iStereoConvergence); + enhancements->Set("StereoConvergencePercentage", iStereoConvergencePercentage); enhancements->Set("StereoSwapEyes", bStereoSwapEyes); IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks"); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index e1681ca291..e070a9f7ab 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -88,10 +88,6 @@ struct VideoConfig final bool bForceFiltering; int iMaxAnisotropy; std::string sPostProcessingShader; - int iStereoMode; - int iStereoDepth; - int iStereoConvergence; - bool bStereoSwapEyes; std::array oStereoPresets; int iStereoActivePreset; @@ -136,9 +132,13 @@ struct VideoConfig final int iSaveTargetId; // TODO: Should be dropped // Stereoscopy + int iStereoMode; + int iStereoDepth; + int iStereoConvergence; + int iStereoConvergencePercentage; + bool bStereoSwapEyes; bool bStereoEFBMonoDepth; int iStereoDepthPercentage; - int iStereoConvergenceMinimum; // D3D only config, mostly to be merged into the above int iAdapter;