Apply camera setting changes immediately. Remove current value check for shader setting changes.

deque
cc9cii 10 years ago
parent 6e8977348a
commit f0c739b763

@ -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…
Cancel
Save