Avoid using Settings::Manager::mDefaultSettings directly

7344-support-launching-the-example-suite^2
elsid 2 years ago
parent 8e487c283c
commit 39e867781e
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -26,7 +26,7 @@
#include <components/resource/resourcesystem.hpp> #include <components/resource/resourcesystem.hpp>
#include <components/resource/scenemanager.hpp> #include <components/resource/scenemanager.hpp>
#include <components/sceneutil/lightmanager.hpp> #include <components/sceneutil/lightmanager.hpp>
#include <components/settings/settings.hpp> #include <components/settings/values.hpp>
#include <components/vfs/manager.hpp> #include <components/vfs/manager.hpp>
#include <components/widgets/sharedstatebutton.hpp> #include <components/widgets/sharedstatebutton.hpp>
@ -620,21 +620,16 @@ namespace MWGui
if (selectedButton == 1 || selectedButton == -1) if (selectedButton == 1 || selectedButton == -1)
return; return;
constexpr std::array<const char*, 6> settings = { Settings::shaders().mLightBoundsMultiplier.reset();
"light bounds multiplier", Settings::shaders().mMaximumLightDistance.reset();
"maximum light distance", Settings::shaders().mLightFadeStart.reset();
"light fade start", Settings::shaders().mMinimumInteriorBrightness.reset();
"minimum interior brightness", Settings::shaders().mMaxLights.reset();
"max lights", Settings::shaders().mLightingMethod.reset();
"lighting method",
};
for (const auto& setting : settings)
Settings::Manager::setString(
setting, "Shaders", Settings::Manager::mDefaultSettings[{ "Shaders", setting }]);
auto lightingMethod = SceneUtil::LightManager::getLightingMethodFromString( const SceneUtil::LightingMethod lightingMethod
Settings::Manager::mDefaultSettings[{ "Shaders", "lighting method" }]); = SceneUtil::LightManager::getLightingMethodFromString(Settings::shaders().mLightingMethod);
auto lightIndex = mLightingMethodButton->findItemIndexWith(lightingMethodToStr(lightingMethod)); const std::size_t lightIndex = mLightingMethodButton->findItemIndexWith(lightingMethodToStr(lightingMethod));
mLightingMethodButton->setIndexSelected(lightIndex); mLightingMethodButton->setIndexSelected(lightIndex);
updateMaxLightsComboBox(mMaxLights); updateMaxLightsComboBox(mMaxLights);

Loading…
Cancel
Save