diff options
-rw-r--r-- | indra/newview/llface.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llface.h | 2 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llselectmgr.h | 15 |
4 files changed, 27 insertions, 21 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 32280d3d90..b2da5bb9f8 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -634,7 +634,7 @@ void renderFace(LLDrawable* drawable, LLFace *face) } } -void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool bSelected, bool wireframe_selection, bool bRenderHiddenSelections) +void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections) { //Need to because crash on ATI 3800 (and similar cards) MAINT-5018 LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 7e68e81862..736d45b7ad 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -198,7 +198,7 @@ public: void renderSelectedUV(); void renderSelected(LLViewerTexture *image, const LLColor4 &color); - void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool bSelected, bool wireframe_selection, bool bRenderHiddenSelections); + void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections); F32 getKey() const { return mDistance; } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9c6be001f6..b36df244f8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5869,6 +5869,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) if (!objectp) continue; + if(getTEMode() && !node->hasSelectedTE()) + continue; + if (objectp->mDrawable && objectp->mDrawable->getVOVolume() && objectp->mDrawable->getVOVolume()->isMesh()) @@ -5876,11 +5879,18 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces for (S32 te = 0; te < num_tes; ++te) { - bool bSelected = node->isTESelected(te) && getTEMode(); - - objectp->mDrawable->getFace(te)->renderOneWireframe( - !bSelected ? LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2) : sHighlightInspectColor - , fogCfx, bSelected, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections); + if (!getTEMode()) + { + objectp->mDrawable->getFace(te)->renderOneWireframe( + LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2) + , fogCfx, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections); + } + else if(node->isTESelected(te)) + { + objectp->mDrawable->getFace(te)->renderOneWireframe( + LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2) + , fogCfx, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections); + } } } else @@ -6078,7 +6088,7 @@ void LLSelectNode::selectTE(S32 te_index, BOOL selected) mLastTESelected = te_index; } -BOOL LLSelectNode::isTESelected(S32 te_index) +BOOL LLSelectNode::isTESelected(S32 te_index) const { if (te_index < 0 || te_index >= mObject->getNumTEs()) { @@ -6087,7 +6097,7 @@ BOOL LLSelectNode::isTESelected(S32 te_index) return (mTESelectMask & (0x1 << te_index)) != 0; } -S32 LLSelectNode::getLastSelectedTE() +S32 LLSelectNode::getLastSelectedTE() const { if (!isTESelected(mLastTESelected)) { @@ -6096,11 +6106,6 @@ S32 LLSelectNode::getLastSelectedTE() return mLastTESelected; } -S32 LLSelectNode::getLastOperatedTE() -{ - return mLastTESelected; -} - LLViewerObject* LLSelectNode::getObject() { if (!mObject) diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 303a984bd0..ce0fee8803 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -173,13 +173,14 @@ public: void selectAllTEs(BOOL b); void selectTE(S32 te_index, BOOL selected); - BOOL isTESelected(S32 te_index); - S32 getLastSelectedTE(); - S32 getLastOperatedTE(); + BOOL isTESelected(S32 te_index) const; + bool hasSelectedTE() const { return TE_SELECT_MASK_ALL & mTESelectMask; } + S32 getLastSelectedTE() const; + S32 getLastOperatedTE() const { return mLastTESelected; } S32 getTESelectMask() { return mTESelectMask; } void renderOneSilhouette(const LLColor4 &color); void setTransient(BOOL transient) { mTransient = transient; } - BOOL isTransient() { return mTransient; } + BOOL isTransient() const { return mTransient; } LLViewerObject* getObject(); void setObject(LLViewerObject* object); // *NOTE: invalidate stored textures and colors when # faces change @@ -539,10 +540,10 @@ public: EGridMode getGridMode() { return mGridMode; } void getGrid(LLVector3& origin, LLQuaternion& rotation, LLVector3 &scale, bool for_snap_guides = false); - BOOL getTEMode() { return mTEMode; } - void setTEMode(BOOL b) { mTEMode = b; } + BOOL getTEMode() const { return mTEMode; } + void setTEMode(BOOL b) { mTEMode = b; } - BOOL shouldShowSelection() { return mShowSelection; } + BOOL shouldShowSelection() const { return mShowSelection; } LLBBox getBBoxOfSelection() const; LLBBox getSavedBBoxOfSelection() const { return mSavedSelectionBBox; } |