From 39cc7084559db78377b28cafa05462b97e3593f9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 15 Apr 2020 19:36:37 +0300 Subject: SL-13040 Fixed crash at EnvironmentPersistAcrossLogin --- indra/newview/llenvironment.cpp | 8 ++++---- indra/newview/llsettingsvo.h | 3 +++ indra/newview/llstartup.cpp | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 0e1c4f9434..342ee3ccf5 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2800,7 +2800,7 @@ void LLEnvironment::loadSkyWaterFromSettings(const LLSD &env_data, bool &valid, } else if (env_data.has("sky_llsd")) { - LLSettingsSky::ptr_t sky = std::make_shared(env_data["sky_llsd"]); + LLSettingsSky::ptr_t sky = LLSettingsVOSky::buildSky(env_data["sky_llsd"]); setEnvironment(ENV_LOCAL, sky); valid = true; } @@ -2814,7 +2814,7 @@ void LLEnvironment::loadSkyWaterFromSettings(const LLSD &env_data, bool &valid, } else if (env_data.has("water_llsd")) { - LLSettingsWater::ptr_t sky = std::make_shared(env_data["water_llsd"]); + LLSettingsWater::ptr_t sky = LLSettingsVOWater::buildWater(env_data["water_llsd"]); setEnvironment(ENV_LOCAL, sky); valid = true; } @@ -2899,8 +2899,8 @@ bool LLEnvironment::loadFromSettings() { S32 length = env_data["day_length"].asInteger(); S32 offset = env_data["day_offset"].asInteger(); - LLSettingsDay::ptr_t day = std::make_shared(env_data["day_llsd"]); - setEnvironment(ENV_LOCAL, day, LLSettingsDay::Seconds(length), LLSettingsDay::Seconds(offset)); + LLSettingsDay::ptr_t pday = LLSettingsVODay::buildDay(env_data["day_llsd"]); + setEnvironment(ENV_LOCAL, pday, LLSettingsDay::Seconds(length), LLSettingsDay::Seconds(offset)); valid = true; } diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h index 1f29013ecf..65136ad2f5 100644 --- a/indra/newview/llsettingsvo.h +++ b/indra/newview/llsettingsvo.h @@ -158,6 +158,9 @@ class LLSettingsVODay : public LLSettingsDay public: typedef std::function asset_built_fn; + // Todo: find a way to make this cnstructor private + // It shouldn't be used outside shared_prt and LLSettingsVODay + // outside of settings only use buildDay(settings) LLSettingsVODay(const LLSD &data); static ptr_t buildDay(LLSD settings); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a1d1e85492..7673bae725 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1879,8 +1879,7 @@ bool idle_startup() display_startup(); - // Load stored local environment if needed. Only should be done once at least - // initial region data got loaded to avoid race condition with region's environment + // Load stored local environment if needed. LLEnvironment::instance().loadFromSettings(); // *TODO : Uncomment that line once the whole grid migrated to SLM and suppress it from LLAgent::handleTeleportFinished() (llagent.cpp) -- cgit v1.2.3 From a387b38d20bdbf1039c36cd7811e9cfb93809a2e Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 15 Apr 2020 09:26:29 -0700 Subject: Cleanup to coding standard --- indra/llrender/llglslshader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 384e5bf99f..8cc3c50ec2 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -485,7 +485,8 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, return success; } -BOOL LLGLSLShader::attachVertexObject(std::string object_path) { +BOOL LLGLSLShader::attachVertexObject(std::string object_path) +{ if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0) { stop_glerror(); -- cgit v1.2.3 From d43b8d8551518d95086f32f03aaee969a4b69916 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 15 Apr 2020 15:38:46 -0700 Subject: SL-13019: Add debug logging of shaders used to track down macOSX / OSX GLSL linker errors --- indra/llrender/llglslshader.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 8cc3c50ec2..74cfa60b27 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -37,6 +37,10 @@ #include "OpenGL/OpenGL.h" #endif +// Print-print list of shader included source files that are linked together via glAttachObjectARB() +// i.e. On macOS / OSX the AMD GLSL linker will display an error if a varying is left in an undefined state. +#define DEBUG_SHADER_INCLUDES 0 + // Lots of STL stuff in here, using namespace std to keep things more readable using std::vector; using std::pair; @@ -402,6 +406,10 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, mDefines["OLD_SELECT"] = "1"; #endif +#if DEBUG_SHADER_INCLUDES + fprintf(stderr, "--- %s ---\n", mName.c_str()); +#endif // DEBUG_SHADER_INCLUDES + //compile new source vector< pair >::iterator fileIter = mShaderFiles.begin(); for ( ; fileIter != mShaderFiles.end(); fileIter++ ) @@ -485,12 +493,36 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, return success; } +#if DEBUG_SHADER_INCLUDES +void dumpAttachObject( const char *func_name, GLhandleARB program_object, const std::string &object_path ) +{ + GLcharARB* info_log; + GLint info_len_expect = 0; + GLint info_len_actual = 0; + + glGetObjectParameterivARB(program_object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_len_expect); + fprintf(stderr, " * %-20s(), log size: %d, %s\n", func_name, info_len_expect, object_path.c_str()); + + if (info_len_expect > 0) + { + fprintf(stderr, " ========== %s() ========== \n", func_name); + info_log = new GLcharARB [ info_len_expect ]; + glGetInfoLogARB(program_object, info_len_expect, &info_len_actual, info_log); + fprintf(stderr, "%s\n", info_log); + delete [] info_log; + } +} +#endif // DEBUG_SHADER_INCLUDES + BOOL LLGLSLShader::attachVertexObject(std::string object_path) { if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0) { stop_glerror(); glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mVertexShaderObjects[object_path]); +#if DEBUG_SHADER_INCLUDES + dumpAttachObject("attachVertexObject", mProgramObject, object_path); +#endif // DEBUG_SHADER_INCLUDES stop_glerror(); return TRUE; } @@ -507,6 +539,9 @@ BOOL LLGLSLShader::attachFragmentObject(std::string object_path) { stop_glerror(); glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mFragmentShaderObjects[object_path]); +#if DEBUG_SHADER_INCLUDES + dumpAttachObject("attachFragmentObject", mProgramObject, object_path); +#endif // DEBUG_SHADER_INCLUDES stop_glerror(); return TRUE; } @@ -523,6 +558,10 @@ void LLGLSLShader::attachObject(GLhandleARB object) { stop_glerror(); glAttachObjectARB(mProgramObject, object); +#if DEBUG_SHADER_INCLUDES + std::string object_path("???"); + dumpAttachObject("attachObject", mProgramObject, object_path); +#endif // DEBUG_SHADER_INCLUDES stop_glerror(); } else -- cgit v1.2.3 From 11e9fbefeb11f4ed90e22e7f0a0558442317875e Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Thu, 2 Apr 2020 10:55:31 -0700 Subject: Fixed -Wstring-plus-int related errors for compatibility with Xcode-11.4 --- indra/llcommon/llsdutil.cpp | 2 +- indra/newview/llcommandhandler.cpp | 2 +- indra/newview/llxmlrpclistener.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 6a23c443a0..1f8384f415 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -506,7 +506,7 @@ struct Data const char* name; } typedata[] = { -#define def(type) { LLSD::type, #type + 4 } +#define def(type) { LLSD::type, &#type[4] } def(TypeUndefined), def(TypeBoolean), def(TypeInteger), diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 76d965b1f1..23e2271eae 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -222,7 +222,7 @@ struct symbol_info #define ent(SYMBOL) \ { \ - #SYMBOL + 28, /* skip "LLCommandHandler::UNTRUSTED_" prefix */ \ + &#SYMBOL[28], /* skip "LLCommandHandler::UNTRUSTED_" prefix */ \ SYMBOL \ } diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index 0693d08dfb..0daf3e761d 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -100,7 +100,7 @@ public: { // from curl.h // skip the "CURLE_" prefix for each of these strings -#define def(sym) (mMap[sym] = #sym + 6) +#define def(sym) (mMap[sym] = &#sym[6]) def(CURLE_OK); def(CURLE_UNSUPPORTED_PROTOCOL); /* 1 */ def(CURLE_FAILED_INIT); /* 2 */ -- cgit v1.2.3 From 224a4e09922a5ae425bdfcc0d1d9e34d82ca4ba7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 21 Feb 2020 23:38:39 +0200 Subject: SL-12678 Remove automatic retry of login Cherry-pick the retry disable into DRTVWR-510 --- indra/newview/lllogininstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 8a69acb8dc..873531ef22 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -62,7 +62,7 @@ #include #include -const S32 LOGIN_MAX_RETRIES = 3; +const S32 LOGIN_MAX_RETRIES = 0; // Viewer should not autmatically retry login const F32 LOGIN_SRV_TIMEOUT_MIN = 10; const F32 LOGIN_SRV_TIMEOUT_MAX = 120; const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time -- cgit v1.2.3 From ba6004d69e6cc88066cdd6554c5015c855dd01ab Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 24 Apr 2020 15:31:51 -0700 Subject: DRTVWR-510 Cleanup: Fix copy-pasta typo of camera matrices --- indra/newview/llviewerwindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ae1eec81e0..d686aa7df9 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -709,32 +709,32 @@ public: } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10], gGLProjection[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10], gGLProjection[11])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6], gGLProjection[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6], gGLProjection[7])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2], gGLProjection[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2], gGLProjection[3])); ypos += y_inc; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14], gGLModelView[15])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14], gGLModelView[15])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10], gGLModelView[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10], gGLModelView[11])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6], gGLModelView[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6], gGLModelView[7])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2], gGLModelView[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2], gGLModelView[3])); ypos += y_inc; addText(xpos, ypos, "View Matrix"); -- cgit v1.2.3 From 1062efd059874ddce380bfa9d2305bcd85127a16 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 27 Apr 2020 15:27:31 -0700 Subject: DRTVWR-510 Cleanup: Remove (redundant) last columns from Debug Camera matrices as they are static. --- indra/newview/llviewerwindow.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d686aa7df9..bce742e513 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -709,32 +709,33 @@ public: } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); + // Projection last column is always <0,0,-1,0> + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10], gGLProjection[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6], gGLProjection[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2], gGLProjection[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2])); ypos += y_inc; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14], gGLModelView[15])); + // View last column is always <0,0,0,1> + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10], gGLModelView[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6], gGLModelView[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2], gGLModelView[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2])); ypos += y_inc; addText(xpos, ypos, "View Matrix"); -- cgit v1.2.3 From 88eca95208b7510196bcbc8a9fdcf11653aa3506 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 27 Apr 2020 15:30:54 -0700 Subject: SL-12971: Add logging of Display Devices -- useful on dual GPU machines --- indra/llwindow/llwindowwin32.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 3c69aa98c4..4a13c73c8c 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -676,6 +676,37 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // TrackMouseEvent( &track_mouse_event ); // } + // SL-12971 dual GPU display + DISPLAY_DEVICEA display_device; + int display_index = -1; + DWORD display_flags = 0; // EDD_GET_DEVICE_INTERFACE_NAME ? + const size_t display_bytes = sizeof(display_device); + + do + { + if (display_index >= 0) + { + // CHAR DeviceName [ 32] Adapter name + // CHAR DeviceString[128] + CHAR text[256]; + + size_t name_len = strlen(display_device.DeviceName ); + size_t desc_len = strlen(display_device.DeviceString); + + CHAR *name = name_len ? display_device.DeviceName : "???"; + CHAR *desc = desc_len ? display_device.DeviceString : "???"; + + sprintf(text, "Display Device %d: %s, %s", display_index, name, desc); + LL_INFOS("Window") << text << LL_ENDL; + } + + ::ZeroMemory(&display_device,display_bytes); + display_device.cb = display_bytes; + + display_index++; + } while( EnumDisplayDevicesA(NULL, display_index, &display_device, display_flags )); + + LL_INFOS("Window") << "Total Display Devices: " << display_index << LL_ENDL; //----------------------------------------------------------------------- // Create GL drawing context -- cgit v1.2.3 From c21d3621ec0431ae943b7952a0c207bac8ac413a Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 09:12:32 -0700 Subject: DRTVWR-510: Cleanup: Add link for Optimus global variable for nVidia driver. --- indra/llrender/llgl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index c01c15391d..757f71cb65 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2632,6 +2632,7 @@ LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_w #if LL_WINDOWS // Expose desired use of high-performance graphics processor to Optimus driver +// https://docs.nvidia.com/gameworks/content/technologies/desktop/optimus.htm extern "C" { _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; -- cgit v1.2.3 From 7e107328216556ed5085a050f0aaa1487b183896 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 17:19:59 -0700 Subject: DRTVWR-510 Cleanup: Align camera matrices columns for consistent placement to improve readability --- indra/newview/llviewerwindow.cpp | 97 ++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 23 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bce742e513..6a92e35ab6 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -311,6 +311,66 @@ RecordToChatConsole::RecordToChatConsole(): mRecorder->showMultiline(true); } +//////////////////////////////////////////////////////////////////////////// +// +// Print Utility +// + +// Convert a normalized float (-1.0 <= x <= +1.0) to a fixed 1.4 format string: +// +// s#.#### +// +// Where: +// s sign character; space if x is positiv, minus if negative +// # decimal digits +// +// This is similar to printf("%+.4f") except positive numbers are NOT cluttered with a leading '+' sign. +void normalized_float_to_string(const float x, char *out_str) +{ + static const unsigned char DECIMAL_BCD2[] = + { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99 + }; + + int neg = (x < 0); + int rem = neg + ? (int)(x * -10000.) + : (int)(x * 10000.); + + int d10 = rem % 100; rem /= 100; + int d32 = rem % 100; rem /= 100; + + out_str[7] = 0; + out_str[6] = '0' + ((DECIMAL_BCD2[ d10 ] >> 0) & 0xF); + out_str[5] = '0' + ((DECIMAL_BCD2[ d10 ] >> 4) & 0xF); + out_str[4] = '0' + ((DECIMAL_BCD2[ d32 ] >> 0) & 0xF); + out_str[3] = '0' + ((DECIMAL_BCD2[ d32 ] >> 4) & 0xF); + out_str[2] = '.'; + out_str[1] = '0' + (rem & 1); + out_str[0] = " -"[neg]; // Could always show '+' for positive but this clutters up the common case +} + +// normalized float +#define MATRIX_ROW_N32_TO_STR( matrix_row, i ) \ + normalized_float_to_string( matrix_row[i+0], x_str ); \ + normalized_float_to_string( matrix_row[i+1], y_str ); \ + normalized_float_to_string( matrix_row[i+2], z_str ); + +// regular float +#define MATRIX_ROW_F32_TO_STR( matrix_row, i ) \ + sprintf(x_str, "%-9.2f", matrix_row[i+0] ); \ + sprintf(y_str, "%-9.2f", matrix_row[i+1] ); \ + sprintf(z_str, "%-9.2f", matrix_row[i+2] ); + //////////////////////////////////////////////////////////////////////////// // // LLDebugText @@ -709,34 +769,25 @@ public: } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { - // Projection last column is always <0,0,-1,0> - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14])); - ypos += y_inc; + char x_str[16]; + char y_str[16]; + char z_str[16]; - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2])); - ypos += y_inc; + // Projection last column is always <0,0,-1,0> + // Projection last row is <0,0,x> + MATRIX_ROW_N32_TO_STR(gGLProjection, 12); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; - // View last column is always <0,0,0,1> - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2])); - ypos += y_inc; + // View last column is always <0,0,0,1> + MATRIX_ROW_F32_TO_STR(gGLModelView, 12); addText(xpos, ypos, llformat("%s ""%s ""%s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; addText(xpos, ypos, "View Matrix"); ypos += y_inc; -- cgit v1.2.3 From 2054fed4ceada9620d476897500450c27c58db82 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 17:21:16 -0700 Subject: DRTVWR-510 Cleanup: Add dark background under camera matrice for contrast when against a white background --- indra/newview/llviewerwindow.cpp | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6a92e35ab6..73ce481e7b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -393,7 +393,11 @@ private: typedef std::vector line_list_t; line_list_t mLineList; LLColor4 mTextColor; - + + LLColor4 mBackColor; + LLRect mBackRectCamera1; + LLRect mBackRectCamera2; + void addText(S32 x, S32 y, const std::string &text) { mLineList.push_back(Line(text, x, y)); @@ -429,11 +433,22 @@ public: mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f ); // Draw stuff growing up from right lower corner of screen - S32 xpos = mWindow->getWorldViewWidthScaled() - 400; + S32 x_right = mWindow->getWorldViewWidthScaled(); + S32 xpos = x_right - 400; xpos = llmax(xpos, 0); S32 ypos = 64; const S32 y_inc = 20; + // Camera matrix text is hard to see again a white background + // Add a dark background underneath the matrices for readability (contrast) + mBackRectCamera1.mLeft = xpos; + mBackRectCamera1.mRight = x_right; + mBackRectCamera1.mTop = -1; + mBackRectCamera1.mBottom = -1; + mBackRectCamera2 = mBackRectCamera1; + + mBackColor = LLUIColorTable::instance().getColor( "MenuDefaultBgColor" ); + clearText(); if (gSavedSettings.getBOOL("DebugShowTime")) @@ -775,10 +790,11 @@ public: // Projection last column is always <0,0,-1,0> // Projection last row is <0,0,x> + mBackRectCamera1.mBottom = ypos - y_inc; MATRIX_ROW_N32_TO_STR(gGLProjection, 12); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; MATRIX_ROW_N32_TO_STR(gGLProjection, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLProjection, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLProjection, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera1.mTop = ypos; + MATRIX_ROW_N32_TO_STR(gGLProjection, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera2.mBottom = ypos; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; @@ -786,7 +802,7 @@ public: // View last column is always <0,0,0,1> MATRIX_ROW_F32_TO_STR(gGLModelView, 12); addText(xpos, ypos, llformat("%s ""%s ""%s", x_str, y_str, z_str)); ypos += y_inc; MATRIX_ROW_N32_TO_STR(gGLModelView, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLModelView, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera2.mTop = ypos; MATRIX_ROW_N32_TO_STR(gGLModelView, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; addText(xpos, ypos, "View Matrix"); @@ -929,6 +945,18 @@ public: void draw() { LL_RECORD_BLOCK_TIME(FTM_DISPLAY_DEBUG_TEXT); + + // Camera matrix text is hard to see again a white background + // Add a dark background underneath the matrices for readability (contrast) + if (mBackRectCamera1.mTop >= 0) + { + mBackColor.setAlpha( 0.75f ); + gl_rect_2d(mBackRectCamera1, mBackColor, true); + + mBackColor.setAlpha( 0.66f ); + gl_rect_2d(mBackRectCamera2, mBackColor, true); + } + for (line_list_t::iterator iter = mLineList.begin(); iter != mLineList.end(); ++iter) { -- cgit v1.2.3 From 494d59a2616ce8a120884331a62d754c76864410 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 17:23:09 -0700 Subject: DRTVWR-510 Cleanup: Remove useless redundant debug lines clear; updateDebugText() is always called before drawDebugText() which already clears the debug text lines --- indra/newview/llviewerwindow.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 73ce481e7b..1add8767b9 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -965,7 +965,6 @@ public: LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); } - mLineList.clear(); } }; -- cgit v1.2.3 From a3d0e3f14de4ae99128424ce0f495f40bb638202 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 15 Apr 2020 09:26:29 -0700 Subject: Cleanup to coding standard --- indra/llrender/llglslshader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 384e5bf99f..8cc3c50ec2 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -485,7 +485,8 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, return success; } -BOOL LLGLSLShader::attachVertexObject(std::string object_path) { +BOOL LLGLSLShader::attachVertexObject(std::string object_path) +{ if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0) { stop_glerror(); -- cgit v1.2.3 From 2df08951e102c05335ce4143fe436b40cc34d22a Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 15 Apr 2020 15:38:46 -0700 Subject: SL-13019: Add debug logging of shaders used to track down macOSX / OSX GLSL linker errors --- indra/llrender/llglslshader.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 8cc3c50ec2..74cfa60b27 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -37,6 +37,10 @@ #include "OpenGL/OpenGL.h" #endif +// Print-print list of shader included source files that are linked together via glAttachObjectARB() +// i.e. On macOS / OSX the AMD GLSL linker will display an error if a varying is left in an undefined state. +#define DEBUG_SHADER_INCLUDES 0 + // Lots of STL stuff in here, using namespace std to keep things more readable using std::vector; using std::pair; @@ -402,6 +406,10 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, mDefines["OLD_SELECT"] = "1"; #endif +#if DEBUG_SHADER_INCLUDES + fprintf(stderr, "--- %s ---\n", mName.c_str()); +#endif // DEBUG_SHADER_INCLUDES + //compile new source vector< pair >::iterator fileIter = mShaderFiles.begin(); for ( ; fileIter != mShaderFiles.end(); fileIter++ ) @@ -485,12 +493,36 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, return success; } +#if DEBUG_SHADER_INCLUDES +void dumpAttachObject( const char *func_name, GLhandleARB program_object, const std::string &object_path ) +{ + GLcharARB* info_log; + GLint info_len_expect = 0; + GLint info_len_actual = 0; + + glGetObjectParameterivARB(program_object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_len_expect); + fprintf(stderr, " * %-20s(), log size: %d, %s\n", func_name, info_len_expect, object_path.c_str()); + + if (info_len_expect > 0) + { + fprintf(stderr, " ========== %s() ========== \n", func_name); + info_log = new GLcharARB [ info_len_expect ]; + glGetInfoLogARB(program_object, info_len_expect, &info_len_actual, info_log); + fprintf(stderr, "%s\n", info_log); + delete [] info_log; + } +} +#endif // DEBUG_SHADER_INCLUDES + BOOL LLGLSLShader::attachVertexObject(std::string object_path) { if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0) { stop_glerror(); glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mVertexShaderObjects[object_path]); +#if DEBUG_SHADER_INCLUDES + dumpAttachObject("attachVertexObject", mProgramObject, object_path); +#endif // DEBUG_SHADER_INCLUDES stop_glerror(); return TRUE; } @@ -507,6 +539,9 @@ BOOL LLGLSLShader::attachFragmentObject(std::string object_path) { stop_glerror(); glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mFragmentShaderObjects[object_path]); +#if DEBUG_SHADER_INCLUDES + dumpAttachObject("attachFragmentObject", mProgramObject, object_path); +#endif // DEBUG_SHADER_INCLUDES stop_glerror(); return TRUE; } @@ -523,6 +558,10 @@ void LLGLSLShader::attachObject(GLhandleARB object) { stop_glerror(); glAttachObjectARB(mProgramObject, object); +#if DEBUG_SHADER_INCLUDES + std::string object_path("???"); + dumpAttachObject("attachObject", mProgramObject, object_path); +#endif // DEBUG_SHADER_INCLUDES stop_glerror(); } else -- cgit v1.2.3 From 2c651f3e21c5eeb0cc361e7b03dcb507c96593d8 Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Thu, 2 Apr 2020 10:55:31 -0700 Subject: Fixed -Wstring-plus-int related errors for compatibility with Xcode-11.4 --- indra/llcommon/llsdutil.cpp | 2 +- indra/newview/llcommandhandler.cpp | 2 +- indra/newview/llxmlrpclistener.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 6a23c443a0..1f8384f415 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -506,7 +506,7 @@ struct Data const char* name; } typedata[] = { -#define def(type) { LLSD::type, #type + 4 } +#define def(type) { LLSD::type, &#type[4] } def(TypeUndefined), def(TypeBoolean), def(TypeInteger), diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 76d965b1f1..23e2271eae 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -222,7 +222,7 @@ struct symbol_info #define ent(SYMBOL) \ { \ - #SYMBOL + 28, /* skip "LLCommandHandler::UNTRUSTED_" prefix */ \ + &#SYMBOL[28], /* skip "LLCommandHandler::UNTRUSTED_" prefix */ \ SYMBOL \ } diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index 0693d08dfb..0daf3e761d 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -100,7 +100,7 @@ public: { // from curl.h // skip the "CURLE_" prefix for each of these strings -#define def(sym) (mMap[sym] = #sym + 6) +#define def(sym) (mMap[sym] = &#sym[6]) def(CURLE_OK); def(CURLE_UNSUPPORTED_PROTOCOL); /* 1 */ def(CURLE_FAILED_INIT); /* 2 */ -- cgit v1.2.3 From fd2f138ec75c092ae2a4b29127fa4c6aca50cf0e Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 24 Apr 2020 15:31:51 -0700 Subject: DRTVWR-510 Cleanup: Fix copy-pasta typo of camera matrices --- indra/newview/llviewerwindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f64dfcf0d4..aaba8dfa5c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -709,32 +709,32 @@ public: } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10], gGLProjection[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10], gGLProjection[11])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6], gGLProjection[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6], gGLProjection[7])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2], gGLProjection[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2], gGLProjection[3])); ypos += y_inc; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14], gGLModelView[15])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14], gGLModelView[15])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10], gGLModelView[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10], gGLModelView[11])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6], gGLModelView[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6], gGLModelView[7])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2], gGLModelView[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2], gGLModelView[3])); ypos += y_inc; addText(xpos, ypos, "View Matrix"); -- cgit v1.2.3 From f4da8cd3738b8dafecad3ab4f8c1d03fafdfd37e Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 27 Apr 2020 15:27:31 -0700 Subject: DRTVWR-510 Cleanup: Remove (redundant) last columns from Debug Camera matrices as they are static. --- indra/newview/llviewerwindow.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index aaba8dfa5c..7364454b45 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -709,32 +709,33 @@ public: } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); + // Projection last column is always <0,0,-1,0> + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10], gGLProjection[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6], gGLProjection[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2], gGLProjection[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2])); ypos += y_inc; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14], gGLModelView[15])); + // View last column is always <0,0,0,1> + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10], gGLModelView[11])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6], gGLModelView[7])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6])); ypos += y_inc; - addText(xpos, ypos, llformat("%.4f %.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2], gGLModelView[3])); + addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2])); ypos += y_inc; addText(xpos, ypos, "View Matrix"); -- cgit v1.2.3 From 3313f382bd872ccb68509afbbdbc51c3a96b816f Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 27 Apr 2020 15:30:54 -0700 Subject: SL-12971: Add logging of Display Devices -- useful on dual GPU machines --- indra/llwindow/llwindowwin32.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 0b3936f8a5..de83efb8a3 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -676,6 +676,37 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // TrackMouseEvent( &track_mouse_event ); // } + // SL-12971 dual GPU display + DISPLAY_DEVICEA display_device; + int display_index = -1; + DWORD display_flags = 0; // EDD_GET_DEVICE_INTERFACE_NAME ? + const size_t display_bytes = sizeof(display_device); + + do + { + if (display_index >= 0) + { + // CHAR DeviceName [ 32] Adapter name + // CHAR DeviceString[128] + CHAR text[256]; + + size_t name_len = strlen(display_device.DeviceName ); + size_t desc_len = strlen(display_device.DeviceString); + + CHAR *name = name_len ? display_device.DeviceName : "???"; + CHAR *desc = desc_len ? display_device.DeviceString : "???"; + + sprintf(text, "Display Device %d: %s, %s", display_index, name, desc); + LL_INFOS("Window") << text << LL_ENDL; + } + + ::ZeroMemory(&display_device,display_bytes); + display_device.cb = display_bytes; + + display_index++; + } while( EnumDisplayDevicesA(NULL, display_index, &display_device, display_flags )); + + LL_INFOS("Window") << "Total Display Devices: " << display_index << LL_ENDL; //----------------------------------------------------------------------- // Create GL drawing context -- cgit v1.2.3 From 05ddffb6bab6da2e2bcaaa215824b4c09d6928e7 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 09:12:32 -0700 Subject: DRTVWR-510: Cleanup: Add link for Optimus global variable for nVidia driver. --- indra/llrender/llgl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 4c56b8eace..7560fe9505 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2703,6 +2703,7 @@ LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_w #if LL_WINDOWS // Expose desired use of high-performance graphics processor to Optimus driver +// https://docs.nvidia.com/gameworks/content/technologies/desktop/optimus.htm extern "C" { _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; -- cgit v1.2.3 From c2c11a67ff594d0163f9fed9d178b1fbb6f8f25b Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 17:19:59 -0700 Subject: DRTVWR-510 Cleanup: Align camera matrices columns for consistent placement to improve readability --- indra/newview/llviewerwindow.cpp | 97 ++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 23 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7364454b45..77cccf1c3b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -311,6 +311,66 @@ RecordToChatConsole::RecordToChatConsole(): mRecorder->showMultiline(true); } +//////////////////////////////////////////////////////////////////////////// +// +// Print Utility +// + +// Convert a normalized float (-1.0 <= x <= +1.0) to a fixed 1.4 format string: +// +// s#.#### +// +// Where: +// s sign character; space if x is positiv, minus if negative +// # decimal digits +// +// This is similar to printf("%+.4f") except positive numbers are NOT cluttered with a leading '+' sign. +void normalized_float_to_string(const float x, char *out_str) +{ + static const unsigned char DECIMAL_BCD2[] = + { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99 + }; + + int neg = (x < 0); + int rem = neg + ? (int)(x * -10000.) + : (int)(x * 10000.); + + int d10 = rem % 100; rem /= 100; + int d32 = rem % 100; rem /= 100; + + out_str[7] = 0; + out_str[6] = '0' + ((DECIMAL_BCD2[ d10 ] >> 0) & 0xF); + out_str[5] = '0' + ((DECIMAL_BCD2[ d10 ] >> 4) & 0xF); + out_str[4] = '0' + ((DECIMAL_BCD2[ d32 ] >> 0) & 0xF); + out_str[3] = '0' + ((DECIMAL_BCD2[ d32 ] >> 4) & 0xF); + out_str[2] = '.'; + out_str[1] = '0' + (rem & 1); + out_str[0] = " -"[neg]; // Could always show '+' for positive but this clutters up the common case +} + +// normalized float +#define MATRIX_ROW_N32_TO_STR( matrix_row, i ) \ + normalized_float_to_string( matrix_row[i+0], x_str ); \ + normalized_float_to_string( matrix_row[i+1], y_str ); \ + normalized_float_to_string( matrix_row[i+2], z_str ); + +// regular float +#define MATRIX_ROW_F32_TO_STR( matrix_row, i ) \ + sprintf(x_str, "%-9.2f", matrix_row[i+0] ); \ + sprintf(y_str, "%-9.2f", matrix_row[i+1] ); \ + sprintf(z_str, "%-9.2f", matrix_row[i+2] ); + //////////////////////////////////////////////////////////////////////////// // // LLDebugText @@ -709,34 +769,25 @@ public: } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { - // Projection last column is always <0,0,-1,0> - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14])); - ypos += y_inc; + char x_str[16]; + char y_str[16]; + char z_str[16]; - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[8], gGLProjection[9], gGLProjection[10])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[4], gGLProjection[5], gGLProjection[6])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLProjection[0], gGLProjection[1], gGLProjection[2])); - ypos += y_inc; + // Projection last column is always <0,0,-1,0> + // Projection last row is <0,0,x> + MATRIX_ROW_N32_TO_STR(gGLProjection, 12); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; - // View last column is always <0,0,0,1> - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[12], gGLModelView[13], gGLModelView[14])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[8], gGLModelView[9], gGLModelView[10])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[4], gGLModelView[5], gGLModelView[6])); - ypos += y_inc; - - addText(xpos, ypos, llformat("%.4f %.4f %.4f", gGLModelView[0], gGLModelView[1], gGLModelView[2])); - ypos += y_inc; + // View last column is always <0,0,0,1> + MATRIX_ROW_F32_TO_STR(gGLModelView, 12); addText(xpos, ypos, llformat("%s ""%s ""%s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; addText(xpos, ypos, "View Matrix"); ypos += y_inc; -- cgit v1.2.3 From 2665cd65dd7f04db432002b0d5e1d83ba9cde222 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 17:21:16 -0700 Subject: DRTVWR-510 Cleanup: Add dark background under camera matrice for contrast when against a white background --- indra/newview/llviewerwindow.cpp | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 77cccf1c3b..fb4db23c26 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -393,7 +393,11 @@ private: typedef std::vector line_list_t; line_list_t mLineList; LLColor4 mTextColor; - + + LLColor4 mBackColor; + LLRect mBackRectCamera1; + LLRect mBackRectCamera2; + void addText(S32 x, S32 y, const std::string &text) { mLineList.push_back(Line(text, x, y)); @@ -429,11 +433,22 @@ public: mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f ); // Draw stuff growing up from right lower corner of screen - S32 xpos = mWindow->getWorldViewWidthScaled() - 400; + S32 x_right = mWindow->getWorldViewWidthScaled(); + S32 xpos = x_right - 400; xpos = llmax(xpos, 0); S32 ypos = 64; const S32 y_inc = 20; + // Camera matrix text is hard to see again a white background + // Add a dark background underneath the matrices for readability (contrast) + mBackRectCamera1.mLeft = xpos; + mBackRectCamera1.mRight = x_right; + mBackRectCamera1.mTop = -1; + mBackRectCamera1.mBottom = -1; + mBackRectCamera2 = mBackRectCamera1; + + mBackColor = LLUIColorTable::instance().getColor( "MenuDefaultBgColor" ); + clearText(); if (gSavedSettings.getBOOL("DebugShowTime")) @@ -775,10 +790,11 @@ public: // Projection last column is always <0,0,-1,0> // Projection last row is <0,0,x> + mBackRectCamera1.mBottom = ypos - y_inc; MATRIX_ROW_N32_TO_STR(gGLProjection, 12); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; MATRIX_ROW_N32_TO_STR(gGLProjection, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLProjection, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLProjection, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera1.mTop = ypos; + MATRIX_ROW_N32_TO_STR(gGLProjection, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera2.mBottom = ypos; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; @@ -786,7 +802,7 @@ public: // View last column is always <0,0,0,1> MATRIX_ROW_F32_TO_STR(gGLModelView, 12); addText(xpos, ypos, llformat("%s ""%s ""%s", x_str, y_str, z_str)); ypos += y_inc; MATRIX_ROW_N32_TO_STR(gGLModelView, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLModelView, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera2.mTop = ypos; MATRIX_ROW_N32_TO_STR(gGLModelView, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; addText(xpos, ypos, "View Matrix"); @@ -929,6 +945,18 @@ public: void draw() { LL_RECORD_BLOCK_TIME(FTM_DISPLAY_DEBUG_TEXT); + + // Camera matrix text is hard to see again a white background + // Add a dark background underneath the matrices for readability (contrast) + if (mBackRectCamera1.mTop >= 0) + { + mBackColor.setAlpha( 0.75f ); + gl_rect_2d(mBackRectCamera1, mBackColor, true); + + mBackColor.setAlpha( 0.66f ); + gl_rect_2d(mBackRectCamera2, mBackColor, true); + } + for (line_list_t::iterator iter = mLineList.begin(); iter != mLineList.end(); ++iter) { -- cgit v1.2.3 From 7449f4b6d770be9d56ee5fa3d20b6b59d816719c Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 28 Apr 2020 17:23:09 -0700 Subject: DRTVWR-510 Cleanup: Remove useless redundant debug lines clear; updateDebugText() is always called before drawDebugText() which already clears the debug text lines --- indra/newview/llviewerwindow.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fb4db23c26..e4b5c02a56 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -965,7 +965,6 @@ public: LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); } - mLineList.clear(); } }; -- cgit v1.2.3 From 39c0505412fe6cf2f9aa9681991d4a21da03319c Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 5 May 2020 12:23:59 -0600 Subject: DRTVWR-510 add code to report Vulkan capability in stats (Windows-only) --- indra/newview/llviewerstats.cpp | 42 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 85d87a43af..eccbefcd3e 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -55,7 +55,6 @@ #include "llviewerregion.h" #include "llvoavatar.h" #include "llvoavatarself.h" -#include "llviewerwindow.h" // *TODO: remove, only used for width/height #include "llworld.h" #include "llfeaturemanager.h" #include "llviewernetwork.h" @@ -582,21 +581,32 @@ void send_stats() // If the current revision is recent, ping the previous author before overriding LLSD &misc = body["stats"]["misc"]; - // Screen size so the UI team can figure out how big the widgets - // appear and use a "typical" size for end user tests. - - S32 window_width = gViewerWindow->getWindowWidthRaw(); - S32 window_height = gViewerWindow->getWindowHeightRaw(); - S32 window_size = (window_width * window_height) / 1024; - misc["string_1"] = llformat("%d", window_size); - misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value()); - - F32 unbaked_time = LLVOAvatar::sUnbakedTime * 1000.f / gFrameTimeSeconds; - misc["int_1"] = LLSD::Integer(unbaked_time); // Steve: 1.22 - F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds; - misc["int_2"] = LLSD::Integer(grey_time); // Steve: 1.22 - - LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL; +#ifdef LL_WINDOWS + // Probe for Vulkan capability (Dave Houlton 05/2020) + // + // Check for presense of a Vulkan loader dll, as a proxy for a Vulkan-capable gpu. + // False-positives and false-negatives are possible, but unlikely. We'll get a good + // approximation of Vulkan capability within current user systems from this. More + // detailed information on versions and extensions can come later. + HMODULE vulkanDll = LoadLibraryExA("vulkan-1.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); + if (NULL == vulkanDll) + { + misc["string_1"] = llformat("No Vulkan driver detected"); + } + else + { + misc["string_1"] = llformat("Vulkan driver is detected"); + FreeLibrary(vulkanDll); + } +#else + misc["string_1"] = llformat("Unused"); +#endif // LL_WINDOWS + + misc["string_2"] = llformat("Unused"); + misc["int_1"] = LLSD::Integer(0); + misc["int_2"] = LLSD::Integer(0); + + LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL; LL_INFOS() << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << LL_ENDL; body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames"); -- cgit v1.2.3 From 7bf2a1f5fef557e4531731c608c8dd924c97bc39 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 6 May 2020 09:37:16 -0700 Subject: DRTVWR-510: Add clarifaction on last rows, add pretty printing for > +/-99K, more cleanup --- indra/newview/llviewerwindow.cpp | 80 ++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1add8767b9..c1e4d1be90 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -325,6 +325,7 @@ RecordToChatConsole::RecordToChatConsole(): // # decimal digits // // This is similar to printf("%+.4f") except positive numbers are NOT cluttered with a leading '+' sign. +// NOTE: This does NOT null terminate the output void normalized_float_to_string(const float x, char *out_str) { static const unsigned char DECIMAL_BCD2[] = @@ -349,7 +350,6 @@ void normalized_float_to_string(const float x, char *out_str) int d10 = rem % 100; rem /= 100; int d32 = rem % 100; rem /= 100; - out_str[7] = 0; out_str[6] = '0' + ((DECIMAL_BCD2[ d10 ] >> 0) & 0xF); out_str[5] = '0' + ((DECIMAL_BCD2[ d10 ] >> 4) & 0xF); out_str[4] = '0' + ((DECIMAL_BCD2[ d32 ] >> 0) & 0xF); @@ -360,16 +360,49 @@ void normalized_float_to_string(const float x, char *out_str) } // normalized float -#define MATRIX_ROW_N32_TO_STR( matrix_row, i ) \ - normalized_float_to_string( matrix_row[i+0], x_str ); \ - normalized_float_to_string( matrix_row[i+1], y_str ); \ - normalized_float_to_string( matrix_row[i+2], z_str ); +// printf("%-.4f %-.4f %-.4f") +// Params: +// float &matrix_row[4] +// int matrix_cell_index +// string out_buffer (size 32) +// Note: The buffer is assumed to be pre-filled with spaces +#define MATRIX_ROW_N32_TO_STR(matrix_row, i, out_buffer) \ + normalized_float_to_string(matrix_row[i+0], out_buffer + 0); \ + normalized_float_to_string(matrix_row[i+1], out_buffer + 11); \ + normalized_float_to_string(matrix_row[i+2], out_buffer + 22); \ + out_buffer[31] = 0; + // regular float -#define MATRIX_ROW_F32_TO_STR( matrix_row, i ) \ - sprintf(x_str, "%-9.2f", matrix_row[i+0] ); \ - sprintf(y_str, "%-9.2f", matrix_row[i+1] ); \ - sprintf(z_str, "%-9.2f", matrix_row[i+2] ); +// sprintf(buffer, "%-8.2f %-8.2f %-8.2f", matrix_row[i+0], matrix_row[i+1], matrix_row[i+2]); +// Params: +// float &matrix_row[4] +// int matrix_cell_index +// char out_buffer[32] +// Note: The buffer is assumed to be pre-filled with spaces +#define MATRIX_ROW_F32_TO_STR(matrix_row, i, out_buffer) { \ + static const char *format[3] = { \ + "%-8.2f" , /* 0 */ \ + "> 99K ", /* 1 */ \ + "< -99K " /* 2 */ \ + }; \ + \ + F32 temp_0 = matrix_row[i+0]; \ + F32 temp_1 = matrix_row[i+1]; \ + F32 temp_2 = matrix_row[i+2]; \ + \ + U8 flag_0 = (((U8)(temp_0 < -99999.99)) << 1) | ((U8)(temp_0 > 99999.99)); \ + U8 flag_1 = (((U8)(temp_1 < -99999.99)) << 1) | ((U8)(temp_1 > 99999.99)); \ + U8 flag_2 = (((U8)(temp_2 < -99999.99)) << 1) | ((U8)(temp_2 > 99999.99)); \ + \ + if (temp_0 < 0.f) out_buffer[ 0] = '-'; \ + if (temp_1 < 0.f) out_buffer[11] = '-'; \ + if (temp_2 < 0.f) out_buffer[22] = '-'; \ + \ + sprintf(out_buffer+ 1,format[flag_0],fabsf(temp_0)); out_buffer[ 1+8] = ' '; \ + sprintf(out_buffer+12,format[flag_1],fabsf(temp_1)); out_buffer[12+8] = ' '; \ + sprintf(out_buffer+23,format[flag_2],fabsf(temp_2)); out_buffer[23+8] = 0 ; \ +} //////////////////////////////////////////////////////////////////////////// // @@ -784,26 +817,25 @@ public: } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { - char x_str[16]; - char y_str[16]; - char z_str[16]; - - // Projection last column is always <0,0,-1,0> - // Projection last row is <0,0,x> - mBackRectCamera1.mBottom = ypos - y_inc; - MATRIX_ROW_N32_TO_STR(gGLProjection, 12); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLProjection, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLProjection, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera1.mTop = ypos; - MATRIX_ROW_N32_TO_STR(gGLProjection, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera2.mBottom = ypos; + char camera_lines[8][32]; + memset(camera_lines, ' ', sizeof(camera_lines)); + + // Projection last column is always <0,0,-1.0001,0> + // Projection last row is always <0,0,-0.2> + mBackRectCamera1.mBottom = ypos - y_inc + 2; + MATRIX_ROW_N32_TO_STR(gGLProjection, 12,camera_lines[7]); addText(xpos, ypos, std::string(camera_lines[7])); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 8,camera_lines[6]); addText(xpos, ypos, std::string(camera_lines[6])); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLProjection, 4,camera_lines[5]); addText(xpos, ypos, std::string(camera_lines[5])); ypos += y_inc; mBackRectCamera1.mTop = ypos + 2; + MATRIX_ROW_N32_TO_STR(gGLProjection, 0,camera_lines[4]); addText(xpos, ypos, std::string(camera_lines[4])); ypos += y_inc; mBackRectCamera2.mBottom = ypos + 2; addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; // View last column is always <0,0,0,1> - MATRIX_ROW_F32_TO_STR(gGLModelView, 12); addText(xpos, ypos, llformat("%s ""%s ""%s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLModelView, 8); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; - MATRIX_ROW_N32_TO_STR(gGLModelView, 4); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; mBackRectCamera2.mTop = ypos; - MATRIX_ROW_N32_TO_STR(gGLModelView, 0); addText(xpos, ypos, llformat("%s %s %s", x_str, y_str, z_str)); ypos += y_inc; + MATRIX_ROW_F32_TO_STR(gGLModelView, 12,camera_lines[3]); addText(xpos, ypos, std::string(camera_lines[3])); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 8,camera_lines[2]); addText(xpos, ypos, std::string(camera_lines[2])); ypos += y_inc; + MATRIX_ROW_N32_TO_STR(gGLModelView, 4,camera_lines[1]); addText(xpos, ypos, std::string(camera_lines[1])); ypos += y_inc; mBackRectCamera2.mTop = ypos + 2; + MATRIX_ROW_N32_TO_STR(gGLModelView, 0,camera_lines[0]); addText(xpos, ypos, std::string(camera_lines[0])); ypos += y_inc; addText(xpos, ypos, "View Matrix"); ypos += y_inc; -- cgit v1.2.3 From 0a071f94c9863f88f960f3b09b8b177e17a0be20 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Wed, 6 May 2020 11:55:02 -0600 Subject: DRTVWR-510 cache vulkan-detect result --- indra/newview/llviewerstats.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index eccbefcd3e..04172adde9 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -588,16 +588,22 @@ void send_stats() // False-positives and false-negatives are possible, but unlikely. We'll get a good // approximation of Vulkan capability within current user systems from this. More // detailed information on versions and extensions can come later. - HMODULE vulkanDll = LoadLibraryExA("vulkan-1.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); - if (NULL == vulkanDll) - { - misc["string_1"] = llformat("No Vulkan driver detected"); - } - else + static bool vulkan_oneshot = false; + static bool vulkan_detected = false; + + if (!vulkan_oneshot) { - misc["string_1"] = llformat("Vulkan driver is detected"); - FreeLibrary(vulkanDll); + HMODULE vulkan_loader = LoadLibraryExA("vulkan-1.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); + if (NULL != vulkan_loader) + { + vulkan_detected = true; + FreeLibrary(vulkan_loader); + } + vulkan_oneshot = true; } + + misc["string_1"] = vulkan_detected ? llformat("Vulkan driver is detected") : llformat("No Vulkan driver detected"); + #else misc["string_1"] = llformat("Unused"); #endif // LL_WINDOWS -- cgit v1.2.3 From abbd55db30d455710092f58053c66d8c931af60b Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Wed, 20 May 2020 14:43:27 -0600 Subject: DRTVWR-510: Fix coord error in 'Show Color Under Cursor' --- indra/newview/llviewerwindow.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0b5ca0b79c..09f86ae391 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -841,16 +841,21 @@ public: ypos += y_inc; } // disable use of glReadPixels which messes up nVidia nSight graphics debugging - if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport) - { - U8 color[4]; - LLCoordGL coord = gViewerWindow->getCurrentMouse(); - glReadPixels(coord.mX, coord.mY, 1,1,GL_RGBA, GL_UNSIGNED_BYTE, color); - addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3])); - ypos += y_inc; - } + if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport) + { + U8 color[4]; + LLCoordGL coord = gViewerWindow->getCurrentMouse(); + + // Convert x,y to raw pixel coords + S32 x_raw = llround(coord.mX * gViewerWindow->getWindowWidthRaw() / (F32) gViewerWindow->getWindowWidthScaled()); + S32 y_raw = llround(coord.mY * gViewerWindow->getWindowHeightRaw() / (F32) gViewerWindow->getWindowHeightScaled()); + + glReadPixels(x_raw, y_raw, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, color); + addText(xpos, ypos, llformat("Pixel <%1d, %1d> R:%1d G:%1d B:%1d A:%1d", x_raw, y_raw, color[0], color[1], color[2], color[3])); + ypos += y_inc; + } - // only display these messages if we are actually rendering beacons at this moment + // only display these messages if we are actually rendering beacons at this moment if (LLPipeline::getRenderBeacons() && LLFloaterReg::instanceVisible("beacons")) { if (LLPipeline::getRenderMOAPBeacons()) -- cgit v1.2.3 From 3c4a1b3fd80fd8e174919e685166e819e311f0ef Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Thu, 21 May 2020 17:24:21 -0600 Subject: SL-13163 - Fix (revert) EEP specular contribution calculation for deferred --- .../shaders/class2/deferred/softenLightF.glsl | 34 +++------------------- 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index b0dff0c628..40f0f0448a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -127,42 +127,16 @@ void main() if (spec.a > 0.0) // specular reflection { - -#if 1 //EEP - vec3 npos = -normalize(pos.xyz); - - //vec3 ref = dot(pos+lv, norm); - vec3 h = normalize(light_dir.xyz+npos); - float nh = dot(norm.xyz, h); - float nv = dot(norm.xyz, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5)*0.4+0.5; - - float gtdenom = 2 * nh; - float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); - - if (nh > 0.0) - { - float scontrib = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da); - vec3 sp = sun_contrib*scontrib / 6.0; - sp = clamp(sp, vec3(0), vec3(1)); - bloom += dot(sp, sp) / 4.0; - color += sp * spec.rgb; - } -#else //PRODUCTION float sa = dot(refnormpersp, light_dir.xyz); - vec3 dumbshiny = sunlit*(texture2D(lightFunc, vec2(sa, spec.a)).r); - + vec3 dumbshiny = sunlit * (texture2D(lightFunc, vec2(sa, spec.a)).r); + // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib) / 6; color.rgb += spec_contrib; -#endif - } - - color.rgb = mix(color.rgb, diffuse.rgb, diffuse.a); + + color.rgb = mix(color.rgb, diffuse.rgb, diffuse.a); if (envIntensity > 0.0) { //add environmentmap -- cgit v1.2.3 From d1ed4deba0a8d895a78c871b551b47c353d54ab8 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Fri, 29 May 2020 22:37:14 +0000 Subject: edit-me-to-trigger-new-build.txt edited online with Bitbucket --- indra/edit-me-to-trigger-new-build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt index fd40910d9e..c76e18f480 100644 --- a/indra/edit-me-to-trigger-new-build.txt +++ b/indra/edit-me-to-trigger-new-build.txt @@ -1,4 +1,4 @@ - +euclid 5/29/2020 -- cgit v1.2.3 From 534d326c48271b63c4cc173f1d2382846b028021 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 4 Jun 2020 11:47:55 -0700 Subject: SL-13084: Fix clouds flipped along East/West axis to match texture preview Cloud Image and direction to match Cloud Scroll --- .../newview/app_settings/shaders/class1/deferred/cloudsV.glsl | 8 +++++++- .../app_settings/shaders/class2/windlight/cloudsV.glsl | 7 ++++++- indra/newview/llsettingsvo.cpp | 11 ++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index caa4fe1f65..7ea807804a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -78,7 +78,13 @@ void main() gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); // Texture coords - vary_texcoord0 = texcoord0; + // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll + // Keep in Sync! + // * indra\newview\llsettingsvo.cpp + // * indra\newview\app_settings\shaders\class2\windlight\cloudsV.glsl + // * indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl + vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); + vary_texcoord0.xy -= 0.5; vary_texcoord0.xy /= cloud_scale; vary_texcoord0.xy += 0.5; diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 2c1475d547..fdd90eb004 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -72,7 +72,12 @@ void main() // World / view / projection gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vary_texcoord0 = texcoord0; + // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll + // Keep in Sync! + // * indra\newview\llsettingsvo.cpp + // * indra\newview\app_settings\shaders\class2\windlight\cloudsV.glsl + // * indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl + vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); // Get relative position vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index c72a0706cd..5a4427a7b7 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -678,8 +678,17 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) { shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, light_direction.mV); + // Legacy? SETTING_CLOUD_SCROLL_RATE("cloud_scroll_rate") LLVector4 vect_c_p_d1(mSettings[SETTING_CLOUD_POS_DENSITY1]); - vect_c_p_d1 += LLVector4(LLEnvironment::instance().getCloudScrollDelta()); + LLVector4 cloud_scroll( LLEnvironment::instance().getCloudScrollDelta() ); + + // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll + // Keep in Sync! + // * indra\newview\llsettingsvo.cpp + // * indra\newview\app_settings\shaders\class2\windlight\cloudsV.glsl + // * indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl + cloud_scroll[0] = -cloud_scroll[0]; + vect_c_p_d1 += cloud_scroll; shader->uniform4fv(LLShaderMgr::CLOUD_POS_DENSITY1, 1, vect_c_p_d1.mV); LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); -- cgit v1.2.3 From e541d5962604b7938b957ce9e7867723d54b0489 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 4 Jun 2020 11:47:55 -0700 Subject: SL-13804: Fix clouds flipped along East/West axis to match texture preview Cloud Image and direction to match Cloud Scroll --- indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index 7ea807804a..62edf82cb3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -70,7 +70,9 @@ uniform float cloud_scale; // NOTE: Keep these in sync! // indra\newview\app_settings\shaders\class1\deferred\skyV.glsl // indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl +// indra\newview\app-settings\shaders\class2\windlight\cloudsV.glsl // indra\newview\lllegacyatmospherics.cpp +// indra\newview\llsettingsvo.cpp void main() { @@ -79,11 +81,7 @@ void main() // Texture coords // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll - // Keep in Sync! - // * indra\newview\llsettingsvo.cpp - // * indra\newview\app_settings\shaders\class2\windlight\cloudsV.glsl - // * indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl - vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); + vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); // See: LLSettingsVOSky::applySpecial vary_texcoord0.xy -= 0.5; vary_texcoord0.xy /= cloud_scale; -- cgit v1.2.3 From b6941de16a24d65d73370f51c07815ef56c81c4c Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 5 Jun 2020 08:44:44 -0700 Subject: SL-13084: Fix inverted cloud scroll with ALM is off --- indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index fdd90eb004..b55555ad23 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -181,7 +181,6 @@ void main() // Texture coords - vary_texcoord0 = texcoord0; vary_texcoord0.xy -= 0.5; vary_texcoord0.xy /= cloud_scale; vary_texcoord0.xy += 0.5; -- cgit v1.2.3 From 4a92f1787090009b8f11c85b6c267b099eda7dd8 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 5 Jun 2020 08:50:59 -0700 Subject: SL-13084: Move texture coords section to top in class2/windlight/cloudsV to match class1/deffered/cloudsV --- .../shaders/class2/windlight/cloudsV.glsl | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index b55555ad23..7d560b0363 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -72,6 +72,7 @@ void main() // World / view / projection gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + // Texture coords // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll // Keep in Sync! // * indra\newview\llsettingsvo.cpp @@ -79,6 +80,17 @@ void main() // * indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); + vary_texcoord0.xy -= 0.5; + vary_texcoord0.xy /= cloud_scale; + vary_texcoord0.xy += 0.5; + + vary_texcoord1 = vary_texcoord0; + vary_texcoord1.x += lightnorm.x * 0.0125; + vary_texcoord1.y += lightnorm.z * 0.0125; + + vary_texcoord2 = vary_texcoord0 * 16.; + vary_texcoord3 = vary_texcoord1 * 16.; + // Get relative position vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); @@ -180,18 +192,6 @@ void main() vary_CloudDensity = 2. * (cloud_shadow - 0.25); - // Texture coords - vary_texcoord0.xy -= 0.5; - vary_texcoord0.xy /= cloud_scale; - vary_texcoord0.xy += 0.5; - - vary_texcoord1 = vary_texcoord0; - vary_texcoord1.x += lightnorm.x * 0.0125; - vary_texcoord1.y += lightnorm.z * 0.0125; - - vary_texcoord2 = vary_texcoord0 * 16.; - vary_texcoord3 = vary_texcoord1 * 16.; - // Combine these to minimize register use vary_CloudColorAmbient += oHazeColorBelowCloud; -- cgit v1.2.3 From 8925e821e86b6067e86f5aa65fc232fb9920c1b7 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 5 Jun 2020 09:27:13 -0700 Subject: SL-13084: Add references to other common files --- .../app_settings/shaders/class1/deferred/cloudsV.glsl | 1 - .../app_settings/shaders/class2/windlight/cloudsV.glsl | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index 62edf82cb3..495daa2db6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -75,7 +75,6 @@ uniform float cloud_scale; // indra\newview\llsettingsvo.cpp void main() { - // World / view / projection gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 7d560b0363..a4389f62dc 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -36,6 +36,7 @@ ATTRIBUTE vec2 texcoord0; VARYING vec4 vary_CloudColorSun; VARYING vec4 vary_CloudColorAmbient; VARYING float vary_CloudDensity; + VARYING vec2 vary_texcoord0; VARYING vec2 vary_texcoord1; VARYING vec2 vary_texcoord2; @@ -66,19 +67,20 @@ uniform vec4 cloud_color; uniform float cloud_scale; +// NOTE: Keep these in sync! +// indra\newview\app_settings\shaders\class1\deferred\skyV.glsl +// indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl +// indra\newview\app-settings\shaders\class2\windlight\cloudsV.glsl +// indra\newview\lllegacyatmospherics.cpp +// indra\newview\llsettingsvo.cpp void main() { - // World / view / projection gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); // Texture coords // SL-13084 EEP added support for custom cloud textures -- flip them horizontally to match the preview of Clouds > Cloud Scroll - // Keep in Sync! - // * indra\newview\llsettingsvo.cpp - // * indra\newview\app_settings\shaders\class2\windlight\cloudsV.glsl - // * indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl - vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); + vary_texcoord0 = vec2( -texcoord0.x, texcoord0.y ); // See: LLSettingsVOSky::applySpecial vary_texcoord0.xy -= 0.5; vary_texcoord0.xy /= cloud_scale; -- cgit v1.2.3 From 3d872fb21f089ce06da576ee08660a0245262cc5 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Mon, 8 Jun 2020 15:47:41 -0600 Subject: SL-13281, add missing srgb->linear conversion for specular --- indra/llrender/llimagegl.cpp | 80 +++++++++++++--------- indra/llrender/llrender.cpp | 22 +++--- indra/llrender/llrendertarget.cpp | 10 +-- .../shaders/class1/deferred/multiPointLightF.glsl | 1 + 4 files changed, 69 insertions(+), 44 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index ff74380217..3b6a49735e 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -985,38 +985,56 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image) return FALSE; } - if( !mHasExplicitFormat ) - { - switch (mComponents) - { - case 1: - // Use luminance alpha (for fonts) - mFormatInternal = GL_LUMINANCE8; - mFormatPrimary = GL_LUMINANCE; - mFormatType = GL_UNSIGNED_BYTE; - break; - case 2: - // Use luminance alpha (for fonts) - mFormatInternal = GL_LUMINANCE8_ALPHA8; - mFormatPrimary = GL_LUMINANCE_ALPHA; - mFormatType = GL_UNSIGNED_BYTE; - break; - case 3: - mFormatInternal = GL_RGB8; - mFormatPrimary = GL_RGB; - mFormatType = GL_UNSIGNED_BYTE; - break; - case 4: - mFormatInternal = GL_RGBA8; - mFormatPrimary = GL_RGBA; - mFormatType = GL_UNSIGNED_BYTE; - break; - default: - LL_ERRS() << "Bad number of components for texture: " << (U32)getComponents() << LL_ENDL; - } - } + if (!mHasExplicitFormat) + { + switch (mComponents) + { + case 1: + // Use luminance alpha (for fonts) + mFormatInternal = GL_LUMINANCE8; + mFormatPrimary = GL_LUMINANCE; + mFormatType = GL_UNSIGNED_BYTE; + break; + case 2: + // Use luminance alpha (for fonts) + mFormatInternal = GL_LUMINANCE8_ALPHA8; + mFormatPrimary = GL_LUMINANCE_ALPHA; + mFormatType = GL_UNSIGNED_BYTE; + break; + case 3: +#if USE_SRGB_DECODE + if (gGLManager.mHasTexturesRGBDecode) + { + mFormatInternal = GL_SRGB8; + } + else +#endif + { + mFormatInternal = GL_RGB8; + } + mFormatPrimary = GL_RGB; + mFormatType = GL_UNSIGNED_BYTE; + break; + case 4: +#if USE_SRGB_DECODE + if (gGLManager.mHasTexturesRGBDecode) + { + mFormatInternal = GL_SRGB8_ALPHA8; + } + else +#endif + { + mFormatInternal = GL_RGBA8; + } + mFormatPrimary = GL_RGBA; + mFormatType = GL_UNSIGNED_BYTE; + break; + default: + LL_ERRS() << "Bad number of components for texture: " << (U32) getComponents() << LL_ENDL; + } + } - mCurrentDiscardLevel = discard_level; + mCurrentDiscardLevel = discard_level; mDiscardLevelInAtlas = discard_level; mTexelsInAtlas = raw_image->getWidth() * raw_image->getHeight() ; mLastBindTime = sLastFrameTime; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index ebc4659bcf..eb9da34ca8 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -849,26 +849,32 @@ void LLTexUnit::debugTextureUnit(void) } } -void LLTexUnit::setTextureColorSpace(eTextureColorSpace space) { +void LLTexUnit::setTextureColorSpace(eTextureColorSpace space) +{ mTexColorSpace = space; #if USE_SRGB_DECODE - if (gGLManager.mHasTexturesRGBDecode) { - - if (space == TCS_SRGB) { + if (gGLManager.mHasTexturesRGBDecode) + { + if (space == TCS_SRGB) + { glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_SRGB_DECODE_EXT, GL_DECODE_EXT); } - else { + else + { glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT); } - if (gDebugGL) { + if (gDebugGL) + { assert_glerror(); } } + else #endif - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT); - + { + glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT); + } } LLLightState::LLLightState(S32 index) diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 9fb4f7f2b0..e3c0255290 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -501,23 +501,23 @@ U32 LLRenderTarget::getNumTextures() const return mTex.size(); } - void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options) { - gGL.getTexUnit(channel)->bindManual(mUsage, getTexture(index)); + gGL.getTexUnit(channel)->bindManual(mUsage, getTexture(index)); bool isSRGB = false; llassert(mInternalFormat.size() > index); switch (mInternalFormat[index]) { - case GL_SRGB_ALPHA: case GL_SRGB: + case GL_SRGB8: + case GL_SRGB_ALPHA: case GL_SRGB8_ALPHA8: isSRGB = true; - break; + break; default: - break; + break; } gGL.getTexUnit(channel)->setTextureFilteringOption(filter_options); diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 0d1cc81786..c6afda375c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -77,6 +77,7 @@ void main() vec3 norm = getNorm(frag.xy); vec4 spec = texture2DRect(specularRect, frag.xy); + spec.rgb = srgb_to_linear(spec.rgb); vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; diff.rgb = srgb_to_linear(diff.rgb); -- cgit v1.2.3 From e19e628b0875a87468851825d516113534b4262f Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Mon, 8 Jun 2020 16:42:34 -0600 Subject: SL-13821 shader clean up and format --- .../shaders/class1/deferred/multiPointLightF.glsl | 204 ++++++++++----------- 1 file changed, 98 insertions(+), 106 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index c6afda375c..8c402fcb54 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -1,24 +1,24 @@ -/** - * @file multiPointLightF.glsl +/** + * @file class1/deferred/multiPointLightF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, 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$ */ @@ -36,120 +36,112 @@ out vec4 frag_color; uniform sampler2DRect depthMap; uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; -uniform samplerCube environmentMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; +uniform samplerCube environmentMap; +uniform sampler2D noiseMap; +uniform sampler2D lightFunc; - -uniform vec3 env_mat[3]; +uniform vec3 env_mat[3]; uniform float sun_wash; +uniform int light_count; +uniform vec4 light[LIGHT_COUNT]; +uniform vec4 light_col[LIGHT_COUNT]; -uniform int light_count; - -uniform vec4 light[LIGHT_COUNT]; -uniform vec4 light_col[LIGHT_COUNT]; - -VARYING vec4 vary_fragcoord; -uniform vec2 screen_res; - +uniform vec2 screen_res; uniform float far_z; +uniform mat4 inv_proj; -uniform mat4 inv_proj; +VARYING vec4 vary_fragcoord; vec4 getPosition(vec2 pos_screen); vec3 getNorm(vec2 pos_screen); vec3 srgb_to_linear(vec3 c); -void main() +void main() { - vec3 out_col = vec3(0,0,0); - #if defined(LOCAL_LIGHT_KILL) - discard; -#else - vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res; - vec3 pos = getPosition(frag.xy).xyz; - if (pos.z < far_z) - { - discard; - } - - vec3 norm = getNorm(frag.xy); - - vec4 spec = texture2DRect(specularRect, frag.xy); - spec.rgb = srgb_to_linear(spec.rgb); - vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; - diff.rgb = srgb_to_linear(diff.rgb); - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - vec3 npos = normalize(-pos); - - // As of OSX 10.6.7 ATI Apple's crash when using a variable size loop - for (int i = 0; i < LIGHT_COUNT; ++i) - { - vec3 lv = light[i].xyz-pos; - float dist = length(lv); - dist /= light[i].w; - if (dist <= 1.0) - { - float da = dot(norm, lv); - if (da > 0.0) - { - lv = normalize(lv); - da = dot(norm, lv); - - float fa = light_col[i].a+1.0; - float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); - dist_atten *= dist_atten; - - // Tweak falloff slightly to match pre-EEP attenuation - // NOTE: this magic number also shows up in a great many other places, search for dist_atten *= to audit - dist_atten *= 2.0; - - dist_atten *= noise; - - float lit = da * dist_atten; - - vec3 col = light_col[i].rgb*lit*diff; - - //vec3 col = vec3(dist2, light_col[i].a, lit); - - if (spec.a > 0.0) - { - lit = min(da*6.0, 1.0) * dist_atten; - //vec3 ref = dot(pos+lv, norm); - vec3 h = normalize(lv+npos); - float nh = dot(norm, h); - float nv = dot(norm, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5)*0.4+0.5; - - float gtdenom = 2 * nh; - float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); - - if (nh > 0.0) - { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da); - col += lit*scol*light_col[i].rgb*spec.rgb; - //col += spec.rgb; - } - } - - out_col += col; - } - } - } + discard; // Bail immediately #endif - - frag_color.rgb = out_col; - frag_color.a = 0.0; + + vec3 out_col = vec3(0, 0, 0); + vec2 frag = (vary_fragcoord.xy * 0.5 + 0.5) * screen_res; + vec3 pos = getPosition(frag.xy).xyz; + if (pos.z < far_z) + { + discard; + } + + vec3 norm = getNorm(frag.xy); + + vec4 spec = texture2DRect(specularRect, frag.xy); + spec.rgb = srgb_to_linear(spec.rgb); + vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; + diff.rgb = srgb_to_linear(diff.rgb); + + float noise = texture2D(noiseMap, frag.xy / 128.0).b; + vec3 npos = normalize(-pos); + + // As of OSX 10.6.7 ATI Apple's crash when using a variable size loop + for (int i = 0; i < LIGHT_COUNT; ++i) + { + vec3 lv = light[i].xyz - pos; + float dist = length(lv); + dist /= light[i].w; + if (dist <= 1.0) + { + float da = dot(norm, lv); + if (da > 0.0) + { + lv = normalize(lv); + da = dot(norm, lv); + + float fa = light_col[i].a + 1.0; + float dist_atten = clamp(1.0 - (dist - 1.0 * (1.0 - fa)) / fa, 0.0, 1.0); + dist_atten *= dist_atten; + + // Tweak falloff slightly to match pre-EEP attenuation + // NOTE: this magic number also shows up in a great many other places, search for dist_atten *= to audit + dist_atten *= 2.0; + + dist_atten *= noise; + + float lit = da * dist_atten; + + vec3 col = light_col[i].rgb * lit * diff; + + if (spec.a > 0.0) + { + lit = min(da * 6.0, 1.0) * dist_atten; + vec3 h = normalize(lv + npos); + float nh = dot(norm, h); + float nv = dot(norm, npos); + float vh = dot(npos, h); + float sa = nh; + float fres = pow(1 - dot(h, npos), 5) * 0.4 + 0.5; + + float gtdenom = 2 * nh; + float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); + + if (nh > 0.0) + { + float scol = fres * texture2D(lightFunc, vec2(nh, spec.a)).r * gt / (nh * da); + col += lit * scol * light_col[i].rgb * spec.rgb; + } + } + + out_col += col; + } + } + } + + frag_color.rgb = out_col; + frag_color.a = 0.0; #ifdef IS_AMD_CARD - // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. - vec4 dummy1 = light[0]; - vec4 dummy2 = light_col[0]; - vec4 dummy3 = light[LIGHT_COUNT-1]; - vec4 dummy4 = light_col[LIGHT_COUNT-1]; + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage + // awawy which leads to unfun crashes and artifacts. + vec4 dummy1 = light[0]; + vec4 dummy2 = light_col[0]; + vec4 dummy3 = light[LIGHT_COUNT - 1]; + vec4 dummy4 = light_col[LIGHT_COUNT - 1]; #endif } -- cgit v1.2.3 From c5f00ab478416cd847836dfaf6553f6f601259a2 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 16 Jun 2020 18:22:35 -0600 Subject: SL-13449, fix link errors for class1 soften shaders --- .../class1/windlight/atmosphericsVarsF.glsl | 27 +++++++++------ .../class1/windlight/atmosphericsVarsV.glsl | 40 ++++++++++++++++------ .../class1/windlight/atmosphericsVarsWaterF.glsl | 25 ++++++++------ .../class1/windlight/atmosphericsVarsWaterV.glsl | 40 +++++++++++++++------- .../class2/windlight/atmosphericsVarsF.glsl | 2 +- 5 files changed, 90 insertions(+), 44 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl index a0699affbf..3b4d358cfa 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl @@ -1,30 +1,37 @@ -/** +/** * @file class1\windlight\atmosphericVarsF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, 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$ */ - -vec3 getPositionEye() -{ - return vec3(0,0,0); -} +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; + +vec3 getAmblitColor() { return vec3(0, 0, 0); } + +vec3 getAdditiveColor() { return vary_AdditiveColor; } + +vec3 getAtmosAttenuation() { return vec3(vary_AtmosAttenuation); } + +vec3 getSunlitColor() { return vec3(0, 0, 0); } + +vec3 getPositionEye() { return vec3(0, 0, 0); } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl index bd1d150fc8..1fea2c3628 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl @@ -1,36 +1,56 @@ -/** +/** * @file class1\windlight\atmosphericVarsV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, 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$ */ - +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; -vec3 getPositionEye() +vec3 additive_color; +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; +vec3 position_eye; + +vec3 getSunlitColor() { return sunlit_color; } +void setSunlitColor(vec3 v) { sunlit_color = v; } + +vec3 getAdditiveColor() { return additive_color; } +void setAdditiveColor(vec3 v) { - return vec3(0,0,0); + additive_color = v; + vary_AdditiveColor = v; } -void setPositionEye(vec3 v) +vec3 getAmblitColor() { return amblit_color; } +void setAmblitColor(vec3 v) { amblit_color = v; } + +vec3 getAtmosAttenuation() { return atmos_attenuation; } +void setAtmosAttenuation(vec3 v) { - + atmos_attenuation = v; + vary_AtmosAttenuation = v; } + +vec3 getPositionEye() { return position_eye; } +void setPositionEye(vec3 v) { position_eye = v; } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl index 5dc086ab1e..f83434b7ec 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl @@ -1,33 +1,38 @@ -/** +/** * @file class1\windlight\atmosphericVarsWaterF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, 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$ */ - VARYING vec3 vary_PositionEye; +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; + +vec3 getSunlitColor() { return vec3(0, 0, 0); } + +vec3 getAmblitColor() { return vec3(0, 0, 0); } + +vec3 getAdditiveColor() { return vary_AdditiveColor; } -vec3 getPositionEye() -{ - return vary_PositionEye; -} +vec3 getAtmosAttenuation() { return vary_AtmosAttenuation; } +vec3 getPositionEye() { return vary_PositionEye; } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl index e59eca265a..65d1176777 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl @@ -1,37 +1,51 @@ -/** +/** * @file class1\windlight\atmosphericVarsWaterV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, 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$ */ - - + VARYING vec3 vary_PositionEye; +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; -vec3 getPositionEye() -{ - return vary_PositionEye; -} +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; + +vec3 getSunlitColor() { return sunlit_color; } +void setSunlitColor(vec3 v) { sunlit_color = v; } + +vec3 getAmblitColor() { return amblit_color; } +void setAmblitColor(vec3 v) { amblit_color = v; } -void setPositionEye(vec3 v) +vec3 getAdditiveColor() { return vary_AdditiveColor; } +void setAdditiveColor(vec3 v) { vary_AdditiveColor = v; } + +vec3 getAtmosAttenuation() { return atmos_attenuation; } +void setAtmosAttenuation(vec3 v) { - vary_PositionEye = v; + atmos_attenuation = v; + vary_AtmosAttenuation = v; } + +vec3 getPositionEye() { return vary_PositionEye; } +void setPositionEye(vec3 v) { vary_PositionEye = v; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl index d758f85d71..07733bda18 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl @@ -1,5 +1,5 @@ /** - * @file class2\wl\atmosphericVars.glsl + * @file class2\wl\atmosphericVarsF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code -- cgit v1.2.3 From aa5bd5d6f530f576556c9256714f01f2a35854bf Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Wed, 17 Jun 2020 18:53:05 -0600 Subject: SL-13163 revert 2 more instances of 'new EEP' specular calculation --- .../shaders/class1/deferred/materialF.glsl | 882 +++++++++++---------- .../shaders/class1/deferred/softenLightF.glsl | 34 +- 2 files changed, 447 insertions(+), 469 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 0afd1a9672..80d19102b6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -1,439 +1,443 @@ -/** -* @file materialF.glsl -* -* $LicenseInfo:firstyear=2007&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2007, 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$ -*/ - -/*[EXTRA_CODE_HERE]*/ - -//class1/deferred/materialF.glsl - -// This shader is used for both writing opaque/masked content to the gbuffer and writing blended content to the framebuffer during the alpha pass. - -#define DIFFUSE_ALPHA_MODE_NONE 0 -#define DIFFUSE_ALPHA_MODE_BLEND 1 -#define DIFFUSE_ALPHA_MODE_MASK 2 -#define DIFFUSE_ALPHA_MODE_EMISSIVE 3 - -uniform float emissive_brightness; // fullbright flag, 1.0 == fullbright, 0.0 otherwise -uniform int sun_up_factor; - -#ifdef WATER_FOG -vec4 applyWaterFogView(vec3 pos, vec4 color); -#endif - -vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); -vec3 scaleSoftClipFrag(vec3 l); - -vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); -vec3 fullbrightScaleSoftClip(vec3 light); - -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); - -vec3 srgb_to_linear(vec3 cs); -vec3 linear_to_srgb(vec3 cs); - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -#ifdef HAS_SUN_SHADOW -float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen); -#endif - -uniform samplerCube environmentMap; -uniform sampler2D lightFunc; - -// Inputs -uniform vec4 morphFactor; -uniform vec3 camPosLocal; -uniform mat3 env_mat; - -uniform vec3 sun_dir; -uniform vec3 moon_dir; -VARYING vec2 vary_fragcoord; - -VARYING vec3 vary_position; - -uniform mat4 proj_mat; -uniform mat4 inv_proj; -uniform vec2 screen_res; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec4 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float getAmbientClamp(); - -vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare, float ambiance) -{ - vec3 col = vec3(0); - - //get light vector - vec3 lv = lp.xyz - v; - - //get distance - float dist = length(lv); - float da = 1.0; - - dist /= la; - - if (dist > 0.0 && la > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist_atten = clamp(1.0 - (dist - 1.0*(1.0 - fa)) / fa, 0.0, 1.0); - dist_atten *= dist_atten; - dist_atten *= 2.0f; - - if (dist_atten <= 0.0) - { - return col; - } - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= dot(n, lv); - - float lit = 0.0f; - - float amb_da = ambiance; - if (da >= 0) - { - lit = max(da * dist_atten, 0.0); - col = lit * light_col * diffuse; - amb_da += (da*0.5 + 0.5) * ambiance; - } - amb_da += (da*da*0.5 + 0.5) * ambiance; - amb_da *= dist_atten; - amb_da = min(amb_da, 1.0f - lit); - - // SL-10969 need to see why these are blown out - //col.rgb += amb_da * light_col * diffuse; - - if (spec.a > 0.0) - { - //vec3 ref = dot(pos+lv, norm); - vec3 h = normalize(lv + npos); - float nh = dot(n, h); - float nv = dot(n, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; - - float gtdenom = 2 * nh; - float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); - - if (nh > 0.0) - { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); - vec3 speccol = lit*scol*light_col.rgb*spec.rgb; - speccol = clamp(speccol, vec3(0), vec3(1)); - col += speccol; - - float cur_glare = max(speccol.r, speccol.g); - cur_glare = max(cur_glare, speccol.b); - glare = max(glare, speccol.r); - glare += max(cur_glare, 0.0); - } - } - } - - return max(col, vec3(0.0, 0.0, 0.0)); -} - -#else -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif -#endif - -uniform sampler2D diffuseMap; //always in sRGB space - -#ifdef HAS_NORMAL_MAP -uniform sampler2D bumpMap; -#endif - -#ifdef HAS_SPECULAR_MAP -uniform sampler2D specularMap; - -VARYING vec2 vary_texcoord2; -#endif - -uniform float env_intensity; -uniform vec4 specular_color; // specular color RGB and specular exponent (glossiness) in alpha - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) -uniform float minimum_alpha; -#endif - -#ifdef HAS_NORMAL_MAP -VARYING vec3 vary_mat0; -VARYING vec3 vary_mat1; -VARYING vec3 vary_mat2; -VARYING vec2 vary_texcoord1; -#else -VARYING vec3 vary_normal; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -vec2 encode_normal(vec3 n); - -void main() -{ - vec2 pos_screen = vary_texcoord0.xy; - - vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy); - diffcol.rgb *= vertex_color.rgb; - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) - - // Comparing floats cast from 8-bit values, produces acne right at the 8-bit transition points - float bias = 0.001953125; // 1/512, or half an 8-bit quantization - if (diffcol.a < minimum_alpha-bias) - { - discard; - } -#endif - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) - vec3 gamma_diff = diffcol.rgb; - diffcol.rgb = srgb_to_linear(diffcol.rgb); -#endif - -#ifdef HAS_SPECULAR_MAP - vec4 spec = texture2D(specularMap, vary_texcoord2.xy); - spec.rgb *= specular_color.rgb; -#else - vec4 spec = vec4(specular_color.rgb, 1.0); -#endif - -#ifdef HAS_NORMAL_MAP - vec4 norm = texture2D(bumpMap, vary_texcoord1.xy); - - norm.xyz = norm.xyz * 2 - 1; - - vec3 tnorm = vec3(dot(norm.xyz,vary_mat0), - dot(norm.xyz,vary_mat1), - dot(norm.xyz,vary_mat2)); -#else - vec4 norm = vec4(0,0,0,1.0); - vec3 tnorm = vary_normal; -#endif - - norm.xyz = normalize(tnorm.xyz); - - vec2 abnormal = encode_normal(norm.xyz); - - vec4 final_color = diffcol; - -#if (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE) - final_color.a = emissive_brightness; -#else - final_color.a = max(final_color.a, emissive_brightness); -#endif - - vec4 final_specular = spec; - -#ifdef HAS_SPECULAR_MAP - vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity * spec.a, 0.0); - final_specular.a = specular_color.a * norm.a; -#else - vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity, 0.0); - final_specular.a = specular_color.a; -#endif - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) - - //forward rendering, output just lit sRGBA - vec3 pos = vary_position; - - float shadow = 1.0f; - -#ifdef HAS_SUN_SHADOW - shadow = sampleDirectionalShadow(pos.xyz, norm.xyz, pos_screen); -#endif - - spec = final_specular; - vec4 diffuse = final_color; - float envIntensity = final_normal.z; - - vec3 color = vec3(0,0,0); - - vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; - - float bloom = 0.0; - vec3 sunlit; - vec3 amblit; - vec3 additive; - vec3 atten; - - calcAtmosphericVars(pos.xyz, light_dir, 1.0, sunlit, amblit, additive, atten, false); - - // This call breaks the Mac GLSL compiler/linker for unknown reasons (17Mar2020) - // The call is either a no-op or a pure (pow) gamma adjustment, depending on GPU level - // TODO: determine if we want to re-apply the gamma adjustment, and if so understand & fix Mac breakage - //color = fullbrightScaleSoftClip(color); - - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - - //we're in sRGB space, so gamma correct this dot product so - // lighting from the sun stays sharp - float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0); - da = pow(da, 1.0 / 1.3); - - color = amblit; - - //darken ambient for normals perpendicular to light vector so surfaces in shadow - // and facing away from light still have some definition to them. - // do NOT gamma correct this dot product so ambient lighting stays soft - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0 - ambient); - - vec3 sun_contrib = min(da, shadow) * sunlit; - - color *= ambient; - - color += sun_contrib; - - color *= gamma_diff.rgb; - - float glare = 0.0; - - if (spec.a > 0.0) // specular reflection - { -#if 1 //EEP - - vec3 npos = -normalize(pos.xyz); - - //vec3 ref = dot(pos+lv, norm); - vec3 h = normalize(light_dir.xyz + npos); - float nh = dot(norm.xyz, h); - float nv = dot(norm.xyz, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; - - float gtdenom = 2 * nh; - float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); - - if (nh > 0.0) - { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); - vec3 sp = sun_contrib*scol / 6.0f; - sp = clamp(sp, vec3(0), vec3(1)); - bloom = dot(sp, sp) / 4.0; - color += sp * spec.rgb; - } -#else // PRODUCTION - float sa = dot(refnormpersp, sun_dir.xyz); - vec3 dumbshiny = sunlit*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r); - - // add the two types of shiny together - vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib) / 6; - - glare = max(spec_contrib.r, spec_contrib.g); - glare = max(glare, spec_contrib.b); - - color += spec_contrib; -#endif - } - - color = mix(color.rgb, diffcol.rgb, diffuse.a); - - if (envIntensity > 0.0) - { - //add environmentmap - vec3 env_vec = env_mat * refnormpersp; - - vec3 reflected_color = textureCube(environmentMap, env_vec).rgb; - - color = mix(color, reflected_color, envIntensity); - - float cur_glare = max(reflected_color.r, reflected_color.g); - cur_glare = max(cur_glare, reflected_color.b); - cur_glare *= envIntensity*4.0; - glare += cur_glare; - } - - color = atmosFragLighting(color, additive, atten); - color = scaleSoftClipFrag(color); - - //convert to linear before adding local lights - color = srgb_to_linear(color); - - vec3 npos = normalize(-pos.xyz); - - vec3 light = vec3(0, 0, 0); - -#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w ); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color += light; - - glare = min(glare, 1.0); - float al = max(diffcol.a, glare)*vertex_color.a; - - //convert to srgb as this color is being written post gamma correction - color = linear_to_srgb(color); - -#ifdef WATER_FOG - vec4 temp = applyWaterFogView(pos, vec4(color, al)); - color = temp.rgb; - al = temp.a; -#endif - - frag_color = vec4(color, al); - -#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer - - // deferred path - frag_data[0] = final_color; //gbuffer is sRGB - frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent. - frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. -#endif -} - +/** +* @file materialF.glsl +* +* $LicenseInfo:firstyear=2007&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2007, 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$ +*/ + +/*[EXTRA_CODE_HERE]*/ + +//class1/deferred/materialF.glsl + +// This shader is used for both writing opaque/masked content to the gbuffer and writing blended content to the framebuffer during the alpha pass. + +#define DIFFUSE_ALPHA_MODE_NONE 0 +#define DIFFUSE_ALPHA_MODE_BLEND 1 +#define DIFFUSE_ALPHA_MODE_MASK 2 +#define DIFFUSE_ALPHA_MODE_EMISSIVE 3 + +uniform float emissive_brightness; // fullbright flag, 1.0 == fullbright, 0.0 otherwise +uniform int sun_up_factor; + +#ifdef WATER_FOG +vec4 applyWaterFogView(vec3 pos, vec4 color); +#endif + +vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); +vec3 scaleSoftClipFrag(vec3 l); + +vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); +vec3 fullbrightScaleSoftClip(vec3 light); + +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); + +vec3 srgb_to_linear(vec3 cs); +vec3 linear_to_srgb(vec3 cs); + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +#ifdef HAS_SUN_SHADOW +float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen); +#endif + +uniform samplerCube environmentMap; +uniform sampler2D lightFunc; + +// Inputs +uniform vec4 morphFactor; +uniform vec3 camPosLocal; +uniform mat3 env_mat; + +uniform vec3 sun_dir; +uniform vec3 moon_dir; +VARYING vec2 vary_fragcoord; + +VARYING vec3 vary_position; + +uniform mat4 proj_mat; +uniform mat4 inv_proj; +uniform vec2 screen_res; + +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec4 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + +float getAmbientClamp(); + +vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare, float ambiance) +{ + vec3 col = vec3(0); + + //get light vector + vec3 lv = lp.xyz - v; + + //get distance + float dist = length(lv); + float da = 1.0; + + dist /= la; + + if (dist > 0.0 && la > 0.0) + { + //normalize light vector + lv = normalize(lv); + + //distance attenuation + float dist_atten = clamp(1.0 - (dist - 1.0*(1.0 - fa)) / fa, 0.0, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0f; + + if (dist_atten <= 0.0) + { + return col; + } + + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_pointlight); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + + //angular attenuation + da *= dot(n, lv); + + float lit = 0.0f; + + float amb_da = ambiance; + if (da >= 0) + { + lit = max(da * dist_atten, 0.0); + col = lit * light_col * diffuse; + amb_da += (da*0.5 + 0.5) * ambiance; + } + amb_da += (da*da*0.5 + 0.5) * ambiance; + amb_da *= dist_atten; + amb_da = min(amb_da, 1.0f - lit); + + // SL-10969 need to see why these are blown out + //col.rgb += amb_da * light_col * diffuse; + + if (spec.a > 0.0) + { + //vec3 ref = dot(pos+lv, norm); + vec3 h = normalize(lv + npos); + float nh = dot(n, h); + float nv = dot(n, npos); + float vh = dot(npos, h); + float sa = nh; + float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; + + float gtdenom = 2 * nh; + float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); + + if (nh > 0.0) + { + float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); + vec3 speccol = lit*scol*light_col.rgb*spec.rgb; + speccol = clamp(speccol, vec3(0), vec3(1)); + col += speccol; + + float cur_glare = max(speccol.r, speccol.g); + cur_glare = max(cur_glare, speccol.b); + glare = max(glare, speccol.r); + glare += max(cur_glare, 0.0); + } + } + } + + return max(col, vec3(0.0, 0.0, 0.0)); +} + +#else +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData +#endif +#endif + +uniform sampler2D diffuseMap; //always in sRGB space + +#ifdef HAS_NORMAL_MAP +uniform sampler2D bumpMap; +#endif + +#ifdef HAS_SPECULAR_MAP +uniform sampler2D specularMap; + +VARYING vec2 vary_texcoord2; +#endif + +uniform float env_intensity; +uniform vec4 specular_color; // specular color RGB and specular exponent (glossiness) in alpha + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) +uniform float minimum_alpha; +#endif + +#ifdef HAS_NORMAL_MAP +VARYING vec3 vary_mat0; +VARYING vec3 vary_mat1; +VARYING vec3 vary_mat2; +VARYING vec2 vary_texcoord1; +#else +VARYING vec3 vary_normal; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +vec2 encode_normal(vec3 n); + +void main() +{ + vec2 pos_screen = vary_texcoord0.xy; + + vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy); + diffcol.rgb *= vertex_color.rgb; + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) + + // Comparing floats cast from 8-bit values, produces acne right at the 8-bit transition points + float bias = 0.001953125; // 1/512, or half an 8-bit quantization + if (diffcol.a < minimum_alpha-bias) + { + discard; + } +#endif + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) + vec3 gamma_diff = diffcol.rgb; + diffcol.rgb = srgb_to_linear(diffcol.rgb); +#endif + +#ifdef HAS_SPECULAR_MAP + vec4 spec = texture2D(specularMap, vary_texcoord2.xy); + spec.rgb *= specular_color.rgb; +#else + vec4 spec = vec4(specular_color.rgb, 1.0); +#endif + +#ifdef HAS_NORMAL_MAP + vec4 norm = texture2D(bumpMap, vary_texcoord1.xy); + + norm.xyz = norm.xyz * 2 - 1; + + vec3 tnorm = vec3(dot(norm.xyz,vary_mat0), + dot(norm.xyz,vary_mat1), + dot(norm.xyz,vary_mat2)); +#else + vec4 norm = vec4(0,0,0,1.0); + vec3 tnorm = vary_normal; +#endif + + norm.xyz = normalize(tnorm.xyz); + + vec2 abnormal = encode_normal(norm.xyz); + + vec4 final_color = diffcol; + +#if (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE) + final_color.a = emissive_brightness; +#else + final_color.a = max(final_color.a, emissive_brightness); +#endif + + vec4 final_specular = spec; + +#ifdef HAS_SPECULAR_MAP + vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity * spec.a, 0.0); + final_specular.a = specular_color.a * norm.a; +#else + vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity, 0.0); + final_specular.a = specular_color.a; +#endif + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) + + //forward rendering, output just lit sRGBA + vec3 pos = vary_position; + + float shadow = 1.0f; + +#ifdef HAS_SUN_SHADOW + shadow = sampleDirectionalShadow(pos.xyz, norm.xyz, pos_screen); +#endif + + spec = final_specular; + vec4 diffuse = final_color; + float envIntensity = final_normal.z; + + vec3 color = vec3(0,0,0); + + vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; + + float bloom = 0.0; + vec3 sunlit; + vec3 amblit; + vec3 additive; + vec3 atten; + + calcAtmosphericVars(pos.xyz, light_dir, 1.0, sunlit, amblit, additive, atten, false); + + // This call breaks the Mac GLSL compiler/linker for unknown reasons (17Mar2020) + // The call is either a no-op or a pure (pow) gamma adjustment, depending on GPU level + // TODO: determine if we want to re-apply the gamma adjustment, and if so understand & fix Mac breakage + //color = fullbrightScaleSoftClip(color); + + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + + //we're in sRGB space, so gamma correct this dot product so + // lighting from the sun stays sharp + float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0); + da = pow(da, 1.0 / 1.3); + + color = amblit; + + //darken ambient for normals perpendicular to light vector so surfaces in shadow + // and facing away from light still have some definition to them. + // do NOT gamma correct this dot product so ambient lighting stays soft + float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); + ambient *= 0.5; + ambient *= ambient; + ambient = (1.0 - ambient); + + vec3 sun_contrib = min(da, shadow) * sunlit; + + color *= ambient; + + color += sun_contrib; + + color *= gamma_diff.rgb; + + float glare = 0.0; + + if (spec.a > 0.0) // specular reflection + { + /* // Reverting this specular calculation to previous 'dumbshiny' version - DJH 6/17/2020 + // Preserving the refactored version as a comment for potential reconsideration, + // overriding the general rule to avoid pollutiong the source with commented code. + // + // If you're reading this in 2021+, feel free to obliterate. + + vec3 npos = -normalize(pos.xyz); + + //vec3 ref = dot(pos+lv, norm); + vec3 h = normalize(light_dir.xyz + npos); + float nh = dot(norm.xyz, h); + float nv = dot(norm.xyz, npos); + float vh = dot(npos, h); + float sa = nh; + float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; + + float gtdenom = 2 * nh; + float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); + + if (nh > 0.0) + { + float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); + vec3 sp = sun_contrib*scol / 6.0f; + sp = clamp(sp, vec3(0), vec3(1)); + bloom = dot(sp, sp) / 4.0; + color += sp * spec.rgb; + } + */ + + float sa = dot(refnormpersp, sun_dir.xyz); + vec3 dumbshiny = sunlit * shadow * (texture2D(lightFunc, vec2(sa, spec.a)).r); + + // add the two types of shiny together + vec3 spec_contrib = dumbshiny * spec.rgb; + bloom = dot(spec_contrib, spec_contrib) / 6; + + glare = max(spec_contrib.r, spec_contrib.g); + glare = max(glare, spec_contrib.b); + + color += spec_contrib; + } + + color = mix(color.rgb, diffcol.rgb, diffuse.a); + + if (envIntensity > 0.0) + { + //add environmentmap + vec3 env_vec = env_mat * refnormpersp; + + vec3 reflected_color = textureCube(environmentMap, env_vec).rgb; + + color = mix(color, reflected_color, envIntensity); + + float cur_glare = max(reflected_color.r, reflected_color.g); + cur_glare = max(cur_glare, reflected_color.b); + cur_glare *= envIntensity*4.0; + glare += cur_glare; + } + + color = atmosFragLighting(color, additive, atten); + color = scaleSoftClipFrag(color); + + //convert to linear before adding local lights + color = srgb_to_linear(color); + + vec3 npos = normalize(-pos.xyz); + + vec3 light = vec3(0, 0, 0); + +#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w ); + + LIGHT_LOOP(1) + LIGHT_LOOP(2) + LIGHT_LOOP(3) + LIGHT_LOOP(4) + LIGHT_LOOP(5) + LIGHT_LOOP(6) + LIGHT_LOOP(7) + + color += light; + + glare = min(glare, 1.0); + float al = max(diffcol.a, glare)*vertex_color.a; + + //convert to srgb as this color is being written post gamma correction + color = linear_to_srgb(color); + +#ifdef WATER_FOG + vec4 temp = applyWaterFogView(pos, vec4(color, al)); + color = temp.rgb; + al = temp.a; +#endif + + frag_color = vec4(color, al); + +#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer + + // deferred path + frag_data[0] = final_color; //gbuffer is sRGB + frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent. + frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. +#endif +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index a5804220bc..f80f1a985a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -124,41 +124,15 @@ void main() if (spec.a > 0.0) // specular reflection { + float sa = dot(refnormpersp, light_dir.xyz); + vec3 dumbshiny = sunlit * (texture2D(lightFunc, vec2(sa, spec.a)).r); -#if 1 //EEP - vec3 npos = -normalize(pos.xyz); - - //vec3 ref = dot(pos+lv, norm); - vec3 h = normalize(light_dir.xyz+npos); - float nh = dot(norm.xyz, h); - float nv = dot(norm.xyz, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5)*0.4+0.5; - - float gtdenom = 2 * nh; - float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); - - if (nh > 0.0) - { - float scontrib = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da); - vec3 sp = sun_contrib*scontrib / 6.0; - sp = clamp(sp, vec3(0), vec3(1)); - bloom += dot(sp, sp) / 4.0; - color += sp * spec.rgb; - } -#else //PRODUCTION - float sa = dot(refnormpersp, light_dir.xyz); - vec3 dumbshiny = sunlit*(texture2D(lightFunc, vec2(sa, spec.a)).r); - // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib) / 6; + bloom = dot(spec_contrib, spec_contrib) / 6; color.rgb += spec_contrib; -#endif - } - + color.rgb = mix(color.rgb, diffuse.rgb, diffuse.a); if (envIntensity > 0.0) -- cgit v1.2.3 From b490a59ce245202fa7cc186694d5ae1ca100b9e9 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 18 Jun 2020 10:39:49 -0700 Subject: SL-9632: Fix most HUD objects incorrectly being effected by the environment lighting --- .../shaders/class1/objects/simpleV.glsl | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index a59bd9c0a6..575a641b7a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -1,4 +1,4 @@ -/** +/** * @file simpleV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -28,6 +28,9 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; +// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() +uniform int no_atmo; + ATTRIBUTE vec3 position; void passTextureIndex(); ATTRIBUTE vec2 texcoord0; @@ -46,19 +49,22 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - passTextureIndex(); - vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + + passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; - - - vec3 norm = normalize(normal_matrix * normal); + if (no_atmo == 1) + { + vertex_color = diffuse_color; + } + else + { + vec4 pos = (modelview_matrix * vert); + vec3 norm = normalize(normal_matrix * normal); - calcAtmospherics(pos.xyz); + calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, diffuse_color); - vertex_color = color; - - + vertex_color = calcLighting(pos.xyz, norm, diffuse_color); + } } -- cgit v1.2.3 From 7f9765a41cb62102c9cbde0d44151ca9f487adac Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 18 Jun 2020 15:15:54 -0700 Subject: SL-9632 Fix HUD objects to not use environment lighting --- .../shaders/class1/deferred/fullbrightShinyF.glsl | 38 +++++++++++++--------- .../class1/lighting/lightFullbrightShinyF.glsl | 20 +++++++++--- .../shaders/class1/objects/simpleV.glsl | 3 +- 3 files changed, 40 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl index bd0ad3bce8..2d40e63eff 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl @@ -42,6 +42,9 @@ VARYING vec4 vary_position; uniform samplerCube environmentMap; +// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() +uniform int no_atmo; + vec3 fullbrightShinyAtmosTransport(vec3 light); vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); vec3 fullbrightScaleSoftClip(vec3 light); @@ -51,7 +54,9 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou vec3 linear_to_srgb(vec3 c); vec3 srgb_to_linear(vec3 c); - +// See: +// class1\deferred\fullbrightShinyF.glsl +// class1\lighting\lightFullbrightShinyF.glsl void main() { #ifdef HAS_DIFFUSE_LOOKUP @@ -59,25 +64,28 @@ void main() #else vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); #endif - + color.rgb *= vertex_color.rgb; - vec3 pos = vary_position.xyz/vary_position.w; - vec3 sunlit; - vec3 amblit; - vec3 additive; - vec3 atten; + // SL-9632 HUDs are affected by Atmosphere + if (no_atmo == 0) + { + vec3 sunlit; + vec3 amblit; + vec3 additive; + vec3 atten; + vec3 pos = vary_position.xyz/vary_position.w; + + calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); - calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - float env_intensity = vertex_color.a; - color.rgb = mix(color.rgb, envColor.rgb, env_intensity); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + float env_intensity = vertex_color.a; //color.rgb = srgb_to_linear(color.rgb); - - color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten); - color.rgb = fullbrightScaleSoftClip(color.rgb); + color.rgb = mix(color.rgb, envColor.rgb, env_intensity); + color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten); + color.rgb = fullbrightScaleSoftClip(color.rgb); + } color.a = 1.0; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl index 567811cd75..3eaaa41866 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl @@ -35,20 +35,30 @@ VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; +// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() +uniform int no_atmo; + vec3 fullbrightShinyAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); +// See: +// class1\deferred\fullbrightShinyF.glsl +// class1\lighting\lightFullbrightShinyF.glsl void fullbright_shiny_lighting() { vec4 color = diffuseLookup(vary_texcoord0.xy); color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low - color.rgb = fullbrightShinyAtmosTransport(color.rgb); + // SL-9632 HUDs are affected by Atmosphere + if (no_atmo == 0) + { + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low + + color.rgb = fullbrightShinyAtmosTransport(color.rgb); - color.rgb = fullbrightScaleSoftClip(color.rgb); + color.rgb = fullbrightScaleSoftClip(color.rgb); + } color.a = 1.0; diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index 575a641b7a..9ef7704b70 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -53,7 +53,8 @@ void main() passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; - + + // SL-9632 HUDs are affected by Atmosphere if (no_atmo == 1) { vertex_color = diffuse_color; -- cgit v1.2.3 From 0e3e3db40ea3778f65b36df781f1aacb5b9bd59c Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Fri, 19 Jun 2020 16:41:19 -0600 Subject: SL-13416 eliminate sun/moon specular on shadowed surfaces --- .../shaders/class2/deferred/softenLightF.glsl | 169 +++++++++------------ 1 file changed, 76 insertions(+), 93 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 40f0f0448a..f4db53e0b7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -1,24 +1,24 @@ -/** +/** * @file class2/deferred/softenLightF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, 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$ */ @@ -39,7 +39,7 @@ uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; -uniform samplerCube environmentMap; +uniform samplerCube environmentMap; uniform sampler2D lightFunc; uniform float blur_size; @@ -50,7 +50,7 @@ uniform mat3 env_mat; uniform vec3 sun_dir; uniform vec3 moon_dir; -uniform int sun_up_factor; +uniform int sun_up_factor; VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; @@ -61,10 +61,10 @@ vec4 getPositionWithDepth(vec2 pos_screen, float depth); void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); float getAmbientClamp(); -vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); -vec3 scaleSoftClipFrag(vec3 l); -vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); -vec3 fullbrightScaleSoftClip(vec3 light); +vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); +vec3 scaleSoftClipFrag(vec3 l); +vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); +vec3 fullbrightScaleSoftClip(vec3 light); vec3 linear_to_srgb(vec3 c); vec3 srgb_to_linear(vec3 c); @@ -73,102 +73,85 @@ vec3 srgb_to_linear(vec3 c); vec4 applyWaterFogView(vec3 pos, vec4 color); #endif -void main() +void main() { - vec2 tc = vary_fragcoord.xy; - float depth = texture2DRect(depthMap, tc.xy).r; - vec4 pos = getPositionWithDepth(tc, depth); - vec4 norm = texture2DRect(normalMap, tc); + vec2 tc = vary_fragcoord.xy; + float depth = texture2DRect(depthMap, tc.xy).r; + vec4 pos = getPositionWithDepth(tc, depth); + vec4 norm = texture2DRect(normalMap, tc); float envIntensity = norm.z; - norm.xyz = getNorm(tc); - - vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; - float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0); - float light_gamma = 1.0/1.3; - da = pow(da, light_gamma); - + norm.xyz = getNorm(tc); + + vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; + float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0); + float light_gamma = 1.0 / 1.3; + da = pow(da, light_gamma); + vec4 diffuse = texture2DRect(diffuseRect, tc); - - vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); + vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; - scol_ambocc = pow(scol_ambocc, vec2(light_gamma)); + scol_ambocc = pow(scol_ambocc, vec2(light_gamma)); + float scol = max(scol_ambocc.r, diffuse.a); + float ambocc = scol_ambocc.g; - float scol = max(scol_ambocc.r, diffuse.a); + vec3 color = vec3(0); + float bloom = 0.0; - float ambocc = scol_ambocc.g; + vec3 sunlit; + vec3 amblit; + vec3 additive; + vec3 atten; + calcAtmosphericVars(pos.xyz, light_dir, ambocc, sunlit, amblit, additive, atten, true); - vec3 color = vec3(0); - float bloom = 0.0; + color.rgb = amblit; + + float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); + ambient *= 0.5; + ambient *= ambient; + ambient = (1.0 - ambient); + color.rgb *= ambient; + + vec3 sun_contrib = min(da, scol) * sunlit; + color.rgb += sun_contrib; + color.rgb *= diffuse.rgb; + + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + + if (spec.a > 0.0) // specular reflection { - vec3 sunlit; - vec3 amblit; - vec3 additive; - vec3 atten; - - calcAtmosphericVars(pos.xyz, light_dir, ambocc, sunlit, amblit, additive, atten, true); - - color.rgb = amblit; - - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0 - ambient); - - color.rgb *= ambient; - - vec3 sun_contrib = min(da, scol) * sunlit; - - color.rgb += sun_contrib; - - color.rgb *= diffuse.rgb; - - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - - if (spec.a > 0.0) // specular reflection - { - float sa = dot(refnormpersp, light_dir.xyz); - vec3 dumbshiny = sunlit * (texture2D(lightFunc, vec2(sa, spec.a)).r); - - // add the two types of shiny together - vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib) / 6; - color.rgb += spec_contrib; - } - - color.rgb = mix(color.rgb, diffuse.rgb, diffuse.a); - - if (envIntensity > 0.0) - { //add environmentmap - vec3 env_vec = env_mat * refnormpersp; - vec3 reflected_color = textureCube(environmentMap, env_vec).rgb; - color = mix(color.rgb, reflected_color, envIntensity); - } - - if (norm.w < 0.5) - { - color = mix(atmosFragLighting(color, additive, atten), fullbrightAtmosTransportFrag(color, additive, atten), diffuse.a); - color = mix(scaleSoftClipFrag(color), fullbrightScaleSoftClip(color), diffuse.a); - } - - #ifdef WATER_FOG - vec4 fogged = applyWaterFogView(pos.xyz,vec4(color, bloom)); - color = fogged.rgb; - bloom = fogged.a; - #endif + float sa = dot(refnormpersp, light_dir.xyz); + vec3 dumbshiny = sunlit * scol * (texture2D(lightFunc, vec2(sa, spec.a)).r); + + // add the two types of shiny together + vec3 spec_contrib = dumbshiny * spec.rgb; + bloom = dot(spec_contrib, spec_contrib) / 6; + color.rgb += spec_contrib; + } + + color.rgb = mix(color.rgb, diffuse.rgb, diffuse.a); + + if (envIntensity > 0.0) + { // add environmentmap + vec3 env_vec = env_mat * refnormpersp; + vec3 reflected_color = textureCube(environmentMap, env_vec).rgb; + color = mix(color.rgb, reflected_color, envIntensity); + } + if (norm.w < 0.5) + { + color = mix(atmosFragLighting(color, additive, atten), fullbrightAtmosTransportFrag(color, additive, atten), diffuse.a); + color = mix(scaleSoftClipFrag(color), fullbrightScaleSoftClip(color), diffuse.a); } -// linear debuggables -//color.rgb = vec3(final_da); -//color.rgb = vec3(ambient); -//color.rgb = vec3(scol); -//color.rgb = diffuse_srgb.rgb; +#ifdef WATER_FOG + vec4 fogged = applyWaterFogView(pos.xyz, vec4(color, bloom)); + color = fogged.rgb; + bloom = fogged.a; +#endif // convert to linear as fullscreen lights need to sum in linear colorspace // and will be gamma (re)corrected downstream... - frag_color.rgb = srgb_to_linear(color.rgb); - frag_color.a = bloom; + frag_color.a = bloom; } - -- cgit v1.2.3 From 38e585f5be6a1604aefd183d498070eae73dac0b Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Thu, 23 Jul 2020 11:22:10 -0600 Subject: DRTVWR-510, trigger new build --- indra/edit-me-to-trigger-new-build.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt index c76e18f480..0cad6370a9 100644 --- a/indra/edit-me-to-trigger-new-build.txt +++ b/indra/edit-me-to-trigger-new-build.txt @@ -1,4 +1,2 @@ euclid 5/29/2020 - - - +euclid 7/23/2020 -- cgit v1.2.3 From 42e1a9ed870c537b5684cd15a7acc524a3672685 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 27 Jan 2020 17:54:02 +0200 Subject: SL-12475 add Inventory Favorites tab # Conflicts: # indra/newview/llinventorybridge.cpp # indra/newview/llinventorypanel.cpp --- indra/llui/llfolderview.h | 2 + .../newview/app_settings/settings_per_account.xml | 11 +++ indra/newview/llinventorybridge.cpp | 52 ++++++++++-- indra/newview/llinventorymodel.cpp | 5 ++ indra/newview/llinventorypanel.cpp | 96 ++++++++++++++++++++++ indra/newview/llinventorypanel.h | 21 +++++ indra/newview/llpanelmaininventory.cpp | 12 ++- indra/newview/llpanelmaininventory.h | 2 + .../skins/default/xui/en/menu_inventory.xml | 7 ++ .../skins/default/xui/en/panel_main_inventory.xml | 40 +++++---- indra/newview/skins/default/xui/en/strings.xml | 1 + 11 files changed, 225 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 6bb5e6c02e..c175034d75 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -241,6 +241,8 @@ public: void dumpSelectionInformation(); virtual S32 notify(const LLSD& info) ; + + void setShowEmptyMessage(bool show_msg) { mShowEmptyMessage = show_msg; } bool useLabelSuffix() { return mUseLabelSuffix; } virtual void updateMenu(); diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 8f4ca6c633..5eecf1b9f5 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -392,6 +392,17 @@ Value + FavoritesFolder + + Comment + User's chosen folder which will be shown in the Favorites tab (UUID) + Persist + 1 + Type + String + Value + + SnapshotBaseDir Comment diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 657c65c68d..03123689c5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -138,6 +138,35 @@ bool isMarketplaceSendAction(const std::string& action) return ("send_to_marketplace" == action); } +bool isPanelActive(const std::string& panel_name) +{ + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + return (active_panel && (active_panel->getName() == panel_name)); +} + +bool isParentSystemFolder(const LLInventoryModel* model, const LLUUID& folder_id) +{ + if (!model || folder_id.isNull()) return false; + + LLViewerInventoryCategory* cat = model->getCategory(folder_id); + if (cat) + { + if (cat->getPreferredType() == LLFolderType::FT_ROOT_INVENTORY) + { + return false; + } + if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) + { + return true; + } + else + { + return isParentSystemFolder(model, cat->getParentUUID()); + } + } + return false; +} + // Used by LLFolderBridge as callback for directory fetching recursion class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver { @@ -888,8 +917,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Properties")); } - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (active_panel && (active_panel->getName() != "All Items")) + if (!isPanelActive("All Items")) { items.push_back(std::string("Show in Main Panel")); } @@ -980,7 +1008,7 @@ void LLInvFVBridge::addDeleteContextMenuOptions(menuentry_vec_t &items, items.push_back(std::string("Delete")); - if (!isItemRemovable()) + if (!isItemRemovable() || isPanelActive("Favorite Items")) { disabled_items.push_back(std::string("Delete")); } @@ -4010,6 +4038,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); + disabled_items.push_back(std::string("Set Favorites folder")); } if (favorites == mUUID) { @@ -4037,6 +4066,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); + disabled_items.push_back(std::string("Set Favorites folder")); } if (marketplace_listings_id == mUUID) { @@ -4045,14 +4075,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Cut")); disabled_items.push_back(std::string("Delete")); } + + if (isPanelActive("Favorite Items")) + { + disabled_items.push_back(std::string("Delete")); + } if(trash_id == mUUID) { - bool is_recent_panel = false; - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (active_panel && (active_panel->getName() == "Recent Items")) - { - is_recent_panel = true; - } + bool is_recent_panel = isPanelActive("Recent Items"); // This is the trash. items.push_back(std::string("Empty Trash")); @@ -4102,6 +4132,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); + if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) + { + items.push_back(std::string("Set Favorites folder")); + } if (!LLEnvironment::instance().isInventoryEnabled()) { disabled_items.push_back("New Settings"); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 17e80dca89..a44a54632c 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -542,6 +542,11 @@ const LLUUID LLInventoryModel::findUserDefinedCategoryUUIDForType(LLFolderType:: cat_id = LLUUID(gSavedPerAccountSettings.getString("AnimationUploadFolder")); break; } + case LLFolderType::FT_FAVORITE: + { + cat_id = LLUUID(gSavedPerAccountSettings.getString("FavoritesFolder")); + break; + } default: break; } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c6075b4066..8e814916ad 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -179,6 +179,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2)); + mCommitCallbackRegistrar.add("Inventory.SetFavoritesFolder", boost::bind(&LLInventoryPanel::setFavoritesFolder, this, _2)); } LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) @@ -1374,6 +1375,11 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata) } } +void LLInventoryPanel::setFavoritesFolder(const LLSD& userdata) +{ + gSavedPerAccountSettings.setString("FavoritesFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); +} + void LLInventoryPanel::purgeSelectedItems() { if (!mFolderRoot.get()) return; @@ -1753,6 +1759,96 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params) mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER; } +static LLDefaultChildRegistry::Register t_favorites_inventory_panel("favorites_inventory_panel"); + +LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params) + : LLInventoryPanel(params) +{ + std::string ctrl_name = "FavoritesFolder"; + if (gSavedPerAccountSettings.controlExists(ctrl_name)) + { + LLPointer cntrl_ptr = gSavedPerAccountSettings.getControl(ctrl_name); + if (cntrl_ptr.notNull()) + { + mFolderChangedSignal = cntrl_ptr->getCommitSignal()->connect(boost::bind(&LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder, this)); + } + } +} + +void LLInventoryFavoriteItemsPanel::setSelectCallback(const boost::function& items, BOOL user_action)>& cb) +{ + if (mFolderRoot.get()) + { + mFolderRoot.get()->setSelectCallback(cb); + mSelectionCallback = cb; + } +} + +void LLInventoryFavoriteItemsPanel::initFromParams(const Params& p) +{ + Params fav_params(p); + fav_params.start_folder.id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + LLInventoryPanel::initFromParams(fav_params); + updateFavoritesRootFolder(); +} + +void LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder() +{ + const LLUUID& folder_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + + bool is_favorites_set = (folder_id != gInventory.findCategoryUUIDForTypeInRoot(LLFolderType::FT_FAVORITE, true, gInventory.getRootFolderID())); + + if (!is_favorites_set || folder_id != getRootFolderID()) + { + LLUUID root_id = folder_id; + if (mFolderRoot.get()) + { + removeItemID(getRootFolderID()); + mFolderRoot.get()->destroyView(); + } + + mCommitCallbackRegistrar.pushScope(); + { + LLFolderView* folder_view = createFolderRoot(root_id); + mFolderRoot = folder_view->getHandle(); + + addItemID(root_id, mFolderRoot.get()); + + + LLRect scroller_view_rect = getRect(); + scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + LLScrollContainer::Params scroller_params(mParams.scroll()); + scroller_params.rect(scroller_view_rect); + + if (mScroller) + { + removeChild(mScroller); + delete mScroller; + mScroller = NULL; + } + mScroller = LLUICtrlFactory::create(scroller_params); + addChild(mScroller); + mScroller->addChild(mFolderRoot.get()); + mFolderRoot.get()->setScrollContainer(mScroller); + mFolderRoot.get()->setFollowsAll(); + mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); + + if (!mSelectionCallback.empty()) + { + mFolderRoot.get()->setSelectCallback(mSelectionCallback); + } + } + mCommitCallbackRegistrar.popScope(); + mFolderRoot.get()->setCallbackRegistrar(&mCommitCallbackRegistrar); + + if (is_favorites_set) + { + buildNewViews(folder_id); + } + mFolderRoot.get()->setShowEmptyMessage(!is_favorites_set); + } +} + /************************************************************************/ /* Asset Pre-Filtered Inventory Panel related class */ /* Exchanges filter's flexibility for speed of generation and */ diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index b55eb2b828..d1c0b35e21 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -214,6 +214,7 @@ public: void doCreate(const LLSD& userdata); bool beginIMSession(); void fileUploadLocation(const LLSD& userdata); + void setFavoritesFolder(const LLSD& userdata); void purgeSelectedItems(); bool attachObject(const LLSD& userdata); static void idle(void* user_data); @@ -338,4 +339,24 @@ private: bool mViewsInitialized; // Views have been generated }; + +class LLInventoryFavoriteItemsPanel : public LLInventoryPanel +{ +public: + struct Params : public LLInitParam::Block + {}; + + void initFromParams(const Params& p); + bool isSelectionRemovable() { return false; } + void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); + +protected: + LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params); + ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } + void updateFavoritesRootFolder(); + + boost::signals2::connection mFolderChangedSignal; + boost::function& items, BOOL user_action)> mSelectionCallback; + friend class LLUICtrlFactory; +}; #endif // LL_LLINVENTORYPANEL_H diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 02cd22c307..89682d9576 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -188,6 +188,16 @@ BOOL LLPanelMainInventory::postBuild() worn_filter.markDefault(); mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2)); } + + mFavoriteItemsPanel = getChild("Favorite Items"); + if (mFavoriteItemsPanel) + { + LLInventoryFilter& recent_filter = mFavoriteItemsPanel->getFilter(); + recent_filter.setEmptyLookupMessage("InventoryFavoritItemsNotSelected"); + recent_filter.markDefault(); + mFavoriteItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mFavoriteItemsPanel, _1, _2)); + } + mSearchTypeCombo = getChild("search_type"); if(mSearchTypeCombo) { @@ -1403,7 +1413,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) } if (command_name == "delete") { - return getActivePanel()->isSelectionRemovable(); + return getActivePanel()->isSelectionRemovable() && (getActivePanel() != mFavoriteItemsPanel); } if (command_name == "save_texture") { diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index a6bdee233d..c0b4a7b6fc 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -37,6 +37,7 @@ class LLComboBox; class LLFolderViewItem; class LLInventoryPanel; +class LLInventoryFavoriteItemsPanel; class LLSaveFolderState; class LLFilterEditor; class LLTabContainer; @@ -136,6 +137,7 @@ private: LLHandle mFinderHandle; LLInventoryPanel* mActivePanel; LLInventoryPanel* mWornItemsPanel; + LLInventoryFavoriteItemsPanel* mFavoriteItemsPanel; bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 9aa84c1bac..adefa261aa 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -393,6 +393,13 @@ parameter="model" /> + + + - - + + Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]. Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters]. + Click "Use as Favorites folder" on a folder of your choice. You can choose a different folder at any time. System folders cannot be used for Favorites. Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search]. Drag a landmark here to add it to your favorites. No items found. Check the spelling of your search string and try again. -- cgit v1.2.3 From ae1e7c1231861aab49ddf348f914eba1b8993bbb Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 28 Jan 2020 14:50:32 +0200 Subject: SL-12475 Mac buildfix --- indra/newview/llinventorypanel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index d1c0b35e21..32d122cab8 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -351,7 +351,7 @@ public: void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); protected: - LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params); + LLInventoryFavoriteItemsPanel(const Params& params); ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } void updateFavoritesRootFolder(); -- cgit v1.2.3 From 980cb570162f5f4e48a2de99726d83336e3d5f59 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 21 Aug 2020 15:20:23 +0300 Subject: SL-13823 FIXED "Settings" are not shown in Inventory filter message --- indra/newview/llinventoryfilter.cpp | 12 ++++++++++++ indra/newview/skins/default/xui/en/strings.xml | 1 + 2 files changed, 13 insertions(+) (limited to 'indra') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 745b953996..8f18de0210 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -1230,6 +1230,18 @@ const std::string& LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } + if (isFilterObjectTypesWith(LLInventoryType::IT_SETTINGS)) + { + filtered_types += LLTrans::getString("Settings"); + filtered_by_type = TRUE; + num_filter_types++; + } + else + { + not_filtered_types += LLTrans::getString("Settings"); + filtered_by_all_types = FALSE; + } + if (!LLInventoryModelBackgroundFetch::instance().folderFetchActive() && filtered_by_type && !filtered_by_all_types) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b26ae0ebf8..8a87199551 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2416,6 +2416,7 @@ If you continue to receive this message, please contact Second Life support for + -- cgit v1.2.3 From 0e829d2ecca9454f4d4bcced0fe9049b0f91465d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 21 Aug 2020 16:40:53 +0300 Subject: SL-13824 Remove notification when joining a group --- indra/newview/llviewermessage.cpp | 1 - indra/newview/skins/default/xui/en/notifications.xml | 12 ------------ 2 files changed, 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 06a8ebbe89..e78ace061e 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -777,7 +777,6 @@ void response_group_invitation_coro(std::string url, LLUUID group_id, bool notif LL_DEBUGS("GroupInvite") << "Successfully sent response to group " << group_id << " invitation" << LL_ENDL; if (notify_and_update) { - LLNotificationsUtil::add("JoinGroupSuccess"); gAgent.sendAgentDataUpdateRequest(); LLGroupMgr::getInstance()->clearGroupData(group_id); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 32ae56e3af..fa1c15c411 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1022,18 +1022,6 @@ The group no longer has open enrollment. yestext="OK"/> - -You have been added to the group - group_id - success - - - Date: Wed, 26 Aug 2020 12:26:07 +0300 Subject: SL-13824 Remove notification when both joining a group and leaving a group --- indra/newview/llviewermessage.cpp | 9 +++++++++ indra/newview/skins/default/xui/en/notifications.xml | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e78ace061e..9c56766d0d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5036,6 +5036,15 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // notification was specified using the new mechanism, so we can just handle it here std::string notificationID; msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); + + //SL-13824 skip notification when both joining a group and leaving a group + //remove this after server stops sending these messages + if (notificationID == "JoinGroupSuccess" || + notificationID == "GroupDepart") + { + return true; + } + if (!LLNotifications::getInstance()->templateExists(notificationID)) { return false; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index fa1c15c411..d141cfc313 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4214,13 +4214,6 @@ Leave Group? yestext="OK"/> - -You have left the group '<nolink>[group_name]</nolink>'. - group - Date: Mon, 31 Aug 2020 21:27:37 +0300 Subject: SL-13852 Add visibility options to inventory search results --- indra/llui/lllineeditor.h | 3 + indra/llui/llsearcheditor.cpp | 22 +++++- indra/llui/llsearcheditor.h | 20 ++++- indra/newview/llfolderviewmodelinventory.h | 1 + indra/newview/llinventoryfilter.cpp | 85 ++++++++++++++++++++- indra/newview/llinventoryfilter.h | 17 ++++- indra/newview/llpanelmaininventory.cpp | 35 +++++++++ indra/newview/llpanelmaininventory.h | 2 + .../icons/Inv_Toolbar_SearchVisibility.png | Bin 0 -> 756 bytes indra/newview/skins/default/textures/textures.xml | 3 + .../widgets/TextField_Search_Highlight.png | Bin 0 -> 16287 bytes .../xui/en/menu_inventory_search_visibility.xml | 44 +++++++++++ .../skins/default/xui/en/panel_main_inventory.xml | 40 ++++++---- .../skins/default/xui/en/widgets/filter_editor.xml | 4 +- .../skins/default/xui/en/widgets/search_editor.xml | 4 +- 15 files changed, 258 insertions(+), 22 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png create mode 100644 indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png create mode 100644 indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml (limited to 'indra') diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index aa5779d45f..f84625bea7 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -283,6 +283,9 @@ public: void resetContextMenu() { setContextMenu(NULL); }; + void setBgImage(LLPointer image) { mBgImage = image; } + void setBgImageFocused(LLPointer image) { mBgImageFocused = image; } + private: // private helper methods diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index 1fdd05a11c..bafeef41fb 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -34,7 +34,11 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) : LLUICtrl(p), mSearchButton(NULL), - mClearButton(NULL) + mClearButton(NULL), + mEditorImage(p.background_image), + mEditorImageFocused(p.background_image_focused), + mEditorSearchImage(p.background_image_highlight), + mHighlightTextField(p.highlight_text_field) { S32 srch_btn_top = p.search_button.top_pad + p.search_button.rect.height; S32 srch_btn_right = p.search_button.rect.width + p.search_button.left_pad; @@ -57,6 +61,8 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) // Set up line editor. LLLineEditor::Params line_editor_params(p); line_editor_params.name("filter edit box"); + line_editor_params.background_image(p.background_image); + line_editor_params.background_image_focused(p.background_image_focused); line_editor_params.rect(getLocalRect()); line_editor_params.follows.flags(FOLLOWS_ALL); line_editor_params.text_pad_left(text_pad_left); @@ -104,6 +110,20 @@ void LLSearchEditor::draw() if (mClearButton) mClearButton->setVisible(!mSearchEditor->getWText().empty()); + if (mHighlightTextField) + { + if (!mSearchEditor->getWText().empty()) + { + mSearchEditor->setBgImage(mEditorSearchImage); + mSearchEditor->setBgImageFocused(mEditorSearchImage); + } + else + { + mSearchEditor->setBgImage(mEditorImage); + mSearchEditor->setBgImageFocused(mEditorImageFocused); + } + } + LLUICtrl::draw(); } diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index 3b12868225..c0f3c1d60c 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -47,14 +47,23 @@ public: Optional search_button, clear_button; Optional search_button_visible, - clear_button_visible; + clear_button_visible, + highlight_text_field; Optional keystroke_callback; + Optional background_image, + background_image_focused, + background_image_highlight; + Params() : search_button("search_button"), search_button_visible("search_button_visible"), clear_button("clear_button"), - clear_button_visible("clear_button_visible") + clear_button_visible("clear_button_visible"), + highlight_text_field("highlight_text_field"), + background_image("background_image"), + background_image_focused("background_image_focused"), + background_image_highlight("background_image_highlight") {} }; @@ -93,6 +102,13 @@ protected: LLLineEditor* mSearchEditor; LLButton* mSearchButton; LLButton* mClearButton; + + LLPointer mEditorImage; + LLPointer mEditorImageFocused; + LLPointer mEditorSearchImage; + LLPointer mEditorSearchImageFocused; + + bool mHighlightTextField; }; #endif // LL_SEARCHEDITOR_H diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 06a908cccc..51b98339c4 100644 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -45,6 +45,7 @@ public: virtual LLFolderType::EType getPreferredType() const = 0; virtual void showProperties(void) = 0; virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual. + virtual BOOL isAgentInventory() const { return FALSE; } virtual BOOL isUpToDate() const = 0; virtual bool hasChildren() const = 0; virtual LLInventoryType::EType getInventoryType() const = 0; diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 8f18de0210..1b99c90d5c 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -63,7 +63,8 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p) mPermissions(p.permissions), mFilterTypes(p.types), mFilterUUID(p.uuid), - mFilterLinks(p.links) + mFilterLinks(p.links), + mSearchVisibility(0xffffFFFFffffFFFFULL) { } @@ -154,6 +155,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) passed = passed && checkAgainstPermissions(listener); passed = passed && checkAgainstFilterLinks(listener); passed = passed && checkAgainstCreator(listener); + passed = passed && checkAgainstSearchVisibility(listener); return passed; } @@ -550,6 +552,27 @@ bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory } } +bool LLInventoryFilter::checkAgainstSearchVisibility(const LLFolderViewModelItemInventory* listener) const +{ + if (!listener || !hasFilterString()) return TRUE; + + const LLUUID object_id = listener->getUUID(); + const LLInventoryObject *object = gInventory.getObject(object_id); + if (!object) return TRUE; + + const BOOL is_link = object->getIsLinkType(); + if (is_link && ((mFilterOps.mSearchVisibility & VISIBILITY_LINKS) == 0)) + return FALSE; + + if (listener->isItemInTrash() && ((mFilterOps.mSearchVisibility & VISIBILITY_TRASH) == 0)) + return FALSE; + + if (!listener->isAgentInventory() && ((mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY) == 0)) + return FALSE; + + return TRUE; +} + const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const { return mFilterSubString; @@ -718,6 +741,61 @@ void LLInventoryFilter::setFilterMarketplaceListingFolders(bool select_only_list } } + +void LLInventoryFilter::toggleSearchVisibilityLinks() +{ + bool hide_links = mFilterOps.mSearchVisibility & VISIBILITY_LINKS; + if (hide_links) + { + mFilterOps.mSearchVisibility &= ~VISIBILITY_LINKS; + } + else + { + mFilterOps.mSearchVisibility |= VISIBILITY_LINKS; + } + + if (hasFilterString()) + { + setModified(hide_links ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE); + } +} + +void LLInventoryFilter::toggleSearchVisibilityTrash() +{ + bool hide_trash = mFilterOps.mSearchVisibility & VISIBILITY_TRASH; + if (hide_trash) + { + mFilterOps.mSearchVisibility &= ~VISIBILITY_TRASH; + } + else + { + mFilterOps.mSearchVisibility |= VISIBILITY_TRASH; + } + + if (hasFilterString()) + { + setModified(hide_trash ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE); + } +} + +void LLInventoryFilter::toggleSearchVisibilityLibrary() +{ + bool hide_library = mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY; + if (hide_library) + { + mFilterOps.mSearchVisibility &= ~VISIBILITY_LIBRARY; + } + else + { + mFilterOps.mSearchVisibility |= VISIBILITY_LIBRARY; + } + + if (hasFilterString()) + { + setModified(hide_library ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE); + } +} + void LLInventoryFilter::setFilterNoMarketplaceFolder() { mFilterOps.mFilterTypes |= FILTERTYPE_NO_MARKETPLACE_ITEMS; @@ -1349,6 +1427,11 @@ U64 LLInventoryFilter::getFilterSettingsTypes() const return mFilterOps.mFilterSettingsTypes; } +U64 LLInventoryFilter::getSearchVisibilityTypes() const +{ + return mFilterOps.mSearchVisibility; +} + bool LLInventoryFilter::hasFilterString() const { return mFilterSubString.size() > 0; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index be02ee3623..caba8315c4 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -99,6 +99,14 @@ public: FILTERCREATOR_OTHERS }; + enum ESearchVisibility + { + VISIBILITY_NONE = 0, + VISIBILITY_TRASH = 0x1 << 0, + VISIBILITY_LIBRARY = 0x1 << 1, + VISIBILITY_LINKS = 0x1 << 2 + }; + struct FilterOps { struct DateRange : public LLInitParam::Block @@ -154,6 +162,7 @@ public: mFilterWearableTypes, mFilterSettingsTypes, // for _SETTINGS mFilterLinks, + mSearchVisibility, mFilterCategoryTypes; // For _CATEGORY LLUUID mFilterUUID; // for UUID @@ -193,7 +202,8 @@ public: U64 getFilterObjectTypes() const; U64 getFilterCategoryTypes() const; U64 getFilterWearableTypes() const; - U64 getFilterSettingsTypes() const; + U64 getFilterSettingsTypes() const; + U64 getSearchVisibilityTypes() const; bool isFilterObjectTypesWith(LLInventoryType::EType t) const; void setFilterObjectTypes(U64 types); @@ -213,6 +223,10 @@ public: ESearchType getSearchType() { return mSearchType; } void setFilterCreator(EFilterCreatorType type); + void toggleSearchVisibilityLinks(); + void toggleSearchVisibilityTrash(); + void toggleSearchVisibilityLibrary(); + void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; const std::string& getFilterSubStringOrig() const { return mFilterSubStringOrig; } @@ -309,6 +323,7 @@ private: bool checkAgainstPermissions(const LLInventoryItem* item) const; bool checkAgainstFilterLinks(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstCreator(const class LLFolderViewModelItemInventory* listener) const; + bool checkAgainstSearchVisibility(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstClipboard(const LLUUID& object_id) const; FilterOps mFilterOps; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 89682d9576..f845e9b056 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -115,6 +115,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mSavedFolderState(NULL), mFilterText(""), mMenuGearDefault(NULL), + mMenuVisibility(NULL), mMenuAddHandle(), mNeedUploadCost(true) { @@ -238,6 +239,7 @@ BOOL LLPanelMainInventory::postBuild() } mGearMenuButton = getChild("options_gear_btn"); + mVisibilityMenuButton = getChild("options_visibility_btn"); initListCommandsHandlers(); @@ -1174,6 +1176,9 @@ void LLPanelMainInventory::initListCommandsHandlers() LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAddHandle = menu->getHandle(); + mMenuVisibility = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_search_visibility.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mVisibilityMenuButton->setMenu(mMenuVisibility); + // Update the trash button when selected item(s) get worn or taken off. LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this)); } @@ -1363,6 +1368,21 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) } LLFloaterReg::showInstance("linkreplace", params); } + + if (command_name == "toggle_search_trash") + { + mActivePanel->getFilter().toggleSearchVisibilityTrash(); + } + + if (command_name == "toggle_search_library") + { + mActivePanel->getFilter().toggleSearchVisibilityLibrary(); + } + + if (command_name == "include_links") + { + mActivePanel->getFilter().toggleSearchVisibilityLinks(); + } } void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility ) @@ -1508,6 +1528,21 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) return sort_order_mask & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP; } + if (command_name == "toggle_search_trash") + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_TRASH) != 0; + } + + if (command_name == "toggle_search_library") + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LIBRARY) != 0; + } + + if (command_name == "include_links") + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0; + } + return FALSE; } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index c0b4a7b6fc..903b33bdbf 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -171,7 +171,9 @@ protected: private: LLDragAndDropButton* mTrashButton; LLToggleableMenu* mMenuGearDefault; + LLToggleableMenu* mMenuVisibility; LLMenuButton* mGearMenuButton; + LLMenuButton* mVisibilityMenuButton; LLHandle mMenuAddHandle; bool mNeedUploadCost; diff --git a/indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png b/indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png new file mode 100644 index 0000000000..048da25c92 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 7325d836d2..1302edda7a 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -333,6 +333,8 @@ with the same filename but different name + + @@ -648,6 +650,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png b/indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png new file mode 100644 index 0000000000..e3944289c6 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png differ diff --git a/indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml b/indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml new file mode 100644 index 0000000000..46193f4a7a --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 2745b9d302..7bd5c9b548 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -32,30 +32,20 @@ left="12" name="ItemcountText" font="SansSerifMedium" - text_color="EmphasisColor" + text_color="InventoryItemLinkColor" use_ellipses="true" top_pad="0" width="300"> Items: - - + follows="top|left" + width="88"> - + + + + background_image_focused="TextField_Search_Active" + background_image_highlight="TextField_Search_Highlight"> + background_image_focused="TextField_Search_Active" + background_image_highlight="TextField_Search_Highlight"> Date: Tue, 1 Sep 2020 20:03:03 +0300 Subject: SL-13852 Show menu below the button --- indra/newview/llpanelmaininventory.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f845e9b056..7d04c1dc67 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1178,6 +1178,7 @@ void LLPanelMainInventory::initListCommandsHandlers() mMenuVisibility = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_search_visibility.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mVisibilityMenuButton->setMenu(mMenuVisibility); + mVisibilityMenuButton->setMenuPosition(LLMenuButton::MP_BOTTOM_LEFT); // Update the trash button when selected item(s) get worn or taken off. LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this)); -- cgit v1.2.3 From 73ece917247d550140c0ae193746ebf66cca1081 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 17 Feb 2020 17:43:00 +0200 Subject: =?UTF-8?q?SL-11867=20Show=20=E2=80=9CUnable=20to=20buy=E2=80=9D?= =?UTF-8?q?=20message=20via=20notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llfloaterbuycurrency.cpp | 37 +++---------------- .../skins/default/xui/da/floater_buy_currency.xml | 5 ++- .../skins/default/xui/de/floater_buy_currency.xml | 5 ++- .../skins/default/xui/en/floater_buy_currency.xml | 42 +++------------------- .../newview/skins/default/xui/en/notifications.xml | 12 +++++++ .../skins/default/xui/es/floater_buy_currency.xml | 5 ++- .../skins/default/xui/fr/floater_buy_currency.xml | 5 ++- .../skins/default/xui/it/floater_buy_currency.xml | 5 ++- .../skins/default/xui/ja/floater_buy_currency.xml | 5 ++- .../skins/default/xui/pl/floater_buy_currency.xml | 5 ++- .../skins/default/xui/pt/floater_buy_currency.xml | 5 ++- .../skins/default/xui/ru/floater_buy_currency.xml | 5 ++- .../skins/default/xui/tr/floater_buy_currency.xml | 5 ++- .../skins/default/xui/zh/floater_buy_currency.xml | 5 ++- 14 files changed, 43 insertions(+), 103 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 91436e52fe..25348474a1 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -74,7 +74,6 @@ public: void onClickBuy(); void onClickCancel(); - void onClickErrorWeb(); }; LLFloater* LLFloaterBuyCurrency::buildFloater(const LLSD& key) @@ -132,7 +131,6 @@ BOOL LLFloaterBuyCurrencyUI::postBuild() getChild("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickBuy, this)); getChild("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickCancel, this)); - getChild("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickErrorWeb, this)); center(); @@ -173,7 +171,6 @@ void LLFloaterBuyCurrencyUI::updateUI() // hide most widgets - we'll turn them on as needed next getChildView("info_buying")->setVisible(FALSE); - getChildView("info_cannot_buy")->setVisible(FALSE); getChildView("info_need_more")->setVisible(FALSE); getChildView("purchase_warning_repurchase")->setVisible(FALSE); getChildView("purchase_warning_notenough")->setVisible(FALSE); @@ -183,32 +180,16 @@ void LLFloaterBuyCurrencyUI::updateUI() if (hasError) { // display an error from the server - getChildView("normal_background")->setVisible(FALSE); - getChildView("error_background")->setVisible(TRUE); - getChildView("info_cannot_buy")->setVisible(TRUE); - getChildView("cannot_buy_message")->setVisible(TRUE); - getChildView("balance_label")->setVisible(FALSE); - getChildView("balance_amount")->setVisible(FALSE); - getChildView("buying_label")->setVisible(FALSE); - getChildView("buying_amount")->setVisible(FALSE); - getChildView("total_label")->setVisible(FALSE); - getChildView("total_amount")->setVisible(FALSE); - - LLTextBox* message = getChild("cannot_buy_message"); - if (message) - { - message->setText(mManager.errorMessage()); - } - - getChildView("error_web")->setVisible( !mManager.errorURI().empty()); + LLSD args; + args["TITLE"] = getString("info_cannot_buy"); + args["MESSAGE"] = mManager.errorMessage(); + LLNotificationsUtil::add("CouldNotBuyCurrency", args); + closeFloater(); } else { // display the main Buy L$ interface getChildView("normal_background")->setVisible(TRUE); - getChildView("error_background")->setVisible(FALSE); - getChildView("cannot_buy_message")->setVisible(FALSE); - getChildView("error_web")->setVisible(FALSE); if (mHasTarget) { @@ -278,14 +259,6 @@ void LLFloaterBuyCurrencyUI::onClickCancel() LLStatusBar::sendMoneyBalanceRequest(); } -void LLFloaterBuyCurrencyUI::onClickErrorWeb() -{ - LLWeb::loadURL(mManager.errorURI()); - closeFloater(); - // Update L$ balance - LLStatusBar::sendMoneyBalanceRequest(); -} - // static void LLFloaterBuyCurrency::buyCurrency() { diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml index 3c0428b2b0..b7ac181dd4 100644 --- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml @@ -60,8 +60,7 @@ objektet. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Editing Shape + Shape diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index afce9f6eb5..adbeb09935 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -81,7 +81,7 @@ name="title" text_color="LtGray" top="0" - value="Edit Outfit" + value="Current Outfit" use_ellipses="true" width="275" /> -- cgit v1.2.3 From 94cd34cc1762fbcc88930f095fb89b9ae4292928 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 8 Jul 2020 20:29:44 +0300 Subject: SL-13479 Avatar menu tweaks --- indra/llui/llmenugl.cpp | 4 +- indra/newview/llviewermenu.cpp | 10 + indra/newview/llviewermenu.h | 4 + indra/newview/llvoavatarself.cpp | 8 +- .../skins/default/xui/en/menu_attachment_self.xml | 210 +++++++++++++++++++-- .../skins/default/xui/en/menu_avatar_self.xml | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 186 +++++++++++++++++- 7 files changed, 404 insertions(+), 20 deletions(-) (limited to 'indra') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 5568a84494..c2698fa648 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -79,7 +79,7 @@ const U32 LEFT_PAD_PIXELS = 3; const U32 LEFT_WIDTH_PIXELS = 15; const U32 LEFT_PLAIN_PIXELS = LEFT_PAD_PIXELS + LEFT_WIDTH_PIXELS; -const U32 RIGHT_PAD_PIXELS = 2; +const U32 RIGHT_PAD_PIXELS = 7; const U32 RIGHT_WIDTH_PIXELS = 15; const U32 RIGHT_PLAIN_PIXELS = RIGHT_PAD_PIXELS + RIGHT_WIDTH_PIXELS; @@ -95,7 +95,7 @@ const std::string SEPARATOR_NAME("separator"); const std::string VERTICAL_SEPARATOR_LABEL( "|" ); const std::string LLMenuGL::BOOLEAN_TRUE_PREFIX( "\xE2\x9C\x94" ); // U+2714 HEAVY CHECK MARK -const std::string LLMenuGL::BRANCH_SUFFIX( "\xE2\x96\xB6" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE +const std::string LLMenuGL::BRANCH_SUFFIX( "\xe2\x96\xb8" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE const std::string LLMenuGL::ARROW_UP ("^^^^^^^"); const std::string LLMenuGL::ARROW_DOWN("vvvvvvv"); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 34b4d7f3b3..12d13a78a2 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -186,11 +186,15 @@ const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents" LLMenuGL* gAttachSubMenu = NULL; LLMenuGL* gDetachSubMenu = NULL; LLMenuGL* gTakeOffClothes = NULL; +LLMenuGL* gDetachAvatarMenu = NULL; +LLMenuGL* gDetachHUDAvatarMenu = NULL; LLContextMenu* gAttachScreenPieMenu = NULL; LLContextMenu* gAttachPieMenu = NULL; LLContextMenu* gAttachBodyPartPieMenus[9]; LLContextMenu* gDetachPieMenu = NULL; LLContextMenu* gDetachScreenPieMenu = NULL; +LLContextMenu* gDetachAttSelfMenu = NULL; +LLContextMenu* gDetachHUDAttSelfMenu = NULL; LLContextMenu* gDetachBodyPartPieMenus[9]; // @@ -445,6 +449,9 @@ void init_menus() gMenuAttachmentOther = LLUICtrlFactory::createFromFile( "menu_attachment_other.xml", gMenuHolder, registry); + gDetachHUDAttSelfMenu = gMenuHolder->getChild("Detach Self HUD", true); + gDetachAttSelfMenu = gMenuHolder->getChild("Detach Self", true); + gMenuLand = LLUICtrlFactory::createFromFile( "menu_land.xml", gMenuHolder, registry); @@ -501,6 +508,9 @@ void init_menus() gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE); gDetachSubMenu = gMenuBarView->findChildMenuByName("Detach Object", TRUE); + gDetachAvatarMenu = gMenuHolder->getChild("Avatar Detach", true); + gDetachHUDAvatarMenu = gMenuHolder->getChild("Avatar Detach HUD", true); + // Don't display the Memory console menu if the feature is turned off LLMenuItemCheckGL *memoryMenu = gMenuBarView->getChild("Memory", TRUE); if (memoryMenu) diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 0f63c8cf58..36b6971c81 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -188,10 +188,14 @@ extern LLContextMenu *gMenuMuteParticle; extern LLMenuGL* gAttachSubMenu; extern LLMenuGL* gDetachSubMenu; extern LLMenuGL* gTakeOffClothes; +extern LLMenuGL* gDetachAvatarMenu; +extern LLMenuGL* gDetachHUDAvatarMenu; extern LLContextMenu* gAttachScreenPieMenu; extern LLContextMenu* gDetachScreenPieMenu; +extern LLContextMenu* gDetachHUDAttSelfMenu; extern LLContextMenu* gAttachPieMenu; extern LLContextMenu* gDetachPieMenu; +extern LLContextMenu* gDetachAttSelfMenu; extern LLContextMenu* gAttachBodyPartPieMenus[9]; extern LLContextMenu* gDetachBodyPartPieMenus[9]; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index aea12380e8..d2dc139d4b 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -465,6 +465,8 @@ BOOL LLVOAvatarSelf::buildMenus() if (gDetachBodyPartPieMenus[i]) { gDetachPieMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] ); + gDetachAttSelfMenu->appendContextSubMenu(gDetachBodyPartPieMenus[i]); + gDetachAvatarMenu->appendContextSubMenu(gDetachBodyPartPieMenus[i]); } else { @@ -493,12 +495,14 @@ BOOL LLVOAvatarSelf::buildMenus() LLMenuItemCallGL* item = LLUICtrlFactory::create(item_params); gDetachPieMenu->addChild(item); - + gDetachAttSelfMenu->addChild(LLUICtrlFactory::create(item_params)); + gDetachAvatarMenu->addChild(LLUICtrlFactory::create(item_params)); break; } } } } + // add screen attachments for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); @@ -532,6 +536,8 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.on_enable.parameter = iter->first; item = LLUICtrlFactory::create(item_params); gDetachScreenPieMenu->addChild(item); + gDetachHUDAttSelfMenu->addChild(LLUICtrlFactory::create(item_params)); + gDetachHUDAvatarMenu->addChild(LLUICtrlFactory::create(item_params)); } } diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index 03c05e6591..856bf4ce73 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -2,17 +2,6 @@ - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -293,7 +475,7 @@ name="Help with avatars"> + parameter="https://community.secondlife.com/search/?type=cms_records3&tags=avatar&nodes=30&search_and_or=or"/> Date: Wed, 15 Jul 2020 18:35:59 +0300 Subject: SL-13612 Dedicated Avatar menu -- Revise toolbar button labels --- indra/newview/skins/default/xui/en/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0b95b43f39..db9d3bfa83 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4113,8 +4113,8 @@ Try enclosing path to the editor with double quotes. About land - Appearance - Avatar + Outfits + Complete avatars Build Chat Conversations -- cgit v1.2.3 From 6ec194154be3d40f897d728925d1a565c6f8be78 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 10 Dec 2020 17:43:21 +0200 Subject: SL-13826 Show result of "Find original" and "Show original" in Main Inventory floater and reset the filters to guarantee success --- indra/newview/llinventorybridge.cpp | 41 +++++++------------ indra/newview/llinventoryfunctions.cpp | 73 +++++++++++++++++----------------- indra/newview/llinventorypanel.cpp | 36 ++++------------- indra/newview/llinventorypanel.h | 6 +-- indra/newview/llpanelmaininventory.cpp | 15 ++----- indra/newview/llpanelmaininventory.h | 6 +-- 6 files changed, 67 insertions(+), 110 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ae96963b2a..27e222237e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1863,29 +1863,11 @@ void LLItemBridge::restoreToWorld() void LLItemBridge::gotoItem() { - LLInventoryObject *obj = getInventoryObject(); - if (obj && obj->getIsLinkType()) - { - const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); - if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id)) - { - LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); - if (sidepanel_inventory && sidepanel_inventory->getInboxPanel()) - { - sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); - } - } - else - { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (active_panel) - { - active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); - active_panel->setFocus(TRUE); - } - } - - } + LLInventoryObject *obj = getInventoryObject(); + if (obj && obj->getIsLinkType()) + { + show_item_original(obj->getUUID()); + } } LLUIImagePtr LLItemBridge::getIcon() const @@ -7251,13 +7233,20 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti } LLItemBridge::performAction(model,action); } - void LLLinkFolderBridge::gotoItem() { LLItemBridge::gotoItem(); - LLInventoryPanel::getActiveInventoryPanel()->openFolderByID(getFolderID()); -} + const LLUUID &cat_uuid = getFolderID(); + if (!cat_uuid.isNull()) + { + LLFolderViewItem *base_folder = LLInventoryPanel::getActiveInventoryPanel()->getItemByID(cat_uuid); + if (base_folder) + { + base_folder->setOpen(TRUE); + } + } +} const LLUUID &LLLinkFolderBridge::getFolderID() const { if (LLViewerInventoryItem *link_item = getItem()) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 628363a47e..181bc48571 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -774,35 +774,45 @@ void show_item_profile(const LLUUID& item_uuid) void show_item_original(const LLUUID& item_uuid) { - LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory"); - if (!floater_inventory) - { - LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL; - return; - } - - //sidetray inventory panel - LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); - + LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory"); + if (!floater_inventory) + { + LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL; + return; + } + LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + if (sidepanel_inventory) + { + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (main_inventory) + { + main_inventory->resetFilters(); + } + reset_inventory_filter(); - LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (!active_panel) - { - //this may happen when there is no floatera and other panel is active in inventory tab + if (!LLFloaterReg::getTypedInstance("inventory")->isInVisibleChain()) + { + LLFloaterReg::toggleInstanceOrBringToFront("inventory"); + } - if (sidepanel_inventory) - { - sidepanel_inventory->showInventoryPanel(); - } - } - - active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (!active_panel) - { - return; - } - active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES); - active_panel->setFocus(TRUE); + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); + if (gInventory.isObjectDescendentOf(gInventory.getLinkedItemID(item_uuid), inbox_id)) + { + if (sidepanel_inventory->getInboxPanel()) + { + sidepanel_inventory->openInbox(); + sidepanel_inventory->getInboxPanel()->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES); + } + } + else + { + sidepanel_inventory->selectAllItemsPanel(); + if (sidepanel_inventory->getActivePanel()) + { + sidepanel_inventory->getActivePanel()->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES); + } + } + } } @@ -2486,15 +2496,6 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root } else { - if (action == "goto") - { - LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); - if (sidepanel_inventory && sidepanel_inventory->getMainInventoryPanel()) - { - model = sidepanel_inventory->getMainInventoryPanel()->getActivePanel()->getModel(); - } - } - std::set::iterator set_iter; for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter) { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0246878ab6..1f5dfa6d5c 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -157,7 +157,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mViewsInitialized(false), mInvFVBridgeBuilder(NULL), mInventoryViewModel(p.name), - mGroupedItemBridge(new LLFolderViewGroupedItemBridge) + mGroupedItemBridge(new LLFolderViewGroupedItemBridge), + mFocusSelection(false) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -339,7 +340,6 @@ void LLInventoryPanel::draw() { // Select the desired item (in case it wasn't loaded when the selection was requested) updateSelection(); - updateFolderState(); LLPanel::draw(); } @@ -1222,7 +1222,7 @@ void LLInventoryPanel::setSelectCallback(const boost::functiongetViewModelItem()) + if(itemp && itemp->getViewModelItem() && itemp->passedFilter()) { itemp->arrangeAndSet(TRUE, take_keyboard_focus); mSelectThisID.setNull(); + mFocusSelection = false; return; } else { // save the desired item to be selected later (if/when ready) + mFocusSelection = take_keyboard_focus; mSelectThisID = obj_id; } } @@ -1719,34 +1721,10 @@ void LLInventoryPanel::updateSelection() { if (mSelectThisID.notNull()) { - setSelectionByID(mSelectThisID, false); + setSelectionByID(mSelectThisID, mFocusSelection); } } -void LLInventoryPanel::openFolderByID( const LLUUID& folder_id) -{ - LLFolderViewItem* itemp = getItemByID(folder_id); - if(itemp && itemp->getViewModelItem()) - { - itemp->setOpen(TRUE); - mOpenFolderID.setNull(); - return; - } - else - { - // save the desired folder to be open later (if/when ready) - mOpenFolderID = folder_id; - } -} - -void LLInventoryPanel::updateFolderState() -{ - if (mOpenFolderID.notNull()) - { - openFolderByID(mOpenFolderID); - } -} - void LLInventoryPanel::doToSelected(const LLSD& userdata) { if (("purge" == userdata.asString())) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 2bcc3f3c0b..447d24b959 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -244,9 +244,7 @@ public: LLFolderViewItem* getItemByID(const LLUUID& id); LLFolderViewFolder* getFolderByID(const LLUUID& id); void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus); - void openFolderByID(const LLUUID& folder_id); void updateSelection(); - void updateFolderState(); void setSuppressOpenItemAction(bool supress_open_item) { mSuppressOpenItemAction = supress_open_item; } @@ -262,11 +260,11 @@ protected: void openStartFolderOrMyInventory(); // open the first level of inventory void onItemsCompletion(); // called when selected items are complete - LLUUID mSelectThisID; - LLUUID mOpenFolderID; + LLUUID mSelectThisID; LLInventoryModel* mInventory; LLInventoryObserver* mInventoryObserver; LLInvPanelComplObserver* mCompletionObserver; + bool mFocusSelection; bool mAcceptsDragAndDrop; bool mAllowMultiSelect; bool mAllowDrag; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 813a5b3c20..4691ee3849 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -383,16 +383,15 @@ void LLPanelMainInventory::closeAllFolders() getPanel()->getRootFolder()->closeAllFolders(); } -LLFloaterSidePanelContainer* LLPanelMainInventory::newWindow() +void LLPanelMainInventory::newWindow() { static S32 instance_num = 0; instance_num = (instance_num + 1) % S32_MAX; if (!gAgentCamera.cameraMouselook()) { - return LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); + LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); } - return NULL; } void LLPanelMainInventory::doCreate(const LLSD& userdata) @@ -1344,15 +1343,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { return; } - LLSidepanelInventory *sidepanel_inventory = newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); - if (sidepanel_inventory) - { - LLPanelMainInventory* new_inventory = sidepanel_inventory->getMainInventoryPanel(); - if (new_inventory) - { - static_cast(current_item->getViewModelItem())->performAction(new_inventory->getActivePanel()->getModel(), "goto"); - } - } + static_cast(current_item->getViewModelItem())->performAction(getActivePanel()->getModel(), "goto"); } if (command_name == "find_links") diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 40f04da6e9..313e478bfe 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -46,7 +46,6 @@ class LLMenuButton; class LLMenuGL; class LLToggleableMenu; class LLFloater; -class LLFloaterSidePanelContainer; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPanelMainInventory @@ -91,10 +90,12 @@ public: void setFocusFilterEditor(); - static LLFloaterSidePanelContainer* newWindow(); + static void newWindow(); void toggleFindOptions(); + void resetFilters(); + protected: // // Misc functions @@ -119,7 +120,6 @@ protected: void doToSelected(const LLSD& userdata); void closeAllFolders(); void doCreate(const LLSD& userdata); - void resetFilters(); void setSortBy(const LLSD& userdata); void saveTexture(const LLSD& userdata); bool isSaveTextureEnabled(const LLSD& userdata); -- cgit v1.2.3 From 9962df9fb7303dc52f52bf448bef407342286008 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 4 Jan 2021 16:33:50 +0200 Subject: SL-14529 Replace dynamic_cast to LLAvatarJoint with static casts Replaced couple (LLAvatarJoint*) for consistency --- indra/llappearance/llavatarjoint.cpp | 6 +++--- indra/newview/llviewerjoint.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp index 80b3e42b52..a1d4fe6423 100644 --- a/indra/llappearance/llavatarjoint.cpp +++ b/indra/llappearance/llavatarjoint.cpp @@ -103,7 +103,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive ) for (joints_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { - LLAvatarJoint* joint = (LLAvatarJoint*)(*iter); + LLAvatarJoint* joint = static_cast(*iter); joint->setValid(valid, TRUE); } } @@ -136,7 +136,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive) for (joints_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { - LLAvatarJoint* joint = (LLAvatarJoint*)(*iter); + LLAvatarJoint* joint = static_cast(*iter); joint->setVisible(visible, recursive); } } @@ -167,7 +167,7 @@ void LLAvatarJoint::updateJointGeometry() for (joints_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { - LLAvatarJoint* joint = dynamic_cast(*iter); + LLAvatarJoint* joint = static_cast(*iter); joint->updateJointGeometry(); } } diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index a448a95904..9653e80b53 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -143,8 +143,10 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) //---------------------------------------------------------------- for (LLJoint* j : mChildren) { - LLAvatarJoint* joint = dynamic_cast(j); - F32 jointLOD = joint ? joint->getLOD() : 0; + // LLViewerJoint is derived from LLAvatarJoint, + // all children of LLAvatarJoint are assumed to be LLAvatarJoint + LLAvatarJoint* joint = static_cast(j); + F32 jointLOD = joint->getLOD(); if (pixelArea >= jointLOD || sDisableLOD) { triangle_count += joint->render( pixelArea, TRUE, is_dummy ); -- cgit v1.2.3 From 1a8800b051166d3406065df312c66b7e4f00fe05 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 19 Nov 2020 16:56:10 +0000 Subject: SL-14347 Crash at ChoosePixelFormat --- indra/llwindow/llwindowwin32.cpp | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 8ec85976c3..6831071cd1 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -428,7 +428,8 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, memset(mCurrentGammaRamp, 0, sizeof(mCurrentGammaRamp)); memset(mPrevGammaRamp, 0, sizeof(mPrevGammaRamp)); mCustomGammaSet = FALSE; - + mWindowHandle = NULL; + if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &mMouseVanish, 0)) { mMouseVanish = TRUE; @@ -1169,7 +1170,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO << " Height: " << (window_rect.bottom - window_rect.top) << " Fullscreen: " << mFullscreen << LL_ENDL; - if (!destroy_window_handler(mWindowHandle)) + if (mWindowHandle && !destroy_window_handler(mWindowHandle)) { LL_WARNS("Window") << "Failed to properly close window before recreating it!" << LL_ENDL; } @@ -1228,13 +1229,26 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO LL_INFOS("Window") << "Device context retrieved." << LL_ENDL ; - if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd))) - { - close(); - OSMessageBox(mCallbacks->translateString("MBPixelFmtErr"), - mCallbacks->translateString("MBError"), OSMB_OK); - return FALSE; - } + try + { + // Looks like ChoosePixelFormat can crash in case of faulty driver + if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd))) + { + LL_WARNS("Window") << "ChoosePixelFormat failed, code: " << GetLastError() << LL_ENDL; + OSMessageBox(mCallbacks->translateString("MBPixelFmtErr"), + mCallbacks->translateString("MBError"), OSMB_OK); + close(); + return FALSE; + } + } + catch (...) + { + LL_WARNS("Window") << "ChoosePixelFormat failed." << LL_ENDL; + OSMessageBox(mCallbacks->translateString("MBPixelFmtErr"), + mCallbacks->translateString("MBError"), OSMB_OK); + close(); + return FALSE; + } LL_INFOS("Window") << "Pixel format chosen." << LL_ENDL ; @@ -1494,7 +1508,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO } // Destroy The Window - if (!destroy_window_handler(mWindowHandle)) + if (mWindowHandle && !destroy_window_handler(mWindowHandle)) { LL_WARNS("Window") << "Failed to properly close window!" << LL_ENDL; } -- cgit v1.2.3 From ba47d9315470049bc19a7c07b6a333f56b490bad Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 4 Jan 2021 20:26:23 +0200 Subject: SL-14491 llDialog spacing inconsistent between string and buttons --- indra/newview/lltoastnotifypanel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index bccf88128d..024f25bc98 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -387,9 +387,9 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) if (mIsScriptDialog) { // we are using default width for script buttons so we can determinate button_rows - //to get a number of rows we divide the required width of the buttons to button_panel_width - S32 button_rows = llceil(F32(buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width); - //S32 button_rows = (buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width; + // to get a number of rows we divide the required width of the buttons to button_panel_width + // buttons.size() is reduced by -2 due to presence of ignore button which is calculated independently a bit lower + S32 button_rows = llceil(F32(buttons.size() - 2) * (BUTTON_WIDTH + h_pad) / (button_panel_width + h_pad)); //reserve one row for the ignore_btn button_rows++; //calculate required panel height for scripdialog notification. -- cgit v1.2.3 From 8c41c00888bbfe7b1c6501e995554a39a8bf944b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 5 Jan 2021 17:43:14 +0200 Subject: SL-14632 FIXED The viewer is crashed after deleting the new favorite folder --- indra/newview/llviewerinventory.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index bbed741a33..ed1d726528 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1422,6 +1422,11 @@ void remove_inventory_category( LLNotificationsUtil::add("CannotRemoveProtectedCategories"); return; } + const LLUUID fav_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + if ((cat_id == fav_id) || gInventory.isObjectDescendentOf(fav_id, cat_id)) + { + gSavedPerAccountSettings.setString("FavoritesFolder", ""); + } AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); AISAPI::RemoveCategory(cat_id, cr); } -- cgit v1.2.3 From 1087c26de7ba89465618518ba93dc7161f075f47 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 6 Jan 2021 12:08:21 +0200 Subject: SL-14633 FIXED The item from the favorite tab in the inventory floater can be purged --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 27e222237e..34e2dc7904 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -987,7 +987,7 @@ void LLInvFVBridge::addTrashContextMenuOptions(menuentry_vec_t &items, } } items.push_back(std::string("Purge Item")); - if (!isItemRemovable()) + if (!isItemRemovable() || isPanelActive("Favorite Items")) { disabled_items.push_back(std::string("Purge Item")); } -- cgit v1.2.3 From 5af5498cf60b98c6ca00a1341ec4099b6cf0ffe9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 14 Dec 2020 19:20:22 +0200 Subject: SL-11300 Camera distance to avatar in neighbouring region incorrect --- indra/newview/lldrawable.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 2219f20272..1da94f4698 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -912,22 +912,18 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) if (volume->getAvatar()) { const LLVector3* av_box = volume->getAvatar()->getLastAnimExtents(); - LLVector3d cam_pos = gAgent.getPosGlobalFromAgent(LLViewerCamera::getInstance()->getOrigin()); - LLVector3 cam_region_pos = LLVector3(cam_pos - volume->getRegion()->getOriginGlobal()); - - LLVector3 cam_to_box_offset = point_to_box_offset(cam_region_pos, av_box); + LLVector3 cam_pos_from_agent = LLViewerCamera::getInstance()->getOrigin(); + LLVector3 cam_to_box_offset = point_to_box_offset(cam_pos_from_agent, av_box); mDistanceWRTCamera = llmax(0.01f, ll_round(cam_to_box_offset.magVec(), 0.01f)); LL_DEBUGS("DynamicBox") << volume->getAvatar()->getFullname() << " pos (ignored) " << pos - << " cam pos " << cam_pos - << " cam region pos " << cam_region_pos + << " cam pos " << cam_pos_from_agent << " box " << av_box[0] << "," << av_box[1] << " -> dist " << mDistanceWRTCamera << LL_ENDL; mVObjp->updateLOD(); return; } - } else { -- cgit v1.2.3 From daa957b93ba173feb69d003dbc578e621a9a68e3 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 6 Jan 2021 17:36:10 -0800 Subject: SL-14035: Incorporate patch from Sovereign Engineer to fix specular reflection --- indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl | 3 +++ indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 7 ++----- .../app_settings/shaders/class1/deferred/multiPointLightF.glsl | 2 -- .../app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 4 ---- .../newview/app_settings/shaders/class1/deferred/pointLightF.glsl | 3 +-- .../newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 2 +- .../app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 4 ---- .../newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 5 +++-- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 2 +- 9 files changed, 11 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index d29e8a9423..eb6e56e718 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -40,6 +40,8 @@ uniform sampler2D specularMap; VARYING vec2 vary_texcoord0; +vec3 linear_to_srgb(vec3 c); + void main() { vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); @@ -52,6 +54,7 @@ void main() vec4 norm = texture2D(normalMap, vary_texcoord0.xy); vec4 spec = texture2D(specularMap, vary_texcoord0.xy); + col.rgb = linear_to_srgb(col.rgb); frag_data[0] = vec4(col.rgb, 0.0); frag_data[1] = spec; frag_data[2] = vec4(norm.xy,0,0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 80d19102b6..bb69e45816 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -159,11 +159,6 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe vec3 speccol = lit*scol*light_col.rgb*spec.rgb; speccol = clamp(speccol, vec3(0), vec3(1)); col += speccol; - - float cur_glare = max(speccol.r, speccol.g); - cur_glare = max(cur_glare, speccol.b); - glare = max(glare, speccol.r); - glare += max(cur_glare, 0.0); } } } @@ -406,6 +401,8 @@ void main() vec3 light = vec3(0, 0, 0); + final_specular.rgb = srgb_to_linear(final_specular.rgb); // SL-14035 + #define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w ); LIGHT_LOOP(1) diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 8c402fcb54..09c47165dd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -73,9 +73,7 @@ void main() vec3 norm = getNorm(frag.xy); vec4 spec = texture2DRect(specularRect, frag.xy); - spec.rgb = srgb_to_linear(spec.rgb); vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; - diff.rgb = srgb_to_linear(diff.rgb); float noise = texture2D(noiseMap, frag.xy / 128.0).b; vec3 npos = normalize(-pos); diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 9bba45bc4e..ec3fb9c543 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -182,10 +182,6 @@ void main() vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb; - // SL-12005 Projector light pops as we get closer, more objectionable than being in wrong color space. - // We can't switch to linear here unless we do it everywhere* - // *gbuffer is sRGB, convert to linear whenever sampling from it - diff_tex.rgb = srgb_to_linear(diff_tex.rgb); vec3 dlit = vec3(0, 0, 0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index d805c9ea48..18616a9bb3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -90,7 +90,6 @@ void main() float noise = texture2D(noiseMap, frag.xy/128.0).b; vec3 col = texture2DRect(diffuseRect, frag.xy).rgb; - col.rgb = srgb_to_linear(col.rgb); float fa = falloff+1.0; float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); @@ -127,7 +126,7 @@ void main() { discard; } -//col.rgb = vec3(0); + frag_color.rgb = col; frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index f80f1a985a..7f2c603f87 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -90,7 +90,7 @@ void main() vec4 diffuse = texture2DRect(diffuseRect, tc); //convert to gamma space - //diffuse.rgb = linear_to_srgb(diffuse.rgb); + diffuse.rgb = linear_to_srgb(diffuse.rgb); // SL-14035 vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); vec3 color = vec3(0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 5d7a28c359..1b7a1cc6ec 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -191,10 +191,6 @@ void main() float da = dot(norm, lv); vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb; - // SL-12005 Projector light pops as we get closer, more objectionable than being in wrong color space. - // We can't switch to linear here unless we do it everywhere* - // *gbuffer IS sRGB, convert to linear since this shader outputs linear - diff_tex.rgb = srgb_to_linear(diff_tex.rgb); vec4 spec = texture2DRect(specularRect, frag.xy); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index f4db53e0b7..7700d16007 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -87,8 +87,9 @@ void main() float light_gamma = 1.0 / 1.3; da = pow(da, light_gamma); - vec4 diffuse = texture2DRect(diffuseRect, tc); - vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); + vec4 diffuse = texture2DRect(diffuseRect, tc); + diffuse.rgb = linear_to_srgb(diffuse.rgb); // SL-14025 + vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; scol_ambocc = pow(scol_ambocc, vec2(light_gamma)); diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 5ab0b5c5b4..774f537821 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -189,7 +189,7 @@ void main() lv = normalize(lv); float da = dot(norm, lv); - vec3 diff_tex = srgb_to_linear(texture2DRect(diffuseRect, frag.xy).rgb); + vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb; vec4 spec = texture2DRect(specularRect, frag.xy); vec3 dlit = vec3(0, 0, 0); -- cgit v1.2.3 From a5aac898093371fddf3c7323c9dadc2f5be15583 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 6 Jan 2021 18:17:56 -0800 Subject: SL-14035: Don't use sRGB textures when not specified --- indra/llrender/llrender.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 11d9ef3f57..d515fc707a 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -871,10 +871,10 @@ void LLTexUnit::setTextureColorSpace(eTextureColorSpace space) } } else -#endif { glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT); } +#endif } LLLightState::LLLightState(S32 index) -- cgit v1.2.3 From f89db964071121812baa4d81ce065f3579701251 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 7 Jan 2021 10:39:55 -0800 Subject: SL-14035 revert incorrect removal of glare --- indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index bb69e45816..e1f7031af6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -159,6 +159,11 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe vec3 speccol = lit*scol*light_col.rgb*spec.rgb; speccol = clamp(speccol, vec3(0), vec3(1)); col += speccol; + + float cur_glare = max(speccol.r, speccol.g); + cur_glare = max(cur_glare, speccol.b); + glare = max(glare, speccol.r); + glare += max(cur_glare, 0.0); } } } -- cgit v1.2.3 From 9e58a7bdd6777889a43c2a7753cd3b372e55fe84 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 12 Jan 2021 18:13:16 -0700 Subject: SL-13629 Modify texcoord to reverse rainbow color order --- .../newview/app_settings/shaders/class2/deferred/skyF.glsl | 10 +++++++++- .../newview/app_settings/shaders/class3/deferred/skyF.glsl | 13 +++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl index 1485c515a4..5a58f9bc8c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl @@ -73,7 +73,15 @@ uniform float ice_level; vec3 rainbow(float d) { - d = clamp(d, -1.0, 0.0); + // d is the dot product of view and sun directions, so ranging -1.0..1.0 + // 'interesting' values of d are the range -0.75..-0.825, when view is nearly opposite of sun vec + // Rainbox texture mode is GL_REPEAT, so tc of -.75 is equiv to 0.25, -0.825 equiv to 0.175. + + // SL-13629 Rainbow texture has colors within the correct .175...250 range, but order is inverted. + // Rather than replace the texture, we mirror and translate the y tc to keep the colors within the + // interesting range, but in reversed order: i.e. d = (1 - d) - 1.575 + d = clamp(-0.575 - d, 0.0, 1.0); + float rad = (droplet_radius - 5.0f) / 1024.0f; return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl index 6de01cb667..0f908a1d82 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl @@ -56,8 +56,17 @@ vec3 GetSkyLuminanceToPoint(vec3 camPos, vec3 pos, float shadow_length, vec3 dir vec3 ColorFromRadiance(vec3 radiance); vec3 rainbow(float d) { - float rad = (droplet_radius - 5.0f) / 1024.0f; - return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level; + // d is the dot product of view and sun directions, so ranging -1.0..1.0 + // 'interesting' values of d are the range -0.75..-0.825, when view is nearly opposite of sun vec + // Rainbox texture mode is GL_REPEAT, so tc of -.75 is equiv to 0.25, -0.825 equiv to 0.175. + + // SL-13629 Rainbow texture has colors within the correct .175...250 range, but order is inverted. + // Rather than replace the texture, we mirror and translate the y tc to keep the colors within the + // interesting range, but in reversed order: i.e. d = (1 - d) - 1.575 + d = clamp(-0.575 - d, 0.0, 1.0); + + float rad = (droplet_radius - 5.0f) / 1024.0f; + return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level; } vec3 halo22(float d) -- cgit v1.2.3 From 28b9a465ac79e7d2284f9d561bb3ffda61c922d8 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 19 Jan 2021 11:11:46 -0700 Subject: SL-13629, reconstruct rainbow lookup coord to reduce interior banding --- indra/newview/app_settings/shaders/class2/deferred/skyF.glsl | 6 ++++++ indra/newview/app_settings/shaders/class3/deferred/skyF.glsl | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl index 5a58f9bc8c..6841a8194f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl @@ -82,6 +82,12 @@ vec3 rainbow(float d) // interesting range, but in reversed order: i.e. d = (1 - d) - 1.575 d = clamp(-0.575 - d, 0.0, 1.0); + // With the colors in the lower 1/4 of the texture, inverting the coords leaves most of it inaccessible. + // So, we can stretch the texcoord above the colors (ie > 0.25) to fill the entire remaining coordinate + // space. This improves gradation, reduces banding within the rainbow interior. (1-0.25) / (0.425/0.25) = 4.2857 + float interior_coord = max(0.0, d - 0.25) * 4.2857; + d = clamp(d, 0.0, 0.25) + interior_coord; + float rad = (droplet_radius - 5.0f) / 1024.0f; return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl index 0f908a1d82..a0b082ed7c 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl @@ -65,6 +65,12 @@ vec3 rainbow(float d) // interesting range, but in reversed order: i.e. d = (1 - d) - 1.575 d = clamp(-0.575 - d, 0.0, 1.0); + // With the colors in the lower 1/4 of the texture, inverting the coords leaves most of it inaccessible. + // So, we can stretch the texcoord above the colors (ie > 0.25) to fill the entire remaining coordinate + // space. This improves gradation, reduces banding within the rainbow interior. (1-0.25) / (0.425/0.25) = 4.2857 + float interior_coord = max(0.0, d - 0.25) * 4.2857; + d = clamp(d, 0.0, 0.25) + interior_coord; + float rad = (droplet_radius - 5.0f) / 1024.0f; return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level; } -- cgit v1.2.3 From 1e26adf288f8b4585c0ce8338dd548475613862c Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 22 Jan 2021 16:31:50 -0800 Subject: SL-14707: Merge Sovereign Engineer's fix for clouds: Clouds are unusually dim in EEP --- indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl | 1 + indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl | 1 + 2 files changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index a132220bef..8e0a001403 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -166,6 +166,7 @@ void main() (blue_horizon * blue_weight * (sunlight + tmpAmbient) + (haze_horizon * haze_weight) * (sunlight * haze_glow + tmpAmbient)); // CLOUDS + sunlight = sunlight_color; // SL-14707 reset color -- Clouds are unusually dim in EEP off_axis = 1.0 / max(1e-6, lightnorm.y * 2.); sunlight *= exp(-light_atten * off_axis); diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index b004cc7ddd..97ffa9feef 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -166,6 +166,7 @@ void main() (blue_horizon * blue_weight * (sunlight + tmpAmbient) + (haze_horizon * haze_weight) * (sunlight * haze_glow + tmpAmbient)); // CLOUDS + sunlight = sunlight_color; // SL-14707 reset color -- Clouds are unusually dim in EEP off_axis = 1.0 / max(1e-6, lightnorm.y * 2.); sunlight *= exp(-light_atten * off_axis); -- cgit v1.2.3 From ef4c7c124753ca93659e34c6bbf0f6ef0ca208e7 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 21 Jan 2021 17:29:54 -0800 Subject: SL-14705: Merge Sovereign Engineer's fix for name tags showing in front with AMD GPUs: Fix GL_INVALID_OPERATION when copying stencil to default window framebuffer on AMD graphics on windows --- indra/llwindow/llwindowwin32.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 6831071cd1..0db9886d03 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1474,24 +1474,29 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO LL_INFOS("Window") << "pixel formats done." << LL_ENDL ; - S32 swap_method = 0; - S32 cur_format = num_formats-1; - GLint swap_query = WGL_SWAP_METHOD_ARB; - - BOOL found_format = FALSE; - - while (!found_format && wglGetPixelFormatAttribivARB(mhDC, pixel_format, 0, 1, &swap_query, &swap_method)) + S32 swap_method = 0; + S32 cur_format = 0; + GLint swap_query = WGL_SWAP_METHOD_ARB; + + // SL-14705 Fix name tags showing in front of objects with AMD GPUs. + // On AMD hardware we need to iterate from the first pixel format to the end. + // Spec: + // https://www.khronos.org/registry/OpenGL/extensions/ARB/WGL_ARB_pixel_format.txt + while (wglGetPixelFormatAttribivARB(mhDC, pixel_formats[cur_format], 0, 1, &swap_query, &swap_method)) { - if (swap_method == WGL_SWAP_UNDEFINED_ARB || cur_format <= 0) + if (swap_method == WGL_SWAP_UNDEFINED_ARB) { - found_format = TRUE; + break; } - else + else if (cur_format >= (S32)(num_formats - 1)) { - --cur_format; + cur_format = 0; + break; } + + ++cur_format; } - + pixel_format = pixel_formats[cur_format]; if (mhDC != 0) // Does The Window Have A Device Context? -- cgit v1.2.3 From 7b2dd98962c92a4ae84ce8042109f0d9ec9b4b56 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 22 Jan 2021 16:48:31 -0800 Subject: SL-14705: Cleanup U32 S32 cast --- indra/llwindow/llwindowwin32.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 0db9886d03..afe0c2cc6a 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1476,6 +1476,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO S32 swap_method = 0; S32 cur_format = 0; +const S32 max_format = (S32)num_formats - 1; GLint swap_query = WGL_SWAP_METHOD_ARB; // SL-14705 Fix name tags showing in front of objects with AMD GPUs. @@ -1488,7 +1489,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO { break; } - else if (cur_format >= (S32)(num_formats - 1)) + else if (cur_format >= max_format) { cur_format = 0; break; -- cgit v1.2.3 From 6564fce81aa22e2ff558206903d2281a57a7f1cd Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Fri, 22 Jan 2021 16:58:58 -0700 Subject: SL-13490 fix debug normals under non-uniform scale --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llspatialpartition.cpp | 126 ++++++++++++++++++++++---------- 2 files changed, 87 insertions(+), 41 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0b9cc78132..62ceb9077a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9091,7 +9091,7 @@ Type F32 Value - 0.03 + 0.1 RenderDebugPipeline diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 8fc2405f0a..b87551dab5 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2253,52 +2253,98 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) } } -void renderNormals(LLDrawable* drawablep) +void renderNormals(LLDrawable *drawablep) { - LLVertexBuffer::unbind(); + if (!drawablep->isVisible()) + return; - LLVOVolume* vol = drawablep->getVOVolume(); - if (vol) - { - LLVolume* volume = vol->getVolume(); - gGL.pushMatrix(); - gGL.multMatrix((F32*) vol->getRelativeXform().mMatrix); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLVertexBuffer::unbind(); - LLVector4a scale(gSavedSettings.getF32("RenderDebugNormalScale")); + LLVOVolume *vol = drawablep->getVOVolume(); - for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) - { - const LLVolumeFace& face = volume->getVolumeFace(i); + if (vol) + { + LLVolume *volume = vol->getVolume(); - for (S32 j = 0; j < face.mNumVertices; ++j) - { - gGL.begin(LLRender::LINES); - LLVector4a n,p; - - n.setMul(face.mNormals[j], scale); - p.setAdd(face.mPositions[j], n); - - gGL.diffuseColor4f(1,1,1,1); - gGL.vertex3fv(face.mPositions[j].getF32ptr()); - gGL.vertex3fv(p.getF32ptr()); - - if (face.mTangents) - { - n.setMul(face.mTangents[j], scale); - p.setAdd(face.mPositions[j], n); - - gGL.diffuseColor4f(0,1,1,1); - gGL.vertex3fv(face.mPositions[j].getF32ptr()); - gGL.vertex3fv(p.getF32ptr()); - } - gGL.end(); - } - } + // Drawable's normals & tangents are stored in model space, i.e. before any scaling is applied. + // + // SL-13490, using pos + normal to compute the 2nd vertex of a normal line segment doesn't + // work when there's a non-uniform scale in the mix. Normals require MVP-inverse-transpose + // transform. We get that effect here by pre-applying the inverse scale (twice, because + // one forward scale will be re-applied via the MVP in the vertex shader) - gGL.popMatrix(); - } + LLVector3 scale_v3 = vol->getScale(); + LLVector4a obj_scale(scale_v3.mV[VX], scale_v3.mV[VY], scale_v3.mV[VZ]); + obj_scale.normalize3(); + + float draw_length = gSavedSettings.getF32("RenderDebugNormalScale"); + + // Create inverse-scale vector for normals + LLVector4a inv_scale(1.0 / scale_v3.mV[VX], 1.0 / scale_v3.mV[VY], 1.0 / scale_v3.mV[VZ]); + inv_scale.mul(inv_scale); // Squared, to apply inverse scale twice + inv_scale.normalize3fast(); + + gGL.pushMatrix(); + gGL.multMatrix((F32 *) vol->getRelativeXform().mMatrix); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) + { + const LLVolumeFace &face = volume->getVolumeFace(i); + + gGL.flush(); + gGL.diffuseColor4f(1, 1, 0, 1); + gGL.begin(LLRender::LINES); + for (S32 j = 0; j < face.mNumVertices; ++j) + { + LLVector4a n, p; + + n.setMul(face.mNormals[j], 1.0); + n.mul(inv_scale); // Pre-scale normal, so it's left with an inverse-transpose xform after MVP + n.normalize3fast(); + + // Since we send 2 vertices instead of a vertex and a vector, the drawn normal length ends up + // getting stretched along with the object. To minimize that effect (imperfectly), reduce its + // length by a dot factor with the dominant scale direction. + float mvp_scale_factor = 0.95 * abs(n.dot3(obj_scale).getF32()); + n.mul((1.0 - mvp_scale_factor) * draw_length); + p.setAdd(face.mPositions[j], n); + + gGL.vertex3fv(face.mPositions[j].getF32ptr()); + gGL.vertex3fv(p.getF32ptr()); + } + gGL.end(); + + // Tangents are simple vectors and do not require reorientation via pre-scaling + if (face.mTangents) + { + gGL.flush(); + gGL.diffuseColor4f(0, 1, 1, 1); + gGL.begin(LLRender::LINES); + for (S32 j = 0; j < face.mNumVertices; ++j) + { + LLVector4a t, p; + + t.setMul(face.mTangents[j], 1.0f); + t.normalize3fast(); + + // Since we send 2 vertices instead of a vertex and a vector, the drawn tangent length ends up + // getting stretched along with the object. To minimize that effect (imperfectly), reduce its + // length by a dot factor with the dominant scale direction. + float mvp_scale_factor = 0.95 * abs(t.dot3(obj_scale).getF32()); + t.mul((1.0 - mvp_scale_factor) * draw_length); + p.setAdd(face.mPositions[j], t); + + gGL.vertex3fv(face.mPositions[j].getF32ptr()); + gGL.vertex3fv(p.getF32ptr()); + } + gGL.end(); + } + } + + gGL.popMatrix(); + } } S32 get_physics_detail(const LLVolumeParams& volume_params, const LLVector3& scale) -- cgit v1.2.3 From 10e95a60af08c870e3d2b0a4cc74f76cd923d2aa Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Fri, 29 Jan 2021 12:05:29 -0700 Subject: SL-13490 replace imperfect object-relative normals with constant length --- indra/newview/llspatialpartition.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index b87551dab5..0186c1943f 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2274,10 +2274,13 @@ void renderNormals(LLDrawable *drawablep) // one forward scale will be re-applied via the MVP in the vertex shader) LLVector3 scale_v3 = vol->getScale(); + float scale_len = scale_v3.length(); LLVector4a obj_scale(scale_v3.mV[VX], scale_v3.mV[VY], scale_v3.mV[VZ]); obj_scale.normalize3(); - float draw_length = gSavedSettings.getF32("RenderDebugNormalScale"); + // Normals &tangent line segments get scaled along with the object. Divide by scale length + // to keep the as-viewed lengths (relatively) constant with the debug setting length + float draw_length = gSavedSettings.getF32("RenderDebugNormalScale") / scale_len; // Create inverse-scale vector for normals LLVector4a inv_scale(1.0 / scale_v3.mV[VX], 1.0 / scale_v3.mV[VY], 1.0 / scale_v3.mV[VZ]); @@ -2303,12 +2306,7 @@ void renderNormals(LLDrawable *drawablep) n.setMul(face.mNormals[j], 1.0); n.mul(inv_scale); // Pre-scale normal, so it's left with an inverse-transpose xform after MVP n.normalize3fast(); - - // Since we send 2 vertices instead of a vertex and a vector, the drawn normal length ends up - // getting stretched along with the object. To minimize that effect (imperfectly), reduce its - // length by a dot factor with the dominant scale direction. - float mvp_scale_factor = 0.95 * abs(n.dot3(obj_scale).getF32()); - n.mul((1.0 - mvp_scale_factor) * draw_length); + n.mul(draw_length); p.setAdd(face.mPositions[j], n); gGL.vertex3fv(face.mPositions[j].getF32ptr()); @@ -2328,12 +2326,7 @@ void renderNormals(LLDrawable *drawablep) t.setMul(face.mTangents[j], 1.0f); t.normalize3fast(); - - // Since we send 2 vertices instead of a vertex and a vector, the drawn tangent length ends up - // getting stretched along with the object. To minimize that effect (imperfectly), reduce its - // length by a dot factor with the dominant scale direction. - float mvp_scale_factor = 0.95 * abs(t.dot3(obj_scale).getF32()); - t.mul((1.0 - mvp_scale_factor) * draw_length); + t.mul(draw_length); p.setAdd(face.mPositions[j], t); gGL.vertex3fv(face.mPositions[j].getF32ptr()); -- cgit v1.2.3 From d7b2016e39cb298a0a105e624ecc7bcf9d7db187 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 29 Jan 2021 13:04:39 -0800 Subject: SL-14731: Fix sun gamma -- merge Sovereign Engineer's patch: Fix sun gamma space for accurate color reproduction of sun textures --- indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl | 4 ---- indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl | 1 - 2 files changed, 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl index 454af2a9bc..b2fa5d8a25 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl @@ -49,10 +49,6 @@ void main() vec4 sunDiscB = texture2D(altDiffuseMap, vary_texcoord0.xy); vec4 c = mix(sunDiscA, sunDiscB, blend_factor); - c.rgb = srgb_to_linear(c.rgb); - c.rgb = clamp(c.rgb, vec3(0), vec3(1)); - c.rgb = pow(c.rgb, vec3(0.7f)); - //c.rgb = fullbrightAtmosTransport(c.rgb); c.rgb = fullbrightScaleSoftClip(c.rgb); diff --git a/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl index b9ae7a0226..5a41dc644a 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl @@ -51,7 +51,6 @@ void main() // SL-9806 stars poke through // c.a *= sun_fade; - c.rgb = pow(c.rgb, vec3(0.7f)); c.rgb = fullbrightAtmosTransport(c.rgb); c.rgb = fullbrightScaleSoftClip(c.rgb); frag_color = c; -- cgit v1.2.3 From cc6d132e90921c7006253f6fba149d22f2cabd39 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 29 Jan 2021 14:32:37 -0800 Subject: SL-14732: Merge Sovereign Engineer's cloud patch: Fix writing outside outside of the bound fbo in forward render class2 cloud shader --- indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index 75bf8730df..fa928d993e 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -26,9 +26,9 @@ /*[EXTRA_CODE_HERE]*/ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; +out vec4 frag_color; #else -#define frag_data gl_FragData +#define frag_color gl_FragColor #endif ///////////////////////////////////////////////////////////////////////// @@ -126,8 +126,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); /// Gamma correct for WL (soft clip effect). - frag_data[0] = vec4(color.rgb, alpha1); - frag_data[1] = vec4(0.0,0.0,0.0,0.0); - frag_data[2] = vec4(0,0,0,1); + frag_color = vec4(color.rgb, alpha1); } -- cgit v1.2.3 From ab02a6dfd42bb44bdfbdf5a97221c0abdfbe81e2 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 29 Jan 2021 18:41:04 -0800 Subject: SL-14706 Merge Sovereign Engineer's fix for stars not centered around camera: Stars render around center of sim instead of center of camera. --- indra/newview/lldrawpoolwlsky.cpp | 13 +++++++++---- indra/newview/lldrawpoolwlsky.h | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index d4e7f1600e..0c3d8f3098 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -226,7 +226,7 @@ void LLDrawPoolWLSky::renderSkyHaze(const LLVector3& camPosLocal, F32 camHeightL } } -void LLDrawPoolWLSky::renderStars(void) const +void LLDrawPoolWLSky::renderStars(const LLVector3& camPosLocal) const { LLGLSPipelineBlendSkyBox gls_skybox(true, false); @@ -266,6 +266,7 @@ void LLDrawPoolWLSky::renderStars(void) const } gGL.pushMatrix(); + gGL.translatef(camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]); gGL.rotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f); if (LLGLSLShader::sNoFixedFunction) { @@ -296,7 +297,7 @@ void LLDrawPoolWLSky::renderStars(void) const } } -void LLDrawPoolWLSky::renderStarsDeferred(void) const +void LLDrawPoolWLSky::renderStarsDeferred(const LLVector3& camPosLocal) const { LLGLSPipelineBlendSkyBox gls_sky(true, false); @@ -337,6 +338,8 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const gGL.getTexUnit(1)->bind(tex_b); } + gGL.pushMatrix(); + gGL.translatef(camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]); gDeferredStarProgram.uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); if (LLPipeline::sReflectionRender) @@ -355,6 +358,8 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); gDeferredStarProgram.unbind(); + + gGL.popMatrix(); } void LLDrawPoolWLSky::renderSkyCloudsDeferred(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader* cloudshader) const @@ -601,7 +606,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) if (gPipeline.canUseWindLightShaders()) { renderSkyHazeDeferred(origin, camHeightLocal); - renderStarsDeferred(); + renderStarsDeferred(origin); renderHeavenlyBodies(); renderSkyCloudsDeferred(origin, camHeightLocal, cloud_shader); } @@ -620,7 +625,7 @@ void LLDrawPoolWLSky::render(S32 pass) LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); renderSkyHaze(origin, camHeightLocal); - renderStars(); + renderStars(origin); renderHeavenlyBodies(); renderSkyClouds(origin, camHeightLocal, cloud_shader); diff --git a/indra/newview/lldrawpoolwlsky.h b/indra/newview/lldrawpoolwlsky.h index a4f176d6db..324886ed42 100644 --- a/indra/newview/lldrawpoolwlsky.h +++ b/indra/newview/lldrawpoolwlsky.h @@ -78,8 +78,8 @@ private: void renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 camHeightLocal) const; void renderSkyCloudsDeferred(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader* cloudshader) const; - void renderStarsDeferred(void) const; - void renderStars(void) const; + void renderStarsDeferred(const LLVector3& camPosLocal) const; + void renderStars(const LLVector3& camPosLocal) const; void renderHeavenlyBodies(); }; -- cgit v1.2.3 From 033d16747c7aab02e67001c210ecdb1cf953e327 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Mon, 1 Feb 2021 16:25:56 -0700 Subject: DRTVWR-525 fix build error resulting from 6.4.13 merge --- indra/llrender/llgl.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 542b081806..43fedeca64 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1015,7 +1015,6 @@ void LLGLManager::asLLSD(LLSD& info) // Other fields info["has_requirements"] = mHasRequirements; info["has_separate_specular_color"] = mHasSeparateSpecularColor; - info["debug_gpu"] = mDebugGPU; info["max_vertex_range"] = mGLMaxVertexRange; info["max_index_range"] = mGLMaxIndexRange; info["max_texture_size"] = mGLMaxTextureSize; -- cgit v1.2.3 From 1dd32bb772bb2f0d6d4f3180965a8bdcf9c1000d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 2 Feb 2021 23:47:48 +0200 Subject: SL-14796 After teleporting, add notation into Nearby Chat --- indra/llui/llchat.h | 6 ++- indra/newview/llagent.cpp | 60 +++++++++++++++++++++++++ indra/newview/llagent.h | 3 ++ indra/newview/llchathistory.cpp | 62 +++++++++++++++++++------- indra/newview/llviewerdisplay.cpp | 1 + indra/newview/skins/default/colors.xml | 3 ++ indra/newview/skins/default/xui/en/strings.xml | 3 ++ 7 files changed, 120 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h index f5b242fdfc..c39e44200c 100644 --- a/indra/llui/llchat.h +++ b/indra/llui/llchat.h @@ -37,7 +37,8 @@ typedef enum e_chat_source_type CHAT_SOURCE_SYSTEM = 0, CHAT_SOURCE_AGENT = 1, CHAT_SOURCE_OBJECT = 2, - CHAT_SOURCE_UNKNOWN = 3 + CHAT_SOURCE_TELEPORT = 3, + CHAT_SOURCE_UNKNOWN = 4 } EChatSourceType; typedef enum e_chat_type @@ -64,7 +65,8 @@ typedef enum e_chat_style { CHAT_STYLE_NORMAL, CHAT_STYLE_IRC, - CHAT_STYLE_HISTORY + CHAT_STYLE_HISTORY, + CHAT_STYLE_TELEPORT_SEP }EChatStyle; // A piece of chat diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c65bc0fa50..f31135ad4c 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -519,6 +519,10 @@ void LLAgent::cleanup() { mTeleportFailedSlot.disconnect(); } + if (mParcelMgrConnection.connected()) + { + mParcelMgrConnection.disconnect(); + } } //----------------------------------------------------------------------------- @@ -3934,6 +3938,10 @@ void LLAgent::clearTeleportRequest() LLVoiceClient::getInstance()->setHidden(FALSE); } mTeleportRequest.reset(); + if (mParcelMgrConnection.connected()) + { + mParcelMgrConnection.disconnect(); + } } void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) @@ -3942,6 +3950,12 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) mMaturityRatingChange = pMaturityRatingChange; } +void LLAgent::sheduleTeleportIM() +{ + // is supposed to be called during teleport so we are still waiting for parcel + mParcelMgrConnection = addParcelChangedCallback(onParcelReadyAfterTeleport); +} + bool LLAgent::hasPendingTeleportRequest() { return ((mTeleportRequest != NULL) && @@ -4051,6 +4065,52 @@ void LLAgent::handleTeleportFailed() LLNotificationsUtil::add("PreferredMaturityChanged", args); mIsMaturityRatingChangingDuringTeleport = false; } + + if (mParcelMgrConnection.connected()) + { + mParcelMgrConnection.disconnect(); + } +} + +/*static*/ +void LLAgent::onParcelReadyAfterTeleport() +{ + LLViewerRegion* agent_region = gAgent.getRegion(); + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (!agent_region || !agent_parcel) + { + return; + } + + LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat"); + if (nearby_chat) + { + std::string location_name; + LLAgentUI::ELocationFormat format = LLAgentUI::LOCATION_FORMAT_NO_MATURITY; + + // Might be better to provide slurl to chat + if (!LLAgentUI::buildLocationString(location_name, format)) + { + location_name = "Teleport to new region"; // Shouldn't happen + } + + LLChat chat; + chat.mFromName = location_name; + chat.mMuted = FALSE; + chat.mFromID = LLUUID::null; + chat.mSourceType = CHAT_SOURCE_TELEPORT; + chat.mChatStyle = CHAT_STYLE_TELEPORT_SEP; + chat.mText = ""; + + LLSD args; + args["do_not_log"] = TRUE; + nearby_chat->addMessage(chat, true, args); + } + + if (gAgent.mParcelMgrConnection.connected()) + { + gAgent.mParcelMgrConnection.disconnect(); + } } /*static*/ diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index d46c99db8c..8f8c2f6007 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -653,6 +653,7 @@ public: void restartFailedTeleportRequest(); void clearTeleportRequest(); void setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange); + void sheduleTeleportIM(); private: @@ -667,6 +668,7 @@ private: LLTeleportRequestPtr mTeleportCanceled; boost::signals2::connection mTeleportFinishedSlot; boost::signals2::connection mTeleportFailedSlot; + boost::signals2::connection mParcelMgrConnection; bool mIsMaturityRatingChangingDuringTeleport; U8 mMaturityRatingChange; @@ -685,6 +687,7 @@ private: void handleTeleportFinished(); void handleTeleportFailed(); + static void onParcelReadyAfterTeleport(); static void onCapabilitiesReceivedAfterTeleport(); //-------------------------------------------------------------------- diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2ba2c6d8b5..2bb68dbbbe 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -122,6 +122,7 @@ public: mUserNameFont(NULL), mUserNameTextBox(NULL), mTimeBoxTextBox(NULL), + mNeedsTimeBox(true), mAvatarNameCacheConnection() {} @@ -643,8 +644,19 @@ public: user_name->setReadOnlyColor(style_params.readonly_color()); user_name->setColor(style_params.color()); - if (chat.mFromName.empty() - || mSourceType == CHAT_SOURCE_SYSTEM) + if (mSourceType == CHAT_SOURCE_TELEPORT + && chat.mChatStyle == CHAT_STYLE_TELEPORT_SEP) + { + mFrom = chat.mFromName; + mNeedsTimeBox = false; + user_name->setValue(mFrom); + updateMinUserNameWidth(); + LLColor4 sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor"); + setTransparentColor(sep_color); + mTimeBoxTextBox->setVisible(FALSE); + } + else if (chat.mFromName.empty() + || mSourceType == CHAT_SOURCE_SYSTEM) { mFrom = LLTrans::getString("SECOND_LIFE"); if(!chat.mFromName.empty() && (mFrom != chat.mFromName)) @@ -727,6 +739,8 @@ public: break; case CHAT_SOURCE_SYSTEM: icon->setValue(LLSD("SL_Logo")); + case CHAT_SOURCE_TELEPORT: + icon->setValue(LLSD("Command_Destinations_Icon")); break; case CHAT_SOURCE_UNKNOWN: icon->setValue(LLSD("Unknown_Icon")); @@ -766,7 +780,7 @@ public: S32 user_name_width = user_name_rect.getWidth(); S32 time_box_width = time_box->getRect().getWidth(); - if (!time_box->getVisible() && user_name_width > mMinUserNameWidth) + if (mNeedsTimeBox && !time_box->getVisible() && user_name_width > mMinUserNameWidth) { user_name_rect.mRight -= time_box_width; user_name->reshape(user_name_rect.getWidth(), user_name_rect.getHeight()); @@ -968,6 +982,8 @@ protected: LLTextBox* mUserNameTextBox; LLTextBox* mTimeBoxTextBox; + bool mNeedsTimeBox; + private: boost::signals2::connection mAvatarNameCacheConnection; }; @@ -1202,6 +1218,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } bool message_from_log = chat.mChatStyle == CHAT_STYLE_HISTORY; + bool teleport_separator = chat.mSourceType == CHAT_SOURCE_TELEPORT; // We graying out chat history by graying out messages that contains full date in a time string if (message_from_log) { @@ -1222,14 +1239,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params timestamp_style(body_message_params); // out of the timestamp - if (args["show_time"].asBoolean()) + if (args["show_time"].asBoolean() && !teleport_separator) { - if (!message_from_log) - { - LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); - timestamp_style.color(timestamp_color); - timestamp_style.readonly_color(timestamp_color); - } + if (!message_from_log) + { + LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); + timestamp_style.color(timestamp_color); + timestamp_style.readonly_color(timestamp_color); + } mEditor->appendText("[" + chat.mTimeStr + "] ", prependNewLineState, timestamp_style); prependNewLineState = false; } @@ -1272,6 +1289,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL prependNewLineState, link_params); prependNewLineState = false; } + else if (teleport_separator) + { + std::string tp_text = LLTrans::getString("teleport_preamble_compact_chat"); + mEditor->appendText(tp_text + " " + chat.mFromName + "", + prependNewLineState, body_message_params); + prependNewLineState = false; + } else { mEditor->appendText("" + chat.mFromName + "" + delimiter, @@ -1290,8 +1314,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL p.right_pad = mRightWidgetPad; LLDate new_message_time = LLDate::now(); - - if (mLastFromName == chat.mFromName + if (!teleport_separator + && mLastFromName == chat.mFromName && mLastFromID == chat.mFromID && mLastMessageTime.notNull() && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 @@ -1314,7 +1338,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL p.top_pad = 0; else p.top_pad = mTopHeaderPad; - p.bottom_pad = mBottomHeaderPad; + if (teleport_separator) + { + p.bottom_pad = mBottomSeparatorPad; + } + else + { + p.bottom_pad = mBottomHeaderPad; + } if (!view) { LL_WARNS() << "Failed to create header from " << mMessageHeaderFilename << ": can't append to history" << LL_ENDL; @@ -1392,9 +1423,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } } } - // usual messages showing - else + else if(!teleport_separator) { std::string message = irc_me ? chat.mText.substr(3) : chat.mText; @@ -1427,7 +1457,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (square_brackets) { message += "]"; - } + } mEditor->appendText(message, prependNewLineState, body_message_params); prependNewLineState = false; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index d314b1477a..5679c3c325 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -474,6 +474,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gAgent.setTeleportState( LLAgent::TELEPORT_ARRIVING ); gAgent.setTeleportMessage( LLAgent::sTeleportProgressMessages["arriving"]); + gAgent.sheduleTeleportIM(); gTextureList.mForceResetTextureStats = TRUE; gAgentCamera.resetView(TRUE, TRUE); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 034576d30c..92398857ba 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -850,6 +850,9 @@ + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index db9d3bfa83..c2b5286fc3 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3758,6 +3758,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. [SOURCES] have said something new + + + You are now at The session initialization is timed out -- cgit v1.2.3 From 2351809b5cb71d17461a6bec2041cbc1ad2efc91 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 4 Feb 2021 18:04:42 +0200 Subject: SL-14796 Resolved encountered merge issue --- indra/newview/llviewerparcelmgr.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index d5365e4ee8..06172e366d 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1715,9 +1715,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use // Let interesting parties know about agent parcel change. LLViewerParcelMgr* instance = LLViewerParcelMgr::getInstance(); - // Notify anything that wants to know when the agent changes parcels - gAgent.changeParcels(); - if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; @@ -1733,6 +1730,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } parcel->setParcelEnvironmentVersion(parcel_environment_version); LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; + // Notify anything that wants to know when the agent changes parcels gAgent.changeParcels(); instance->mTeleportInProgress = FALSE; -- cgit v1.2.3 From ca6121979c6716aaf986fc6d0d469383471469f4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 4 Feb 2021 18:06:17 +0200 Subject: SL-14796 Updated code accordingly to changed event order --- indra/newview/llagent.cpp | 30 +++++++++++------------------- indra/newview/llagent.h | 4 ++-- indra/newview/llchathistory.cpp | 1 + 3 files changed, 14 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f31135ad4c..3c50493d79 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -387,6 +387,7 @@ LLAgent::LLAgent() : mTeleportFinishedSlot(), mTeleportFailedSlot(), mIsMaturityRatingChangingDuringTeleport(false), + mTPNeedsNeabyChatSeparator(false), mMaturityRatingChange(0U), mIsDoSendMaturityPreferenceToServer(false), mMaturityPreferenceRequestId(0U), @@ -519,10 +520,6 @@ void LLAgent::cleanup() { mTeleportFailedSlot.disconnect(); } - if (mParcelMgrConnection.connected()) - { - mParcelMgrConnection.disconnect(); - } } //----------------------------------------------------------------------------- @@ -3938,10 +3935,7 @@ void LLAgent::clearTeleportRequest() LLVoiceClient::getInstance()->setHidden(FALSE); } mTeleportRequest.reset(); - if (mParcelMgrConnection.connected()) - { - mParcelMgrConnection.disconnect(); - } + mTPNeedsNeabyChatSeparator = false; } void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) @@ -3953,7 +3947,7 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) void LLAgent::sheduleTeleportIM() { // is supposed to be called during teleport so we are still waiting for parcel - mParcelMgrConnection = addParcelChangedCallback(onParcelReadyAfterTeleport); + mTPNeedsNeabyChatSeparator = true; } bool LLAgent::hasPendingTeleportRequest() @@ -4003,6 +3997,12 @@ void LLAgent::startTeleportRequest() void LLAgent::handleTeleportFinished() { LL_INFOS("Teleport") << "Agent handling teleport finished." << LL_ENDL; + if (mTPNeedsNeabyChatSeparator) + { + // parcel is ready at this point + addTPNearbyChatSeparator(); + mTPNeedsNeabyChatSeparator = false; + } clearTeleportRequest(); mTeleportCanceled.reset(); if (mIsMaturityRatingChangingDuringTeleport) @@ -4066,14 +4066,11 @@ void LLAgent::handleTeleportFailed() mIsMaturityRatingChangingDuringTeleport = false; } - if (mParcelMgrConnection.connected()) - { - mParcelMgrConnection.disconnect(); - } + mTPNeedsNeabyChatSeparator = false; } /*static*/ -void LLAgent::onParcelReadyAfterTeleport() +void LLAgent::addTPNearbyChatSeparator() { LLViewerRegion* agent_region = gAgent.getRegion(); LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); @@ -4106,11 +4103,6 @@ void LLAgent::onParcelReadyAfterTeleport() args["do_not_log"] = TRUE; nearby_chat->addMessage(chat, true, args); } - - if (gAgent.mParcelMgrConnection.connected()) - { - gAgent.mParcelMgrConnection.disconnect(); - } } /*static*/ diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 8f8c2f6007..a792d3e11f 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -668,9 +668,9 @@ private: LLTeleportRequestPtr mTeleportCanceled; boost::signals2::connection mTeleportFinishedSlot; boost::signals2::connection mTeleportFailedSlot; - boost::signals2::connection mParcelMgrConnection; bool mIsMaturityRatingChangingDuringTeleport; + bool mTPNeedsNeabyChatSeparator; U8 mMaturityRatingChange; bool hasPendingTeleportRequest(); @@ -687,7 +687,7 @@ private: void handleTeleportFinished(); void handleTeleportFailed(); - static void onParcelReadyAfterTeleport(); + static void addTPNearbyChatSeparator(); static void onCapabilitiesReceivedAfterTeleport(); //-------------------------------------------------------------------- diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2bb68dbbbe..c110e0d815 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -739,6 +739,7 @@ public: break; case CHAT_SOURCE_SYSTEM: icon->setValue(LLSD("SL_Logo")); + break; case CHAT_SOURCE_TELEPORT: icon->setValue(LLSD("Command_Destinations_Icon")); break; -- cgit v1.2.3 From dab09485448f7761f88d0debe6e5204a5980b6d2 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Thu, 4 Feb 2021 10:51:46 -0700 Subject: DRTVWR-525, improve dev's quality-of-life --- indra/llrender/llshadermgr.h | 428 ++++++++++++++++++++-------------------- indra/llrender/llvertexbuffer.h | 43 ++-- 2 files changed, 238 insertions(+), 233 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 127b5ce5b6..3908efd4ec 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -36,221 +36,223 @@ public: LLShaderMgr(); virtual ~LLShaderMgr(); - typedef enum - { - MODELVIEW_MATRIX = 0, - PROJECTION_MATRIX, - INVERSE_PROJECTION_MATRIX, - MODELVIEW_PROJECTION_MATRIX, - INVERSE_MODELVIEW_MATRIX, - NORMAL_MATRIX, - TEXTURE_MATRIX0, - TEXTURE_MATRIX1, - TEXTURE_MATRIX2, - TEXTURE_MATRIX3, - OBJECT_PLANE_S, - OBJECT_PLANE_T, - VIEWPORT, - LIGHT_POSITION, - LIGHT_DIRECTION, - LIGHT_ATTENUATION, - LIGHT_DIFFUSE, - LIGHT_AMBIENT, - MULTI_LIGHT_COUNT, - MULTI_LIGHT, - MULTI_LIGHT_COL, - MULTI_LIGHT_FAR_Z, - PROJECTOR_MATRIX, - PROJECTOR_NEAR, - PROJECTOR_P, - PROJECTOR_N, - PROJECTOR_ORIGIN, - PROJECTOR_RANGE, - PROJECTOR_AMBIANCE, - PROJECTOR_SHADOW_INDEX, - PROJECTOR_SHADOW_FADE, - PROJECTOR_FOCUS, - PROJECTOR_LOD, - PROJECTOR_AMBIENT_LOD, - DIFFUSE_COLOR, - DIFFUSE_MAP, - ALTERNATE_DIFFUSE_MAP, - SPECULAR_MAP, - BUMP_MAP, - BUMP_MAP2, - ENVIRONMENT_MAP, - CLOUD_NOISE_MAP, - CLOUD_NOISE_MAP_NEXT, - FULLBRIGHT, - LIGHTNORM, - SUNLIGHT_COLOR, - AMBIENT, - BLUE_HORIZON, - BLUE_DENSITY, - HAZE_HORIZON, - HAZE_DENSITY, - CLOUD_SHADOW, - DENSITY_MULTIPLIER, - DISTANCE_MULTIPLIER, - MAX_Y, - GLOW, - CLOUD_COLOR, - CLOUD_POS_DENSITY1, - CLOUD_POS_DENSITY2, - CLOUD_SCALE, - GAMMA, - SCENE_LIGHT_STRENGTH, - LIGHT_CENTER, - LIGHT_SIZE, - LIGHT_FALLOFF, - BOX_CENTER, - BOX_SIZE, - - GLOW_MIN_LUMINANCE, - GLOW_MAX_EXTRACT_ALPHA, - GLOW_LUM_WEIGHTS, - GLOW_WARMTH_WEIGHTS, - GLOW_WARMTH_AMOUNT, - GLOW_STRENGTH, - GLOW_DELTA, - - MINIMUM_ALPHA, - EMISSIVE_BRIGHTNESS, - - DEFERRED_SHADOW_MATRIX, - DEFERRED_ENV_MAT, - DEFERRED_SHADOW_CLIP, - DEFERRED_SUN_WASH, - DEFERRED_SHADOW_NOISE, - DEFERRED_BLUR_SIZE, - DEFERRED_SSAO_RADIUS, - DEFERRED_SSAO_MAX_RADIUS, - DEFERRED_SSAO_FACTOR, - DEFERRED_SSAO_FACTOR_INV, - DEFERRED_SSAO_EFFECT_MAT, - DEFERRED_SCREEN_RES, - DEFERRED_NEAR_CLIP, - DEFERRED_SHADOW_OFFSET, - DEFERRED_SHADOW_BIAS, - DEFERRED_SPOT_SHADOW_BIAS, - DEFERRED_SPOT_SHADOW_OFFSET, - DEFERRED_SUN_DIR, - DEFERRED_MOON_DIR, - DEFERRED_SHADOW_RES, - DEFERRED_PROJ_SHADOW_RES, - DEFERRED_DEPTH_CUTOFF, - DEFERRED_NORM_CUTOFF, - DEFERRED_SHADOW_TARGET_WIDTH, - - FXAA_TC_SCALE, - FXAA_RCP_SCREEN_RES, - FXAA_RCP_FRAME_OPT, - FXAA_RCP_FRAME_OPT2, - - DOF_FOCAL_DISTANCE, - DOF_BLUR_CONSTANT, - DOF_TAN_PIXEL_ANGLE, - DOF_MAGNIFICATION, - DOF_MAX_COF, - DOF_RES_SCALE, - DOF_WIDTH, - DOF_HEIGHT, - - DEFERRED_DEPTH, - DEFERRED_SHADOW0, - DEFERRED_SHADOW1, - DEFERRED_SHADOW2, - DEFERRED_SHADOW3, - DEFERRED_SHADOW4, - DEFERRED_SHADOW5, - DEFERRED_NORMAL, - DEFERRED_POSITION, - DEFERRED_DIFFUSE, - DEFERRED_SPECULAR, - DEFERRED_NOISE, - DEFERRED_LIGHTFUNC, - DEFERRED_LIGHT, - DEFERRED_BLOOM, - DEFERRED_PROJECTION, - DEFERRED_NORM_MATRIX, - TEXTURE_GAMMA, - SPECULAR_COLOR, - ENVIRONMENT_INTENSITY, - - AVATAR_MATRIX, - AVATAR_TRANSLATION, - - WATER_SCREENTEX, - WATER_SCREENDEPTH, - WATER_REFTEX, - WATER_EYEVEC, - WATER_TIME, - WATER_WAVE_DIR1, - WATER_WAVE_DIR2, - WATER_LIGHT_DIR, - WATER_SPECULAR, - WATER_SPECULAR_EXP, - WATER_FOGCOLOR, - WATER_FOGDENSITY, - WATER_FOGKS, - WATER_REFSCALE, - WATER_WATERHEIGHT, - WATER_WATERPLANE, - WATER_NORM_SCALE, - WATER_FRESNEL_SCALE, - WATER_FRESNEL_OFFSET, - WATER_BLUR_MULTIPLIER, - WATER_SUN_ANGLE, - WATER_SCALED_ANGLE, - WATER_SUN_ANGLE2, - - WL_CAMPOSLOCAL, - - AVATAR_WIND, - AVATAR_SINWAVE, - AVATAR_GRAVITY, - - TERRAIN_DETAIL0, - TERRAIN_DETAIL1, - TERRAIN_DETAIL2, - TERRAIN_DETAIL3, - TERRAIN_ALPHARAMP, - - SHINY_ORIGIN, - DISPLAY_GAMMA, - - INSCATTER_RT, - SUN_SIZE, - FOG_COLOR, + // clang-format off + typedef enum + { // Shader uniform name, set in LLShaderMgr::initAttribsAndUniforms() + MODELVIEW_MATRIX = 0, // "modelview_matrix" + PROJECTION_MATRIX, // "projection_matrix" + INVERSE_PROJECTION_MATRIX, // "inv_proj" + MODELVIEW_PROJECTION_MATRIX, // "modelview_projection_matrix" + INVERSE_MODELVIEW_MATRIX, // "inv_modelview" + NORMAL_MATRIX, // "normal_matrix" + TEXTURE_MATRIX0, // "texture_matrix0" + TEXTURE_MATRIX1, // "texture_matrix1" + TEXTURE_MATRIX2, // "texture_matrix2" + TEXTURE_MATRIX3, // "texture_matrix3" + OBJECT_PLANE_S, // "object_plane_s" + OBJECT_PLANE_T, // "object_plane_t" + VIEWPORT, // "viewport" + LIGHT_POSITION, // "light_position" + LIGHT_DIRECTION, // "light_direction" + LIGHT_ATTENUATION, // "light_attenuation" + LIGHT_DIFFUSE, // "light_diffuse" + LIGHT_AMBIENT, // "light_ambient" + MULTI_LIGHT_COUNT, // "light_count" + MULTI_LIGHT, // "light" + MULTI_LIGHT_COL, // "light_col" + MULTI_LIGHT_FAR_Z, // "far_z" + PROJECTOR_MATRIX, // "proj_mat" + PROJECTOR_NEAR, // "proj_near" + PROJECTOR_P, // "proj_p" + PROJECTOR_N, // "proj_n" + PROJECTOR_ORIGIN, // "proj_origin" + PROJECTOR_RANGE, // "proj_range" + PROJECTOR_AMBIANCE, // "proj_ambiance" + PROJECTOR_SHADOW_INDEX, // "proj_shadow_idx" + PROJECTOR_SHADOW_FADE, // "shadow_fade" + PROJECTOR_FOCUS, // "proj_focus" + PROJECTOR_LOD, // "proj_lod" + PROJECTOR_AMBIENT_LOD, // "proj_ambient_lod" + DIFFUSE_COLOR, // "color" + DIFFUSE_MAP, // "diffuseMap" + ALTERNATE_DIFFUSE_MAP, // "altDiffuseMap" + SPECULAR_MAP, // "specularMap" + BUMP_MAP, // "bumpMap" + BUMP_MAP2, // "bumpMap2" + ENVIRONMENT_MAP, // "environmentMap" + CLOUD_NOISE_MAP, // "cloud_noise_texture" + CLOUD_NOISE_MAP_NEXT, // "cloud_noise_texture_next" + FULLBRIGHT, // "fullbright" + LIGHTNORM, // "lightnorm" + SUNLIGHT_COLOR, // "sunlight_color" + AMBIENT, // "ambient_color" + BLUE_HORIZON, // "blue_horizon" + BLUE_DENSITY, // "blue_density" + HAZE_HORIZON, // "haze_horizon" + HAZE_DENSITY, // "haze_density" + CLOUD_SHADOW, // "cloud_shadow" + DENSITY_MULTIPLIER, // "density_multiplier" + DISTANCE_MULTIPLIER, // "distance_multiplier" + MAX_Y, // "max_y" + GLOW, // "glow" + CLOUD_COLOR, // "cloud_color" + CLOUD_POS_DENSITY1, // "cloud_pos_density1" + CLOUD_POS_DENSITY2, // "cloud_pos_density2" + CLOUD_SCALE, // "cloud_scale" + GAMMA, // "gamma" + SCENE_LIGHT_STRENGTH, // "scene_light_strength" + LIGHT_CENTER, // "center" + LIGHT_SIZE, // "size" + LIGHT_FALLOFF, // "falloff" + BOX_CENTER, // "box_center" + BOX_SIZE, // "box_size" + + GLOW_MIN_LUMINANCE, // "minLuminance" + GLOW_MAX_EXTRACT_ALPHA, // "maxExtractAlpha" + GLOW_LUM_WEIGHTS, // "lumWeights" + GLOW_WARMTH_WEIGHTS, // "warmthWeights" + GLOW_WARMTH_AMOUNT, // "warmthAmount" + GLOW_STRENGTH, // "glowStrength" + GLOW_DELTA, // "glowDelta" + + MINIMUM_ALPHA, // "minimum_alpha" + EMISSIVE_BRIGHTNESS, // "emissive_brightness" + + DEFERRED_SHADOW_MATRIX, // "shadow_matrix" + DEFERRED_ENV_MAT, // "env_mat" + DEFERRED_SHADOW_CLIP, // "shadow_clip" + DEFERRED_SUN_WASH, // "sun_wash" + DEFERRED_SHADOW_NOISE, // "shadow_noise" + DEFERRED_BLUR_SIZE, // "blur_size" + DEFERRED_SSAO_RADIUS, // "ssao_radius" + DEFERRED_SSAO_MAX_RADIUS, // "ssao_max_radius" + DEFERRED_SSAO_FACTOR, // "ssao_factor" + DEFERRED_SSAO_FACTOR_INV, // "ssao_factor_inv" + DEFERRED_SSAO_EFFECT_MAT, // "ssao_effect_mat" + DEFERRED_SCREEN_RES, // "screen_res" + DEFERRED_NEAR_CLIP, // "near_clip" + DEFERRED_SHADOW_OFFSET, // "shadow_offset" + DEFERRED_SHADOW_BIAS, // "shadow_bias" + DEFERRED_SPOT_SHADOW_BIAS, // "spot_shadow_bias" + DEFERRED_SPOT_SHADOW_OFFSET, // "spot_shadow_offset" + DEFERRED_SUN_DIR, // "sun_dir" + DEFERRED_MOON_DIR, // "moon_dir" + DEFERRED_SHADOW_RES, // "shadow_res" + DEFERRED_PROJ_SHADOW_RES, // "proj_shadow_res" + DEFERRED_DEPTH_CUTOFF, // "depth_cutoff" + DEFERRED_NORM_CUTOFF, // "norm_cutoff" + DEFERRED_SHADOW_TARGET_WIDTH, // "shadow_target_width" + + FXAA_TC_SCALE, // "tc_scale" + FXAA_RCP_SCREEN_RES, // "rcp_screen_res" + FXAA_RCP_FRAME_OPT, // "rcp_frame_opt" + FXAA_RCP_FRAME_OPT2, // "rcp_frame_opt2" + + DOF_FOCAL_DISTANCE, // "focal_distance" + DOF_BLUR_CONSTANT, // "blur_constant" + DOF_TAN_PIXEL_ANGLE, // "tan_pixel_angle" + DOF_MAGNIFICATION, // "magnification" + DOF_MAX_COF, // "max_cof" + DOF_RES_SCALE, // "res_scale" + DOF_WIDTH, // "dof_width" + DOF_HEIGHT, // "dof_height" + + DEFERRED_DEPTH, // "depthMap" + DEFERRED_SHADOW0, // "shadowMap0" + DEFERRED_SHADOW1, // "shadowMap1" + DEFERRED_SHADOW2, // "shadowMap2" + DEFERRED_SHADOW3, // "shadowMap3" + DEFERRED_SHADOW4, // "shadowMap4" + DEFERRED_SHADOW5, // "shadowMap5" + DEFERRED_NORMAL, // "normalMap" + DEFERRED_POSITION, // "positionMap" + DEFERRED_DIFFUSE, // "diffuseRect" + DEFERRED_SPECULAR, // "specularRect" + DEFERRED_NOISE, // "noiseMap" + DEFERRED_LIGHTFUNC, // "lightFunc" + DEFERRED_LIGHT, // "lightMap" + DEFERRED_BLOOM, // "bloomMap" + DEFERRED_PROJECTION, // "projectionMap" + DEFERRED_NORM_MATRIX, // "norm_mat" + TEXTURE_GAMMA, // "texture_gamma" + SPECULAR_COLOR, // "specular_color" + ENVIRONMENT_INTENSITY, // "env_intensity" + + AVATAR_MATRIX, // "matrixPalette" + AVATAR_TRANSLATION, // "translationPalette" + + WATER_SCREENTEX, // "screenTex" + WATER_SCREENDEPTH, // "screenDepth" + WATER_REFTEX, // "refTex" + WATER_EYEVEC, // "eyeVec" + WATER_TIME, // "time" + WATER_WAVE_DIR1, // "waveDir1" + WATER_WAVE_DIR2, // "waveDir2" + WATER_LIGHT_DIR, // "lightDir" + WATER_SPECULAR, // "specular" + WATER_SPECULAR_EXP, // "lightExp" + WATER_FOGCOLOR, // "waterFogColor" + WATER_FOGDENSITY, // "waterFogDensity" + WATER_FOGKS, // "waterFogKS" + WATER_REFSCALE, // "refScale" + WATER_WATERHEIGHT, // "waterHeight" + WATER_WATERPLANE, // "waterPlane" + WATER_NORM_SCALE, // "normScale" + WATER_FRESNEL_SCALE, // "fresnelScale" + WATER_FRESNEL_OFFSET, // "fresnelOffset" + WATER_BLUR_MULTIPLIER, // "blurMultiplier" + WATER_SUN_ANGLE, // "sunAngle" + WATER_SCALED_ANGLE, // "scaledAngle" + WATER_SUN_ANGLE2, // "sunAngle2" + + WL_CAMPOSLOCAL, // "camPosLocal" + + AVATAR_WIND, // "gWindDir" + AVATAR_SINWAVE, // "gSinWaveParams" + AVATAR_GRAVITY, // "gGravity" + + TERRAIN_DETAIL0, // "detail_0" + TERRAIN_DETAIL1, // "detail_1" + TERRAIN_DETAIL2, // "detail_2" + TERRAIN_DETAIL3, // "detail_3" + TERRAIN_ALPHARAMP, // "alpha_ramp" + + SHINY_ORIGIN, // "origin" + DISPLAY_GAMMA, // "display_gamma" + + INSCATTER_RT, // "inscatter" + SUN_SIZE, // "sun_size" + FOG_COLOR, // "fog_color" // precomputed textures - TRANSMITTANCE_TEX, - SCATTER_TEX, - SINGLE_MIE_SCATTER_TEX, - ILLUMINANCE_TEX, - BLEND_FACTOR, - - NO_ATMO, - MOISTURE_LEVEL, - DROPLET_RADIUS, - ICE_LEVEL, - RAINBOW_MAP, - HALO_MAP, - - MOON_BRIGHTNESS, - - CLOUD_VARIANCE, - - SH_INPUT_L1R, - SH_INPUT_L1G, - SH_INPUT_L1B, - - SUN_MOON_GLOW_FACTOR, - WATER_EDGE_FACTOR, - SUN_UP_FACTOR, - MOONLIGHT_COLOR, - END_RESERVED_UNIFORMS - } eGLSLReservedUniforms; + TRANSMITTANCE_TEX, // "transmittance_texture" + SCATTER_TEX, // "scattering_texture" + SINGLE_MIE_SCATTER_TEX, // "single_mie_scattering_texture" + ILLUMINANCE_TEX, // "irradiance_texture" + BLEND_FACTOR, // "blend_factor" + + NO_ATMO, // "no_atmo" + MOISTURE_LEVEL, // "moisture_level" + DROPLET_RADIUS, // "droplet_radius" + ICE_LEVEL, // "ice_level" + RAINBOW_MAP, // "rainbow_map" + HALO_MAP, // "halo_map" + + MOON_BRIGHTNESS, // "moon_brightness" + + CLOUD_VARIANCE, // "cloud_variance" + + SH_INPUT_L1R, // "sh_input_r" + SH_INPUT_L1G, // "sh_input_g" + SH_INPUT_L1B, // "sh_input_b" + + SUN_MOON_GLOW_FACTOR, // "sun_moon_glow_factor" + WATER_EDGE_FACTOR, // "water_edge" + SUN_UP_FACTOR, // "sun_up_factor" + MOONLIGHT_COLOR, // "moonlight_color" + END_RESERVED_UNIFORMS + } eGLSLReservedUniforms; + // clang-format on // singleton pattern implementation static LLShaderMgr * instance(); diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 9867bd16d6..dbe1a3687f 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -155,9 +155,8 @@ public: //get the size of a buffer with the given typemask and vertex count //fill offsets with the offset of each vertex component array into the buffer // indexed by the following enum - static S32 calcOffsets(const U32& typemask, S32* offsets, S32 num_vertices); + static S32 calcOffsets(const U32& typemask, S32* offsets, S32 num_vertices); - //WARNING -- when updating these enums you MUST // 1 - update LLVertexBuffer::sTypeSize // 2 - add a strider accessor @@ -165,24 +164,28 @@ public: // 4 - modify LLVertexBuffer::setupClientArray // 5 - modify LLViewerShaderMgr::mReservedAttribs // 6 - update LLVertexBuffer::setupVertexArray - enum { - TYPE_VERTEX = 0, - TYPE_NORMAL, - TYPE_TEXCOORD0, - TYPE_TEXCOORD1, - TYPE_TEXCOORD2, - TYPE_TEXCOORD3, - TYPE_COLOR, - TYPE_EMISSIVE, - TYPE_TANGENT, - TYPE_WEIGHT, - TYPE_WEIGHT4, - TYPE_CLOTHWEIGHT, - TYPE_TEXTURE_INDEX, - TYPE_MAX, // TYPE_MAX is the size/boundary marker for attributes that go in the vertex buffer - TYPE_INDEX, // TYPE_INDEX is beyond _MAX because it lives in a separate (index) buffer - }; - enum { + + // clang-format off + enum { // Shader attribute name, set in LLShaderMgr::initAttribsAndUniforms() + TYPE_VERTEX = 0, // "position" + TYPE_NORMAL, // "normal" + TYPE_TEXCOORD0, // "texcoord0" + TYPE_TEXCOORD1, // "texcoord1" + TYPE_TEXCOORD2, // "texcoord2" + TYPE_TEXCOORD3, // "texcoord3" + TYPE_COLOR, // "diffuse_color" + TYPE_EMISSIVE, // "emissive" + TYPE_TANGENT, // "tangent" + TYPE_WEIGHT, // "weight" + TYPE_WEIGHT4, // "weight4" + TYPE_CLOTHWEIGHT, // "clothing" + TYPE_TEXTURE_INDEX, // "texture_index" + TYPE_MAX, // TYPE_MAX is the size/boundary marker for attributes that go in the vertex buffer + TYPE_INDEX, // TYPE_INDEX is beyond _MAX because it lives in a separate (index) buffer + }; + // clang-format on + + enum { MAP_VERTEX = (1< Date: Fri, 5 Feb 2021 11:15:06 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#1 --- indra/newview/llpanellandmarks.cpp | 37 +++++++++++++ indra/newview/llpanelplaces.cpp | 2 +- .../default/xui/en/menu_places_gear_folder.xml | 3 ++ .../default/xui/en/menu_places_gear_landmark.xml | 62 +++++++++------------- 4 files changed, 67 insertions(+), 37 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ccd8497484..578485c967 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -40,6 +40,7 @@ #include "llagent.h" #include "llagentpicksinfo.h" #include "llagentui.h" +#include "llavataractions.h" #include "llcallbacklist.h" #include "lldndbutton.h" #include "llfloatersidepanelcontainer.h" @@ -1051,6 +1052,38 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } return false; } + else if ("add_landmark" == command_name) + { + bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; + if (!is_single_selection) + { + return false; + } + LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); + if (!view_model || view_model->getInventoryType() != LLInventoryType::IT_CATEGORY) + { + return false; + } + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + if (landmark) + { + //already exists + return false; + } + return true; + } + else if ("share" == command_name) + { + if (!mCurrentSelectedList) + { + return false; + } + if (!LLAvatarActions::canShareSelectedItems(mCurrentSelectedList)) + { + return false; + } + return true; + } else { LL_WARNS() << "Unprocessed command has come: " << command_name << LL_ENDL; @@ -1078,6 +1111,10 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) { doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1)); } + else if ("share" == command_name && mCurrentSelectedList) + { + LLAvatarActions::shareWithAvatars(mCurrentSelectedList); + } else if ("restore" == command_name && mCurrentSelectedList) { mCurrentSelectedList->doToSelected(userdata); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 53870fb5c7..abec3ba733 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -388,7 +388,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) // Update the buttons at the bottom of the panel updateVerbs(); } - else + else // "create_landmark" { mFilterEditor->clear(); onFilterEdit("", false); diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 1aeb166e01..4d59ab0631 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -13,6 +13,9 @@ + + + + + - + name="copy_slurl"> - + function="Places.LandmarksGear.CopyPaste.Action" + parameter="copy_slurl" /> + + + name="create_pick"> + function="Places.LandmarksGear.Custom.Action" + parameter="create_pick" /> + parameter="create_pick" /> - - - - - - - - -- cgit v1.2.3 From 74d3f9d017a424d69bfc256ecc1062fdaa3b18c3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Feb 2021 20:31:22 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#2 --- indra/newview/llpanellandmarkinfo.cpp | 14 +++++++++++- indra/newview/llpanellandmarkinfo.h | 16 +++++++++---- indra/newview/llpanellandmarks.cpp | 9 +++++++- indra/newview/llpanelplaces.cpp | 3 ++- indra/newview/skins/default/xui/en/menu_picks.xml | 26 +++++++++++----------- .../default/xui/en/menu_places_gear_folder.xml | 4 ++-- 6 files changed, 50 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 6751c25fb9..069fb32a56 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -106,6 +106,18 @@ void LLPanelLandmarkInfo::resetLocation() // virtual void LLPanelLandmarkInfo::setInfoType(EInfoType type) +{ + LLUUID dest_folder; + setInfoType(type, dest_folder); +} + +// Sets CREATE_LANDMARK infotype and creates landmark at desired folder +void LLPanelLandmarkInfo::setInfoAndCreateLandmark(const LLUUID& fodler_id) +{ + setInfoType(CREATE_LANDMARK, fodler_id); +} + +void LLPanelLandmarkInfo::setInfoType(EInfoType type, const LLUUID &folder_id) { LLPanel* landmark_info_panel = getChild("landmark_info_panel"); @@ -183,7 +195,7 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) // remote parcel request to complete. if (!LLLandmarkActions::landmarkAlreadyExists()) { - createLandmark(LLUUID()); + createLandmark(folder_id); } } break; diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h index 9712736182..9a2e0c8f59 100644 --- a/indra/newview/llpanellandmarkinfo.h +++ b/indra/newview/llpanellandmarkinfo.h @@ -43,8 +43,12 @@ public: /*virtual*/ void resetLocation(); + // If landmark doesn't exists, will create it at default folder /*virtual*/ void setInfoType(EInfoType type); + // Sets CREATE_LANDMARK infotype and creates landmark at desired folder + void setInfoAndCreateLandmark(const LLUUID& fodler_id); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); // Displays landmark owner, creator and creation date info. @@ -59,13 +63,17 @@ public: // Select current landmark folder in combobox. BOOL setLandmarkFolder(const LLUUID& id); - // Create a landmark for the current location - // in a folder specified by folder_id. - void createLandmark(const LLUUID& folder_id); - static std::string getFullFolderName(const LLViewerInventoryCategory* cat); private: + // Create a landmark for the current location + // in a folder specified by folder_id. + // Expects title and description to be initialized + void createLandmark(const LLUUID& folder_id); + + // If landmark doesn't exists, will create it at specified folder + void setInfoType(EInfoType type, const LLUUID &folder_id); + void populateFoldersList(); LLTextBox* mOwner; diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 578485c967..46c23961f4 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -785,7 +785,14 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const } else { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); + LLSD args; + args["type"] = "create_landmark"; + if (view_model->getInventoryType() + == LLInventoryType::IT_CATEGORY) + { + args["dest_folder"] = view_model->getUUID(); + } + LLFloaterSidePanelContainer::showPanel("places", args); } } else if ("category" == command_name) diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index abec3ba733..c038207628 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -409,7 +409,8 @@ void LLPanelPlaces::onOpen(const LLSD& key) } else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE) { - mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK); + LLUUID dest_folder = key["dest_folder"]; + mLandmarkInfo->setInfoAndCreateLandmark(dest_folder); if (key.has("x") && key.has("y") && key.has("z")) { diff --git a/indra/newview/skins/default/xui/en/menu_picks.xml b/indra/newview/skins/default/xui/en/menu_picks.xml index ebb49c9004..a408e6136c 100644 --- a/indra/newview/skins/default/xui/en/menu_picks.xml +++ b/indra/newview/skins/default/xui/en/menu_picks.xml @@ -3,7 +3,17 @@ layout="topleft" name="Picks"> + + + + @@ -24,17 +34,7 @@ parameter="edit" /> - - - - Date: Tue, 9 Feb 2021 01:59:15 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#3 --- indra/llinventory/llparcel.h | 6 ---- indra/llinventory/llparcelflags.h | 2 +- indra/newview/lllandmarkactions.cpp | 22 ------------- indra/newview/lllandmarkactions.h | 6 ---- indra/newview/llpanelteleporthistory.cpp | 38 ++++++++++++---------- indra/newview/llpanelteleporthistory.h | 4 +-- indra/newview/llteleporthistorystorage.cpp | 22 +++++++++++++ indra/newview/llteleporthistorystorage.h | 7 ++++ .../default/xui/en/menu_teleport_history_item.xml | 19 ++++++++--- 9 files changed, 67 insertions(+), 59 deletions(-) (limited to 'indra') diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 3b39aeb56b..5d08c1f4c6 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -295,7 +295,6 @@ public: void setAllowTerraform(BOOL b){setParcelFlag(PF_ALLOW_TERRAFORM, b); } void setAllowDamage(BOOL b) { setParcelFlag(PF_ALLOW_DAMAGE, b); } void setAllowFly(BOOL b) { setParcelFlag(PF_ALLOW_FLY, b); } - void setAllowLandmark(BOOL b){ setParcelFlag(PF_ALLOW_LANDMARK, b); } void setAllowGroupScripts(BOOL b) { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); } void setAllowOtherScripts(BOOL b) { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); } void setAllowDeedToGroup(BOOL b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); } @@ -476,11 +475,6 @@ public: BOOL getAllowFly() const { return (mParcelFlags & PF_ALLOW_FLY) ? TRUE : FALSE; } - // Remove permission restrictions for creating landmarks. - // We should eventually remove this flag completely. - BOOL getAllowLandmark() const - { return TRUE; } - BOOL getAllowGroupScripts() const { return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? TRUE : FALSE; } diff --git a/indra/llinventory/llparcelflags.h b/indra/llinventory/llparcelflags.h index 25b27a281a..4cffa83cc1 100644 --- a/indra/llinventory/llparcelflags.h +++ b/indra/llinventory/llparcelflags.h @@ -33,7 +33,7 @@ const U32 PF_ALLOW_FLY = 1 << 0;// Can start flying const U32 PF_ALLOW_OTHER_SCRIPTS= 1 << 1;// Scripts by others can run. const U32 PF_FOR_SALE = 1 << 2;// Can buy this land const U32 PF_FOR_SALE_OBJECTS = 1 << 7;// Can buy all objects on this land -const U32 PF_ALLOW_LANDMARK = 1 << 3; +const U32 PF_ALLOW_LANDMARK = 1 << 3;// Always true/deprecated const U32 PF_ALLOW_TERRAFORM = 1 << 4; const U32 PF_ALLOW_DAMAGE = 1 << 5; const U32 PF_CREATE_OBJECTS = 1 << 6; diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index c243f8b4f0..a17dc674ac 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -228,23 +228,6 @@ LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentPos() return findLandmarkForGlobalPos(gAgent.getPositionGlobal()); } -bool LLLandmarkActions::canCreateLandmarkHere() -{ - LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if(!agent_parcel) - { - LL_WARNS() << "No agent region" << LL_ENDL; - return false; - } - if (agent_parcel->getAllowLandmark() - || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) - { - return true; - } - - return false; -} - void LLLandmarkActions::createLandmarkHere( const std::string& name, const std::string& desc, @@ -261,11 +244,6 @@ void LLLandmarkActions::createLandmarkHere( LL_WARNS() << "No agent parcel" << LL_ENDL; return; } - if (!canCreateLandmarkHere()) - { - LLNotificationsUtil::add("CannotCreateLandmarkNotOwner"); - return; - } create_inventory_item(gAgent.getID(), gAgent.getSessionID(), folder_id, LLTransactionID::tnull, diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 870d92811e..ae7b072fcb 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -72,12 +72,6 @@ public: */ static LLViewerInventoryItem* findLandmarkForAgentPos(); - - /** - * @brief Checks whether agent has rights to create landmark for current parcel. - */ - static bool canCreateLandmarkHere(); - /** * @brief Creates landmark for current parcel. */ diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index fe0608d544..3f5664f431 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -396,9 +396,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() // (N.B. callbacks don't take const refs as mID is local scope) LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - registrar.add("TeleportHistory.Teleport", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onTeleport, this)); - registrar.add("TeleportHistory.MoreInformation",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onInfo, this)); - registrar.add("TeleportHistory.CopyToClipboard",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard, this)); + registrar.add("TeleportHistory.Action", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onUserAction, this, _2)); // create the context menu from the XUI llassert(LLMenuGL::sMenuContainer != NULL); @@ -406,14 +404,27 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() "menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); } -void LLTeleportHistoryPanel::ContextMenu::onTeleport() +void LLTeleportHistoryPanel::ContextMenu::onUserAction(const LLSD& userdata) { - confirmTeleport(mIndex); -} - -void LLTeleportHistoryPanel::ContextMenu::onInfo() -{ - LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); + std::string command_name = userdata.asString(); + if ("teleport" == command_name) + { + confirmTeleport(mIndex); + } + else if ("view" == command_name) + { + LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); + } + else if ("show_on_map" == command_name) + { + LLTeleportHistoryStorage::getInstance()->showItemOnMap(mIndex); + } + else if ("copy_slurl" == command_name) + { + LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos; + LLLandmarkActions::getSLURLfromPosGlobal(globalPos, + boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1)); + } } //static @@ -427,13 +438,6 @@ void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& sl LLNotificationsUtil::add("CopySLURL", args); } -void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard() -{ - LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos; - LLLandmarkActions::getSLURLfromPosGlobal(globalPos, - boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1)); -} - // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper t_teleport_history("panel_teleport_history"); diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index b88861c5c6..e0abbc47db 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -52,9 +52,7 @@ public: private: LLContextMenu* createMenu(); - void onTeleport(); - void onInfo(); - void onCopyToClipboard(); + void onUserAction(const LLSD& userdata); static void gotSLURLCallback(const std::string& slurl); diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index 8a5704939a..93fa457bd0 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -33,6 +33,8 @@ #include "lldir.h" #include "llteleporthistory.h" #include "llagent.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" // Max offset for two global positions to consider them as equal const F64 MAX_GLOBAL_POS_OFFSET = 5.0f; @@ -253,3 +255,23 @@ void LLTeleportHistoryStorage::goToItem(S32 idx) gAgent.teleportViaLocation(mItems[idx].mGlobalPos); } +void LLTeleportHistoryStorage::showItemOnMap(S32 idx) +{ + // Validate specified index. + if (idx < 0 || idx >= (S32)mItems.size()) + { + LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL; + dump(); + return; + } + + LLVector3d landmark_global_pos = mItems[idx].mGlobalPos; + + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if (!landmark_global_pos.isExactlyZero() && worldmap_instance) + { + worldmap_instance->trackLocation(landmark_global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } +} + diff --git a/indra/newview/llteleporthistorystorage.h b/indra/newview/llteleporthistorystorage.h index 946ac0af1a..3578923fd7 100644 --- a/indra/newview/llteleporthistorystorage.h +++ b/indra/newview/llteleporthistorystorage.h @@ -107,6 +107,13 @@ public: */ void goToItem(S32 idx); + /** + * Show specific item on map. + * + * The item is specified by its index (starting from 0). + */ + void showItemOnMap(S32 idx); + private: void load(); diff --git a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml index f939c3996d..52da591e35 100644 --- a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml @@ -7,20 +7,31 @@ layout="topleft" name="Teleport"> + function="TeleportHistory.Action" + parameter="teleport" /> + function="TeleportHistory.Action" + parameter="view" /> + + + + function="TeleportHistory.Action" + parameter="copy_slurl" /> -- cgit v1.2.3 From b23feb2c623df8a58a52afb5fd4e5806a630d3d4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 9 Feb 2021 23:00:44 +0200 Subject: SL-14797 Do not allow creation of landmarks nor folders in library --- indra/newview/llpanellandmarks.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 46c23961f4..6e8eac19fc 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1044,8 +1044,12 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const // ... but except Received folder return !isReceivedFolderSelected(); } + if (mCurrentSelectedList == mLibraryInventoryPanel) + { + return false; + } //"Add a folder" is enabled by default (case when My Landmarks is empty) - else return true; + return true; } else if("create_pick" == command_name) { @@ -1066,6 +1070,10 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const { return false; } + if (mCurrentSelectedList == mLibraryInventoryPanel) + { + return false; + } LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); if (!view_model || view_model->getInventoryType() != LLInventoryType::IT_CATEGORY) { -- cgit v1.2.3 From 17f533fef05520759c5c7f77578e28009633d98a Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 9 Feb 2021 16:36:50 -0700 Subject: DRTVWR-525 housekeeping: delete unused shader file --- .../shaders/class3/deferred/lightUtil.glsl | 117 --------------------- 1 file changed, 117 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/lightUtil.glsl (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class3/deferred/lightUtil.glsl b/indra/newview/app_settings/shaders/class3/deferred/lightUtil.glsl deleted file mode 100644 index 8bb3f07fc6..0000000000 --- a/indra/newview/app_settings/shaders/class3/deferred/lightUtil.glsl +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @file lightInfo.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, 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$ - */ - -struct DirectionalLightInfo -{ - vec4 pos; - float depth; - vec4 normal; - vec3 normalizedLightDirection; - vec3 normalizedToLight; - float lightIntensity; - vec3 lightDiffuseColor; - float specExponent; - float shadow; -}; - -struct SpotLightInfo -{ - vec4 pos; - float depth; - vec4 normal; - vec3 normalizedLightDirection; - vec3 normalizedToLight; - float lightIntensity; - float attenuation; - float distanceToLight; - vec3 lightDiffuseColor; - float innerHalfAngleCos; - float outerHalfAngleCos; - float spotExponent; - float specExponent; - float shadow; -}; - -struct PointLightInfo -{ - vec4 pos; - float depth; - vec4 normal; - vec3 normalizedToLight; - float lightIntensity; - float attenuation; - float distanceToLight; - vec3 lightDiffuseColor; - float lightRadius; - float specExponent; - vec3 worldspaceLightDirection; - float shadow; -}; - -float attenuate(float attenuationSelection, float distanceToLight) -{ -// LLRENDER_REVIEW -// sh/could eventually consume attenuation func defined in texture - return (attenuationSelection == 0.0f) ? 1.0f : // none - (attenuationSelection < 1.0f) ? (1.0f / distanceToLight) : // linear atten - (attenuationSelection < 2.0f) ? (1.0f / (distanceToLight*distanceToLight)) // quadratic atten - : (1.0f / (distanceToLight*distanceToLight*distanceToLight)); // cubic atten -} - - -vec3 lightDirectional(struct DirectionalLightInfo dli) -{ - float lightIntensity = dli.lightIntensity; - lightIntensity *= dot(dli.normal.xyz, dli.normalizedLightDirection); - //lightIntensity *= directionalShadowSample(vec4(dli.pos.xyz, 1.0f), dli.depth, dli.directionalShadowMap, dli.directionalShadowMatrix); - return lightIntensity * dli.lightDiffuseColor; -} - - -vec3 lightSpot(struct SpotLightInfo sli) -{ - float penumbraRange = (sli.outerHalfAngleCos - sli.innerHalfAngleCos); - float coneAngleCos = max(dot(sli.normalizedLightDirection, sli.normalizedToLight), 0.0); - float coneAttenFactor = (coneAngleCos <= sli.outerHalfAngleCos) ? 1.0f : pow(smoothstep(1,0, sli.outerHalfAngleCos / penumbraRange), sli.spotExponent); - float distanceAttenuation = attenuate(sli.attenuation, sli.distanceToLight); - float lightIntensity = sli.lightIntensity; - lightIntensity *= distanceAttenuation; - lightIntensity *= max(dot(sli.normal.xyz, sli.normalizedLightDirection), 0.0); - lightIntensity *= coneAttenFactor; - lightIntensity *= sli.shadow; - return lightIntensity * sli.lightDiffuseColor; -} - -vec3 lightPoint(struct PointLightInfo pli) -{ - float padRadius = pli.lightRadius * 0.1; // distance for which to perform smoothed dropoff past light radius - float distanceAttenuation = attenuate(pli.attenuation, pli.distanceToLight); - float lightIntensity = pli.lightIntensity; - lightIntensity*= distanceAttenuation; - lightIntensity *= clamp((padRadius - pli.distanceToLight + pli.lightRadius) / padRadius, 0.0, 1.0); - lightIntensity *= pli.shadow; - lightIntensity *= max(dot(pli.normal.xyz, pli.normalizedToLight), 0.0); - return lightIntensity * pli.lightDiffuseColor; -} -- cgit v1.2.3 From 48597039b24ffbc976572d24bfc0835922bce43b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Feb 2021 15:29:20 +0000 Subject: SL-14862 - LLViewerStats logs which UI features get used --- indra/llui/CMakeLists.txt | 2 ++ indra/llui/llfloaterreg.cpp | 8 ++++++ indra/llui/lluictrl.cpp | 21 +++++++++++++- indra/llui/lluictrl.h | 4 +++ indra/llui/lluiusage.cpp | 61 +++++++++++++++++++++++++++++++++++++++++ indra/llui/lluiusage.h | 49 +++++++++++++++++++++++++++++++++ indra/newview/llviewerstats.cpp | 3 ++ 7 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 indra/llui/lluiusage.cpp create mode 100644 indra/llui/lluiusage.h (limited to 'indra') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index cce618487b..f781ff4110 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -122,6 +122,7 @@ set(llui_SOURCE_FILES lluictrl.cpp lluictrlfactory.cpp lluistring.cpp + lluiusage.cpp llundo.cpp llurlaction.cpp llurlentry.cpp @@ -241,6 +242,7 @@ set(llui_HEADER_FILES llui.h lluicolor.h lluistring.h + lluiusage.h llundo.h llurlaction.h llurlentry.h diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 85e07fc6a6..6307bf1028 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -32,6 +32,7 @@ #include "llfloater.h" #include "llmultifloater.h" #include "llfloaterreglistener.h" +#include "lluiusage.h" //******************************************************* @@ -243,6 +244,8 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str //static LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus) { + LL_DEBUGS("UIUsage") << "floater showInstance " << name << LL_ENDL; + LLUIUsage::instance().logFloater(name); if( sBlockShowFloaters // see EXT-7090 && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) @@ -273,6 +276,9 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) // returns true if the instance is visible when completed bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) { + LL_DEBUGS("UIUsage") << "floater toggleInstance " << name << LL_ENDL; + LLUIUsage::instance().logFloater(name); + LLFloater* instance = findInstance(name, key); if (LLFloater::isShown(instance)) { @@ -473,6 +479,8 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& LLFloater* instance = getInstance(name, key); + LL_DEBUGS("UIUsage") << "floater toggleInstanceOrBringToFront " << name << LL_ENDL; + LLUIUsage::instance().logFloater(name); if (!instance) { LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 544a76e8d5..0e1c8439ea 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -35,6 +35,7 @@ #include "lluictrlfactory.h" #include "lltabcontainer.h" #include "llaccordionctrltab.h" +#include "lluiusage.h" static LLDefaultChildRegistry::Register r("ui_ctrl"); @@ -282,6 +283,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa else { std::string function_name = cb.function_name; + setFunctionName(function_name); commit_callback_t* func = (CommitCallbackRegistry::getValue(function_name)); if (func) { @@ -422,7 +424,18 @@ BOOL LLUICtrl::canFocusChildren() const void LLUICtrl::onCommit() { if (mCommitSignal) - (*mCommitSignal)(this, getValue()); + { + if (!mFunctionName.empty()) + { + LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; + LLUIUsage::instance().logCommand(mFunctionName); + } + else + { + //LL_DEBUGS("UIUsage") << "calling commit function " << "UNKNOWN" << LL_ENDL; + } + (*mCommitSignal)(this, getValue()); + } } //virtual @@ -597,6 +610,12 @@ void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control) setVisible(!(mMakeInvisibleControlVariable->getValue().asBoolean())); } } + +void LLUICtrl::setFunctionName(const std::string& function_name) +{ + mFunctionName = function_name; +} + // static bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle handle, std::string type) { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 7360bd7659..67dd24341c 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -183,6 +183,8 @@ public: void setMakeVisibleControlVariable(LLControlVariable* control); void setMakeInvisibleControlVariable(LLControlVariable* control); + void setFunctionName(const std::string& function_name); + virtual void setTentative(BOOL b); virtual BOOL getTentative() const; virtual void setValue(const LLSD& value); @@ -310,6 +312,8 @@ protected: LLControlVariable* mMakeInvisibleControlVariable; boost::signals2::connection mMakeInvisibleControlConnection; + std::string mFunctionName; + static F32 sActiveControlTransparency; static F32 sInactiveControlTransparency; diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp new file mode 100644 index 0000000000..e1237031cd --- /dev/null +++ b/indra/llui/lluiusage.cpp @@ -0,0 +1,61 @@ +/** +* @file lluiuisage.cpp +* @brief Source file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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$ +*/ + +#include "linden_common.h" +#include "lluiusage.h" + +LLUIUsage::LLUIUsage() +{ +} + +LLUIUsage::~LLUIUsage() +{ +} + +void LLUIUsage::logFloater(const std::string& floater) +{ + mFloaterCounts[floater]++; +} + +void LLUIUsage::logCommand(const std::string& command) +{ + mCommandCounts[command]++; +} + +LLSD LLUIUsage::asLLSD() const +{ + LLSD result; + for (auto const& it : mFloaterCounts) + { + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mCommandCounts) + { + result["commands"][it.first] = LLSD::Integer(it.second); + } + return result; +} + diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h new file mode 100644 index 0000000000..0c076c2b2c --- /dev/null +++ b/indra/llui/lluiusage.h @@ -0,0 +1,49 @@ +/** +* @file lluiuisage.h +* @brief Header file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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$ +*/ + +#ifndef LL_LLUIUSAGE_H +#define LL_LLUIUSAGE_H + +#include +#include "llsd.h" +#include "llsingleton.h" + +// UIUsage tracking to see which operations and UI elements are most popular in a session +class LLUIUsage : public LLSingleton +{ +public: + LLSINGLETON(LLUIUsage); + ~LLUIUsage(); +public: + void logFloater(const std::string& floater); + void logCommand(const std::string& command); + LLSD asLLSD() const; +private: + std::map mFloaterCounts; + std::map mCommandCounts; +}; + +#endif // LLUIUIUSAGE.h diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 05f88b0a75..314c1a1f1e 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -63,6 +63,7 @@ #include "llsdutil.h" #include "llcorehttputil.h" #include "llvoicevivox.h" +#include "lluiusage.h" namespace LLStatViewer { @@ -577,6 +578,8 @@ void send_viewer_stats(bool include_preferences) fail["invalid"] = (S32) gMessageSystem->mInvalidOnCircuitPackets; fail["missing_updater"] = (S32) LLAppViewer::instance()->isUpdaterMissing(); + body["ui"] = LLUIUsage::instance().asLLSD(); + body["stats"]["voice"] = LLVoiceVivoxStats::getInstance()->read(); // Misc stats, two strings and two ints -- cgit v1.2.3 From 8a718a9ca28a7a544c7622a033fcd2791935909d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Feb 2021 16:05:46 +0000 Subject: SL-14862 - line endings fix, avoid period in key names --- indra/llui/lluiusage.cpp | 131 +++++++++++++++++++++++++---------------------- indra/llui/lluiusage.h | 99 +++++++++++++++++------------------ 2 files changed, 120 insertions(+), 110 deletions(-) (limited to 'indra') diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index e1237031cd..50eeccd214 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -1,61 +1,70 @@ -/** -* @file lluiuisage.cpp -* @brief Source file for LLUIUsage -* -* $LicenseInfo:firstyear=2021&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2021, 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$ -*/ - -#include "linden_common.h" -#include "lluiusage.h" - -LLUIUsage::LLUIUsage() -{ -} - -LLUIUsage::~LLUIUsage() -{ -} - -void LLUIUsage::logFloater(const std::string& floater) -{ - mFloaterCounts[floater]++; -} - -void LLUIUsage::logCommand(const std::string& command) -{ - mCommandCounts[command]++; -} - -LLSD LLUIUsage::asLLSD() const -{ - LLSD result; - for (auto const& it : mFloaterCounts) - { - result["floaters"][it.first] = LLSD::Integer(it.second); - } - for (auto const& it : mCommandCounts) - { - result["commands"][it.first] = LLSD::Integer(it.second); - } - return result; -} - +/** +* @file lluiuisage.cpp +* @brief Source file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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$ +*/ + +#include "linden_common.h" +#include "lluiusage.h" + +LLUIUsage::LLUIUsage() +{ +} + +LLUIUsage::~LLUIUsage() +{ +} + +// static +std::string LLUIUsage::sanitized(const std::string& s) +{ + // ViewerStats db doesn't like "." in keys + std::string result(s); + std::replace(result.begin(), result.end(), '.', '_'); + return result; +} + +void LLUIUsage::logFloater(const std::string& floater) +{ + mFloaterCounts[sanitized(floater)]++; +} + +void LLUIUsage::logCommand(const std::string& command) +{ + mCommandCounts[sanitized(command)]++; +} + +LLSD LLUIUsage::asLLSD() const +{ + LLSD result; + for (auto const& it : mFloaterCounts) + { + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mCommandCounts) + { + result["commands"][it.first] = LLSD::Integer(it.second); + } + return result; +} + diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index 0c076c2b2c..bac607aa60 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -1,49 +1,50 @@ -/** -* @file lluiuisage.h -* @brief Header file for LLUIUsage -* -* $LicenseInfo:firstyear=2021&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2021, 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$ -*/ - -#ifndef LL_LLUIUSAGE_H -#define LL_LLUIUSAGE_H - -#include -#include "llsd.h" -#include "llsingleton.h" - -// UIUsage tracking to see which operations and UI elements are most popular in a session -class LLUIUsage : public LLSingleton -{ -public: - LLSINGLETON(LLUIUsage); - ~LLUIUsage(); -public: - void logFloater(const std::string& floater); - void logCommand(const std::string& command); - LLSD asLLSD() const; -private: - std::map mFloaterCounts; - std::map mCommandCounts; -}; - -#endif // LLUIUIUSAGE.h +/** +* @file lluiuisage.h +* @brief Header file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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$ +*/ + +#ifndef LL_LLUIUSAGE_H +#define LL_LLUIUSAGE_H + +#include +#include "llsd.h" +#include "llsingleton.h" + +// UIUsage tracking to see which operations and UI elements are most popular in a session +class LLUIUsage : public LLSingleton +{ +public: + LLSINGLETON(LLUIUsage); + ~LLUIUsage(); +public: + static std::string sanitized(const std::string& s); + void logFloater(const std::string& floater); + void logCommand(const std::string& command); + LLSD asLLSD() const; +private: + std::map mFloaterCounts; + std::map mCommandCounts; +}; + +#endif // LLUIUIUSAGE.h -- cgit v1.2.3 From 5971c647e4abd11c4c4f055f124ac2251b720c25 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 15 Feb 2021 16:49:08 +0200 Subject: SL-14632 FIXED The viewer is crashed after purging the trash with favorites folder --- indra/newview/llviewerinventory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index ed1d726528..2b200c17c1 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1466,6 +1466,12 @@ void purge_descendents_of(const LLUUID& id, LLPointer cb) LLPointer cat = gInventory.getCategory(id); if (cat.notNull()) { + const LLUUID fav_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + if ((id == fav_id) || gInventory.isObjectDescendentOf(fav_id, id)) + { + gSavedPerAccountSettings.setString("FavoritesFolder", ""); + } + if (LLClipboard::instance().hasContents()) { // Remove items from clipboard or it will remain active even if there is nothing to paste/copy -- cgit v1.2.3 From 58827cb2752b9a184d638ed6a4f0efa0e9740d64 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 13 Feb 2021 01:50:04 +0200 Subject: SL-14725 Rotation sliders for sun and moon panels --- indra/llui/llvirtualtrackball.cpp | 46 ++++++ indra/llui/llvirtualtrackball.h | 3 + indra/newview/llpaneleditsky.cpp | 119 +++++++++++++-- indra/newview/llpaneleditsky.h | 2 + .../default/xui/en/floater_fixedenvironment.xml | 2 +- .../skins/default/xui/en/menu_favorites.xml | 12 +- .../default/xui/en/panel_settings_sky_sunmoon.xml | 162 ++++++++++++++++----- 7 files changed, 294 insertions(+), 52 deletions(-) (limited to 'indra') diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index 723643dd25..15847a7282 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -348,6 +348,52 @@ LLQuaternion LLVirtualTrackball::getRotation() const return mValue; } +// static +void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation) +{ + // LLQuaternion has own function to get azimuth, but it doesn't appear to return correct values (meant for 2d?) + const LLVector3 VectorZero(10000.0f, 0.0f, 0.0f); + LLVector3 point = VectorZero * quat; + + if (!is_approx_zero(point.mV[VX]) || !is_approx_zero(point.mV[VY])) + { + azimuth = atan2f(point.mV[VX], point.mV[VY]); + } + else + { + azimuth = 0; + } + + azimuth -= F_PI_BY_TWO; + + if (azimuth < 0) + { + azimuth += F_PI * 2; + } + + if (abs(point.mV[VY]) > abs(point.mV[VX]) && !is_approx_zero(point.mV[VY])) // to avoid precision drop + { + elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VY])); + } + else if (!is_approx_zero(point.mV[VX])) + { + elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VX])); + } + else + { + // both VX and VY are near zero, VZ should be high + elevation = point.mV[VZ] > 0 ? F_PI_BY_TWO : -F_PI_BY_TWO; + } +} + +// static +void LLVirtualTrackball::getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation) +{ + getAzimuthAndElevation(quat, azimuth, elevation); + azimuth *= RAD_TO_DEG; + elevation *= RAD_TO_DEG; +} + BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) diff --git a/indra/llui/llvirtualtrackball.h b/indra/llui/llvirtualtrackball.h index 2d4b1ece17..c7a893877b 100644 --- a/indra/llui/llvirtualtrackball.h +++ b/indra/llui/llvirtualtrackball.h @@ -96,6 +96,9 @@ public: void setRotation(const LLQuaternion &value); LLQuaternion getRotation() const; + static void getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation); + static void getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation); + protected: friend class LLUICtrlFactory; LLVirtualTrackball(const Params&); diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 2e26b69144..06e406e2ab 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -69,11 +69,15 @@ namespace const std::string FIELD_SKY_GLOW_SIZE("glow_size"); const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness"); const std::string FIELD_SKY_SUN_ROTATION("sun_rotation"); + const std::string FIELD_SKY_SUN_AZIMUTH("sun_azimuth"); + const std::string FIELD_SKY_SUN_ELEVATION("sun_elevation"); const std::string FIELD_SKY_SUN_IMAGE("sun_image"); const std::string FIELD_SKY_SUN_SCALE("sun_scale"); const std::string FIELD_SKY_SUN_BEACON("sunbeacon"); const std::string FIELD_SKY_MOON_BEACON("moonbeacon"); const std::string FIELD_SKY_MOON_ROTATION("moon_rotation"); + const std::string FIELD_SKY_MOON_AZIMUTH("moon_azimuth"); + const std::string FIELD_SKY_MOON_ELEVATION("moon_elevation"); const std::string FIELD_SKY_MOON_IMAGE("moon_image"); const std::string FIELD_SKY_MOON_SCALE("moon_scale"); const std::string FIELD_SKY_MOON_BRIGHTNESS("moon_brightness"); @@ -473,12 +477,16 @@ BOOL LLPanelSettingsSkySunMoonTab::postBuild() getChild(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); }); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); }); getChild(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); }); + getChild(FIELD_SKY_SUN_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); + getChild(FIELD_SKY_SUN_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); getChild(FIELD_SKY_SUN_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunImageChanged(); }); getChild(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); }); getChild(FIELD_SKY_SUN_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId()); getChild(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetBlankSunTextureId()); getChild(FIELD_SKY_SUN_IMAGE)->setAllowNoTexture(TRUE); getChild(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); + getChild(FIELD_SKY_MOON_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); + getChild(FIELD_SKY_MOON_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); getChild(FIELD_SKY_MOON_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonImageChanged(); }); getChild(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetDefaultMoonTextureId()); getChild(FIELD_SKY_MOON_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetDefaultMoonTextureId()); @@ -537,13 +545,29 @@ void LLPanelSettingsSkySunMoonTab::refresh() getChild(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mSkySettings->getStarBrightness()); - getChild(FIELD_SKY_SUN_ROTATION)->setRotation(mSkySettings->getSunRotation()); getChild(FIELD_SKY_SUN_IMAGE)->setValue(mSkySettings->getSunTextureId()); getChild(FIELD_SKY_SUN_SCALE)->setValue(mSkySettings->getSunScale()); - getChild(FIELD_SKY_MOON_ROTATION)->setRotation(mSkySettings->getMoonRotation()); getChild(FIELD_SKY_MOON_IMAGE)->setValue(mSkySettings->getMoonTextureId()); getChild(FIELD_SKY_MOON_SCALE)->setValue(mSkySettings->getMoonScale()); getChild(FIELD_SKY_MOON_BRIGHTNESS)->setValue(mSkySettings->getMoonBrightness()); + + // Sun rotation values + F32 azimuth, elevation; + LLQuaternion quat = mSkySettings->getSunRotation(); + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + + // Moon rotation values + quat = mSkySettings->getMoonRotation(); + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + } //------------------------------------------------------------------------- @@ -583,10 +607,47 @@ void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() { - if (!mSkySettings) return; - mSkySettings->setSunRotation(getChild(FIELD_SKY_SUN_ROTATION)->getRotation()); - mSkySettings->update(); - setIsDirty(); + LLQuaternion quat = getChild(FIELD_SKY_SUN_ROTATION)->getRotation(); + + F32 azimuth, elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + if (mSkySettings) + { + mSkySettings->setSunRotation(quat); + mSkySettings->update(); + setIsDirty(); + } +} + +void LLPanelSettingsSkySunMoonTab::onSunAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); + LLQuaternion quat = mSkySettings->getSunRotation(); + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + + if (mSkySettings) + { + mSkySettings->setSunRotation(quat); + mSkySettings->update(); + setIsDirty(); + } } void LLPanelSettingsSkySunMoonTab::onSunScaleChanged() @@ -607,10 +668,48 @@ void LLPanelSettingsSkySunMoonTab::onSunImageChanged() void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged() { - if (!mSkySettings) return; - mSkySettings->setMoonRotation(getChild(FIELD_SKY_MOON_ROTATION)->getRotation()); - mSkySettings->update(); - setIsDirty(); + LLQuaternion quat = getChild(FIELD_SKY_MOON_ROTATION)->getRotation(); + + F32 azimuth, elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + + if (mSkySettings) + { + mSkySettings->setMoonRotation(quat); + mSkySettings->update(); + setIsDirty(); + } +} + +void LLPanelSettingsSkySunMoonTab::onMoonAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); + LLQuaternion quat = mSkySettings->getMoonRotation(); + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI- azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); + + if (mSkySettings) + { + mSkySettings->setMoonRotation(quat); + mSkySettings->update(); + setIsDirty(); + } } void LLPanelSettingsSkySunMoonTab::onMoonImageChanged() diff --git a/indra/newview/llpaneleditsky.h b/indra/newview/llpaneleditsky.h index c02c9c95a0..d1c558c902 100644 --- a/indra/newview/llpaneleditsky.h +++ b/indra/newview/llpaneleditsky.h @@ -124,9 +124,11 @@ private: void onGlowChanged(); void onStarBrightnessChanged(); void onSunRotationChanged(); + void onSunAzimElevChanged(); void onSunScaleChanged(); void onSunImageChanged(); void onMoonRotationChanged(); + void onMoonAzimElevChanged(); void onMoonScaleChanged(); void onMoonBrightnessChanged(); void onMoonImageChanged(); diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index dbf91b0834..2cc73361f5 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -89,7 +89,7 @@ follows="left|top|right|bottom" auto_resize="false" user_resize="false" - height="40" + height="35" visible="true"> + name="Show On Map"> + parameter="show_on_map" /> + name="Copy slurl"> + parameter="copy_slurl" /> Position: @@ -93,7 +93,7 @@ follows="left|top" height="10" layout="topleft" - left_delta="-5" + left_delta="65" top_delta="20" width="80"> Color: @@ -108,12 +108,58 @@ name="sun_moon_color" top_pad="5" width="60" /> + + Azimuth: + + + + Elevation: + + Glow Focus: @@ -128,8 +174,8 @@ min_val="-2" max_val="2" name="glow_focus" - top_delta="15" - width="250" + top_delta="13" + width="215" can_edit_text="true"/> Position: @@ -278,30 +324,76 @@ top_delta="15" width="130" can_edit_text="true"/> - - Brightness: - - - + Azimuth: + + + + Elevation: + + + + Brightness: + + + Date: Mon, 15 Feb 2021 18:08:55 +0200 Subject: SL-14725 Move environment editors' ok and cancel buttons to center --- indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml | 2 +- indra/newview/skins/default/xui/en/floater_fixedenvironment.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml index 30e9002230..c609e3bd3a 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml @@ -616,7 +616,7 @@ follows="top|left" height="23" label="Save" - left="5" + left="200" top_pad="0" name="save_btn" width="156" /> diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 2cc73361f5..37c56d3235 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -97,7 +97,7 @@ layout="topleft" mouse_opaque="false" name="button_bar_ls" - left="0" + left="212" orientation="horizontal" top="0" width="313"> -- cgit v1.2.3 From fa35eeecd7854b92e52f7bac2dc31bfc07ce012b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 15 Feb 2021 22:53:54 +0200 Subject: SL-14725 Add elevation and azimuth to local lighting --- indra/llui/llvirtualtrackball.cpp | 15 +-- indra/newview/llfloaterenvironmentadjust.cpp | 113 +++++++++++++++++++-- indra/newview/llfloaterenvironmentadjust.h | 2 + indra/newview/llpaneleditsky.cpp | 4 +- .../default/xui/en/floater_adjust_environment.xml | 96 +++++++++++++++-- 5 files changed, 194 insertions(+), 36 deletions(-) (limited to 'indra') diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index 15847a7282..728e86af08 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -352,7 +352,6 @@ LLQuaternion LLVirtualTrackball::getRotation() const void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation) { // LLQuaternion has own function to get azimuth, but it doesn't appear to return correct values (meant for 2d?) - const LLVector3 VectorZero(10000.0f, 0.0f, 0.0f); LLVector3 point = VectorZero * quat; if (!is_approx_zero(point.mV[VX]) || !is_approx_zero(point.mV[VY])) @@ -371,19 +370,7 @@ void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &a azimuth += F_PI * 2; } - if (abs(point.mV[VY]) > abs(point.mV[VX]) && !is_approx_zero(point.mV[VY])) // to avoid precision drop - { - elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VY])); - } - else if (!is_approx_zero(point.mV[VX])) - { - elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VX])); - } - else - { - // both VX and VY are near zero, VZ should be high - elevation = point.mV[VZ] > 0 ? F_PI_BY_TWO : -F_PI_BY_TWO; - } + elevation = asin(point.mV[VZ]); // because VectorZero is '1' } // static diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 4eb5e03603..95d6a2d652 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -53,11 +53,15 @@ namespace const std::string FIELD_SKY_CLOUD_SCALE("cloud_scale"); const std::string FIELD_SKY_SCENE_GAMMA("scene_gamma"); const std::string FIELD_SKY_SUN_ROTATION("sun_rotation"); + const std::string FIELD_SKY_SUN_AZIMUTH("sun_azimuth"); + const std::string FIELD_SKY_SUN_ELEVATION("sun_elevation"); const std::string FIELD_SKY_SUN_SCALE("sun_scale"); const std::string FIELD_SKY_GLOW_FOCUS("glow_focus"); const std::string FIELD_SKY_GLOW_SIZE("glow_size"); const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness"); const std::string FIELD_SKY_MOON_ROTATION("moon_rotation"); + const std::string FIELD_SKY_MOON_AZIMUTH("moon_azimuth"); + const std::string FIELD_SKY_MOON_ELEVATION("moon_elevation"); const std::string BTN_RESET("btn_reset"); const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f); @@ -96,9 +100,13 @@ BOOL LLFloaterEnvironmentAdjust::postBuild() getChild(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); }); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); }); getChild(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); }); + getChild(FIELD_SKY_SUN_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); + getChild(FIELD_SKY_SUN_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); getChild(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); }); getChild(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); + getChild(FIELD_SKY_MOON_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); + getChild(FIELD_SKY_MOON_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); getChild(BTN_RESET)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onButtonReset(); }); getChild(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); }); @@ -169,10 +177,25 @@ void LLFloaterEnvironmentAdjust::refresh() getChild(FIELD_SKY_GLOW_SIZE)->setValue(2.0 - (glow.mV[0] / SLIDER_SCALE_GLOW_R)); getChild(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mLiveSky->getStarBrightness()); - getChild(FIELD_SKY_SUN_ROTATION)->setRotation(mLiveSky->getSunRotation()); getChild(FIELD_SKY_SUN_SCALE)->setValue(mLiveSky->getSunScale()); - getChild(FIELD_SKY_MOON_ROTATION)->setRotation(mLiveSky->getMoonRotation()); + // Sun rotation + LLQuaternion quat = mLiveSky->getSunRotation(); + F32 azimuth; + F32 elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + + // Moon rotation + quat = mLiveSky->getMoonRotation(); + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); } @@ -325,10 +348,45 @@ void LLFloaterEnvironmentAdjust::onStarBrightnessChanged() void LLFloaterEnvironmentAdjust::onSunRotationChanged() { - if (!mLiveSky) - return; - mLiveSky->setSunRotation(getChild(FIELD_SKY_SUN_ROTATION)->getRotation()); - mLiveSky->update(); + LLQuaternion quat = getChild(FIELD_SKY_SUN_ROTATION)->getRotation(); + F32 azimuth; + F32 elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + if (mLiveSky) + { + mLiveSky->setSunRotation(quat); + mLiveSky->update(); + } +} + +void LLFloaterEnvironmentAdjust::onSunAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); + LLQuaternion quat; + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + + if (mLiveSky) + { + mLiveSky->setSunRotation(quat); + mLiveSky->update(); + } } void LLFloaterEnvironmentAdjust::onSunScaleChanged() @@ -341,10 +399,45 @@ void LLFloaterEnvironmentAdjust::onSunScaleChanged() void LLFloaterEnvironmentAdjust::onMoonRotationChanged() { - if (!mLiveSky) - return; - mLiveSky->setMoonRotation(getChild(FIELD_SKY_MOON_ROTATION)->getRotation()); - mLiveSky->update(); + LLQuaternion quat = getChild(FIELD_SKY_MOON_ROTATION)->getRotation(); + F32 azimuth; + F32 elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + if (mLiveSky) + { + mLiveSky->setMoonRotation(quat); + mLiveSky->update(); + } +} + +void LLFloaterEnvironmentAdjust::onMoonAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); + LLQuaternion quat; + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); + + if (mLiveSky) + { + mLiveSky->setMoonRotation(quat); + mLiveSky->update(); + } } void LLFloaterEnvironmentAdjust::onCloudMapChanged() diff --git a/indra/newview/llfloaterenvironmentadjust.h b/indra/newview/llfloaterenvironmentadjust.h index cb38dbcfa8..05ff011be5 100644 --- a/indra/newview/llfloaterenvironmentadjust.h +++ b/indra/newview/llfloaterenvironmentadjust.h @@ -73,9 +73,11 @@ private: void onGlowChanged(); void onStarBrightnessChanged(); void onSunRotationChanged(); + void onSunAzimElevChanged(); void onSunScaleChanged(); void onMoonRotationChanged(); + void onMoonAzimElevChanged(); void onCloudMapChanged(); void onWaterMapChanged(); diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 06e406e2ab..a169712bd8 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -625,7 +625,7 @@ void LLPanelSettingsSkySunMoonTab::onSunAzimElevChanged() { F32 azimuth = getChild(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); F32 elevation = getChild(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); - LLQuaternion quat = mSkySettings->getSunRotation(); + LLQuaternion quat; azimuth *= DEG_TO_RAD; elevation *= DEG_TO_RAD; @@ -687,7 +687,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonAzimElevChanged() { F32 azimuth = getChild(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); F32 elevation = getChild(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); - LLQuaternion quat = mSkySettings->getMoonRotation(); + LLQuaternion quat; azimuth *= DEG_TO_RAD; elevation *= DEG_TO_RAD; diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index 59589e3665..f4a686bae1 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -5,14 +5,14 @@ save_rect="false" title="Personal Lighting" width="845" - height="240" + height="280" min_width="500" - min_height="235" + min_height="275" single_instance="true" can_resize="false"> + Azimuth: + + Elevation: + + left_delta="-5" + top_pad="8" + follows="left|top"/> Scale: + Azimuth: + + Elevation: + + left_delta="0" + top_pad="8"/> -- cgit v1.2.3 From 9eae41e5825662564125b9f5edf87e1aa3c0c508 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 16 Feb 2021 21:47:34 +0200 Subject: SL-14725 Validate trackball elevation --- indra/llui/llvirtualtrackball.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index 728e86af08..6e0aef740d 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -370,7 +370,10 @@ void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &a azimuth += F_PI * 2; } - elevation = asin(point.mV[VZ]); // because VectorZero is '1' + // while vector is '1', F32 is not sufficiently precise and we can get + // values like 1.0000012 which will result in -90deg angle instead of 90deg + F32 z = llclamp(point.mV[VZ], -1.f, 1.f); + elevation = asin(z); // because VectorZero's length is '1' } // static @@ -442,6 +445,10 @@ BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask) mValue *= az_quat; } + // we are doing a lot of F32 mathematical operations with loss of precision, + // re-normalize to compensate + mValue.normalize(); + mPrevX = x; mPrevY = y; onCommit(); -- cgit v1.2.3 From d15156d4e091ee7a095df70cfda04fea4ee2935a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 18 Feb 2021 14:24:54 +0000 Subject: SL-14862 - catching more commands in LLUIUsage --- indra/llui/lltoolbar.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index e6f466ec78..4868c66d1b 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -967,6 +967,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) executeStopParam.function_name = executeStopFunction; executeStopParam.parameter = commandp->executeStopParameters(); LLUICtrl::commit_callback_t execute_func = initCommitCallback(executeParam); + button->setFunctionName(commandp->executeFunctionName()); + LL_DEBUGS("UIUsage") << "button function name a -> " << commandp->executeFunctionName() << LL_ENDL; LLUICtrl::commit_callback_t stop_func = initCommitCallback(executeStopParam); button->setMouseDownCallback(boost::bind(&LLToolBarButton::callIfEnabled, button, execute_func, _1, _2)); @@ -974,6 +976,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) } else { + button->setFunctionName(commandp->executeFunctionName()); + LL_DEBUGS("UIUsage") << "button function name b -> " << commandp->executeFunctionName() << LL_ENDL; button->setCommitCallback(executeParam); } -- cgit v1.2.3 From 53343bc708339b95f18804e11d6a130b542e0c5b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 17 Feb 2021 01:20:24 +0200 Subject: SL-14797 Normalize right-click - favorites panel, part #4 --- indra/newview/llfavoritesbar.cpp | 44 ++++++++++++++++++++++ indra/newview/llfavoritesbar.h | 1 + indra/newview/llpanellandmarks.cpp | 33 ++++++++++------ indra/newview/llpanellandmarks.h | 6 ++- indra/newview/llpanelplaces.cpp | 16 ++++++++ .../skins/default/xui/en/menu_favorites.xml | 23 +++++++++-- .../newview/skins/default/xui/en/notifications.xml | 25 +++++++++++- 7 files changed, 130 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 347997a69a..2394a763ee 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -38,6 +38,7 @@ #include "lltooltip.h" #include "llagent.h" +#include "llagentpicksinfo.h" #include "llavatarnamecache.h" #include "llclipboard.h" #include "llinventorybridge.h" @@ -1194,6 +1195,10 @@ bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata) { return isClipboardPasteable(); } + else if (param == "create_pick") + { + return !LLAgentPicksInfo::getInstance()->isPickLimitReached(); + } return false; } @@ -1242,6 +1247,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) LLFloaterReg::showInstance("world_map", "center"); } } + else if (action == "create_pick") + { + LLSD args; + args["type"] = "create_pick"; + args["item_id"] = item->getUUID(); + LLFloaterSidePanelContainer::showPanel("places", args); + } else if (action == "cut") { } @@ -1257,6 +1269,16 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) { gInventory.removeItem(mSelectedItemID); } + else if (action == "rename") + { + LLSD args; + args["NAME"] = item->getName(); + + LLSD payload; + payload["id"] = mSelectedItemID; + + LLNotificationsUtil::add("RenameLandmark", args, payload, boost::bind(onRenameCommit, _1, _2)); + } // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. @@ -1269,6 +1291,28 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) } } +bool LLFavoritesBarCtrl::onRenameCommit(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + LLUUID id = notification["payload"]["id"].asUUID(); + LLInventoryItem *item = gInventory.getItem(id); + std::string landmark_name = response["new_name"].asString(); + LLStringUtil::trim(landmark_name); + + if (!landmark_name.empty() && item && item->getName() != landmark_name) + { + LLPointer new_item = new LLViewerInventoryItem(item); + new_item->rename(landmark_name); + new_item->updateServer(FALSE); + gInventory.updateItem(new_item); + } + } + + return false; +} + BOOL LLFavoritesBarCtrl::isClipboardPasteable() const { if (!LLClipboard::instance().hasContents()) diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 571208aa31..147308c0ba 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -91,6 +91,7 @@ protected: bool enableSelected(const LLSD& userdata); void doToSelected(const LLSD& userdata); + static bool onRenameCommit(const LLSD& notification, const LLSD& response); BOOL isClipboardPasteable() const; void pasteFromClipboard() const; diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 6e8eac19fc..7eda9c1aa7 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -512,14 +512,20 @@ void LLLandmarksPanel::processParcelInfo(const LLParcelData& parcel_data) { //this function will be called after user will try to create a pick for selected landmark. // We have to make request to sever to get parcel_id and snaption_id. - if(isLandmarkSelected()) + if(mCreatePickItemId.notNull()) { - LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem(); - if (!cur_item) return; - LLUUID id = cur_item->getUUID(); - LLInventoryItem* inv_item = mCurrentSelectedList->getModel()->getItem(id); - doActionOnCurSelectedLandmark(boost::bind( - &LLLandmarksPanel::doProcessParcelInfo, this, _1, getCurSelectedItem(), inv_item, parcel_data)); + LLInventoryItem* inv_item = gInventory.getItem(mCreatePickItemId); + + if (inv_item && inv_item->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + // we are processing response for doCreatePick, landmark should be already loaded + LLLandmark* landmark = LLLandmarkActions::getLandmark(inv_item->getUUID()); + if (landmark) + { + doProcessParcelInfo(landmark, inv_item, parcel_data); + } + } + mCreatePickItemId.setNull(); } } @@ -1124,7 +1130,11 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) } else if ("create_pick" == command_name) { - doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1)); + LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem(); + if (cur_item) + { + doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1, cur_item->getUUID())); + } } else if ("share" == command_name && mCurrentSelectedList) { @@ -1344,7 +1354,6 @@ void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark) } void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, - LLFolderViewItem* cur_item, LLInventoryItem* inv_item, const LLParcelData& parcel_data) { @@ -1373,7 +1382,7 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, LLPickData data; data.pos_global = landmark_global_pos; - data.name = cur_item->getName(); + data.name = inv_item->getName(); data.desc = inv_item->getDescription(); data.snapshot_id = parcel_data.snapshot_id; data.parcel_id = parcel_data.parcel_id; @@ -1393,11 +1402,13 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, panel_pick, panel_places,params)); } -void LLLandmarksPanel::doCreatePick(LLLandmark* landmark) +void LLLandmarksPanel::doCreatePick(LLLandmark* landmark, const LLUUID &item_id) { LLViewerRegion* region = gAgent.getRegion(); if (!region) return; + mCreatePickItemId = item_id; + LLGlobalVec pos_global; LLUUID region_id; landmark->getGlobalPos(pos_global); diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index c11cbe05ae..e8fb62e0e8 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -82,6 +82,8 @@ public: void updateMenuVisibility(LLUICtrl* menu); + void doCreatePick(LLLandmark* landmark, const LLUUID &item_id ); + protected: /** * @return true - if current selected panel is not null and selected item is a landmark @@ -160,10 +162,8 @@ private: */ void doShowOnMap(LLLandmark* landmark); void doProcessParcelInfo(LLLandmark* landmark, - LLFolderViewItem* cur_item, LLInventoryItem* inv_item, const LLParcelData& parcel_data); - void doCreatePick(LLLandmark* landmark); private: LLPlacesInventoryPanel* mFavoritesInventoryPanel; @@ -183,6 +183,8 @@ private: accordion_tabs_t mAccordionTabs; LLAccordionCtrlTab* mMyLandmarksAccordionTab; + + LLUUID mCreatePickItemId; // item we requested a pick for }; #endif //LL_LLPANELLANDMARKS_H diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index c038207628..427b3fbf57 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -79,6 +79,7 @@ static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; +static const std::string CREATE_PICK_TYPE = "create_pick"; static const std::string LANDMARK_INFO_TYPE = "landmark"; static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; @@ -388,6 +389,21 @@ void LLPanelPlaces::onOpen(const LLSD& key) // Update the buttons at the bottom of the panel updateVerbs(); } + else if (key_type == CREATE_PICK_TYPE) + { + LLUUID item_id = key["item_id"]; + + LLLandmarksPanel* landmarks_panel = + dynamic_cast(mTabContainer->getPanelByName("Landmarks")); + if (landmarks_panel && item_id.notNull()) + { + LLLandmark* landmark = LLLandmarkActions::getLandmark(item_id, boost::bind(&LLLandmarksPanel::doCreatePick, landmarks_panel, _1, item_id)); + if (landmark) + { + landmarks_panel->doCreatePick(landmark, item_id); + } + } + } else // "create_landmark" { mFilterEditor->clear(); diff --git a/indra/newview/skins/default/xui/en/menu_favorites.xml b/indra/newview/skins/default/xui/en/menu_favorites.xml index 082f2f9670..6c28032e3f 100644 --- a/indra/newview/skins/default/xui/en/menu_favorites.xml +++ b/indra/newview/skins/default/xui/en/menu_favorites.xml @@ -36,6 +36,17 @@ function="Favorites.DoToSelected" parameter="copy_slurl" /> + + + + @@ -59,10 +70,14 @@ function="Favorites.EnableSelected" parameter="can_paste" /> - - - + + + - + + + Choose a new name for [NAME] + confirm +
+ + [NAME] + +
+ width="268"> Date: Thu, 25 Feb 2021 22:41:18 +0200 Subject: SL-14916 Warn user about detailed logging slowing down model imports --- indra/newview/skins/default/xui/en/floater_model_preview.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 02a21764ce..7f863756eb 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -1362,7 +1362,7 @@ top_pad="9" left="6" width="70" - label="Enable detailed logging" + label="Enable detailed logging (can be very slow)" name="verbose_logging"/> -- cgit v1.2.3 From 14826e17dccb3a12fe7551effc60a2a3c62a4946 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 25 Feb 2021 23:48:48 +0200 Subject: SL-14654 [EEP] Aplying settings locally now is instant The 1 second fade makes it harder to compare different settings. --- indra/newview/llenvironment.cpp | 25 +++++++------------------ indra/newview/llenvironment.h | 3 +-- indra/newview/llinventorybridge.cpp | 4 ++-- indra/newview/llviewermenu.cpp | 18 +++++++++--------- 4 files changed, 19 insertions(+), 31 deletions(-) (limited to 'indra') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index a1b27e48ce..90d22c57b0 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1217,33 +1217,24 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version) { - setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, env_version); -} - -void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsBase::Seconds transition, S32 env_version) -{ - setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, transition, env_version); + setEnvironment(env, assetId, TRANSITION_DEFAULT, env_version); } void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, - LLSettingsDay::Seconds daylength, - LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 env_version) { LLSettingsVOBase::getSettingsAsset(assetId, - [this, env, daylength, dayoffset, env_version, transition](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + [this, env, env_version, transition](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { - onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, transition, status, env_version); + onSetEnvAssetLoaded(env, asset_id, settings, transition, status, env_version); }); } void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, - LLSettingsDay::Seconds daylength, - LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version) @@ -1690,7 +1681,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI if (!envinfo->mDayCycle) { clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, envinfo->mEnvVersion); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion); updateEnvironment(); } else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) @@ -1698,7 +1689,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI { LL_WARNS("ENVIRONMENT") << "Invalid day cycle for region" << LL_ENDL; clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, envinfo->mEnvVersion); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion); updateEnvironment(); } else @@ -2944,17 +2935,15 @@ bool LLEnvironment::loadFromSettings() if (env_data.has("day_id")) { - LLSettingsDay::Seconds length = LLSettingsDay::Seconds(env_data["day_length"].asInteger()); - LLSettingsDay::Seconds offset = LLSettingsDay::Seconds(env_data["day_offset"].asInteger()); LLUUID assetId = env_data["day_id"].asUUID(); LLSettingsVOBase::getSettingsAsset(assetId, - [this, length, offset, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + [this, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { // Day should be always applied first, // otherwise it will override sky or water that was set earlier // so wait for asset to load before applying sky/water - onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, length, offset, TRANSITION_DEFAULT, status, NO_VERSION); + onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, TRANSITION_DEFAULT, status, NO_VERSION); bool valid = false, has_assets = false; loadSkyWaterFromSettings(env_data, valid, has_assets); if (!has_assets && valid) diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 5c1a62d0ab..7cbf2d25bb 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -144,7 +144,6 @@ public: void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t()), env_version); } void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed), env_version); } void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw), env_version); } - void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 env_version); void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version); void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsBase::Seconds transition = TRANSITION_DEFAULT, S32 env_version = NO_VERSION); @@ -435,7 +434,7 @@ private: void onAgentPositionHasChanged(const LLVector3 &localpos); - void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version); + void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsBase::Seconds transition, S32 status, S32 env_version); void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset, altitudes_vect_t altitudes); void handleEnvironmentPushClear(LLUUID experience_id, LLSD &message, F32 transition); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 065a3cb9ae..a0c3608107 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -7064,8 +7064,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action if (!item) return; LLUUID asset_id = item->getAssetUUID(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); } else if ("apply_settings_parcel" == action) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7d7fdf53e2..c09654236c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8608,32 +8608,32 @@ class LLWorldEnvSettings : public view_listener_t if (event_name == "sunrise") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "noon") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "sunset") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "midnight") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "region") { LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "pause_clouds") -- cgit v1.2.3 From 34b971150835872eb04fcd08af6f485601c79b54 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Feb 2021 19:44:58 +0200 Subject: SL-14725 Adjust "Show Beacon" position --- .../skins/default/xui/en/floater_fixedenvironment.xml | 2 +- .../default/xui/en/panel_settings_sky_sunmoon.xml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 37c56d3235..a6e20880a9 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -89,7 +89,7 @@ follows="left|top|right|bottom" auto_resize="false" user_resize="false" - height="35" + height="29" visible="true"> + name="sunbeacon" + top_pad="5" + left_delta="-8"/> + top_pad="5" + left_delta="-8"/> -- cgit v1.2.3 From 4a2f7c82cc6c9628f6be6b4e322b172478d65b9c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Feb 2021 21:38:13 +0200 Subject: SL-14612 Wording improvement for hitting TP throttle Teleport uses teleport_strings.xml, updating noifications.xml as well in case it can be triggered by server directly. --- indra/newview/skins/default/xui/en/notifications.xml | 5 ++--- indra/newview/skins/default/xui/en/teleport_strings.xml | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 23bf3191ae..cdde9d2107 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2431,9 +2431,8 @@ Teleport failed. icon="alertmodal.tga" name="invalid_tport" type="alertmodal"> -Problem encountered processing your teleport request. You may need to log back in before you can teleport. -If you continue to get this message, please check the [SUPPORT_SITE]. - fail +Teleport attempts are limited to 6 per minute. If you are having trouble, wait one minute and try teleporting again. If the problem persists, log out and log in again. + fail
- Problem encountered processing your teleport request. You may need to log back in before you can teleport. -If you continue to get this message, please check the [SUPPORT_SITE]. + Teleport attempts are limited to 6 per minute. If you are having trouble, wait one minute and try teleporting again. If the problem persists, log out and log in again. Problem encountered processing your region crossing. You may need to log back in before you can cross regions. -- cgit v1.2.3 From dd89dec893411c22d4916de14593a56f87d3a284 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 1 Mar 2021 21:38:46 +0000 Subject: SL-14862 - more types of UI usage logs --- indra/llui/llbutton.cpp | 8 ++++++++ indra/llui/lluictrl.cpp | 1 + indra/llui/lluiusage.cpp | 12 ++++++++++++ indra/llui/lluiusage.h | 2 ++ indra/newview/llchatbar.cpp | 3 +++ indra/newview/llfloaterimnearbychat.cpp | 2 ++ indra/newview/llworldmipmap.cpp | 2 ++ 7 files changed, 30 insertions(+) (limited to 'indra') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 9682c3bc10..3a3d9254fd 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -47,6 +47,7 @@ #include "llnotificationsutil.h" #include "llrender.h" #include "lluictrlfactory.h" +#include "lluiusage.h" #include "llhelp.h" #include "lldockablefloater.h" #include "llviewereventrecorder.h" @@ -437,6 +438,13 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) setFocus(TRUE); } + if (!mFunctionName.empty()) + { + LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL; + LLUIUsage::instance().logCommand(mFunctionName); + LLUIUsage::instance().logWidget(getPathname()); + } + /* * ATTENTION! This call fires another mouse down callback. * If you wish to remove this call emit that signal directly diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0e1c8439ea..426c931d07 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -429,6 +429,7 @@ void LLUICtrl::onCommit() { LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); + LLUIUsage::instance().logWidget(getPathname()); } else { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 50eeccd214..99de4ff78a 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -47,11 +47,19 @@ std::string LLUIUsage::sanitized(const std::string& s) void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; + LL_DEBUGS("UIUsage") << "floater " << floater << LL_ENDL; } void LLUIUsage::logCommand(const std::string& command) { mCommandCounts[sanitized(command)]++; + LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; +} + +void LLUIUsage::logWidget(const std::string& w) +{ + mWidgetCounts[sanitized(w)]++; + LL_DEBUGS("UIUsage") << "widget " << w << LL_ENDL; } LLSD LLUIUsage::asLLSD() const @@ -65,6 +73,10 @@ LLSD LLUIUsage::asLLSD() const { result["commands"][it.first] = LLSD::Integer(it.second); } + for (auto const& it : mWidgetCounts) + { + result["widgets"][it.first] = LLSD::Integer(it.second); + } return result; } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index bac607aa60..efc8bb4032 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -41,10 +41,12 @@ public: static std::string sanitized(const std::string& s); void logFloater(const std::string& floater); void logCommand(const std::string& command); + void logWidget(const std::string& w); LLSD asLLSD() const; private: std::map mFloaterCounts; std::map mCommandCounts; + std::map mWidgetCounts; }; #endif // LLUIUIUSAGE.h diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 3ab5c669c4..e400609a74 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -58,6 +58,7 @@ #include "llmultigesture.h" #include "llui.h" #include "lluictrlfactory.h" +#include "lluiusage.h" // // Globals @@ -566,6 +567,8 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL // as soon as we say something, we no longer care about teaching the user // how to chat gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE); + + LLUIUsage::instance().logCommand("Chat.Send"); // Pseudo-command // Look for "/20 foo" channel chats. S32 channel = 0; diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index a6531ed7e1..3a850d4b68 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -67,6 +67,7 @@ #include "llviewerchat.h" #include "lltranslate.h" #include "llautoreplace.h" +#include "lluiusage.h" S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0; @@ -697,6 +698,7 @@ void LLFloaterIMNearbyChat::sendChatFromViewer(const std::string &utf8text, ECha void LLFloaterIMNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) { + LLUIUsage::instance().logCommand("Chat.Send"); // pseuo-command // Look for "/20 foo" channel chats. S32 channel = 0; LLWString out_text = stripChannelNumber(wtext, &channel); diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp index a2e519a61a..040d0deaf3 100644 --- a/indra/newview/llworldmipmap.cpp +++ b/indra/newview/llworldmipmap.cpp @@ -190,6 +190,8 @@ LLPointer LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 //LL_INFOS("WorldMap") << "LLWorldMipmap::loadObjectsTile(), URL = " << imageurl << LL_ENDL; LLPointer img = LLViewerTextureManager::getFetchedTextureFromUrl(imageurl, FTT_MAP_TILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LL_INFOS("MAPURL") << "fetching map tile from " << imageurl << LL_ENDL; + img->setBoostLevel(LLGLTexture::BOOST_MAP); // Return the smart pointer -- cgit v1.2.3 From c06f43adde3aeb87a1510583b6f35b9327598408 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 5 Mar 2021 16:50:41 +0200 Subject: SL-14931 Change messaging on empty lists in People floater --- indra/newview/llfloaterhandler.cpp | 9 ++++++++- indra/newview/llpanelpeople.cpp | 1 + indra/newview/skins/default/xui/en/panel_people.xml | 18 +++++++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterhandler.cpp b/indra/newview/llfloaterhandler.cpp index e2160498e9..8ebb14149c 100644 --- a/indra/newview/llfloaterhandler.cpp +++ b/indra/newview/llfloaterhandler.cpp @@ -26,6 +26,7 @@ #include "llfloater.h" #include "llmediactrl.h" +#include "llfloaterreg.h" // register with dispatch via global object LLFloaterHandler gFloaterHandler; @@ -50,9 +51,15 @@ LLFloater* get_parent_floater(LLView* view) bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, LLMediaCtrl *web) { - if (params.size() < 2) return false; + if (params.size() < 1) return false; LLFloater* floater = NULL; // *TODO: implement floater lookup by name + + if (params[0].asString() == "destinations") + { + LLFloaterReg::toggleInstanceOrBringToFront("destinations"); + return true; + } if (params[0].asString() == "self") { if (web) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e5142f2b5f..5997d522c4 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -661,6 +661,7 @@ BOOL LLPanelPeople::postBuild() mRecentList->setShowIcons("RecentListShowIcons"); mGroupList = getChild("group_list"); + mGroupList->setNoItemsCommentText(getString("no_groups_msg")); mGroupList->setNoItemsMsg(getString("no_groups_msg")); mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg")); diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c4248d9b92..3c8a2fe4f4 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -12,7 +12,7 @@ width="333"> + value="No recent people." /> @@ -30,8 +30,13 @@ value="No friends" /> - Find friends using [secondlife:///app/search/people Search] or right-click on a Resident to add them as a friend. -Looking for people to hang out with? Try the [secondlife:///app/worldmap World Map]. + To add someone as a friend, right-click on their avatar or their name. + +Looking for places with more people? + +[secondlife:///app/floater/destinations Destination Guide] has locations chosen by Second Life staff. + +[secondlife:///app/search/people Search] lets you search all of Second Life for certain keywords. @@ -45,8 +50,11 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="no_filtered_groups_msg" value="Didn't find what you're looking for? Try [secondlife:///app/search/groups/[SEARCH_TERM] Search]." /> + name="no_groups_msg"> +You are not a member of any groups. + +Learn about [https://community.secondlife.com/knowledgebase/joining-and-participating-in-groups-r51/ groups in Second Life.] + -- cgit v1.2.3 From 446253df44dd82a7c5e711b9a69369cbbeb2acb7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 10 Mar 2021 17:54:44 +0200 Subject: SL-14901 Updated button according to new spec --- indra/newview/llfavoritesbar.cpp | 2 +- .../skins/default/textures/navbar/Landmarks.png | Bin 0 -> 15870 bytes indra/newview/skins/default/textures/textures.xml | 4 +++- .../skins/default/xui/en/panel_navigation_bar.xml | 21 ++++++++++----------- 4 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 indra/newview/skins/default/textures/navbar/Landmarks.png (limited to 'indra') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 3bebe6fc59..2394a763ee 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -838,7 +838,7 @@ void LLFavoritesBarCtrl::updateButtons() int j = first_changed_item_index; for (; j < mItems.size(); j++) { - last_new_button = createButton(mItems[j], button_params, j == 0? last_right_edge + 4 : last_right_edge); + last_new_button = createButton(mItems[j], button_params, last_right_edge); if (!last_new_button) { break; diff --git a/indra/newview/skins/default/textures/navbar/Landmarks.png b/indra/newview/skins/default/textures/navbar/Landmarks.png new file mode 100644 index 0000000000..2b35de913b Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Landmarks.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 8d609afeae..03878d9fe7 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -339,7 +339,9 @@ with the same filename but different name - + + + diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 4cc05fedc9..d3448ed0ba 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -151,32 +151,31 @@ layout="topleft" auto_resize="true" user_resize="true" - min_width="242" + min_width="254" name="favorites_layout_panel" - width="320"> + width="342"> Date: Wed, 10 Mar 2021 16:23:20 +0000 Subject: SL-14862 - use nested LLSD for widget info, condensed to the two leaf-most elements of the path. Simplified floater logging. --- indra/llui/llfloater.cpp | 2 ++ indra/llui/llfloaterreg.cpp | 8 -------- indra/llui/lluiusage.cpp | 33 ++++++++++++++++++++++++++++++++- indra/llui/lluiusage.h | 1 + indra/newview/llviewermessage.cpp | 1 - 5 files changed, 35 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e9c980ad9a..c03b024dd5 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -58,6 +58,7 @@ #include "llhelp.h" #include "llmultifloater.h" #include "llsdutil.h" +#include "lluiusage.h" #include @@ -1631,6 +1632,7 @@ void LLFloater::bringToFront( S32 x, S32 y ) // virtual void LLFloater::setVisibleAndFrontmost(BOOL take_focus,const LLSD& key) { + LLUIUsage::instance().logFloater(getInstanceName()); LLMultiFloater* hostp = getHost(); if (hostp) { diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 6307bf1028..7c0933f554 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -244,8 +244,6 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str //static LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus) { - LL_DEBUGS("UIUsage") << "floater showInstance " << name << LL_ENDL; - LLUIUsage::instance().logFloater(name); if( sBlockShowFloaters // see EXT-7090 && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) @@ -276,9 +274,6 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) // returns true if the instance is visible when completed bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) { - LL_DEBUGS("UIUsage") << "floater toggleInstance " << name << LL_ENDL; - LLUIUsage::instance().logFloater(name); - LLFloater* instance = findInstance(name, key); if (LLFloater::isShown(instance)) { @@ -478,9 +473,6 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& std::string name = sdname.asString(); LLFloater* instance = getInstance(name, key); - - LL_DEBUGS("UIUsage") << "floater toggleInstanceOrBringToFront " << name << LL_ENDL; - LLUIUsage::instance().logFloater(name); if (!instance) { LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 99de4ff78a..824c59730b 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" #include "lluiusage.h" +#include LLUIUsage::LLUIUsage() { @@ -41,9 +42,39 @@ std::string LLUIUsage::sanitized(const std::string& s) // ViewerStats db doesn't like "." in keys std::string result(s); std::replace(result.begin(), result.end(), '.', '_'); + std::replace(result.begin(), result.end(), ' ', '_'); return result; } +void LLUIUsage::setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const +{ + std::vector fields; + boost::split(fields, path, boost::is_any_of("/")); + auto first_pos = std::max(fields.begin(), fields.end() - max_elts); + auto end_pos = fields.end(); + std::vector last_fields(first_pos,end_pos); + + // Code below is just to accomplish the equivalent of + // sd[last_fields[0]][last_fields[1]] = LLSD::Integer(val); + // for an arbitrary number of fields. + LLSD* fsd = &sd; + for (auto it=last_fields.begin(); it!=last_fields.end(); ++it) + { + if (it == last_fields.end()-1) + { + (*fsd)[*it] = LLSD::Integer(val); + } + else + { + if (!(*fsd)[*it].isMap()) + { + (*fsd)[*it] = LLSD::emptyMap(); + } + fsd = &(*fsd)[*it]; + } + } +} + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; @@ -75,7 +106,7 @@ LLSD LLUIUsage::asLLSD() const } for (auto const& it : mWidgetCounts) { - result["widgets"][it.first] = LLSD::Integer(it.second); + setLLSDNested(result["widgets"], it.first, 2, it.second); } return result; } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index efc8bb4032..956e184edc 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -39,6 +39,7 @@ public: ~LLUIUsage(); public: static std::string sanitized(const std::string& s); + void setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const; void logFloater(const std::string& floater); void logCommand(const std::string& command); void logWidget(const std::string& w); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 458fc3b13d..0d1b074743 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -116,7 +116,6 @@ #include "llviewerregion.h" #include "llfloaterregionrestarting.h" -#include // #include #include "llnotificationmanager.h" // -- cgit v1.2.3 From 92a17bf53b33050402c292c22614b361dba0e292 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 10 Mar 2021 17:49:06 +0000 Subject: SL-14862 - tab logging --- indra/llui/lltabcontainer.cpp | 3 +++ indra/llui/lluiusage.cpp | 27 ++++++++++++++++++++++++--- indra/llui/lluiusage.h | 7 +++++-- indra/newview/llstartup.cpp | 3 +++ 4 files changed, 35 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index e6b43da8e5..459fdcf2ae 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -38,6 +38,7 @@ #include "llrender.h" #include "llfloater.h" #include "lltrans.h" +#include "lluiusage.h" //---------------------------------------------------------------------------- @@ -1556,6 +1557,8 @@ BOOL LLTabContainer::setTab(S32 which) if (is_selected) { + LLUIUsage::instance().logPanel(tuple->mTabPanel->getName()); + // Make sure selected tab is within scroll region if (mIsVertical) { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 824c59730b..c0d945438f 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -75,16 +75,22 @@ void LLUIUsage::setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S } } +void LLUIUsage::logCommand(const std::string& command) +{ + mCommandCounts[sanitized(command)]++; + LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; +} + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; LL_DEBUGS("UIUsage") << "floater " << floater << LL_ENDL; } -void LLUIUsage::logCommand(const std::string& command) +void LLUIUsage::logPanel(const std::string& p) { - mCommandCounts[sanitized(command)]++; - LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; + mPanelCounts[sanitized(p)]++; + LL_DEBUGS("UIUsage") << "panel " << p << LL_ENDL; } void LLUIUsage::logWidget(const std::string& w) @@ -104,6 +110,10 @@ LLSD LLUIUsage::asLLSD() const { result["commands"][it.first] = LLSD::Integer(it.second); } + for (auto const& it : mPanelCounts) + { + result["panels"][it.first] = LLSD::Integer(it.second); + } for (auto const& it : mWidgetCounts) { setLLSDNested(result["widgets"], it.first, 2, it.second); @@ -111,3 +121,14 @@ LLSD LLUIUsage::asLLSD() const return result; } +// Clear up some junk content generated during initial login/UI initialization +void LLUIUsage::clear() +{ + + LL_DEBUGS("UIUsage") << "clear" << LL_ENDL; + mCommandCounts.clear(); + mFloaterCounts.clear(); + mPanelCounts.clear(); + mWidgetCounts.clear(); +} + diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index 956e184edc..df7360c210 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -40,13 +40,16 @@ public: public: static std::string sanitized(const std::string& s); void setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const; - void logFloater(const std::string& floater); void logCommand(const std::string& command); + void logFloater(const std::string& floater); + void logPanel(const std::string& p); void logWidget(const std::string& w); LLSD asLLSD() const; + void clear(); private: - std::map mFloaterCounts; std::map mCommandCounts; + std::map mFloaterCounts; + std::map mPanelCounts; std::map mWidgetCounts; }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 17777c3ceb..b458582fa8 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -142,6 +142,7 @@ #include "lltoolmgr.h" #include "lltrans.h" #include "llui.h" +#include "lluiusage.h" #include "llurldispatcher.h" #include "llurlentry.h" #include "llslurl.h" @@ -2257,6 +2258,8 @@ bool idle_startup() gAgentAvatarp->sendHoverHeight(); + LLUIUsage::instance().clear(); + return TRUE; } -- cgit v1.2.3 From e3babd1f8d6d5347f9cf1ec5fee976718e0c6a44 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Mar 2021 14:26:36 +0000 Subject: SL-14862 - more generalized LLSD funcs --- indra/llui/lluiusage.cpp | 26 ++++++++++++++++++-------- indra/llui/lluiusage.h | 3 ++- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index c0d945438f..60c124b711 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -46,23 +46,33 @@ std::string LLUIUsage::sanitized(const std::string& s) return result; } -void LLUIUsage::setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const +// static +void LLUIUsage::setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val) { + // Keep the last max_elts components of the specified path std::vector fields; boost::split(fields, path, boost::is_any_of("/")); auto first_pos = std::max(fields.begin(), fields.end() - max_elts); auto end_pos = fields.end(); std::vector last_fields(first_pos,end_pos); - // Code below is just to accomplish the equivalent of - // sd[last_fields[0]][last_fields[1]] = LLSD::Integer(val); - // for an arbitrary number of fields. + setLLSDNested(sd, last_fields, val); +} + +// setLLSDNested +// Accomplish the equivalent of +// sd[fields[0]][fields[1]]... = val; +// for an arbitrary number of fields. +// +// static +void LLUIUsage::setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val) +{ LLSD* fsd = &sd; - for (auto it=last_fields.begin(); it!=last_fields.end(); ++it) + for (auto it=fields.begin(); it!=fields.end(); ++it) { - if (it == last_fields.end()-1) + if (it == fields.end()-1) { - (*fsd)[*it] = LLSD::Integer(val); + (*fsd)[*it] = val; } else { @@ -116,7 +126,7 @@ LLSD LLUIUsage::asLLSD() const } for (auto const& it : mWidgetCounts) { - setLLSDNested(result["widgets"], it.first, 2, it.second); + setLLSDPath(result["widgets"], it.first, 2, LLSD::Integer(it.second)); } return result; } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index df7360c210..e642c55e0f 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -39,7 +39,8 @@ public: ~LLUIUsage(); public: static std::string sanitized(const std::string& s); - void setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const; + static void setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val); + static void setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val); void logCommand(const std::string& command); void logFloater(const std::string& floater); void logPanel(const std::string& p); -- cgit v1.2.3 From acb2e87d9425c8f671d9772409fd291d7fed9aa7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Mar 2021 15:11:51 +0000 Subject: SL-14862 - renamed widgets to the more descriptive controls --- indra/llui/llbutton.cpp | 2 +- indra/llui/lluictrl.cpp | 2 +- indra/llui/lluiusage.cpp | 36 +++++++++++++++++++----------------- indra/llui/lluiusage.h | 4 ++-- 4 files changed, 23 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 3a3d9254fd..0e59fdf519 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -442,7 +442,7 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) { LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); - LLUIUsage::instance().logWidget(getPathname()); + LLUIUsage::instance().logControl(getPathname()); } /* diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 426c931d07..5924542a19 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -429,7 +429,7 @@ void LLUICtrl::onCommit() { LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); - LLUIUsage::instance().logWidget(getPathname()); + LLUIUsage::instance().logControl(getPathname()); } else { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 60c124b711..ccae6643b9 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -39,7 +39,7 @@ LLUIUsage::~LLUIUsage() // static std::string LLUIUsage::sanitized(const std::string& s) { - // ViewerStats db doesn't like "." in keys + // Remove characters that make the ViewerStats db unhappy std::string result(s); std::replace(result.begin(), result.end(), '.', '_'); std::replace(result.begin(), result.end(), ' ', '_'); @@ -59,10 +59,11 @@ void LLUIUsage::setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, con setLLSDNested(sd, last_fields, val); } -// setLLSDNested +// setLLSDNested() // Accomplish the equivalent of // sd[fields[0]][fields[1]]... = val; // for an arbitrary number of fields. +// This might be useful as an LLSD utility function; is not specific to LLUIUsage // // static void LLUIUsage::setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val) @@ -91,6 +92,13 @@ void LLUIUsage::logCommand(const std::string& command) LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; } +void LLUIUsage::logControl(const std::string& control) +{ + mControlCounts[sanitized(control)]++; + LL_DEBUGS("UIUsage") << "control " << control << LL_ENDL; +} + + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; @@ -103,30 +111,24 @@ void LLUIUsage::logPanel(const std::string& p) LL_DEBUGS("UIUsage") << "panel " << p << LL_ENDL; } -void LLUIUsage::logWidget(const std::string& w) -{ - mWidgetCounts[sanitized(w)]++; - LL_DEBUGS("UIUsage") << "widget " << w << LL_ENDL; -} - LLSD LLUIUsage::asLLSD() const { LLSD result; - for (auto const& it : mFloaterCounts) - { - result["floaters"][it.first] = LLSD::Integer(it.second); - } for (auto const& it : mCommandCounts) { result["commands"][it.first] = LLSD::Integer(it.second); } - for (auto const& it : mPanelCounts) + for (auto const& it : mControlCounts) { - result["panels"][it.first] = LLSD::Integer(it.second); + setLLSDPath(result["controls"], it.first, 2, LLSD::Integer(it.second)); } - for (auto const& it : mWidgetCounts) + for (auto const& it : mFloaterCounts) { - setLLSDPath(result["widgets"], it.first, 2, LLSD::Integer(it.second)); + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mPanelCounts) + { + result["panels"][it.first] = LLSD::Integer(it.second); } return result; } @@ -137,8 +139,8 @@ void LLUIUsage::clear() LL_DEBUGS("UIUsage") << "clear" << LL_ENDL; mCommandCounts.clear(); + mControlCounts.clear(); mFloaterCounts.clear(); mPanelCounts.clear(); - mWidgetCounts.clear(); } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index e642c55e0f..a30cd80db3 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -42,16 +42,16 @@ public: static void setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val); static void setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val); void logCommand(const std::string& command); + void logControl(const std::string& control); void logFloater(const std::string& floater); void logPanel(const std::string& p); - void logWidget(const std::string& w); LLSD asLLSD() const; void clear(); private: std::map mCommandCounts; + std::map mControlCounts; std::map mFloaterCounts; std::map mPanelCounts; - std::map mWidgetCounts; }; #endif // LLUIUIUSAGE.h -- cgit v1.2.3 From cdd71c5e64782b33aaf5f8caac8ef61eaa78f607 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 16 Mar 2021 19:29:23 +0200 Subject: SL-14938 Remove Library and Inventory from Places floater --- indra/newview/llpanellandmarks.cpp | 464 +++------------------ indra/newview/llpanellandmarks.h | 57 +-- indra/newview/llpanelplaces.cpp | 22 +- .../default/xui/en/menu_places_gear_folder.xml | 3 + .../default/xui/en/menu_places_gear_sorting.xml | 3 + .../skins/default/xui/en/panel_favorites.xml | 22 + .../skins/default/xui/en/panel_landmarks.xml | 99 +---- .../newview/skins/default/xui/en/panel_places.xml | 7 +- indra/newview/skins/default/xui/en/strings.xml | 4 +- 9 files changed, 153 insertions(+), 528 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_favorites.xml (limited to 'indra') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 9d0c8b015a..1a10654a71 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -36,7 +36,6 @@ #include "llregionhandle.h" #include "llaccordionctrl.h" -#include "llaccordionctrltab.h" #include "llagent.h" #include "llagentpicksinfo.h" #include "llagentui.h" @@ -60,8 +59,6 @@ // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper t_landmarks("panel_landmarks"); -static const std::string TAB_FAVORITES = "tab_favorites"; - // helper functions static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::string& string); static bool category_has_descendents(LLPlacesInventoryPanel* inventory_list); @@ -145,69 +142,37 @@ void LLOpenFolderByID::doFolder(LLFolderViewFolder* folder) } } -/** - * Bridge to support knowing when the inventory has changed to update Landmarks tab - * ShowFolderState filter setting to show all folders when the filter string is empty and - * empty folder message when Landmarks inventory category has no children. - * Ensures that "Landmarks" folder in the Library is open on strart up. - */ -class LLLandmarksPanelObserver : public LLInventoryObserver -{ -public: - LLLandmarksPanelObserver(LLLandmarksPanel* lp) - : mLP(lp), - mIsLibraryLandmarksOpen(false) - {} - virtual ~LLLandmarksPanelObserver() {} - /*virtual*/ void changed(U32 mask); - -private: - LLLandmarksPanel* mLP; - bool mIsLibraryLandmarksOpen; -}; - -void LLLandmarksPanelObserver::changed(U32 mask) +LLLandmarksPanel::LLLandmarksPanel() + : LLPanelPlacesTab() + , mLandmarksInventoryPanel(NULL) + , mCurrentSelectedList(NULL) + , mGearFolderMenu(NULL) + , mGearLandmarkMenu(NULL) + , mSortingMenu(NULL) + , mAddMenu(NULL) + , isLandmarksPanel(true) { - mLP->updateShowFolderState(); - - LLPlacesInventoryPanel* library = mLP->getLibraryInventoryPanel(); - if (!mIsLibraryLandmarksOpen && library) - { - // Search for "Landmarks" folder in the Library and open it once on start up. See EXT-4827. - const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); - if (landmarks_cat.notNull()) - { - LLOpenFolderByID opener(landmarks_cat); - library->getRootFolder()->applyFunctorRecursively(opener); - mIsLibraryLandmarksOpen = opener.isFolderOpen(); - } - } + buildFromFile("panel_landmarks.xml"); } -LLLandmarksPanel::LLLandmarksPanel() +LLLandmarksPanel::LLLandmarksPanel(bool is_landmark_panel) : LLPanelPlacesTab() - , mFavoritesInventoryPanel(NULL) , mLandmarksInventoryPanel(NULL) - , mMyInventoryPanel(NULL) - , mLibraryInventoryPanel(NULL) , mCurrentSelectedList(NULL) , mGearFolderMenu(NULL) , mGearLandmarkMenu(NULL) , mSortingMenu(NULL) , mAddMenu(NULL) + , isLandmarksPanel(is_landmark_panel) { - mInventoryObserver = new LLLandmarksPanelObserver(this); - gInventory.addObserver(mInventoryObserver); - - buildFromFile( "panel_landmarks.xml"); + if (is_landmark_panel) + { + buildFromFile("panel_landmarks.xml"); + } } LLLandmarksPanel::~LLLandmarksPanel() { - if (gInventory.containsObserver(mInventoryObserver)) - { - gInventory.removeObserver(mInventoryObserver); - } } BOOL LLLandmarksPanel::postBuild() @@ -217,17 +182,7 @@ BOOL LLLandmarksPanel::postBuild() // mast be called before any other initXXX methods to init Gear menu initListCommandsHandlers(); - - initFavoritesInventoryPanel(); initLandmarksInventoryPanel(); - initMyInventoryPanel(); - initLibraryInventoryPanel(); - - LLAccordionCtrl* accordion = getChild("landmarks_accordion"); - if (accordion) - { - accordion->setSkipScrollToChild(true); - } return TRUE; } @@ -235,30 +190,10 @@ BOOL LLLandmarksPanel::postBuild() // virtual void LLLandmarksPanel::onSearchEdit(const std::string& string) { - // give FolderView a chance to be refreshed. So, made all accordions visible - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - LLAccordionCtrlTab* tab = *iter; - tab->setVisible(TRUE); - - // expand accordion to see matched items in each one. See EXT-2014. - if (string != "") - { - tab->changeOpenClose(false); - } - - LLPlacesInventoryPanel* inventory_list = dynamic_cast(tab->getAccordionView()); - if (NULL == inventory_list) continue; - - filter_list(inventory_list, string); - } + filter_list(mCurrentSelectedList, string); if (sFilterSubString != string) sFilterSubString = string; - - // show all folders in Landmarks Accordion for empty filter - // only if Landmarks inventory folder is not empty - updateShowFolderState(); } // virtual @@ -349,76 +284,21 @@ LLToggleableMenu* LLLandmarksPanel::getCreateMenu() return mAddMenu; } -// virtual void LLLandmarksPanel::updateVerbs() { - if (!isTabVisible()) - return; -} - -void LLLandmarksPanel::onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque &items, BOOL user_action) -{ - if (user_action && (items.size() > 0)) - { - deselectOtherThan(inventory_list); - mCurrentSelectedList = inventory_list; - } - updateVerbs(); -} - -void LLLandmarksPanel::onSelectorButtonClicked() -{ - // TODO: mantipov: update getting of selected item - // TODO: bind to "i" button - LLFolderViewItem* cur_item = mFavoritesInventoryPanel->getRootFolder()->getCurSelectedItem(); - if (!cur_item) return; - - LLFolderViewModelItemInventory* listenerp = static_cast(cur_item->getViewModelItem()); - if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) - { - LLSD key; - key["type"] = "landmark"; - key["id"] = listenerp->getUUID(); - - LLFloaterSidePanelContainer::showPanel("places", key); - } -} - -void LLLandmarksPanel::updateShowFolderState() -{ - bool show_all_folders = mLandmarksInventoryPanel->getFilterSubString().empty(); - if (show_all_folders) - { - show_all_folders = category_has_descendents(mLandmarksInventoryPanel); - } - - mLandmarksInventoryPanel->setShowFolderState(show_all_folders ? - LLInventoryFilter::SHOW_ALL_FOLDERS : - LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS - ); } void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus) { - if (selectItemInAccordionTab(mFavoritesInventoryPanel, TAB_FAVORITES, obj_id, take_keyboard_focus)) - { - return; - } - - if (selectItemInAccordionTab(mLandmarksInventoryPanel, "tab_landmarks", obj_id, take_keyboard_focus)) - { + if (!mCurrentSelectedList) return; - } - - if (selectItemInAccordionTab(mMyInventoryPanel, "tab_inventory", obj_id, take_keyboard_focus)) - { - return; - } - if (selectItemInAccordionTab(mLibraryInventoryPanel, "tab_library", obj_id, take_keyboard_focus)) - { + LLFolderView* root = mCurrentSelectedList->getRootFolder(); + LLFolderViewItem* item = mCurrentSelectedList->getItemByID(obj_id); + if (!item) return; - } + root->setSelection(item, FALSE, take_keyboard_focus); + root->scrollToShowSelection(); } ////////////////////////////////////////////////////////////////////////// @@ -437,18 +317,6 @@ bool LLLandmarksPanel::isFolderSelected() const return current_item && (current_item->getInventoryType() == LLInventoryType::IT_CATEGORY); } -bool LLLandmarksPanel::isReceivedFolderSelected() const -{ - // Received Folder can be only in Landmarks accordion - if (mCurrentSelectedList != mLandmarksInventoryPanel) return false; - - // *TODO: it should be filled with logic when EXT-976 is done. - - LL_WARNS() << "Not implemented yet until EXT-976 is done." << LL_ENDL; - - return false; -} - void LLLandmarksPanel::doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb) { LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem(); @@ -478,36 +346,6 @@ LLFolderViewModelItemInventory* LLLandmarksPanel::getCurSelectedViewModelItem() } -LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list, - const std::string& tab_name, - const LLUUID& obj_id, - BOOL take_keyboard_focus) const -{ - if (!inventory_list) - return NULL; - - LLFolderView* root = inventory_list->getRootFolder(); - - LLFolderViewItem* item = inventory_list->getItemByID(obj_id); - if (!item) - return NULL; - - LLAccordionCtrlTab* tab = getChild(tab_name); - if (!tab->isExpanded()) - { - tab->changeOpenClose(false); - } - - root->setSelection(item, FALSE, take_keyboard_focus); - - LLAccordionCtrl* accordion = getChild("landmarks_accordion"); - LLRect screen_rc; - localRectToScreen(item->getRect(), &screen_rc); - accordion->notifyParent(LLSD().with("scrollToShowRect", screen_rc.getValue())); - - return item; -} - void LLLandmarksPanel::updateSortOrder(LLInventoryPanel* panel, bool byDate) { if(!panel) return; @@ -525,8 +363,6 @@ void LLLandmarksPanel::updateSortOrder(LLInventoryPanel* panel, bool byDate) void LLLandmarksPanel::resetSelection() { - getChild(TAB_FAVORITES)->setDisplayChildren(true); - getChild(TAB_FAVORITES)->showAndFocusHeader(); } // virtual @@ -572,16 +408,6 @@ void LLLandmarksPanel::setErrorStatus(S32 status, const std::string& reason) // PRIVATE METHODS ////////////////////////////////////////////////////////////////////////// -void LLLandmarksPanel::initFavoritesInventoryPanel() -{ - mFavoritesInventoryPanel = getChild("favorites_list"); - - initLandmarksPanel(mFavoritesInventoryPanel); - mFavoritesInventoryPanel->getFilter().setEmptyLookupMessage("FavoritesNoMatchingItems"); - - initAccordion(TAB_FAVORITES, mFavoritesInventoryPanel, true); -} - void LLLandmarksPanel::initLandmarksInventoryPanel() { mLandmarksInventoryPanel = getChild("landmarks_list"); @@ -593,40 +419,13 @@ void LLLandmarksPanel::initLandmarksInventoryPanel() // subscribe to have auto-rename functionality while creating New Folder mLandmarksInventoryPanel->setSelectCallback(boost::bind(&LLInventoryPanel::onSelectionChange, mLandmarksInventoryPanel, _1, _2)); - mMyLandmarksAccordionTab = initAccordion("tab_landmarks", mLandmarksInventoryPanel, true); -} - -void LLLandmarksPanel::initMyInventoryPanel() -{ - mMyInventoryPanel= getChild("my_inventory_list"); - - initLandmarksPanel(mMyInventoryPanel); - - initAccordion("tab_inventory", mMyInventoryPanel, false); -} - -void LLLandmarksPanel::initLibraryInventoryPanel() -{ - mLibraryInventoryPanel = getChild("library_list"); - - initLandmarksPanel(mLibraryInventoryPanel); - - // We want to fetch only "Landmarks" category from the library. - const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); - if (landmarks_cat.notNull()) - { - LLInventoryModelBackgroundFetch::instance().start(landmarks_cat); - } - - // Expanding "Library" tab for new users who have no landmarks in "My Inventory". - initAccordion("tab_library", mLibraryInventoryPanel, true); + mCurrentSelectedList = mLandmarksInventoryPanel; } void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list) { inventory_list->getFilter().setEmptyLookupMessage("PlacesNoMatchingItems"); inventory_list->setFilterTypes(0x1 << LLInventoryType::IT_LANDMARK); - inventory_list->setSelectCallback(boost::bind(&LLLandmarksPanel::onSelectionChange, this, inventory_list, _1, _2)); inventory_list->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); bool sorting_order = gSavedSettings.getBOOL("LandmarksSortedByDate"); @@ -644,71 +443,6 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list inventory_list->saveFolderState(); } -LLAccordionCtrlTab* LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab) -{ - LLAccordionCtrlTab* accordion_tab = getChild(accordion_tab_name); - - mAccordionTabs.push_back(accordion_tab); - accordion_tab->setDropDownStateChangedCallback( - boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list)); - accordion_tab->setDisplayChildren(expand_tab); - return accordion_tab; -} - -void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list) -{ - bool expanded = param.asBoolean(); - - if(!expanded && (mCurrentSelectedList == inventory_list)) - { - inventory_list->getRootFolder()->clearSelection(); - - mCurrentSelectedList = NULL; - updateVerbs(); - } - - // Start background fetch, mostly for My Inventory and Library - if (expanded) - { - const LLUUID &cat_id = inventory_list->getRootFolderID(); - // Just because the category itself has been fetched, doesn't mean its child folders have. - /* - if (!gInventory.isCategoryComplete(cat_id)) - */ - { - LLInventoryModelBackgroundFetch::instance().start(cat_id); - } - - // Apply filter substring because it might have been changed - // while accordion was closed. See EXT-3714. - filter_list(inventory_list, sFilterSubString); - } -} - -void LLLandmarksPanel::deselectOtherThan(const LLPlacesInventoryPanel* inventory_list) -{ - if (inventory_list != mFavoritesInventoryPanel) - { - mFavoritesInventoryPanel->clearSelection(); - mFavoritesInventoryPanel->getRootFolder()->clearSelection(); - } - - if (inventory_list != mLandmarksInventoryPanel) - { - mLandmarksInventoryPanel->clearSelection(); - mLandmarksInventoryPanel->getRootFolder()->clearSelection(); - } - if (inventory_list != mMyInventoryPanel) - { - mMyInventoryPanel->clearSelection(); - mMyInventoryPanel->getRootFolder()->clearSelection(); - } - if (inventory_list != mLibraryInventoryPanel) - { - mLibraryInventoryPanel->clearSelection(); - mLibraryInventoryPanel->getRootFolder()->clearSelection(); - } -} // List Commands Handlers void LLLandmarksPanel::initListCommandsHandlers() @@ -730,6 +464,7 @@ void LLLandmarksPanel::initListCommandsHandlers() // show menus even if all items are disabled mGearLandmarkMenu->setAlwaysShowMenu(TRUE); mGearFolderMenu->setAlwaysShowMenu(TRUE); + mAddMenu->setAlwaysShowMenu(TRUE); } void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu) @@ -797,11 +532,6 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const //in case My Landmarks tab is completely empty (thus cannot be determined as being selected) menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"), gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); - - if (mMyLandmarksAccordionTab) - { - mMyLandmarksAccordionTab->changeOpenClose(false); - } } } else if ("category_root" == command_name) @@ -809,11 +539,6 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const //in case My Landmarks tab is completely empty (thus cannot be determined as being selected) menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"), gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); - - if (mMyLandmarksAccordionTab) - { - mMyLandmarksAccordionTab->changeOpenClose(false); - } } } @@ -848,27 +573,11 @@ void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) if ("expand_all" == command_name) { - expand_all_folders(mFavoritesInventoryPanel->getRootFolder()); - expand_all_folders(mLandmarksInventoryPanel->getRootFolder()); - expand_all_folders(mMyInventoryPanel->getRootFolder()); - expand_all_folders(mLibraryInventoryPanel->getRootFolder()); - - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - (*iter)->changeOpenClose(false); - } + expand_all_folders(mCurrentSelectedList->getRootFolder()); } else if ("collapse_all" == command_name) { - collapse_all_folders(mFavoritesInventoryPanel->getRootFolder()); - collapse_all_folders(mLandmarksInventoryPanel->getRootFolder()); - collapse_all_folders(mMyInventoryPanel->getRootFolder()); - collapse_all_folders(mLibraryInventoryPanel->getRootFolder()); - - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - (*iter)->changeOpenClose(true); - } + collapse_all_folders(mCurrentSelectedList->getRootFolder()); } else if ("sort_by_date" == command_name) { @@ -876,8 +585,6 @@ void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) sorting_order=!sorting_order; gSavedSettings.setBOOL("LandmarksSortedByDate",sorting_order); updateSortOrder(mLandmarksInventoryPanel, sorting_order); - updateSortOrder(mMyInventoryPanel, sorting_order); - updateSortOrder(mLibraryInventoryPanel, sorting_order); } else { @@ -911,49 +618,17 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const if ("collapse_all" == command_name) { - bool disable_collapse_all = !has_expanded_folders(mFavoritesInventoryPanel->getRootFolder()) - && !has_expanded_folders(mLandmarksInventoryPanel->getRootFolder()) - && !has_expanded_folders(mMyInventoryPanel->getRootFolder()) - && !has_expanded_folders(mLibraryInventoryPanel->getRootFolder()); - if (disable_collapse_all) - { - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - if ((*iter)->isExpanded()) - { - disable_collapse_all = false; - break; - } - } - } - - return !disable_collapse_all; + return has_expanded_folders(mCurrentSelectedList->getRootFolder()); } else if ("expand_all" == command_name) { - bool disable_expand_all = !has_collapsed_folders(mFavoritesInventoryPanel->getRootFolder()) - && !has_collapsed_folders(mLandmarksInventoryPanel->getRootFolder()) - && !has_collapsed_folders(mMyInventoryPanel->getRootFolder()) - && !has_collapsed_folders(mLibraryInventoryPanel->getRootFolder()); - if (disable_expand_all) - { - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - if (!(*iter)->isExpanded()) - { - disable_expand_all = false; - break; - } - } - } - - return !disable_expand_all; + return has_collapsed_folders(mCurrentSelectedList->getRootFolder()); } else if ("sort_by_date" == command_name) { - // disable "sort_by_date" for Favorites accordion because + // disable "sort_by_date" for Favorites tab because // it has its own items order. EXT-1758 - if (mCurrentSelectedList == mFavoritesInventoryPanel) + if (!isLandmarksPanel) { return false; } @@ -970,6 +645,11 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const std::set selected_uuids = root_folder_view->getSelectionList(); + if (selected_uuids.empty()) + { + return false; + } + // Allow to execute the command only if it can be applied to all selected items. for (std::set::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter) { @@ -1020,25 +700,10 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const return true; } - if ("category_root" == command_name) + if ("category_root" == command_name || "category" == command_name) { - // Landmarks Accordion - return true; - } - else if("category" == command_name) - { - // we can add folder only in Landmarks Accordion - if (mCurrentSelectedList == mLandmarksInventoryPanel) - { - // ... but except Received folder - return !isReceivedFolderSelected(); - } - if (mCurrentSelectedList == mLibraryInventoryPanel) - { - return false; - } - //"Add a folder" is enabled by default (case when My Landmarks is empty) - return true; + // we can add folder only in Landmarks tab + return isLandmarksPanel; } else if("create_pick" == command_name) { @@ -1059,10 +724,7 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const { return false; } - if (mCurrentSelectedList == mLibraryInventoryPanel) - { - return false; - } + LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); if (!view_model || view_model->getInventoryType() != LLInventoryType::IT_CATEGORY) { @@ -1203,29 +865,17 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold if (!item) return false; - // nothing can be modified in Library - if (mLibraryInventoryPanel == mCurrentSelectedList) return false; - bool can_be_modified = false; // landmarks can be modified in any other accordion... if (static_cast(item->getViewModelItem())->getInventoryType() == LLInventoryType::IT_LANDMARK) { can_be_modified = true; - - // we can modify landmarks anywhere except paste to My Inventory - if ("paste" == command_name) - { - can_be_modified = (mCurrentSelectedList != mMyInventoryPanel); - } } else { // ...folders only in the Landmarks accordion... - can_be_modified = mLandmarksInventoryPanel == mCurrentSelectedList; - - // ...except "Received" folder - can_be_modified &= !isReceivedFolderSelected(); + can_be_modified = isLandmarksPanel; } // then ask LLFolderView permissions @@ -1325,7 +975,6 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg break; } - updateVerbs(); return true; } @@ -1470,10 +1119,6 @@ static void collapse_all_folders(LLFolderView* root_folder) return; root_folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN); - - // The top level folder is invisible, it must be open to - // display its sub-folders. - root_folder->openTopLevelFolders(); root_folder->arrangeAll(); } @@ -1540,4 +1185,31 @@ void toggle_restore_menu(LLMenuGL *menu, BOOL visible, BOOL enabled) } } } + +LLFavoritesPanel::LLFavoritesPanel() + : LLLandmarksPanel(false) +{ + buildFromFile("panel_favorites.xml"); +} + +BOOL LLFavoritesPanel::postBuild() +{ + if (!gInventory.isInventoryUsable()) + return FALSE; + + // mast be called before any other initXXX methods to init Gear menu + LLLandmarksPanel::initListCommandsHandlers(); + + initFavoritesInventoryPanel(); + + return TRUE; +} + +void LLFavoritesPanel::initFavoritesInventoryPanel() +{ + mCurrentSelectedList = getChild("favorites_list"); + + LLLandmarksPanel::initLandmarksPanel(mCurrentSelectedList); + mCurrentSelectedList->getFilter().setEmptyLookupMessage("FavoritesNoMatchingItems"); +} // EOF diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 95256f4bb4..d7408269b5 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -50,6 +50,7 @@ class LLLandmarksPanel : public LLPanelPlacesTab, LLRemoteParcelInfoObserver { public: LLLandmarksPanel(); + LLLandmarksPanel(bool is_landmark_panel); virtual ~LLLandmarksPanel(); BOOL postBuild() override; @@ -70,26 +71,16 @@ public: */ bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) override; - void onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque &items, BOOL user_action); - void onSelectorButtonClicked(); void setCurrentSelectedList(LLPlacesInventoryPanel* inventory_list) { mCurrentSelectedList = inventory_list; } - /** - * Update filter ShowFolderState setting to show empty folder message - * if Landmarks inventory folder is empty. - */ - void updateShowFolderState(); - /** * Selects item with "obj_id" in one of accordion tabs. */ void setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus); - LLPlacesInventoryPanel* getLibraryInventoryPanel() { return mLibraryInventoryPanel; } - void updateMenuVisibility(LLUICtrl* menu); void doCreatePick(LLLandmark* landmark, const LLUUID &item_id ); @@ -102,40 +93,26 @@ protected: */ bool isLandmarkSelected() const; bool isFolderSelected() const; - bool isReceivedFolderSelected() const; void doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb); LLFolderViewItem* getCurSelectedItem() const; LLFolderViewModelItemInventory* getCurSelectedViewModelItem() const; - /** - * Selects item with "obj_id" in "inventory_list" and scrolls accordion - * scrollbar to show the item. - * Returns pointer to the item if it is found in "inventory_list", otherwise NULL. - */ - LLFolderViewItem* selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list, - const std::string& tab_name, - const LLUUID& obj_id, - BOOL take_keyboard_focus) const; - void updateSortOrder(LLInventoryPanel* panel, bool byDate); //LLRemoteParcelInfoObserver interface void processParcelInfo(const LLParcelData& parcel_data) override; void setParcelID(const LLUUID& parcel_id) override; void setErrorStatus(S32 status, const std::string& reason) override; + + // List Commands Handlers + void initListCommandsHandlers(); + void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list); + + LLPlacesInventoryPanel* mCurrentSelectedList; private: - void initFavoritesInventoryPanel(); void initLandmarksInventoryPanel(); - void initMyInventoryPanel(); - void initLibraryInventoryPanel(); - void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list); - LLAccordionCtrlTab* initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab); - void onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list); - void deselectOtherThan(const LLPlacesInventoryPanel* inventory_list); - // List Commands Handlers - void initListCommandsHandlers(); void onTrashButtonClick() const; void onAddAction(const LLSD& command_name) const; void onClipboardAction(const LLSD& command_name) const; @@ -170,23 +147,25 @@ private: const LLParcelData& parcel_data); private: - LLPlacesInventoryPanel* mFavoritesInventoryPanel; LLPlacesInventoryPanel* mLandmarksInventoryPanel; - LLPlacesInventoryPanel* mMyInventoryPanel; - LLPlacesInventoryPanel* mLibraryInventoryPanel; LLToggleableMenu* mGearLandmarkMenu; LLToggleableMenu* mGearFolderMenu; LLToggleableMenu* mSortingMenu; LLToggleableMenu* mAddMenu; - LLPlacesInventoryPanel* mCurrentSelectedList; - LLInventoryObserver* mInventoryObserver; + + bool isLandmarksPanel; - typedef std::vector accordion_tabs_t; - accordion_tabs_t mAccordionTabs; + LLUUID mCreatePickItemId; // item we requested a pick for +}; - LLAccordionCtrlTab* mMyLandmarksAccordionTab; - LLUUID mCreatePickItemId; // item we requested a pick for +class LLFavoritesPanel : public LLLandmarksPanel +{ +public: + LLFavoritesPanel(); + + BOOL postBuild() override; + void initFavoritesInventoryPanel(); }; #endif //LL_LLPANELLANDMARKS_H diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 11ae980941..7928896d96 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -1119,8 +1119,16 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) } else { - LLLandmarksPanel* landmarks_panel = - dynamic_cast(mTabContainer->getPanelByName("Landmarks")); + std::string tab_panel_name("Landmarks"); + if (mItem.notNull()) + { + if (gInventory.isObjectDescendentOf(mItem->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE))) + { + tab_panel_name = "Favorites"; + } + } + + LLLandmarksPanel* landmarks_panel = dynamic_cast(mTabContainer->getPanelByName(tab_panel_name)); if (landmarks_panel) { // If a landmark info is being closed we open the landmarks tab @@ -1201,6 +1209,16 @@ void LLPanelPlaces::createTabs() if (!(gInventory.isInventoryUsable() && LLTeleportHistory::getInstance() && !mTabsCreated)) return; + LLFavoritesPanel* favorites_panel = new LLFavoritesPanel(); + if (favorites_panel) + { + mTabContainer->addTabPanel( + LLTabContainer::TabPanelParams(). + panel(favorites_panel). + label(getString("favorites_tab_title")). + insert_at(LLTabContainer::END)); + } + LLLandmarksPanel* landmarks_panel = new LLLandmarksPanel(); if (landmarks_panel) { diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index df1139c98f..e9ada52a8f 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -27,6 +27,9 @@ +
+ diff --git a/indra/newview/skins/default/xui/en/panel_favorites.xml b/indra/newview/skins/default/xui/en/panel_favorites.xml new file mode 100644 index 0000000000..1e8ea34ad2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_favorites.xml @@ -0,0 +1,22 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index af2115156e..10b925ec93 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -1,98 +1,23 @@ - - - - - - - - - - - - - - + diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index eed56209b7..dd4cf7ab4e 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -13,10 +13,13 @@ background_visible="true" width="333"> + value="LANDMARKS" /> + value="VISITED" /> + Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]. Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters]. Click "Use as Favorites folder" on a folder of your choice. You can choose a different folder at any time. System folders and folders inside them cannot be used for Favorites. - Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search]. - Drag a landmark here to add it to your favorites. + To add a place to your landmarks, click the star to the right of the location name. + To add a place to your favorites bar, click the star to the right of the location name. No items found. Check the spelling of your search string and try again. You do not have a copy of this texture in your inventory Your Marketplace purchases will appear here. You may then drag them into your inventory to use them. -- cgit v1.2.3 From e48ce282784d508ecc58efbb771d2e717df5d3c8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 16 Mar 2021 20:32:31 +0200 Subject: SL-14936 Do not create a saved outfit automatically for new users --- indra/newview/llstartup.cpp | 23 ----------------------- indra/newview/llstartup.h | 3 --- 2 files changed, 26 deletions(-) (limited to 'indra') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3c250b3bb3..aa206a3cce 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -230,7 +230,6 @@ extern S32 gStartImageHeight; static bool gGotUseCircuitCodeAck = false; static std::string sInitialOutfit; static std::string sInitialOutfitGender; // "male" or "female" -static boost::signals2::connection sWearablesLoadedCon; static bool gUseCircuitCallbackCalled = false; @@ -2702,11 +2701,6 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, } else { - // FIXME SH-3860 - this creates a race condition, where COF - // changes (base outfit link added) after appearance update - // request has been submitted. - sWearablesLoadedCon = gAgentWearables.addLoadedCallback(LLStartUp::saveInitialOutfit); - bool do_copy = true; bool do_append = false; LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); @@ -2720,23 +2714,6 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, gAgentWearables.sendDummyAgentWearablesUpdate(); } -//static -void LLStartUp::saveInitialOutfit() -{ - if (sInitialOutfit.empty()) { - LL_DEBUGS() << "sInitialOutfit is empty" << LL_ENDL; - return; - } - - if (sWearablesLoadedCon.connected()) - { - LL_DEBUGS("Avatar") << "sWearablesLoadedCon is connected, disconnecting" << LL_ENDL; - sWearablesLoadedCon.disconnect(); - } - LL_DEBUGS("Avatar") << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << LL_ENDL; - LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false); -} - std::string& LLStartUp::getInitialOutfitName() { return sInitialOutfit; diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 3ec3ff4133..116aeb36a7 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -110,9 +110,6 @@ public: static void loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ); - //save loaded initial outfit into My Outfits category - static void saveInitialOutfit(); - static std::string& getInitialOutfitName(); static std::string getUserId(); -- cgit v1.2.3 From 38db12920c92b00e11aa533980790e8572ba6908 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 18 Mar 2021 20:18:23 +0200 Subject: SL-14901 adjusted 'More' button --- indra/newview/llfavoritesbar.cpp | 2 ++ indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 2394a763ee..8791f605e9 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -402,6 +402,8 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mMoreTextBox = LLUICtrlFactory::create (more_button_params); mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); addChild(mMoreTextBox); + LLRect rect = mMoreTextBox->getRect(); + mMoreTextBox->setRect(LLRect(rect.mLeft - rect.getWidth(), rect.mTop, rect.mRight, rect.mBottom)); mDropDownItemsCount = 0; diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index d3448ed0ba..2dae2649a9 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -187,7 +187,7 @@ name="favorite" image_drag_indication="Accordion_ArrowOpened_Off" tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!" - width="268"> + width="310">