Skip to content

Commit

Permalink
Enable a higher maximum shadow resolution in the video settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alayan-stk-2 committed Apr 29, 2024
1 parent 95c8f45 commit ec4f406
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/gui/dialogs/custom_video_settings.stkgui
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
11 changes: 8 additions & 3 deletions src/states_screens/dialogs/custom_video_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit ec4f406

Please sign in to comment.