mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
Apply camera setting changes immediately. Remove current value check for shader setting changes.
This commit is contained in:
parent
6e8977348a
commit
f0c739b763
2 changed files with 11 additions and 7 deletions
|
@ -83,7 +83,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
|
|||
fastFactor->setWidgetWidth (10);
|
||||
fastFactor->setViewLocation(1, 2);
|
||||
|
||||
Setting *farClipDist = createSetting (Type_SpinBox, section, "far clip distance");
|
||||
Setting *farClipDist = createSetting (Type_DoubleSpinBox, section, "far clip distance");
|
||||
farClipDist->setDefaultValue(300000);
|
||||
farClipDist->setEditorSetting(true);
|
||||
farClipDist->setColumnSpan (1);
|
||||
|
@ -483,15 +483,13 @@ void CSMSettings::UserSettings::updateUserSetting(const QString &settingKey,
|
|||
{
|
||||
mSettingDefinitions->setValue (settingKey ,list);
|
||||
|
||||
if(settingKey == "Objects/num_lights"
|
||||
&& mSettingDefinitions->value(settingKey).toString() != list.at(0))
|
||||
if(settingKey == "Objects/num_lights" && !list.empty())
|
||||
{
|
||||
sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString());
|
||||
}
|
||||
else if(settingKey == "Objects/shaders"
|
||||
&& mSettingDefinitions->value(settingKey).toString() != list.at(0))
|
||||
else if(settingKey == "Objects/shaders" && !list.empty())
|
||||
{
|
||||
sh::Factory::getInstance ().setShadersEnabled (list.at(0) == "true" ? true : false);
|
||||
sh::Factory::getInstance ().setShadersEnabled (list.at(0).toStdString() == "true" ? true : false);
|
||||
}
|
||||
|
||||
emit userSettingUpdated (settingKey, list);
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace CSVRender
|
|||
|
||||
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
||||
|
||||
int farClipDist = userSettings.setting("Scene/far clip distance", QString("300000")).toInt();
|
||||
float farClipDist = userSettings.setting("Scene/far clip distance", QString("300000")).toFloat();
|
||||
mCamera->setFarClipDistance (farClipDist);
|
||||
|
||||
mFastFactor = userSettings.setting("Scene/fast factor", QString("4")).toInt();
|
||||
|
@ -412,6 +412,12 @@ namespace CSVRender
|
|||
if(key.contains(QRegExp("^\\b(Objects|Shader|Scene)", Qt::CaseInsensitive)))
|
||||
flagAsModified();
|
||||
|
||||
if(key == "Objects/far clip distance" && !list.empty())
|
||||
{
|
||||
if(mCamera->getFarClipDistance() != list.at(0).toFloat())
|
||||
mCamera->setFarClipDistance(list.at(0).toFloat());
|
||||
}
|
||||
|
||||
// minimise unnecessary ogre window creation by updating only when there is a change
|
||||
if(key == "Video/antialiasing")
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue