From f96a6aad6b266c8cd4b1a117510fd4cacb6413c8 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 10 Apr 2012 17:13:28 -0500 Subject: MAINT-74 Fix "show cross sections" crashing and not working in general. --- indra/newview/llmaniptranslate.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'indra/newview/llmaniptranslate.cpp') diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 3a88fbd96d..4dd3fa1722 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -60,6 +60,7 @@ #include "llworld.h" #include "llui.h" #include "pipeline.h" +#include "llviewershadermgr.h" const S32 NUM_AXES = 3; const S32 MOUSE_DRAG_SLOP = 2; // pixels @@ -1645,17 +1646,28 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, LLQuaternion grid_rotation, LLColor4 inner_color) { - if (!gSavedSettings.getBOOL("GridCrossSections")) + if (!gSavedSettings.getBOOL("GridCrossSections") || !LLGLSLShader::sNoFixedFunction) { return; } + + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + + U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY }; U32 num_types = LL_ARRAY_SIZE(types); GLuint stencil_mask = 0xFFFFFFFF; //stencil in volumes + gGL.flush(); + + if (shader) + { + gClipProgram.bind(); + } + { glStencilMask(stencil_mask); glClearStencil(1); @@ -1666,6 +1678,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, glStencilFunc(GL_ALWAYS, 0, stencil_mask); gGL.setColorMask(false, false); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.diffuseColor4f(1,1,1,1); //setup clip plane @@ -1675,10 +1688,12 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, normal = -normal; } F32 d = -(selection_center * normal); - F64 plane[] = { normal.mV[0], normal.mV[1], normal.mV[2], d }; - LLGLEnable clip(GL_CLIP_PLANE0); - glClipPlane(GL_CLIP_PLANE0, plane); + glh::vec4f plane(normal.mV[0], normal.mV[1], normal.mV[2], d ); + gGL.getModelviewMatrix().inverse().mult_vec_matrix(plane); + + gClipProgram.uniform4fv("clip_plane", 1, plane.v); + BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES); BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS); @@ -1729,6 +1744,11 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, F32 sz = mGridSizeMeters; F32 tiles = sz; + if (shader) + { + shader->bind(); + } + //draw volume/plane intersections { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -- cgit v1.2.3 From 3efa013ee4e037c2ba20aaf550aa06bcf578b145 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 13 Apr 2012 11:55:44 -0500 Subject: MAINT-939 Potential fix for crash when editing objects. --- indra/newview/llmaniptranslate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmaniptranslate.cpp') diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 4dd3fa1722..f8088d04b4 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1581,7 +1581,11 @@ void LLManipTranslate::renderSnapGuides() LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); LLGLEnable stipple(GL_LINE_STIPPLE); gGL.flush(); - glLineStipple(1, 0x3333); + + if (!LLGLSLShader::sNoFixedFunction) + { + glLineStipple(1, 0x3333); + } switch (mManipPart) { -- cgit v1.2.3 From 378ae8ce6588ce921b2aa960c08d4293c6b419e5 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 13 Mar 2012 15:33:15 -0700 Subject: PATH-199: Enforcing permanent objects in frozen state to not move. --- indra/newview/llmaniptranslate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmaniptranslate.cpp') diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 3a88fbd96d..e6ccfc0af5 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -687,7 +687,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } } - if (object->permMove()) + if (object->permMove() && !object->isPermanentEnforced()) { // handle attachments in local space if (object->isAttachment() && object->mDrawable.notNull()) @@ -2281,7 +2281,7 @@ BOOL LLManipTranslate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + return objectp->permMove() && !objectp->isPermanentEnforced() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } } func; can_move = mObjectSelection->applyToObjects(&func); -- cgit v1.2.3 From c1a5d6a36b925728d98c37522ed7ae53e3a87155 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 30 Mar 2012 15:42:43 -0700 Subject: PATH-450: Disabling the movement and shape manipulation widgets when editing an item in a linked set. --- indra/newview/llmaniptranslate.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmaniptranslate.cpp') diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index e6ccfc0af5..7a35562f86 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -687,7 +687,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } } - if (object->permMove() && !object->isPermanentEnforced()) + LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); + if (object->permMove() && !object->isPermanentEnforced() && + ((root_object == NULL) || !root_object->isPermanentEnforced())) { // handle attachments in local space if (object->isAttachment() && object->mDrawable.notNull()) @@ -2281,7 +2283,10 @@ BOOL LLManipTranslate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - return objectp->permMove() && !objectp->isPermanentEnforced() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); + return objectp->permMove() && !objectp->isPermanentEnforced() && + ((root_object == NULL) || !root_object->isPermanentEnforced()) && + (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } } func; can_move = mObjectSelection->applyToObjects(&func); -- cgit v1.2.3