diff --git a/apps/openmw/mwrender/luminancecalculator.cpp b/apps/openmw/mwrender/luminancecalculator.cpp index 53240205c7..5b7fe272aa 100644 --- a/apps/openmw/mwrender/luminancecalculator.cpp +++ b/apps/openmw/mwrender/luminancecalculator.cpp @@ -1,7 +1,7 @@ #include "luminancecalculator.hpp" #include -#include +#include #include #include "pingpongcanvas.hpp" @@ -10,11 +10,8 @@ namespace MWRender { LuminanceCalculator::LuminanceCalculator(Shader::ShaderManager& shaderManager) { - const float hdrExposureTime - = std::max(Settings::Manager::getFloat("auto exposure speed", "Post Processing"), 0.0001f); - Shader::ShaderManager::DefineMap defines = { - { "hdrExposureTime", std::to_string(hdrExposureTime) }, + { "hdrExposureTime", std::to_string(Settings::postProcessing().mAutoExposureSpeed) }, }; auto vertex = shaderManager.getShader("fullscreen_tri.vert", {}); diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index d64e9651bc..bcaba03161 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -121,7 +121,7 @@ namespace MWRender , mTriggerShaderReload(false) , mReload(false) , mEnabled(false) - , mUsePostProcessing(false) + , mUsePostProcessing(Settings::postProcessing().mEnabled) , mSoftParticles(false) , mDisableDepthPasses(false) , mLastFrameNumber(0) @@ -136,7 +136,6 @@ namespace MWRender , mPrevPassLights(false) { mSoftParticles = Settings::Manager::getBool("soft particles", "Shaders"); - mUsePostProcessing = Settings::Manager::getBool("enabled", "Post Processing"); osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext(); osg::GLExtensions* ext = gc->getState()->get(); @@ -237,7 +236,7 @@ namespace MWRender { mReload = true; mEnabled = true; - bool postPass = Settings::Manager::getBool("transparent postpass", "Post Processing"); + const bool postPass = Settings::postProcessing().mTransparentPostpass; mUsePostProcessing = usePostProcessing; mDisableDepthPasses = !mSoftParticles && !postPass; @@ -839,9 +838,7 @@ namespace MWRender mTechniques.clear(); - std::vector techniqueStrings = Settings::Manager::getStringArray("chain", "Post Processing"); - - for (auto& techniqueName : techniqueStrings) + for (const std::string& techniqueName : Settings::postProcessing().mChain.get()) { if (techniqueName.empty()) continue; @@ -863,7 +860,7 @@ namespace MWRender chain.push_back(technique->getName()); } - Settings::Manager::setStringArray("chain", "Post Processing", chain); + Settings::postProcessing().mChain.set(chain); } void PostProcessor::toggleMode() diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 6155325410..c6bb8f34aa 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1441,7 +1441,7 @@ namespace MWRender } else if (it->first == "Post Processing" && it->second == "enabled") { - if (Settings::Manager::getBool("enabled", "Post Processing")) + if (Settings::postProcessing().mEnabled) mPostProcessor->enable(); else { diff --git a/components/settings/categories/postprocessing.hpp b/components/settings/categories/postprocessing.hpp index b1e217b611..04810b847c 100644 --- a/components/settings/categories/postprocessing.hpp +++ b/components/settings/categories/postprocessing.hpp @@ -19,7 +19,7 @@ namespace Settings using WithIndex::WithIndex; SettingValue mEnabled{ mIndex, "Post Processing", "enabled" }; - SettingValue mChain{ mIndex, "Post Processing", "chain" }; + SettingValue> mChain{ mIndex, "Post Processing", "chain" }; SettingValue mAutoExposureSpeed{ mIndex, "Post Processing", "auto exposure speed", makeMaxStrictSanitizerFloat(0.0001f) }; SettingValue mTransparentPostpass{ mIndex, "Post Processing", "transparent postpass" };