From ec4f4065f54e521a5f705b356575c78a85ff2051 Mon Sep 17 00:00:00 2001
From: Alayan <25536748+Alayan-stk-2@users.noreply.github.com>
Date: Mon, 29 Apr 2024 12:01:54 +0200
Subject: [PATCH] Enable a higher maximum shadow resolution in the video
settings
---
data/gui/dialogs/custom_video_settings.stkgui | 2 +-
src/states_screens/dialogs/custom_video_settings.cpp | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/data/gui/dialogs/custom_video_settings.stkgui b/data/gui/dialogs/custom_video_settings.stkgui
index 5c58c1008..1981d3d65 100644
--- a/data/gui/dialogs/custom_video_settings.stkgui
+++ b/data/gui/dialogs/custom_video_settings.stkgui
@@ -29,7 +29,7 @@
-
+
diff --git a/src/states_screens/dialogs/custom_video_settings.cpp b/src/states_screens/dialogs/custom_video_settings.cpp
index 131590872..7de363a76 100644
--- a/src/states_screens/dialogs/custom_video_settings.cpp
+++ b/src/states_screens/dialogs/custom_video_settings.cpp
@@ -101,8 +101,11 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
SpinnerWidget* shadows = getWidget("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("dynamiclight")->setState(UserConfigParams::m_dynamic_lights);
getWidget("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("shadows")->getValue() * 512;
+ getWidget("shadows")->getValue() == 1 ? 512 :
+ getWidget("shadows")->getValue() == 2 ? 1024 :
+ getWidget("shadows")->getValue() == 3 ? 2048 : 0;
}
else
{