VideoConfigDiag: Don't enable the post-processing config button when there are no options.

The handling of the Anaglyph override was incorrect.
This commit is contained in:
Jules Blok 2014-12-25 00:06:29 +01:00
parent 31a55384b3
commit 111b04388c
2 changed files with 27 additions and 14 deletions

View File

@ -411,7 +411,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
choice_ppshader->AppendString(StrToWxStr(shader));
}
if (vconfig.sPostProcessingShader.empty())
if (vconfig.sPostProcessingShader.empty() || vconfig.iStereoMode == STEREO_ANAGLYPH)
choice_ppshader->Select(0);
else
choice_ppshader->SetStringSelection(StrToWxStr(vconfig.sPostProcessingShader));
@ -453,19 +453,22 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
{
wxFlexGridSizer* const szr_stereo = new wxFlexGridSizer(2, 5, 5);
const wxString stereo_choices[] = { "Off", "Side-by-Side", "Top-and-Bottom", "Anaglyph", "Nvidia 3D Vision" };
szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Stereoscopic 3D Mode:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_stereo->Add(CreateChoice(page_enh, vconfig.iStereoMode, wxGetTranslation(stereo_3d_desc), vconfig.backend_info.bSupports3DVision ? 5 : 4, stereo_choices));
const wxString stereo_choices[] = { "Off", "Side-by-Side", "Top-and-Bottom", "Anaglyph", "Nvidia 3D Vision" };
wxChoice* stereo_choice = CreateChoice(page_enh, vconfig.iStereoMode, wxGetTranslation(stereo_3d_desc), vconfig.backend_info.bSupports3DVision ? ArraySize(stereo_choices) : ArraySize(stereo_choices) - 1, stereo_choices);
stereo_choice->Bind(wxEVT_CHOICE, &VideoConfigDiag::Event_StereoMode, this);
szr_stereo->Add(stereo_choice);
wxSlider* const sep_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoDepth, 0, 100, wxDefaultPosition, wxDefaultSize);
sep_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoSep, this);
sep_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoDepth, this);
RegisterControl(sep_slider, wxGetTranslation(stereo_depth_desc));
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->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoFoc, this);
conv_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoConvergence, this);
RegisterControl(conv_slider, wxGetTranslation(stereo_convergence_desc));
szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Convergence:")), 1, wxALIGN_CENTER_VERTICAL, 0);

View File

@ -152,7 +152,7 @@ protected:
// Should we enable the configuration button?
PostProcessingShaderConfiguration postprocessing_shader;
postprocessing_shader.LoadShader(vconfig.sPostProcessingShader);
button_config_pp->Enable(postprocessing_shader.HasOptions());
button_config_pp->Enable(postprocessing_shader.HasOptions() && vconfig.iStereoMode != STEREO_ANAGLYPH);
ev.Skip();
}
@ -165,20 +165,36 @@ protected:
ev.Skip();
}
void Event_StereoSep(wxCommandEvent &ev)
void Event_StereoDepth(wxCommandEvent &ev)
{
vconfig.iStereoDepth = ev.GetInt();
ev.Skip();
}
void Event_StereoFoc(wxCommandEvent &ev)
void Event_StereoConvergence(wxCommandEvent &ev)
{
vconfig.iStereoConvergence = ev.GetInt();
ev.Skip();
}
void Event_StereoMode(wxCommandEvent &ev)
{
if (ev.GetInt() == STEREO_ANAGLYPH && vconfig.backend_info.PPShaders.size())
{
// Anaglyph overrides post-processing shaders
choice_ppshader->Select(0);
choice_ppshader->Enable(false);
}
else if (vconfig.backend_info.PPShaders.size())
{
choice_ppshader->Enable(true);
}
ev.Skip();
}
void Event_ClickClose(wxCommandEvent&);
void Event_Close(wxCloseEvent&);
@ -198,12 +214,6 @@ protected:
virtual_xfb->Enable(vconfig.bUseXFB);
real_xfb->Enable(vconfig.bUseXFB);
// PP Shaders
if (choice_ppshader)
choice_ppshader->Enable(vconfig.iStereoMode != STEREO_ANAGLYPH);
if (button_config_pp)
button_config_pp->Enable(vconfig.iStereoMode != STEREO_ANAGLYPH);
// Things which shouldn't be changed during emulation
if (Core::IsRunning())
{