From 94d8f669acc57d670000498edf22589f7b178af0 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 09:58:13 -0700 Subject: DRTVWR-592: Add debug options LocalTerrainAssetN. Fix PBR terrain texture flickering --- indra/newview/llviewercontrol.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index aae4409167..4e0ad11597 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -54,6 +54,7 @@ #include "llvotree.h" #include "llvovolume.h" #include "llworld.h" +#include "llvlcomposition.h" #include "pipeline.h" #include "llviewerjoystick.h" #include "llviewerobjectlist.h" @@ -656,6 +657,16 @@ void handleFPSTuningStrategyChanged(const LLSD& newValue) const auto newval = gSavedSettings.getU32("TuningFPSStrategy"); LLPerfStats::tunables.userFPSTuningStrategy = newval; } + +void handleLocalTerrainChanged(const LLSD& newValue) +{ + for (U32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) + { + const auto setting = gSavedSettings.getString(std::string("LocalTerrainAsset") + std::to_string(i + 1)); + const LLUUID materialID(setting); + gLocalTerrainMaterials.setDetailAssetID(i, materialID); + } +} //////////////////////////////////////////////////////////////////////////// LLPointer setting_get_control(LLControlGroup& group, const std::string& setting) @@ -834,6 +845,10 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "AutoTuneImpostorFarAwayDistance", handleUserImpostorDistanceChanged); setting_setup_signal_listener(gSavedSettings, "AutoTuneImpostorByDistEnabled", handleUserImpostorByDistEnabledChanged); setting_setup_signal_listener(gSavedSettings, "TuningFPSStrategy", handleFPSTuningStrategyChanged); + setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset1", handleLocalTerrainChanged); + setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset2", handleLocalTerrainChanged); + setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset3", handleLocalTerrainChanged); + setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset4", handleLocalTerrainChanged); setting_setup_signal_listener(gSavedPerAccountSettings, "AvatarHoverOffsetZ", handleAvatarHoverOffsetChanged); } -- cgit v1.2.3 From dfa19c5e436edb102d8bd121c853153303631b4d Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:33:16 -0700 Subject: DRTVWR-592: PBR terrain fallback for Mac/Intel: Drop emissive texture. Bump featuretable. --- indra/newview/llviewercontrol.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 4e0ad11597..41b13cacbb 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -702,6 +702,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "FirstPersonAvatarVisible", handleRenderAvatarMouselookChanged); setting_setup_signal_listener(gSavedSettings, "RenderFarClip", handleRenderFarClipChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainDetail", handleTerrainDetailChanged); + setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRDetail", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "OctreeStaticObjectSizeFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeDistanceFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeMaxNodeCapacity", handleRepartition); -- cgit v1.2.3 From b9ba57fd0004751dfbcbea90264a6e16c5849e5e Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:38:42 -0700 Subject: DRTVWR-592: (WIP) Fix terrain PBR texture repeat seam. Legacy terrain texture repeats currently broken --- indra/newview/llviewercontrol.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 41b13cacbb..baf5480c6a 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -124,6 +124,15 @@ static bool handleTerrainDetailChanged(const LLSD& newvalue) return true; } +static bool handleTerrainScaleChanged(const LLSD& newvalue) +{ + F64 scale = newvalue.asReal(); + if (scale != 0.0) + { + LLDrawPoolTerrain::sDetailScale = F32(1.0 / scale); + } + return true; +} static bool handleDebugAvatarJointsChanged(const LLSD& newvalue) { @@ -702,6 +711,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "FirstPersonAvatarVisible", handleRenderAvatarMouselookChanged); setting_setup_signal_listener(gSavedSettings, "RenderFarClip", handleRenderFarClipChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainDetail", handleTerrainDetailChanged); + setting_setup_signal_listener(gSavedSettings, "RenderTerrainScale", handleTerrainScaleChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRDetail", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "OctreeStaticObjectSizeFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeDistanceFactor", handleRepartition); -- cgit v1.2.3 From 35d889f7af9686b79fe0e5255121a444a044beab Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:38:48 -0700 Subject: DRTVWR-592: Create separate config option for terrain repeats. Clean up debug --- indra/newview/llviewercontrol.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index baf5480c6a..8ee675820c 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -134,6 +134,16 @@ static bool handleTerrainScaleChanged(const LLSD& newvalue) return true; } +static bool handlePBRTerrainScaleChanged(const LLSD& newvalue) +{ + F64 scale = newvalue.asReal(); + if (scale != 0.0) + { + LLDrawPoolTerrain::sPBRDetailScale = F32(1.0 / scale); + } + return true; +} + static bool handleDebugAvatarJointsChanged(const LLSD& newvalue) { std::string new_string = newvalue.asString(); @@ -712,6 +722,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderFarClip", handleRenderFarClipChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainDetail", handleTerrainDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainScale", handleTerrainScaleChanged); + setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRScale", handlePBRTerrainScaleChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRDetail", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "OctreeStaticObjectSizeFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeDistanceFactor", handleRepartition); -- cgit v1.2.3 From d6aced7abf0c54ec94033534124025c87fb9aeb2 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:38:54 -0700 Subject: DRTVWR-592: Remove WIP separate code path for terrain geometry rebuilds for PBR as that is not needed at the moment --- indra/newview/llviewercontrol.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 8ee675820c..ea821004a3 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -118,12 +118,6 @@ static bool handleRenderFarClipChanged(const LLSD& newvalue) return false; } -static bool handleTerrainDetailChanged(const LLSD& newvalue) -{ - LLDrawPoolTerrain::sDetailMode = newvalue.asInteger(); - return true; -} - static bool handleTerrainScaleChanged(const LLSD& newvalue) { F64 scale = newvalue.asReal(); @@ -720,7 +714,6 @@ void settings_setup_listeners() { setting_setup_signal_listener(gSavedSettings, "FirstPersonAvatarVisible", handleRenderAvatarMouselookChanged); setting_setup_signal_listener(gSavedSettings, "RenderFarClip", handleRenderFarClipChanged); - setting_setup_signal_listener(gSavedSettings, "RenderTerrainDetail", handleTerrainDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainScale", handleTerrainScaleChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRScale", handlePBRTerrainScaleChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRDetail", handleSetShaderChanged); -- cgit v1.2.3 From 2dc3f3ade165d7d15d8579a0f04b72f6aa56c7fe Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:39:16 -0700 Subject: DRTVWR-592: Add triplanar mapping setting, gate to High graphics setting or higher, bump feature table --- indra/newview/llviewercontrol.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index ea821004a3..19999545b6 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -717,6 +717,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderTerrainScale", handleTerrainScaleChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRScale", handlePBRTerrainScaleChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRDetail", handleSetShaderChanged); + setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRPlanarSampleCount", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "OctreeStaticObjectSizeFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeDistanceFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeMaxNodeCapacity", handleRepartition); -- cgit v1.2.3 From ed973f4cbc58b5460513be709a0a23f0caa1120c Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:39:22 -0700 Subject: DRTVWR-592: Add test config for triplanar mapping blend strength --- indra/newview/llviewercontrol.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 19999545b6..b6f01f2843 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -718,6 +718,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRScale", handlePBRTerrainScaleChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRDetail", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRPlanarSampleCount", handleSetShaderChanged); + setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRTriplanarBlendFactor", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "OctreeStaticObjectSizeFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeDistanceFactor", handleRepartition); setting_setup_signal_listener(gSavedSettings, "OctreeMaxNodeCapacity", handleRepartition); -- cgit v1.2.3 From 7ef2b43802da07b8f30b455448cb84bd1c26320d Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Wed, 10 Apr 2024 15:21:59 -0700 Subject: Multiple fixes for mirrors. (#1192) * #1064 Fix for mirror surfaces going black when the roughness is set too high. * #1130 Fix for the user's avatar not appearing in mouselook in a mirror. * #1059 Disable mirrors on low settings per the feature table. * #860 Modify the settings UI to better reflect that we only have two AA modes: off and FXAA. * #1191 Add some settings for mirrors in preferences. * #1185 Add support for runtime mirror resolution changing. Useful for quality settings, and auto-FPS. --- indra/newview/llviewercontrol.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index ba1add9b92..1fc51ac23c 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -437,6 +437,19 @@ static bool handleReflectionProbeDetailChanged(const LLSD& newvalue) gPipeline.createGLBuffers(); LLViewerShaderMgr::instance()->setShaders(); gPipeline.mReflectionMapManager.reset(); + gPipeline.mHeroProbeManager.reset(); + } + return true; +} + +static bool handleHeroProbeResolutionChanged(const LLSD &newvalue) +{ + if (gPipeline.isInit()) + { + LLPipeline::refreshCachedSettings(); + gPipeline.mHeroProbeManager.reset(); + gPipeline.releaseGLBuffers(); + gPipeline.createGLBuffers(); } return true; } @@ -752,6 +765,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeDetail", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderReflectionsEnabled", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderScreenSpaceReflections", handleReflectionProbeDetailChanged); + setting_setup_signal_listener(gSavedSettings, "RenderHeroProbeResolution", handleHeroProbeResolutionChanged); setting_setup_signal_listener(gSavedSettings, "RenderShadowDetail", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderDeferredSSAO", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderPerformanceTest", handleRenderPerfTestChanged); -- cgit v1.2.3 From b06a99f7c76950484972e25d9dbbee8660a6a6c3 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 15 May 2024 12:47:27 +0300 Subject: Post-merge spaces fix --- indra/newview/llviewercontrol.cpp | 476 +++++++++++++++++++------------------- 1 file changed, 238 insertions(+), 238 deletions(-) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 1fc51ac23c..9f2e9a62b7 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -1,4 +1,4 @@ -/** +/** * @file llviewercontrol.cpp * @brief Viewer configuration * @author Richard Nelson @@ -6,21 +6,21 @@ * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -30,7 +30,7 @@ #include "llviewercontrol.h" // Library includes -#include "llwindow.h" // getGamma() +#include "llwindow.h" // getGamma() // For Listeners #include "llaudioengine.h" @@ -81,15 +81,15 @@ #include #ifdef TOGGLE_HACKED_GODLIKE_VIEWER -BOOL gHackGodmode = FALSE; +BOOL gHackGodmode = FALSE; #endif // Should you contemplate changing the name "Global", please first grep for // that string literal. There are at least a couple other places in the C++ // code that assume the LLControlGroup named "Global" is gSavedSettings. -LLControlGroup gSavedSettings("Global"); // saved at end of session +LLControlGroup gSavedSettings("Global"); // saved at end of session LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session -LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session +LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warnings std::string gLastRunVersion; @@ -102,8 +102,8 @@ extern BOOL gDebugGL; static bool handleRenderAvatarMouselookChanged(const LLSD& newvalue) { - LLVOAvatar::sVisibleInFirstPerson = newvalue.asBoolean(); - return true; + LLVOAvatar::sVisibleInFirstPerson = newvalue.asBoolean(); + return true; } static bool handleRenderFarClipChanged(const LLSD& newvalue) @@ -111,9 +111,9 @@ static bool handleRenderFarClipChanged(const LLSD& newvalue) if (LLStartUp::getStartupState() >= STATE_STARTED) { F32 draw_distance = (F32)newvalue.asReal(); - gAgentCamera.mDrawDistance = draw_distance; - LLWorld::getInstance()->setLandFarClip(draw_distance); - return true; + gAgentCamera.mDrawDistance = draw_distance; + LLWorld::getInstance()->setLandFarClip(draw_distance); + return true; } return false; } @@ -125,7 +125,7 @@ static bool handleTerrainScaleChanged(const LLSD& newvalue) { LLDrawPoolTerrain::sDetailScale = F32(1.0 / scale); } - return true; + return true; } static bool handlePBRTerrainScaleChanged(const LLSD& newvalue) @@ -135,7 +135,7 @@ static bool handlePBRTerrainScaleChanged(const LLSD& newvalue) { LLDrawPoolTerrain::sPBRDetailScale = F32(1.0 / scale); } - return true; + return true; } static bool handleDebugAvatarJointsChanged(const LLSD& newvalue) @@ -147,19 +147,19 @@ static bool handleDebugAvatarJointsChanged(const LLSD& newvalue) static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue) { - if (isAgentAvatarValid()) - { - gAgentAvatarp->setHoverIfRegionEnabled(); - } - return true; + if (isAgentAvatarValid()) + { + gAgentAvatarp->setHoverIfRegionEnabled(); + } + return true; } static bool handleSetShaderChanged(const LLSD& newvalue) { - // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache - gBumpImageList.destroyGL(); - gBumpImageList.restoreGL(); + // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache + gBumpImageList.destroyGL(); + gBumpImageList.restoreGL(); if (gPipeline.isInit()) { @@ -167,9 +167,9 @@ static bool handleSetShaderChanged(const LLSD& newvalue) LLPipeline::refreshCachedSettings(); } - // else, leave terrain detail as is - LLViewerShaderMgr::instance()->setShaders(); - return true; + // else, leave terrain detail as is + LLViewerShaderMgr::instance()->setShaders(); + return true; } static bool handleRenderPerfTestChanged(const LLSD& newvalue) @@ -186,10 +186,10 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) LLPipeline::RENDER_TYPE_HUD, LLPipeline::RENDER_TYPE_CLOUDS, LLPipeline::RENDER_TYPE_HUD_PARTICLES, - LLPipeline::END_RENDER_TYPES); + LLPipeline::END_RENDER_TYPES); gPipeline.setRenderDebugFeatureControl(LLPipeline::RENDER_DEBUG_FEATURE_UI, false); } - else + else { gPipeline.setRenderTypeMask(LLPipeline::RENDER_TYPE_WL_SKY, LLPipeline::RENDER_TYPE_TERRAIN, @@ -209,55 +209,55 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) bool handleRenderTransparentWaterChanged(const LLSD& newvalue) { - if (gPipeline.isInit()) - { - gPipeline.updateRenderTransparentWater(); - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); - LLViewerShaderMgr::instance()->setShaders(); - } - LLWorld::getInstance()->updateWaterObjects(); - return true; + if (gPipeline.isInit()) + { + gPipeline.updateRenderTransparentWater(); + gPipeline.releaseGLBuffers(); + gPipeline.createGLBuffers(); + LLViewerShaderMgr::instance()->setShaders(); + } + LLWorld::getInstance()->updateWaterObjects(); + return true; } static bool handleShadowsResized(const LLSD& newvalue) { - gPipeline.requestResizeShadowTexture(); - return true; + gPipeline.requestResizeShadowTexture(); + return true; } static bool handleWindowResized(const LLSD& newvalue) { - gPipeline.requestResizeScreenTexture(); - return true; + gPipeline.requestResizeScreenTexture(); + return true; } static bool handleReleaseGLBufferChanged(const LLSD& newvalue) { - if (gPipeline.isInit()) - { - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); - } - return true; + if (gPipeline.isInit()) + { + gPipeline.releaseGLBuffers(); + gPipeline.createGLBuffers(); + } + return true; } static bool handleLUTBufferChanged(const LLSD& newvalue) { - if (gPipeline.isInit()) - { - gPipeline.releaseLUTBuffers(); - gPipeline.createLUTBuffers(); - } - return true; + if (gPipeline.isInit()) + { + gPipeline.releaseLUTBuffers(); + gPipeline.createLUTBuffers(); + } + return true; } static bool handleAnisotropicChanged(const LLSD& newvalue) { - LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean(); - LLImageGL::dirtyTexOptions(); - return true; + LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean(); + LLImageGL::dirtyTexOptions(); + return true; } static bool handleVSyncChanged(const LLSD& newvalue) @@ -276,62 +276,62 @@ static bool handleVSyncChanged(const LLSD& newvalue) static bool handleVolumeLODChanged(const LLSD& newvalue) { - LLVOVolume::sLODFactor = llclamp((F32) newvalue.asReal(), 0.01f, MAX_LOD_FACTOR); - LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; - return true; + LLVOVolume::sLODFactor = llclamp((F32) newvalue.asReal(), 0.01f, MAX_LOD_FACTOR); + LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; + return true; } static bool handleAvatarLODChanged(const LLSD& newvalue) { - LLVOAvatar::sLODFactor = llclamp((F32) newvalue.asReal(), 0.f, MAX_AVATAR_LOD_FACTOR); - return true; + LLVOAvatar::sLODFactor = llclamp((F32) newvalue.asReal(), 0.f, MAX_AVATAR_LOD_FACTOR); + return true; } static bool handleAvatarPhysicsLODChanged(const LLSD& newvalue) { - LLVOAvatar::sPhysicsLODFactor = llclamp((F32) newvalue.asReal(), 0.f, MAX_AVATAR_LOD_FACTOR); - return true; + LLVOAvatar::sPhysicsLODFactor = llclamp((F32) newvalue.asReal(), 0.f, MAX_AVATAR_LOD_FACTOR); + return true; } static bool handleTerrainLODChanged(const LLSD& newvalue) { - LLVOSurfacePatch::sLODFactor = (F32)newvalue.asReal(); - //sqaure lod factor to get exponential range of [0,4] and keep - //a value of 1 in the middle of the detail slider for consistency - //with other detail sliders (see panel_preferences_graphics1.xml) - LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; - return true; + LLVOSurfacePatch::sLODFactor = (F32)newvalue.asReal(); + //sqaure lod factor to get exponential range of [0,4] and keep + //a value of 1 in the middle of the detail slider for consistency + //with other detail sliders (see panel_preferences_graphics1.xml) + LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; + return true; } static bool handleTreeLODChanged(const LLSD& newvalue) { - LLVOTree::sTreeFactor = (F32) newvalue.asReal(); - return true; + LLVOTree::sTreeFactor = (F32) newvalue.asReal(); + return true; } static bool handleFlexLODChanged(const LLSD& newvalue) { - LLVolumeImplFlexible::sUpdateFactor = (F32) newvalue.asReal(); - return true; + LLVolumeImplFlexible::sUpdateFactor = (F32) newvalue.asReal(); + return true; } static bool handleGammaChanged(const LLSD& newvalue) { - F32 gamma = (F32) newvalue.asReal(); - if (gamma == 0.0f) - { - gamma = 1.0f; // restore normal gamma - } - if (gViewerWindow && gViewerWindow->getWindow() && gamma != gViewerWindow->getWindow()->getGamma()) - { - // Only save it if it's changed - if (!gViewerWindow->getWindow()->setGamma(gamma)) - { - LL_WARNS() << "setGamma failed!" << LL_ENDL; - } - } + F32 gamma = (F32) newvalue.asReal(); + if (gamma == 0.0f) + { + gamma = 1.0f; // restore normal gamma + } + if (gViewerWindow && gViewerWindow->getWindow() && gamma != gViewerWindow->getWindow()->getGamma()) + { + // Only save it if it's changed + if (!gViewerWindow->getWindow()->setGamma(gamma)) + { + LL_WARNS() << "setGamma failed!" << LL_ENDL; + } + } - return true; + return true; } const F32 MAX_USER_FOG_RATIO = 10.f; @@ -339,93 +339,93 @@ const F32 MIN_USER_FOG_RATIO = 0.5f; static bool handleFogRatioChanged(const LLSD& newvalue) { - F32 fog_ratio = llmax(MIN_USER_FOG_RATIO, llmin((F32) newvalue.asReal(), MAX_USER_FOG_RATIO)); - gSky.setFogRatio(fog_ratio); - return true; + F32 fog_ratio = llmax(MIN_USER_FOG_RATIO, llmin((F32) newvalue.asReal(), MAX_USER_FOG_RATIO)); + gSky.setFogRatio(fog_ratio); + return true; } static bool handleMaxPartCountChanged(const LLSD& newvalue) { - LLViewerPartSim::setMaxPartCount(newvalue.asInteger()); - return true; + LLViewerPartSim::setMaxPartCount(newvalue.asInteger()); + return true; } static bool handleChatFontSizeChanged(const LLSD& newvalue) { - if(gConsole) - { - gConsole->setFontSize(newvalue.asInteger()); - } - return true; + if(gConsole) + { + gConsole->setFontSize(newvalue.asInteger()); + } + return true; } static bool handleChatPersistTimeChanged(const LLSD& newvalue) { - if(gConsole) - { - gConsole->setLinePersistTime((F32) newvalue.asReal()); - } - return true; + if(gConsole) + { + gConsole->setLinePersistTime((F32) newvalue.asReal()); + } + return true; } static bool handleConsoleMaxLinesChanged(const LLSD& newvalue) { - if(gConsole) - { - gConsole->setMaxLines(newvalue.asInteger()); - } - return true; + if(gConsole) + { + gConsole->setMaxLines(newvalue.asInteger()); + } + return true; } static void handleAudioVolumeChanged(const LLSD& newvalue) { - audio_update_volume(true); + audio_update_volume(true); } static bool handleJoystickChanged(const LLSD& newvalue) { - LLViewerJoystick::getInstance()->setCameraNeedsUpdate(TRUE); - return true; + LLViewerJoystick::getInstance()->setCameraNeedsUpdate(TRUE); + return true; } static bool handleUseOcclusionChanged(const LLSD& newvalue) { - LLPipeline::sUseOcclusion = (newvalue.asBoolean() - && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0; - return true; + LLPipeline::sUseOcclusion = (newvalue.asBoolean() + && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0; + return true; } static bool handleUploadBakedTexOldChanged(const LLSD& newvalue) { - LLPipeline::sForceOldBakedUpload = newvalue.asBoolean(); - return true; + LLPipeline::sForceOldBakedUpload = newvalue.asBoolean(); + return true; } static bool handleWLSkyDetailChanged(const LLSD&) { - if (gSky.mVOWLSkyp.notNull()) - { - gSky.mVOWLSkyp->updateGeometry(gSky.mVOWLSkyp->mDrawable); - } - return true; + if (gSky.mVOWLSkyp.notNull()) + { + gSky.mVOWLSkyp->updateGeometry(gSky.mVOWLSkyp->mDrawable); + } + return true; } static bool handleRepartition(const LLSD&) { - if (gPipeline.isInit()) - { - gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity"); - gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize"); - gObjectList.repartitionObjects(); - } - return true; + if (gPipeline.isInit()) + { + gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity"); + gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize"); + gObjectList.repartitionObjects(); + } + return true; } static bool handleRenderDynamicLODChanged(const LLSD& newvalue) { - LLPipeline::sDynamicLOD = newvalue.asBoolean(); - return true; + LLPipeline::sDynamicLOD = newvalue.asBoolean(); + return true; } static bool handleReflectionProbeDetailChanged(const LLSD& newvalue) @@ -456,161 +456,161 @@ static bool handleHeroProbeResolutionChanged(const LLSD &newvalue) static bool handleRenderDebugPipelineChanged(const LLSD& newvalue) { - gDebugPipeline = newvalue.asBoolean(); - return true; + gDebugPipeline = newvalue.asBoolean(); + return true; } static bool handleRenderResolutionDivisorChanged(const LLSD&) { - gResizeScreenTexture = TRUE; - return true; + gResizeScreenTexture = TRUE; + return true; } static bool handleDebugViewsChanged(const LLSD& newvalue) { - LLView::sDebugRects = newvalue.asBoolean(); - return true; + LLView::sDebugRects = newvalue.asBoolean(); + return true; } static bool handleLogFileChanged(const LLSD& newvalue) { - std::string log_filename = newvalue.asString(); - LLFile::remove(log_filename); - LLError::logToFile(log_filename); - return true; + std::string log_filename = newvalue.asString(); + LLFile::remove(log_filename); + LLError::logToFile(log_filename); + return true; } bool handleHideGroupTitleChanged(const LLSD& newvalue) { - gAgent.setHideGroupTitle(newvalue); - return true; + gAgent.setHideGroupTitle(newvalue); + return true; } bool handleEffectColorChanged(const LLSD& newvalue) { - gAgent.setEffectColor(LLColor4(newvalue)); - return true; + gAgent.setEffectColor(LLColor4(newvalue)); + return true; } bool handleHighResSnapshotChanged(const LLSD& newvalue) { - // High Res Snapshot active, must uncheck RenderUIInSnapshot - if (newvalue.asBoolean()) - { - gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE ); - } - return true; + // High Res Snapshot active, must uncheck RenderUIInSnapshot + if (newvalue.asBoolean()) + { + gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE ); + } + return true; } bool handleVoiceClientPrefsChanged(const LLSD& newvalue) { - if (LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->updateSettings(); - } - return true; + if (LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->updateSettings(); + } + return true; } bool handleVelocityInterpolate(const LLSD& newvalue) { - LLMessageSystem* msg = gMessageSystem; - if ( newvalue.asBoolean() ) - { - msg->newMessageFast(_PREHASH_VelocityInterpolateOn); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); - LL_INFOS() << "Velocity Interpolation On" << LL_ENDL; - } - else - { - msg->newMessageFast(_PREHASH_VelocityInterpolateOff); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); - LL_INFOS() << "Velocity Interpolation Off" << LL_ENDL; - } - return true; + LLMessageSystem* msg = gMessageSystem; + if ( newvalue.asBoolean() ) + { + msg->newMessageFast(_PREHASH_VelocityInterpolateOn); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); + LL_INFOS() << "Velocity Interpolation On" << LL_ENDL; + } + else + { + msg->newMessageFast(_PREHASH_VelocityInterpolateOff); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); + LL_INFOS() << "Velocity Interpolation Off" << LL_ENDL; + } + return true; } bool handleForceShowGrid(const LLSD& newvalue) { - LLPanelLogin::updateLocationSelectorsVisibility(); - return true; + LLPanelLogin::updateLocationSelectorsVisibility(); + return true; } bool handleLoginLocationChanged() { - /* - * This connects the default preference setting to the state of the login - * panel if it is displayed; if you open the preferences panel before - * logging in, and change the default login location there, the login - * panel immediately changes to match your new preference. - */ - std::string new_login_location = gSavedSettings.getString("LoginLocation"); - LL_DEBUGS("AppInit")< dict_list; - std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); - boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); - if (!dict_list.empty()) - { - LLSpellChecker::setUseSpellCheck(dict_list.front()); - dict_list.pop_front(); - LLSpellChecker::instance().setSecondaryDictionaries(dict_list); - return true; - } - } - LLSpellChecker::setUseSpellCheck(LLStringUtil::null); - return true; + if (gSavedSettings.getBOOL("SpellCheck")) + { + std::list dict_list; + std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); + boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); + if (!dict_list.empty()) + { + LLSpellChecker::setUseSpellCheck(dict_list.front()); + dict_list.pop_front(); + LLSpellChecker::instance().setSecondaryDictionaries(dict_list); + return true; + } + } + LLSpellChecker::setUseSpellCheck(LLStringUtil::null); + return true; } bool toggle_agent_pause(const LLSD& newvalue) { - if ( newvalue.asBoolean() ) - { - send_agent_pause(); - } - else - { - send_agent_resume(); - } - return true; + if ( newvalue.asBoolean() ) + { + send_agent_pause(); + } + else + { + send_agent_resume(); + } + return true; } bool toggle_show_navigation_panel(const LLSD& newvalue) { - bool value = newvalue.asBoolean(); + bool value = newvalue.asBoolean(); - LLNavigationBar::getInstance()->setVisible(value); - gSavedSettings.setBOOL("ShowMiniLocationPanel", !value); + LLNavigationBar::getInstance()->setVisible(value); + gSavedSettings.setBOOL("ShowMiniLocationPanel", !value); gViewerWindow->reshapeStatusBarContainer(); - return true; + return true; } bool toggle_show_mini_location_panel(const LLSD& newvalue) { - bool value = newvalue.asBoolean(); + bool value = newvalue.asBoolean(); - LLPanelTopInfoBar::getInstance()->setVisible(value); - gSavedSettings.setBOOL("ShowNavbarNavigationPanel", !value); + LLPanelTopInfoBar::getInstance()->setVisible(value); + gSavedSettings.setBOOL("ShowNavbarNavigationPanel", !value); - return true; + return true; } bool toggle_show_object_render_cost(const LLSD& newvalue) { - LLFloaterTools::sShowObjectCost = newvalue.asBoolean(); - return true; + LLFloaterTools::sShowObjectCost = newvalue.asBoolean(); + return true; } void handleTargetFPSChanged(const LLSD& newValue) @@ -757,7 +757,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderFogRatio", handleFogRatioChanged); setting_setup_signal_listener(gSavedSettings, "RenderMaxPartCount", handleMaxPartCountChanged); setting_setup_signal_listener(gSavedSettings, "RenderDynamicLOD", handleRenderDynamicLODChanged); - setting_setup_signal_listener(gSavedSettings, "RenderVSyncEnable", handleVSyncChanged); + setting_setup_signal_listener(gSavedSettings, "RenderVSyncEnable", handleVSyncChanged); setting_setup_signal_listener(gSavedSettings, "RenderDeferredNoise", handleReleaseGLBufferChanged); setting_setup_signal_listener(gSavedSettings, "RenderDebugPipeline", handleRenderDebugPipelineChanged); setting_setup_signal_listener(gSavedSettings, "RenderResolutionDivisor", handleRenderResolutionDivisorChanged); @@ -848,7 +848,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "VoiceInputAudioDevice", handleVoiceClientPrefsChanged); setting_setup_signal_listener(gSavedSettings, "VoiceOutputAudioDevice", handleVoiceClientPrefsChanged); setting_setup_signal_listener(gSavedSettings, "AudioLevelMic", handleVoiceClientPrefsChanged); - setting_setup_signal_listener(gSavedSettings, "LipSyncEnabled", handleVoiceClientPrefsChanged); + setting_setup_signal_listener(gSavedSettings, "LipSyncEnabled", handleVoiceClientPrefsChanged); setting_setup_signal_listener(gSavedSettings, "VelocityInterpolate", handleVelocityInterpolate); setting_setup_signal_listener(gSavedSettings, "QAMode", show_debug_menus); setting_setup_signal_listener(gSavedSettings, "UseDebugMenus", show_debug_menus); @@ -904,21 +904,21 @@ static LLCachedControl test_BrowserHomePage("BrowserHomePage", "hah void test_cached_control() { #define do { TEST_LLCC(T, V) if((T)mySetting_##T != V) LL_ERRS() << "Fail "#T << LL_ENDL; } while(0) - TEST_LLCC(U32, 666); - TEST_LLCC(S32, (S32)-666); - TEST_LLCC(F32, (F32)-666.666); - TEST_LLCC(bool, true); - TEST_LLCC(BOOL, FALSE); - if((std::string)mySetting_string != "Default String Value") LL_ERRS() << "Fail string" << LL_ENDL; - TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f)); - TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f)); - TEST_LLCC(LLRect, LLRect(0, 0, 100, 500)); - TEST_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f)); - TEST_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f)); - TEST_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255)); -//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd); - - if((std::string)test_BrowserHomePage != "http://www.secondlife.com") LL_ERRS() << "Fail BrowserHomePage" << LL_ENDL; + TEST_LLCC(U32, 666); + TEST_LLCC(S32, (S32)-666); + TEST_LLCC(F32, (F32)-666.666); + TEST_LLCC(bool, true); + TEST_LLCC(BOOL, FALSE); + if((std::string)mySetting_string != "Default String Value") LL_ERRS() << "Fail string" << LL_ENDL; + TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f)); + TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f)); + TEST_LLCC(LLRect, LLRect(0, 0, 100, 500)); + TEST_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f)); + TEST_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f)); + TEST_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255)); +//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd); + + if((std::string)test_BrowserHomePage != "http://www.secondlife.com") LL_ERRS() << "Fail BrowserHomePage" << LL_ENDL; } #endif // TEST_CACHED_CONTROL -- cgit v1.2.3