Improve graphics settings dialog to try to avoid mutually incompatible options

This commit is contained in:
Marianne Gagnon 2014-07-21 19:58:45 -04:00
parent b2fab2ae6d
commit fff498b9fe

View File

@ -102,29 +102,19 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
{ {
if (eventSource == "close") if (eventSource == "close")
{ {
bool dynamic_light = getWidget<CheckBoxWidget>("dynamiclight")->getState(); bool advanced_pipeline = getWidget<CheckBoxWidget>("dynamiclight")->getState();
UserConfigParams::m_dynamic_lights = dynamic_light; UserConfigParams::m_dynamic_lights = advanced_pipeline;
UserConfigParams::m_graphical_effects =
getWidget<CheckBoxWidget>("anim_gfx")->getState();
UserConfigParams::m_weather_effects =
getWidget<CheckBoxWidget>("weather_gfx")->getState();
UserConfigParams::m_ubo_disabled =
!getWidget<CheckBoxWidget>("ubo")->getState();
UserConfigParams::m_dof = UserConfigParams::m_dof =
getWidget<CheckBoxWidget>("dof")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("dof")->getState();
UserConfigParams::m_high_definition_textures =
getWidget<CheckBoxWidget>("hd-textures")->getState();
UserConfigParams::m_motionblur = UserConfigParams::m_motionblur =
getWidget<CheckBoxWidget>("motionblur")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("motionblur")->getState();
UserConfigParams::m_show_steering_animations =
getWidget<SpinnerWidget>("steering_animations")->getValue(); if (advanced_pipeline)
if (dynamic_light)
{ {
UserConfigParams::m_shadows = UserConfigParams::m_shadows =
getWidget<SpinnerWidget>("shadows")->getValue(); advanced_pipeline && getWidget<SpinnerWidget>("shadows")->getValue();
} }
else else
{ {
@ -132,26 +122,41 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
} }
UserConfigParams::m_mlaa = UserConfigParams::m_mlaa =
getWidget<CheckBoxWidget>("mlaa")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("mlaa")->getState();
UserConfigParams::m_ssao = UserConfigParams::m_ssao =
getWidget<CheckBoxWidget>("ssao")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("ssao")->getState();
UserConfigParams::m_light_shaft = UserConfigParams::m_light_shaft =
getWidget<CheckBoxWidget>("lightshaft")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("lightshaft")->getState();
UserConfigParams::m_gi = UserConfigParams::m_gi =
getWidget<CheckBoxWidget>("global_illumination")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("global_illumination")->getState();
UserConfigParams::m_glow = UserConfigParams::m_glow =
getWidget<CheckBoxWidget>("glow")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("glow")->getState();
UserConfigParams::m_bloom = UserConfigParams::m_bloom =
getWidget<CheckBoxWidget>("bloom")->getState(); advanced_pipeline && getWidget<CheckBoxWidget>("bloom")->getState();
UserConfigParams::m_texture_compression = UserConfigParams::m_texture_compression =
getWidget<CheckBoxWidget>("texture_compression")->getState(); getWidget<CheckBoxWidget>("texture_compression")->getState();
UserConfigParams::m_graphical_effects =
getWidget<CheckBoxWidget>("anim_gfx")->getState();
UserConfigParams::m_weather_effects =
getWidget<CheckBoxWidget>("weather_gfx")->getState();
UserConfigParams::m_ubo_disabled =
!getWidget<CheckBoxWidget>("ubo")->getState();
UserConfigParams::m_high_definition_textures =
getWidget<CheckBoxWidget>("hd-textures")->getState();
UserConfigParams::m_show_steering_animations =
getWidget<SpinnerWidget>("steering_animations")->getValue();
switch (getWidget<SpinnerWidget>("filtering")->getValue()) switch (getWidget<SpinnerWidget>("filtering")->getValue())
{ {
case 0: case 0: