diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index bc197ab48..156bff22a 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -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); diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 9ff9ac4db..3ca2a171c 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -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") {