summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterperformance.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-02-04 12:46:23 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-02-04 12:46:23 +0200
commit7af2d51f57416cb68b435cecfd4eacf5d1a4c9fc (patch)
treed5b92f8afea4b4477e6f4fb3b07e27b801da67a0 /indra/newview/llfloaterperformance.cpp
parent817f764edc6d71727300bfaba533821a8d428950 (diff)
SL-15923 increase the shortcut level to the minimum required when clicking advanced lighting or shadows settings
Diffstat (limited to 'indra/newview/llfloaterperformance.cpp')
-rw-r--r--indra/newview/llfloaterperformance.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp
index 9cb3c4ce66..e45d7a0c73 100644
--- a/indra/newview/llfloaterperformance.cpp
+++ b/indra/newview/llfloaterperformance.cpp
@@ -32,6 +32,7 @@
#include "llavataractions.h"
#include "llavatarrendernotifier.h"
#include "llcheckboxctrl.h"
+#include "llcombobox.h"
#include "llfeaturemanager.h"
#include "llfloaterpreference.h" // LLAvatarComplexityControls
#include "llfloaterreg.h"
@@ -120,6 +121,8 @@ BOOL LLFloaterPerformance::postBuild()
mSettingsPanel->getChild<LLButton>("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this));
mSettingsPanel->getChild<LLRadioGroup>("graphics_quality")->setCommitCallback(boost::bind(&LLFloaterPerformance::onChangeQuality, this, _2));
+ mSettingsPanel->getChild<LLCheckBoxCtrl>("advanced_lighting_model")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::onClickAdvancedLighting, this));
+ mSettingsPanel->getChild<LLComboBox>("ShadowDetail")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::onClickShadows, this));
mNearbyPanel->getChild<LLButton>("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this));
mNearbyPanel->getChild<LLCheckBoxCtrl>("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this));
@@ -540,4 +543,56 @@ void LLFloaterPerformance::onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y)
}
}
+const U32 RENDER_QUALITY_LEVEL = 3;
+void LLFloaterPerformance::changeQualityLevel(const std::string& notif)
+{
+ LLNotificationsUtil::add(notif, LLSD(), LLSD(),
+ [](const LLSD&notif, const LLSD&resp)
+ {
+ S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
+ if (opt == 0)
+ {
+ LLFloaterPreference* instance = LLFloaterReg::getTypedInstance<LLFloaterPreference>("preferences");
+ if (instance)
+ {
+ gSavedSettings.setU32("RenderQualityPerformance", RENDER_QUALITY_LEVEL);
+ instance->onChangeQuality(LLSD((S32)RENDER_QUALITY_LEVEL));
+ }
+ }
+ });
+}
+
+bool is_ALM_available()
+{
+ bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump");
+ bool shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
+
+ return LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
+ bumpshiny &&
+ shaders &&
+ gGLManager.mHasFramebufferObject;
+}
+
+void LLFloaterPerformance::onClickAdvancedLighting()
+{
+ if (!is_ALM_available())
+ {
+ changeQualityLevel("AdvancedLightingConfirm");
+ }
+}
+
+void LLFloaterPerformance::onClickShadows()
+{
+ if (gSavedSettings.getBOOL("AutoFPS"))
+ {
+ LLFloaterPreference::showAutoAdjustWarning();
+ }
+ else
+ {
+ if (!is_ALM_available() || !gSavedSettings.getBOOL("RenderDeferred"))
+ {
+ changeQualityLevel("ShadowsConfirm");
+ }
+ }
+}
// EOF