Enable a higher maximum shadow resolution in the video settings

This commit is contained in:
Alayan 2024-04-29 12:01:54 +02:00
parent 95c8f452de
commit ec4f4065f5
No known key found for this signature in database
2 changed files with 9 additions and 4 deletions

View File

@ -29,7 +29,7 @@
<div layout="horizontal-row" proportion="1" height="fit">
<label text="Shadows" I18N="Video settings"/>
<spacer width="10" height="10"/>
<gauge id="shadows" min_value="0" max_value="2" proportion="1"/>
<gauge id="shadows" min_value="0" max_value="3" proportion="1"/>
</div>
</div>

View File

@ -101,8 +101,11 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
SpinnerWidget* shadows = getWidget<SpinnerWidget>("shadows");
shadows->addLabel(_("Disabled")); // 0
shadows->addLabel(_("Low")); // 1
shadows->addLabel(_("High")); // 2
shadows->setValue(UserConfigParams::m_shadows_resolution / 512);
shadows->addLabel(_("Medium")); // 2
shadows->addLabel(_("High")); // 3
shadows->setValue(UserConfigParams::m_shadows_resolution == 2048 ? 3 :
UserConfigParams::m_shadows_resolution == 1024 ? 2 :
UserConfigParams::m_shadows_resolution == 512 ? 1 : 0);
getWidget<CheckBoxWidget>("dynamiclight")->setState(UserConfigParams::m_dynamic_lights);
getWidget<CheckBoxWidget>("lightshaft")->setState(UserConfigParams::m_light_shaft);
@ -156,7 +159,9 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
if (advanced_pipeline)
{
UserConfigParams::m_shadows_resolution =
getWidget<SpinnerWidget>("shadows")->getValue() * 512;
getWidget<SpinnerWidget>("shadows")->getValue() == 1 ? 512 :
getWidget<SpinnerWidget>("shadows")->getValue() == 2 ? 1024 :
getWidget<SpinnerWidget>("shadows")->getValue() == 3 ? 2048 : 0;
}
else
{