From ffc33a1cc5b96d9ae6de7f447c09de3ae8174fbc Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Mon, 15 Oct 2012 16:46:42 -0700 Subject: MAINT-1598 Edit Linked Parts isn't returning creator/owner * Show creator, owner and group information when only selecting a single prim in a linkset. reviewed with Simon --- indra/newview/llpanelpermissions.cpp | 2 +- indra/newview/llselectmgr.cpp | 301 +++++++++++++++++------------------ indra/newview/llselectmgr.h | 6 + 3 files changed, 156 insertions(+), 153 deletions(-) diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 51ab7649a4..e641370d2e 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -425,7 +425,7 @@ void LLPanelPermissions::refresh() } } - getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced); + getChildView("button set group")->setEnabled(root_selected && owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced); getChildView("Name:")->setEnabled(TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 13845c3b38..9c4c594280 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2941,116 +2941,148 @@ BOOL LLSelectMgr::selectGetRootsCopy() return TRUE; } -//----------------------------------------------------------------------------- -// selectGetCreator() -// Creator information only applies to root objects. -//----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) +struct LLSelectGetFirstTest { - BOOL identical = TRUE; - BOOL first = TRUE; - LLUUID first_id; - for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin(); - iter != getSelection()->root_object_end(); iter++ ) + LLSelectGetFirstTest() : mIdentical(true), mFirst(true) { } + virtual ~LLSelectGetFirstTest() { } + + // returns false to break out of the iteration. + bool checkMatchingNode(LLSelectNode* node) { - LLSelectNode* node = *iter; - if (!node->mValid) + if (!node || !node->mValid) { - return FALSE; + return false; } - if (first) + if (mFirst) { - first_id = node->mPermissions->getCreator(); - first = FALSE; + mFirstValue = getValueFromNode(node); + mFirst = false; } else { - if ( !(first_id == node->mPermissions->getCreator() ) ) + if ( mFirstValue != getValueFromNode(node) ) + { + mIdentical = false; + // stop testing once we know not all selected are identical. + return false; + } + } + // continue testing. + return true; + } + + bool mIdentical; + LLUUID mFirstValue; + +protected: + virtual const LLUUID& getValueFromNode(LLSelectNode* node) = 0; + +private: + bool mFirst; +}; + +void LLSelectMgr::getFirst(LLSelectGetFirstTest* test) +{ + if (gSavedSettings.getBOOL("EditLinkedParts")) + { + for (LLObjectSelection::valid_iterator iter = getSelection()->valid_begin(); + iter != getSelection()->valid_end(); ++iter ) + { + if (!test->checkMatchingNode(*iter)) { - identical = FALSE; break; } } } - if (first_id.isNull()) + else + { + for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin(); + iter != getSelection()->root_object_end(); ++iter ) + { + if (!test->checkMatchingNode(*iter)) + { + break; + } + } + } +} + +//----------------------------------------------------------------------------- +// selectGetCreator() +// Creator information only applies to roots unless editing linked parts. +//----------------------------------------------------------------------------- +struct LLSelectGetFirstCreator : public LLSelectGetFirstTest +{ +protected: + virtual const LLUUID& getValueFromNode(LLSelectNode* node) + { + return node->mPermissions->getCreator(); + } +}; + +BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) +{ + LLSelectGetFirstCreator test; + getFirst(&test); + + if (test.mFirstValue.isNull()) { name = LLTrans::getString("AvatarNameNobody"); return FALSE; } - result_id = first_id; + result_id = test.mFirstValue; - if (identical) + if (test.mIdentical) { - name = LLSLURL("agent", first_id, "inspect").getSLURLString(); + name = LLSLURL("agent", test.mFirstValue, "inspect").getSLURLString(); } else { name = LLTrans::getString("AvatarNameMultiple"); } - return identical; + return test.mIdentical; } - //----------------------------------------------------------------------------- // selectGetOwner() -// Owner information only applies to roots. +// Owner information only applies to roots unless editing linked parts. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name) +struct LLSelectGetFirstOwner : public LLSelectGetFirstTest { - BOOL identical = TRUE; - BOOL first = TRUE; - BOOL first_group_owned = FALSE; - LLUUID first_id; - for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin(); - iter != getSelection()->root_object_end(); iter++ ) +protected: + virtual const LLUUID& getValueFromNode(LLSelectNode* node) { - LLSelectNode* node = *iter; - if (!node->mValid) - { - return FALSE; - } - - if (first) - { - node->mPermissions->getOwnership(first_id, first_group_owned); - first = FALSE; - } - else - { - LLUUID owner_id; - BOOL is_group_owned = FALSE; - if (!(node->mPermissions->getOwnership(owner_id, is_group_owned)) - || owner_id != first_id || is_group_owned != first_group_owned) - { - identical = FALSE; - break; - } - } + // Don't use 'getOwnership' since we return a reference, not a copy. + // Will return LLUUID::null if unowned (which is not allowed and should never happen.) + return node->mPermissions->isGroupOwned() ? node->mPermissions->getGroup() : node->mPermissions->getOwner(); } - if (first_id.isNull()) +}; + +BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name) +{ + LLSelectGetFirstOwner test; + getFirst(&test); + + if (test.mFirstValue.isNull()) { return FALSE; } - result_id = first_id; + result_id = test.mFirstValue; - if (identical) + if (test.mIdentical) { - BOOL public_owner = (first_id.isNull() && !first_group_owned); - if (first_group_owned) + bool group_owned = selectIsGroupOwned(); + if (group_owned) { - name = LLSLURL("group", first_id, "inspect").getSLURLString(); - } - else if(!public_owner) - { - name = LLSLURL("agent", first_id, "inspect").getSLURLString(); + name = LLSLURL("group", test.mFirstValue, "inspect").getSLURLString(); } else { - name = LLTrans::getString("AvatarNameNobody"); + name = LLSLURL("agent", test.mFirstValue, "inspect").getSLURLString(); } } else @@ -3058,131 +3090,92 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name) name = LLTrans::getString("AvatarNameMultiple"); } - return identical; + return test.mIdentical; } - //----------------------------------------------------------------------------- // selectGetLastOwner() -// Owner information only applies to roots. +// Owner information only applies to roots unless editing linked parts. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name) +struct LLSelectGetFirstLastOwner : public LLSelectGetFirstTest { - BOOL identical = TRUE; - BOOL first = TRUE; - LLUUID first_id; - for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin(); - iter != getSelection()->root_object_end(); iter++ ) +protected: + virtual const LLUUID& getValueFromNode(LLSelectNode* node) { - LLSelectNode* node = *iter; - if (!node->mValid) - { - return FALSE; - } - - if (first) - { - first_id = node->mPermissions->getLastOwner(); - first = FALSE; - } - else - { - if ( !(first_id == node->mPermissions->getLastOwner() ) ) - { - identical = FALSE; - break; - } - } + return node->mPermissions->getLastOwner(); } - if (first_id.isNull()) +}; + +BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name) +{ + LLSelectGetFirstLastOwner test; + getFirst(&test); + + if (test.mFirstValue.isNull()) { return FALSE; } - result_id = first_id; + result_id = test.mFirstValue; - if (identical) + if (test.mIdentical) { - BOOL public_owner = (first_id.isNull()); - if(!public_owner) - { - name = LLSLURL("agent", first_id, "inspect").getSLURLString(); - } - else - { - name.assign("Public or Group"); - } + name = LLSLURL("agent", test.mFirstValue, "inspect").getSLURLString(); } else { name.assign( "" ); } - return identical; + return test.mIdentical; } - //----------------------------------------------------------------------------- // selectGetGroup() -// Group information only applies to roots. +// Group information only applies to roots unless editing linked parts. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id) +struct LLSelectGetFirstGroup : public LLSelectGetFirstTest { - BOOL identical = TRUE; - BOOL first = TRUE; - LLUUID first_id; - for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin(); - iter != getSelection()->root_object_end(); iter++ ) +protected: + virtual const LLUUID& getValueFromNode(LLSelectNode* node) { - LLSelectNode* node = *iter; - if (!node->mValid) - { - return FALSE; - } - - if (first) - { - first_id = node->mPermissions->getGroup(); - first = FALSE; - } - else - { - if ( !(first_id == node->mPermissions->getGroup() ) ) - { - identical = FALSE; - break; - } - } + return node->mPermissions->getGroup(); } +}; - result_id = first_id; +BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id) +{ + LLSelectGetFirstGroup test; + getFirst(&test); - return identical; + result_id = test.mFirstValue; + return test.mIdentical; } //----------------------------------------------------------------------------- // selectIsGroupOwned() -// Only operates on root nodes. -// Returns TRUE if all have valid data and they are all group owned. +// Only operates on root nodes unless editing linked parts. +// Returns TRUE if the first selected is group owned. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectIsGroupOwned() +struct LLSelectGetFirstGroupOwner : public LLSelectGetFirstTest { - BOOL found_one = FALSE; - for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin(); - iter != getSelection()->root_object_end(); iter++ ) +protected: + virtual const LLUUID& getValueFromNode(LLSelectNode* node) { - LLSelectNode* node = *iter; - if (!node->mValid) + if (node->mPermissions->isGroupOwned()) { - return FALSE; - } - found_one = TRUE; - if (!node->mPermissions->isGroupOwned()) - { - return FALSE; + return node->mPermissions->getGroup(); } - } - return found_one ? TRUE : FALSE; + return LLUUID::null; + } +}; + +BOOL LLSelectMgr::selectIsGroupOwned() +{ + LLSelectGetFirstGroupOwner test; + getFirst(&test); + + return test.mFirstValue.notNull() ? TRUE : FALSE; } //----------------------------------------------------------------------------- @@ -4987,7 +4980,11 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data } func(id); LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func); - if (node) + if (!node) + { + llwarns << "Couldn't find object " << id << " selected." << llendl; + } + else { if (node->mInventorySerial != inv_serial) { diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index ecbb20df1b..9257ee9eeb 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -343,6 +343,9 @@ typedef LLSafeHandle LLObjectSelectionHandle; extern template class LLSelectMgr* LLSingleton::getInstance(); #endif +// For use with getFirstTest() +struct LLSelectGetFirstTest; + class LLSelectMgr : public LLEditMenuHandler, public LLSingleton { public: @@ -745,6 +748,9 @@ private: static void packGodlikeHead(void* user_data); static bool confirmDelete(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle handle); + // Get the first ID that matches test and whether or not all ids are identical in selected objects. + void getFirst(LLSelectGetFirstTest* test); + public: // Observer/callback support for when object selection changes or // properties are received/updated -- cgit v1.2.3 From ec125540c4dccc8f1ff64018364a6a2235b9e8d0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 16 Oct 2012 16:25:01 -0500 Subject: MAINT-643 Fix for incorrect lighting and colors in preview displays. --- .../shaders/class1/objects/previewF.glsl | 41 ++++++++++++++++++++++ .../shaders/class1/objects/previewV.glsl | 6 ++-- indra/newview/llfloaterimagepreview.cpp | 4 ++- indra/newview/llfloatermodelpreview.cpp | 12 +++---- indra/newview/llviewershadermgr.cpp | 6 ++-- 5 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/objects/previewF.glsl diff --git a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl new file mode 100644 index 0000000000..284da3d0ac --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl @@ -0,0 +1,41 @@ +/** + * @file previewF.glsl + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, 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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform sampler2D diffuseMap; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void main() +{ + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; + frag_color = color; +} diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index 5dcfa87066..a4cc6a9c99 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -32,6 +32,8 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec3 normal; ATTRIBUTE vec2 texcoord0; +uniform vec4 color; + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; @@ -50,8 +52,8 @@ void main() calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.)); - vertex_color = color; + vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.)); + vertex_color = col; } diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 6b2492d927..2575f6f817 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -901,11 +901,13 @@ BOOL LLImagePreviewSculpted::render() { gObjectPreviewProgram.bind(); } + gPipeline.enableLightsPreview(); + gGL.pushMatrix(); const F32 SCALE = 1.25f; gGL.scalef(SCALE, SCALE, SCALE); const F32 BRIGHTNESS = 0.9f; - gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); + gGL.diffuseColor3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0); mVertexBuffer->draw(LLRender::TRIANGLES, num_indices, 0); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 449173f9b4..e501fcaa90 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -5087,6 +5087,11 @@ BOOL LLModelPreview::render() refresh(); } + if (use_shaders) + { + gObjectPreviewProgram.bind(); + } + gGL.loadIdentity(); gPipeline.enableLightsPreview(); @@ -5112,11 +5117,6 @@ BOOL LLModelPreview::render() const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; - if (use_shaders) - { - gObjectPreviewProgram.bind(); - } - LLGLEnable normalize(GL_NORMALIZE); if (!mBaseModel.empty() && mVertexBuffer[5].empty()) @@ -5305,7 +5305,7 @@ BOOL LLModelPreview::render() hull_colors.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127, 128)); } - glColor4ubv(hull_colors[i].mV); + gGL.diffuseColor4ubv(hull_colors[i].mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, physics.mMesh[i].mPositions, physics.mMesh[i].mNormals); if (explode > 0.f) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 4b0e0598f6..142cb2090d 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2026,15 +2026,15 @@ BOOL LLViewerShaderMgr::loadShadersObject() { gObjectPreviewProgram.mName = "Simple Shader"; gObjectPreviewProgram.mFeatures.calculatesLighting = true; - gObjectPreviewProgram.mFeatures.calculatesAtmospherics = true; + gObjectPreviewProgram.mFeatures.calculatesAtmospherics = false; gObjectPreviewProgram.mFeatures.hasGamma = true; - gObjectPreviewProgram.mFeatures.hasAtmospherics = true; + gObjectPreviewProgram.mFeatures.hasAtmospherics = false; gObjectPreviewProgram.mFeatures.hasLighting = true; gObjectPreviewProgram.mFeatures.mIndexedTextureChannels = 0; gObjectPreviewProgram.mFeatures.disableTextureIndex = true; gObjectPreviewProgram.mShaderFiles.clear(); gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectPreviewProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectPreviewProgram.createShader(NULL, NULL); } -- cgit v1.2.3 From b19a5c192fbbfb2e94c8dacc9db6808f47bbfd07 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 16 Oct 2012 17:27:03 -0500 Subject: MAINT-1404 Fix for child objects not appearing to move when editing until deselecting. --- indra/newview/llmanip.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 6e0f360cbc..9ec5d7c20c 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -72,7 +72,6 @@ void LLManip::rebuild(LLViewerObject* vobj) LLDrawable* drawablep = vobj->mDrawable; if (drawablep && drawablep->getVOVolume()) { - gPipeline.markRebuild(drawablep,LLDrawable::REBUILD_VOLUME, TRUE); drawablep->setState(LLDrawable::MOVE_UNDAMPED); // force to UNDAMPED drawablep->updateMove(); @@ -82,6 +81,14 @@ void LLManip::rebuild(LLViewerObject* vobj) group->dirtyGeom(); gPipeline.markRebuild(group, TRUE); } + + LLViewerObject::const_child_list_t& child_list = vobj->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(), endIter = child_list.end(); + iter != endIter; ++iter) + { + LLViewerObject* child = *iter; + rebuild(child); + } } } -- cgit v1.2.3 From 161c848e3d78a1ec6265b33b3d9f999dd11126f9 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Oct 2012 13:29:15 -0500 Subject: MAINT-643 Cleanup some shader compilation errors when atmospheric shaders are enabled. --- .../shaders/class1/objects/previewV.glsl | 22 ++++++++++++++-------- indra/newview/pipeline.cpp | 6 +++--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index a4cc6a9c99..f2db314201 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -23,6 +23,9 @@ * $/LicenseInfo$ */ +float calcDirectionalLight(vec3 n, vec3 l); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); + uniform mat3 normal_matrix; uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; @@ -37,9 +40,10 @@ uniform vec4 color; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; void main() { @@ -47,13 +51,15 @@ void main() vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - + vec3 norm = normalize(normal_matrix * normal); - calcAtmospherics(pos.xyz); + vec4 col = vec4(0,0,0,1); - vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.)); + // Collect normal lights (need to be divided by two, as we later multiply by 2) + col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); + vertex_color = col; - - } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 38e6b84f44..eb4f440951 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6045,7 +6045,7 @@ void LLPipeline::enableLightsPreview() LLVector4 light_pos(dir0, 0.0f); - LLLightState* light = gGL.getLight(0); + LLLightState* light = gGL.getLight(1); light->enable(); light->setPosition(light_pos); @@ -6057,7 +6057,7 @@ void LLPipeline::enableLightsPreview() light_pos = LLVector4(dir1, 0.f); - light = gGL.getLight(1); + light = gGL.getLight(2); light->enable(); light->setPosition(light_pos); light->setDiffuse(diffuse1); @@ -6067,7 +6067,7 @@ void LLPipeline::enableLightsPreview() light->setSpotCutoff(180.f); light_pos = LLVector4(dir2, 0.f); - light = gGL.getLight(2); + light = gGL.getLight(3); light->enable(); light->setPosition(light_pos); light->setDiffuse(diffuse2); -- cgit v1.2.3 From 378e9528d440470aab819be46392cec8b3a44563 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Oct 2012 15:33:01 -0500 Subject: MAINT-873 Fix for inability to upload meshes on some systems. --- doc/contributions.txt | 4 ++++ indra/newview/llmeshrepository.cpp | 33 ++++++++++++++++++++++++++++----- indra/newview/llmeshrepository.h | 3 +++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 43de729bff..d29d7ce464 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -321,6 +321,7 @@ Dale Glass VWR-1358 VWR-2041 Darien Caldwell + SH-3055 Dartagan Shepherd Debs Regent Decro Schmooz @@ -890,6 +891,8 @@ Nicholaz Beresford VWR-2682 VWR-2684 Nick Rhodes +NickyD + MAINT-873 Nicky Perian OPEN-1 STORM-1087 @@ -1243,6 +1246,7 @@ Westley Streeter Whimsy Winx Whirly Fizzle STORM-1895 + MAINT-873 Whoops Babii VWR-631 VWR-1640 diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index bc7f522848..57a5569dd7 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -361,7 +361,20 @@ public: mModelData(model_data), mObserverHandle(observer_handle) { + if (mThread) + { + mThread->startRequest(); + } + } + + ~LLWholeModelFeeResponder() + { + if (mThread) + { + mThread->stopRequest(); + } } + virtual void completed(U32 status, const std::string& reason, const LLSD& content) @@ -372,7 +385,6 @@ public: cc = llsd_from_file("fake_upload_error.xml"); } - mThread->mPendingUploads--; dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num)); LLWholeModelFeeObserver* observer = mObserverHandle.get(); @@ -415,7 +427,20 @@ public: mModelData(model_data), mObserverHandle(observer_handle) { + if (mThread) + { + mThread->startRequest(); + } + } + + ~LLWholeModelUploadResponder() + { + if (mThread) + { + mThread->stopRequest(); + } } + virtual void completed(U32 status, const std::string& reason, const LLSD& content) @@ -426,7 +451,6 @@ public: cc = llsd_from_file("fake_upload_error.xml"); } - mThread->mPendingUploads--; dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num)); LLWholeModelUploadObserver* observer = mObserverHandle.get(); @@ -1620,7 +1644,7 @@ void LLMeshUploadThread::doWholeModelUpload() mCurlRequest->process(); //sleep for 10ms to prevent eating a whole core apr_sleep(10000); - } while (!LLAppViewer::isQuitting() && mCurlRequest->getQueued() > 0); + } while (!LLAppViewer::isQuitting() && mPendingUploads > 0); } delete mCurlRequest; @@ -1642,7 +1666,6 @@ void LLMeshUploadThread::requestWholeModelFee() wholeModelToLLSD(model_data,false); dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num)); - mPendingUploads++; LLCurlRequest::headers_t headers; { @@ -1659,7 +1682,7 @@ void LLMeshUploadThread::requestWholeModelFee() mCurlRequest->process(); //sleep for 10ms to prevent eating a whole core apr_sleep(10000); - } while (!LLApp::isQuitting() && mCurlRequest->getQueued() > 0); + } while (!LLApp::isQuitting() && mPendingUploads > 0); delete mCurlRequest; mCurlRequest = NULL; diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index da81bb057b..6e301c26a2 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -405,6 +405,9 @@ public: LLHandle fee_observer= (LLHandle()), LLHandle upload_observer = (LLHandle())); ~LLMeshUploadThread(); + void startRequest() { ++mPendingUploads; } + void stopRequest() { --mPendingUploads; } + bool finished() { return mFinished; } virtual void run(); void preStart(); -- cgit v1.2.3 From 9d701e563b90a70794fccc28bdfb8edb5b0abfeb Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Wed, 17 Oct 2012 14:05:14 -0700 Subject: MAINT-1742 Child object does not update position while selected. reviewed with Davep --- indra/newview/lldrawable.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index cdf6460408..05ae336bc5 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -547,6 +547,10 @@ F32 LLDrawable::updateXform(BOOL undamped) } } } + else if (!damped && isVisible()) + { + dist_squared = dist_vec_squared(old_pos, target_pos); + } LLVector3 vec = mCurrentScale-target_scale; -- cgit v1.2.3 From ab38c854c34ada4fc166487b980fa2137badfdb9 Mon Sep 17 00:00:00 2001 From: "simon@Simon-PC.lindenlab.com" Date: Wed, 17 Oct 2012 16:43:56 -0700 Subject: MAINT-1724 : Viewer crashes while attempt to open '+ inventory' floater that already opened in separated floater. Changed to non-tearable menu. Reviewed by Kelly --- indra/newview/skins/default/xui/en/menu_inventory_add.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index e91f5af3d5..29720a680b 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -3,7 +3,7 @@ layout="topleft" left="0" mouse_opaque="false" - can_tear_off="true" + can_tear_off="false" name="menu_inventory_add" visible="false"> Date: Thu, 18 Oct 2012 18:58:55 +0300 Subject: MAINT-1303 FIXED Hide menus and buttons after exiting mouselook if 'Hide all controls' is switched on. --- indra/newview/app_settings/settings.xml | 12 +++++++++++ indra/newview/llagentcamera.cpp | 6 ++++++ indra/newview/llviewermenu.cpp | 37 ++++++++++++++++++--------------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7497a273ea..0dd997a51a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14059,5 +14059,17 @@ 1.0 + + HideUIControls + + Comment + Hide all menu items and buttons + Persist + 0 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 751b73e1eb..9025c7af8b 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -35,6 +35,7 @@ #include "llfloaterreg.h" #include "llhudmanager.h" #include "lljoystickbutton.h" +#include "llmoveview.h" #include "llselectmgr.h" #include "llsmoothstep.h" #include "lltoolmgr.h" @@ -2113,6 +2114,11 @@ void LLAgentCamera::changeCameraToDefault() { changeCameraToThirdPerson(); } + if (gSavedSettings.getBOOL("HideUIControls")) + { + gViewerWindow->setUIVisibility(false); + LLPanelStandStopFlying::getInstance()->setVisible(false); + } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 21a96a4e07..9d79d99204 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3908,25 +3908,27 @@ class LLViewToggleUI : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLNotification::Params params("ConfirmHideUI"); - params.functor.function(boost::bind(&LLViewToggleUI::confirm, this, _1, _2)); - LLSD substitutions; + if(gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) + { + LLNotification::Params params("ConfirmHideUI"); + params.functor.function(boost::bind(&LLViewToggleUI::confirm, this, _1, _2)); + LLSD substitutions; #if LL_DARWIN - substitutions["SHORTCUT"] = "Cmd+Shift+U"; + substitutions["SHORTCUT"] = "Cmd+Shift+U"; #else - substitutions["SHORTCUT"] = "Ctrl+Shift+U"; + substitutions["SHORTCUT"] = "Ctrl+Shift+U"; #endif - params.substitutions = substitutions; - if (gViewerWindow->getUIVisibility()) - { - // hiding, so show notification - LLNotifications::instance().add(params); - } - else - { - LLNotifications::instance().forceResponse(params, 0); + params.substitutions = substitutions; + if (!gSavedSettings.getBOOL("HideUIControls")) + { + // hiding, so show notification + LLNotifications::instance().add(params); + } + else + { + LLNotifications::instance().forceResponse(params, 0); + } } - return true; } @@ -3936,8 +3938,9 @@ class LLViewToggleUI : public view_listener_t if (option == 0) // OK { - gViewerWindow->setUIVisibility(!gViewerWindow->getUIVisibility()); - LLPanelStandStopFlying::getInstance()->setVisible(gViewerWindow->getUIVisibility()); + gViewerWindow->setUIVisibility(gSavedSettings.getBOOL("HideUIControls")); + LLPanelStandStopFlying::getInstance()->setVisible(gSavedSettings.getBOOL("HideUIControls")); + gSavedSettings.setBOOL("HideUIControls",!gSavedSettings.getBOOL("HideUIControls")); } } }; -- cgit v1.2.3 From 48b2dbcd65e72994054b9e525c0e45e346a981fb Mon Sep 17 00:00:00 2001 From: voidpointer Date: Thu, 18 Oct 2012 15:11:22 -0700 Subject: MAINT-1615 - Something invisible pushes avatars around on Dore --- indra/newview/skins/default/xui/en/notifications.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 232ed2dcb4..c32e23d553 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9960,5 +9960,12 @@ Inventory creation on in-world object failed. An internal error prevented us from properly updating your viewer. The L$ balance or parcel holdings displayed in your viewer may not reflect your actual balance on the servers. + + fail +Cannot create large prims that intersect other players. Please re-try when other players have moved. + -- cgit v1.2.3 From 10697d59b6082a6e472cf80063ef767cad73bc75 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 23 Oct 2012 13:35:11 -0500 Subject: MAINT-1567 Fix for incorrect triangle and hull counts in mesh importer. Reviewed by VoidPointer --- indra/newview/llfloatermodelpreview.cpp | 123 ++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 47 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e501fcaa90..6d0d9f67d5 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3884,15 +3884,30 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim U32 triangle_count = 0; - for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter) + U32 instanced_triangle_count = 0; + + //get the triangle count for the whole scene + for (LLModelLoader::scene::iterator iter = mBaseScene.begin(), endIter = mBaseScene.end(); iter != endIter; ++iter) { - LLModel* mdl = *iter; - for (S32 i = 0; i < mdl->getNumVolumeFaces(); ++i) + for (LLModelLoader::model_instance_list::iterator instance = iter->second.begin(), end_instance = iter->second.end(); instance != end_instance; ++instance) { - triangle_count += mdl->getVolumeFace(i).mNumIndices/3; + LLModel* mdl = instance->mModel; + if (mdl) + { + instanced_triangle_count += mdl->getNumTriangles(); + } } } + //get the triangle count for the non-instanced set of models + for (U32 i = 0; i < mBaseModel.size(); ++i) + { + triangle_count += mBaseModel[i]->getNumTriangles(); + } + + //get ratio of uninstanced triangles to instanced triangles + F32 triangle_ratio = (F32) triangle_count / (F32) instanced_triangle_count; + U32 base_triangle_count = triangle_count; U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; @@ -3926,6 +3941,8 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim if (which_lod > -1 && which_lod < NUM_LOD) { limit = mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asInteger(); + //convert from "scene wide" to "non-instanced" triangle limit + limit *= triangle_ratio; } } else @@ -4031,7 +4048,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim U32 actual_verts = 0; U32 submeshes = 0; - mRequestedTriangleCount[lod] = triangle_count; + mRequestedTriangleCount[lod] = triangle_count/triangle_ratio; mRequestedErrorThreshold[lod] = lod_error_threshold; glodGroupParameteri(mGroup, GLOD_ADAPT_MODE, lod_mode); @@ -4213,28 +4230,36 @@ void LLModelPreview::updateStatusMessages() //initialize total for this lod to 0 total_tris[lod] = total_verts[lod] = total_submeshes[lod] = 0; - for (U32 i = 0; i < mModel[lod].size(); ++i) - { //for each model in the lod - S32 cur_tris = 0; - S32 cur_verts = 0; - S32 cur_submeshes = mModel[lod][i]->getNumVolumeFaces(); - - for (S32 j = 0; j < cur_submeshes; ++j) - { //for each submesh (face), add triangles and vertices to current total - const LLVolumeFace& face = mModel[lod][i]->getVolumeFace(j); - cur_tris += face.mNumIndices/3; - cur_verts += face.mNumVertices; - } + for (LLModelLoader::scene::iterator iter = mScene[lod].begin(), endIter = mScene[lod].end(); iter != endIter; ++iter) + { + for (LLModelLoader::model_instance_list::iterator instance = iter->second.begin(), end_instance = iter->second.end(); instance != end_instance; ++instance) + { + LLModel* model = instance->mModel; + if (model) + { + //for each model in the lod + S32 cur_tris = 0; + S32 cur_verts = 0; + S32 cur_submeshes = model->getNumVolumeFaces(); + + for (S32 j = 0; j < cur_submeshes; ++j) + { //for each submesh (face), add triangles and vertices to current total + const LLVolumeFace& face = model->getVolumeFace(j); + cur_tris += face.mNumIndices/3; + cur_verts += face.mNumVertices; + } - //add this model to the lod total - total_tris[lod] += cur_tris; - total_verts[lod] += cur_verts; - total_submeshes[lod] += cur_submeshes; + //add this model to the lod total + total_tris[lod] += cur_tris; + total_verts[lod] += cur_verts; + total_submeshes[lod] += cur_submeshes; - //store this model's counts to asset data - tris[lod].push_back(cur_tris); - verts[lod].push_back(cur_verts); - submeshes[lod].push_back(cur_submeshes); + //store this model's counts to asset data + tris[lod].push_back(cur_tris); + verts[lod].push_back(cur_verts); + submeshes[lod].push_back(cur_submeshes); + } + } } } @@ -4411,34 +4436,38 @@ void LLModelPreview::updateStatusMessages() } //add up physics triangles etc - S32 start = 0; - S32 end = mModel[LLModel::LOD_PHYSICS].size(); - S32 phys_tris = 0; S32 phys_hulls = 0; S32 phys_points = 0; - for (S32 i = start; i < end; ++i) - { //add up hulls and points and triangles for selected mesh(es) - LLModel* model = mModel[LLModel::LOD_PHYSICS][i]; - S32 cur_submeshes = model->getNumVolumeFaces(); - - LLModel::convex_hull_decomposition& decomp = model->mPhysics.mHull; - - if (!decomp.empty()) + //get the triangle count for the whole scene + for (LLModelLoader::scene::iterator iter = mScene[LLModel::LOD_PHYSICS].begin(), endIter = mScene[LLModel::LOD_PHYSICS].end(); iter != endIter; ++iter) + { + for (LLModelLoader::model_instance_list::iterator instance = iter->second.begin(), end_instance = iter->second.end(); instance != end_instance; ++instance) { - phys_hulls += decomp.size(); - for (U32 i = 0; i < decomp.size(); ++i) + LLModel* model = instance->mModel; + if (model) { - phys_points += decomp[i].size(); - } - } - else - { //choose physics shape OR decomposition, can't use both - for (S32 j = 0; j < cur_submeshes; ++j) - { //for each submesh (face), add triangles and vertices to current total - const LLVolumeFace& face = model->getVolumeFace(j); - phys_tris += face.mNumIndices/3; + S32 cur_submeshes = model->getNumVolumeFaces(); + + LLModel::convex_hull_decomposition& decomp = model->mPhysics.mHull; + + if (!decomp.empty()) + { + phys_hulls += decomp.size(); + for (U32 i = 0; i < decomp.size(); ++i) + { + phys_points += decomp[i].size(); + } + } + else + { //choose physics shape OR decomposition, can't use both + for (S32 j = 0; j < cur_submeshes; ++j) + { //for each submesh (face), add triangles and vertices to current total + const LLVolumeFace& face = model->getVolumeFace(j); + phys_tris += face.mNumIndices/3; + } + } } } } -- cgit v1.2.3 From 8039c4583e68b7090fffea28b388fffd61d4b443 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 23 Oct 2012 14:31:34 -0500 Subject: MAINT-1567 cleanup some gcc warnings --- indra/newview/llfloatermodelpreview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6d0d9f67d5..ea839e6f5a 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3942,7 +3942,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim { limit = mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asInteger(); //convert from "scene wide" to "non-instanced" triangle limit - limit *= triangle_ratio; + limit = (S32) ( (F32) limit*triangle_ratio ); } } else @@ -4048,7 +4048,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim U32 actual_verts = 0; U32 submeshes = 0; - mRequestedTriangleCount[lod] = triangle_count/triangle_ratio; + mRequestedTriangleCount[lod] = (S32) ( (F32) triangle_count / triangle_ratio ); mRequestedErrorThreshold[lod] = lod_error_threshold; glodGroupParameteri(mGroup, GLOD_ADAPT_MODE, lod_mode); -- cgit v1.2.3 From 9b8cd0e923440d6c37f9b97aef29edec6ac09dbc Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 23 Oct 2012 17:31:44 -0500 Subject: MAINT-1579 Fix for diffuse color being ignored in mesh import preview render. --- indra/newview/app_settings/shaders/class1/objects/previewV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index f2db314201..da3387e7a5 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -61,5 +61,5 @@ void main() col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); - vertex_color = col; + vertex_color = col*color; } -- cgit v1.2.3 From d41eaa2e3d9eeaeb06a593d9e3dcbdd4174cecea Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Thu, 25 Oct 2012 09:54:04 -0700 Subject: MAINT-1743 "Use Selection for Grid" does not change the grid ruler to "Reference" in the tools floater Reviewed with Simon. --- indra/newview/llfloatertools.cpp | 11 +++++++++++ indra/newview/llfloatertools.h | 2 ++ indra/newview/llselectmgr.cpp | 3 --- indra/newview/llselectmgr.h | 2 -- indra/newview/llviewermenu.cpp | 1 + 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 48484786f6..1eb7f4469a 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1055,6 +1055,17 @@ void commit_grid_mode(LLUICtrl *ctrl) LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex()); } +// static +void LLFloaterTools::setGridMode(S32 mode) +{ + LLFloaterTools* tools_floater = LLFloaterReg::getTypedInstance("build"); + if (!tools_floater || !tools_floater->mComboGridMode) + { + return; + } + + tools_floater->mComboGridMode->setCurrentByIndex(mode); +} void LLFloaterTools::onClickGridOptions() { diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index 7a19d093a4..ecb0092a6f 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -107,6 +107,8 @@ public: bool selectedMediaEditable(); void updateLandImpacts(); + static void setGridMode(S32 mode); + private: void refresh(); void refreshMedia(); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9c4c594280..343316d30a 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -211,7 +211,6 @@ LLSelectMgr::LLSelectMgr() mGridMode = GRID_MODE_WORLD; gSavedSettings.setS32("GridMode", (S32)GRID_MODE_WORLD); - mGridValid = FALSE; mSelectedObjects = new LLObjectSelection(); mHoverObjects = new LLObjectSelection(); @@ -1170,7 +1169,6 @@ void LLSelectMgr::setGridMode(EGridMode mode) mGridMode = mode; gSavedSettings.setS32("GridMode", mode); updateSelectionCenter(); - mGridValid = FALSE; } void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale) @@ -1271,7 +1269,6 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & origin = mGridOrigin; rotation = mGridRotation; scale = mGridScale; - mGridValid = TRUE; } //----------------------------------------------------------------------------- diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 9257ee9eeb..cc78e35869 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -769,8 +769,6 @@ private: LLVector3 mGridOrigin; LLVector3 mGridScale; EGridMode mGridMode; - BOOL mGridValid; - BOOL mTEMode; // render te LLVector3d mSelectionCenterGlobal; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9d79d99204..c66fbb006b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7477,6 +7477,7 @@ class LLToolsUseSelectionForGrid : public view_listener_t } func; LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func); LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT); + LLFloaterTools::setGridMode((S32)GRID_MODE_REF_OBJECT); return true; } }; -- cgit v1.2.3 From b014d949d7a294068dfe2367faee8f2006ec22af Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Thu, 25 Oct 2012 10:53:58 -0700 Subject: MAINT-1275 [SECURITY] Web session tokens saved in SecondLife.log reviewed with Simon --- indra/newview/llviewermedia.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1eb4bedfaf..ec48fa553b 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -316,9 +316,13 @@ public: /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content) { LL_WARNS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL; - LL_WARNS("MediaAuth") << content << LL_ENDL; + + LLSD stripped_content = content; + stripped_content.erase("set-cookie"); + LL_WARNS("MediaAuth") << stripped_content << LL_ENDL; std::string cookie = content["set-cookie"].asString(); + LL_DEBUGS("MediaAuth") << "cookie = " << cookie << LL_ENDL; LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, mHost); -- cgit v1.2.3 From 002634a41bcaa29fbc8ed6a20ef60230185bf1a2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 26 Oct 2012 11:17:06 -0500 Subject: MAINT-1311 Add some logging and assertions to help track down mesh loading errors. --- indra/newview/llmeshrepository.cpp | 60 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 57a5569dd7..4cd50ecd15 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -204,15 +204,18 @@ class LLMeshHeaderResponder : public LLCurl::Responder { public: LLVolumeParams mMeshParams; - + bool mProcessed; + LLMeshHeaderResponder(const LLVolumeParams& mesh_params) : mMeshParams(mesh_params) { LLMeshRepoThread::sActiveHeaderRequests++; + mProcessed = false; } ~LLMeshHeaderResponder() { + llassert(mProcessed); LLMeshRepoThread::sActiveHeaderRequests--; } @@ -229,15 +232,18 @@ public: S32 mLOD; U32 mRequestedBytes; U32 mOffset; + bool mProcessed; LLMeshLODResponder(const LLVolumeParams& mesh_params, S32 lod, U32 offset, U32 requested_bytes) : mMeshParams(mesh_params), mLOD(lod), mOffset(offset), mRequestedBytes(requested_bytes) { LLMeshRepoThread::sActiveLODRequests++; + mProcessed = false; } ~LLMeshLODResponder() { + llassert(mProcessed); LLMeshRepoThread::sActiveLODRequests--; } @@ -253,10 +259,17 @@ public: LLUUID mMeshID; U32 mRequestedBytes; U32 mOffset; + bool mProcessed; LLMeshSkinInfoResponder(const LLUUID& id, U32 offset, U32 size) : mMeshID(id), mRequestedBytes(size), mOffset(offset) { + mProcessed = false; + } + + ~LLMeshSkinInfoResponder() + { + llassert(mProcessed); } virtual void completedRaw(U32 status, const std::string& reason, @@ -271,10 +284,17 @@ public: LLUUID mMeshID; U32 mRequestedBytes; U32 mOffset; + bool mProcessed; LLMeshDecompositionResponder(const LLUUID& id, U32 offset, U32 size) : mMeshID(id), mRequestedBytes(size), mOffset(offset) { + mProcessed = false; + } + + ~LLMeshDecompositionResponder() + { + llassert(mProcessed); } virtual void completedRaw(U32 status, const std::string& reason, @@ -289,10 +309,17 @@ public: LLUUID mMeshID; U32 mRequestedBytes; U32 mOffset; + bool mProcessed; LLMeshPhysicsShapeResponder(const LLUUID& id, U32 offset, U32 size) : mMeshID(id), mRequestedBytes(size), mOffset(offset) { + mProcessed = false; + } + + ~LLMeshPhysicsShapeResponder() + { + llassert(mProcessed); } virtual void completedRaw(U32 status, const std::string& reason, @@ -1819,6 +1846,7 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { + mProcessed = true; S32 data_size = buffer->countAfter(channels.in(), NULL); @@ -1831,11 +1859,13 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, { if (status == 499 || status == 503) { //timeout or service unavailable, try again + llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshLOD(mMeshParams, mLOD); } else { + llassert(status == 499 || status == 503); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -1874,6 +1904,8 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { + mProcessed = true; + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status > 400) @@ -1885,11 +1917,13 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason { if (status == 499 || status == 503) { //timeout or service unavailable, try again + llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); } else { + llassert(status == 499 || status == 503); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -1928,6 +1962,8 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { + mProcessed = true; + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status > 400) @@ -1939,11 +1975,13 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r { if (status == 499 || status == 503) { //timeout or service unavailable, try again + llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshDecomposition(mMeshID); } else { + llassert(status == 499 || status == 503); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -1982,6 +2020,8 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { + mProcessed = true; + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status > 400) @@ -1993,11 +2033,13 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re { if (status == 499 || status == 503) { //timeout or service unavailable, try again + llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); } else { + llassert(status == 499 || status == 503); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2036,6 +2078,8 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { + mProcessed = true; + if (status < 200 || status > 400) { //llwarns @@ -2048,8 +2092,12 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, // TODO*: Add maximum retry logic, exponential backoff // and (somewhat more optional than the others) retries // again after some set period of time + + llassert(status == 503 || status == 499); + if (status == 503 || status == 499) { //retry + llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; LLMeshRepoThread::HeaderRequest req(mMeshParams); LLMutexLock lock(gMeshRepo.mThread->mMutex); @@ -2057,6 +2105,10 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, return; } + else + { + llwarns << "Unhandled status." << llendl; + } } S32 data_size = buffer->countAfter(channels.in(), NULL); @@ -2071,7 +2123,11 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, LLMeshRepository::sBytesReceived += llmin(data_size, 4096); - if (!gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size)) + bool success = gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size); + + llassert(success); + + if (!success) { llwarns << "Unable to parse mesh header: " -- cgit v1.2.3 From 58a73b4fc1e39df13c3c11a6f286cdeeace26c4f Mon Sep 17 00:00:00 2001 From: "simon@Simon-PC.lindenlab.com" Date: Mon, 29 Oct 2012 13:10:37 -0700 Subject: MAINT-1791 : Parcel media clear list crash. Reviewed by Kelly --- indra/llmessage/llurlrequest.cpp | 7 +++++-- indra/newview/llfloaterurlentry.cpp | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 5831c3c1c1..227efdb07a 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -356,7 +356,8 @@ LLIOPipe::EStatus LLURLRequest::process_impl( } } - while(1) + bool keep_looping = true; + while(keep_looping) { CURLcode result; @@ -408,8 +409,9 @@ LLIOPipe::EStatus LLURLRequest::process_impl( case CURLE_FAILED_INIT: case CURLE_COULDNT_CONNECT: status = STATUS_NO_CONNECTION; + keep_looping = false; break; - default: + default: // CURLE_URL_MALFORMAT llwarns << "URLRequest Error: " << result << ", " << LLCurl::strerror(result) @@ -417,6 +419,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( << (mDetail->mURL.empty() ? "" : mDetail->mURL) << llendl; status = STATUS_ERROR; + keep_looping = false; break; } } diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 151cd2a1cd..e85d849c9a 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -219,7 +219,8 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) } // Discover the MIME type only for "http" scheme. - if(scheme == "http" || scheme == "https") + if(!media_url.empty() && + (scheme == "http" || scheme == "https")) { LLHTTPClient::getHeaderOnly( media_url, new LLMediaTypeResponder(self->getHandle())); -- cgit v1.2.3 From 2126cdb9a25da4dcc4c81659038b85bcff17c4ee Mon Sep 17 00:00:00 2001 From: "simon@Simon-PC.lindenlab.com" Date: Wed, 31 Oct 2012 15:05:52 -0700 Subject: MAINT-1560 : Make Slow Motion Animations affect all avatars. Added new menu. Reviewed by Kelly --- indra/llcharacter/llmotioncontroller.cpp | 3 +- indra/llcharacter/llmotioncontroller.h | 6 ++- indra/newview/llviewermenu.cpp | 53 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 44 ++++++++++++++---- 4 files changed, 94 insertions(+), 12 deletions(-) diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 829dda9993..e9fb91ad73 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -42,6 +42,7 @@ const U32 MAX_MOTION_INSTANCES = 32; //----------------------------------------------------------------------------- // Constants and statics //----------------------------------------------------------------------------- +F32 LLMotionController::sCurrentTimeFactor = 1.f; LLMotionRegistry LLMotionController::sRegistry; //----------------------------------------------------------------------------- @@ -125,7 +126,7 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id ) // Class Constructor //----------------------------------------------------------------------------- LLMotionController::LLMotionController() - : mTimeFactor(1.f), + : mTimeFactor(sCurrentTimeFactor), mCharacter(NULL), mAnimTime(0.f), mPrevTimerElapsed(0.f), diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index b996f708d2..52eaf557b1 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -168,6 +168,9 @@ public: const LLFrameTimer& getFrameTimer() { return mTimer; } + static F32 getCurrentTimeFactor() { return sCurrentTimeFactor; }; + static void setCurrentTimeFactor(F32 factor) { sCurrentTimeFactor = factor; }; + protected: // internal operations act on motion instances directly // as there can be duplicate motions per id during blending overlap @@ -187,7 +190,8 @@ protected: void deactivateStoppedMotions(); protected: - F32 mTimeFactor; + F32 mTimeFactor; // 1.f for normal speed + static F32 sCurrentTimeFactor; // Value to use for initialization static LLMotionRegistry sRegistry; LLPoseBlender mPoseBlender; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c66fbb006b..d69acbbd07 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1638,6 +1638,54 @@ class LLAdvancedForceParamsToDefault : public view_listener_t }; +////////////////////////// +// ANIMATION SPEED // +////////////////////////// + +// Utility function to set all AV time factors to the same global value +static void set_all_animation_time_factors(F32 time_factor) +{ + LLMotionController::setCurrentTimeFactor(time_factor); + for (std::vector::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) + { + (*iter)->setAnimTimeFactor(time_factor); + } +} + +class LLAdvancedAnimTenFaster : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + //llinfos << "LLAdvancedAnimTenFaster" << llendl; + F32 time_factor = LLMotionController::getCurrentTimeFactor(); + time_factor = llmin(time_factor + 0.1f, 2.f); // Upper limit is 200% speed + set_all_animation_time_factors(time_factor); + return true; + } +}; + +class LLAdvancedAnimTenSlower : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + //llinfos << "LLAdvancedAnimTenSlower" << llendl; + F32 time_factor = LLMotionController::getCurrentTimeFactor(); + time_factor = llmax(time_factor - 0.1f, 0.1f); // Lower limit is at 10% of normal speed + set_all_animation_time_factors(time_factor); + return true; + } +}; + +class LLAdvancedAnimResetAll : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + set_all_animation_time_factors(1.f); + return true; + } +}; + ////////////////////////// // RELOAD VERTEX SHADER // @@ -8407,6 +8455,11 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale"); view_listener_t::addMenu(new LLAdvancedTestFemale(), "Advanced.TestFemale"); + // Advanced > Character > Animation Speed + view_listener_t::addMenu(new LLAdvancedAnimTenFaster(), "Advanced.AnimTenFaster"); + view_listener_t::addMenu(new LLAdvancedAnimTenSlower(), "Advanced.AnimTenSlower"); + view_listener_t::addMenu(new LLAdvancedAnimResetAll(), "Advanced.AnimResetAll"); + // Advanced > Character (toplevel) view_listener_t::addMenu(new LLAdvancedForceParamsToDefault(), "Advanced.ForceParamsToDefault"); view_listener_t::addMenu(new LLAdvancedReloadVertexShader(), "Advanced.ReloadVertexShader"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 59d268c53a..0fc1982a86 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3178,6 +3178,40 @@ parameter="AllowSelectAvatar" /> + + + + + + + + + + + + + + + @@ -3194,16 +3228,6 @@ function="Advanced.ToggleAnimationInfo" parameter="" /> - - - - -- cgit v1.2.3