diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 73 |
1 files changed, 57 insertions, 16 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 4a2d545b33..20445ba56f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2089,29 +2089,33 @@ void LLSelectMgr::selectionSetGlow(F32 glow) mSelectedObjects->applyToObjects( &func2 ); } -void LLSelectMgr::selectionSetMaterialParams(LLSelectedTEMaterialFunctor* material_func) +void LLSelectMgr::selectionSetMaterialParams(LLSelectedTEMaterialFunctor* material_func, int te) { struct f1 : public LLSelectedTEFunctor { LLMaterialPtr mMaterial; - f1(LLSelectedTEMaterialFunctor* material_func) : _material_func(material_func) {} + f1(LLSelectedTEMaterialFunctor* material_func, int te) : _material_func(material_func), _specific_te(te) {} - bool apply(LLViewerObject* object, S32 face) + bool apply(LLViewerObject* object, S32 te) { - if (object && object->permModify() && _material_func) - { - LLTextureEntry* tep = object->getTE(face); - if (tep) - { - LLMaterialPtr current_material = tep->getMaterialParams(); - _material_func->apply(object, face, tep, current_material); - } - } + if (_specific_te == -1 || (te == _specific_te)) + { + if (object && object->permModify() && _material_func) + { + LLTextureEntry* tep = object->getTE(te); + if (tep) + { + LLMaterialPtr current_material = tep->getMaterialParams(); + _material_func->apply(object, te, tep, current_material); + } + } + } return true; } LLSelectedTEMaterialFunctor* _material_func; - } func1(material_func); + int _specific_te; + } func1(material_func, te); mSelectedObjects->applyToTEs( &func1 ); struct f2 : public LLSelectedObjectFunctor @@ -6355,7 +6359,9 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) + bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections; + + if (LLSelectMgr::sRenderHiddenSelections) { gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); @@ -6388,8 +6394,6 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) gGL.diffuseColor4f(color.mV[VRED] * 2, color.mV[VGREEN] * 2, color.mV[VBLUE] * 2, LLSelectMgr::sHighlightAlpha * 2); { - bool wireframe_selection = gFloaterTools && gFloaterTools->getVisible(); - LLGLDisable depth(wireframe_selection ? 0 : GL_BLEND); LLGLEnable stencil(wireframe_selection ? 0 : GL_STENCIL_TEST); @@ -8050,3 +8054,40 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } + +template<> +bool LLCheckIdenticalFunctor<F32>::same(const F32& a, const F32& b, const F32& tolerance) +{ + F32 delta = (a - b); + F32 abs_delta = fabs(delta); + return abs_delta <= tolerance; +} + +#define DEF_DUMMY_CHECK_FUNCTOR(T) \ +template<> \ +bool LLCheckIdenticalFunctor<T>::same(const T& a, const T& b, const T& tolerance) \ +{ \ + (void)tolerance; \ + return a == b; \ +} + +DEF_DUMMY_CHECK_FUNCTOR(LLUUID) +DEF_DUMMY_CHECK_FUNCTOR(LLGLenum) +DEF_DUMMY_CHECK_FUNCTOR(LLTextureEntry) +DEF_DUMMY_CHECK_FUNCTOR(LLTextureEntry::e_texgen) +DEF_DUMMY_CHECK_FUNCTOR(bool) +DEF_DUMMY_CHECK_FUNCTOR(U8) +DEF_DUMMY_CHECK_FUNCTOR(int) +DEF_DUMMY_CHECK_FUNCTOR(LLColor4) +DEF_DUMMY_CHECK_FUNCTOR(LLMediaEntry) +DEF_DUMMY_CHECK_FUNCTOR(LLPointer<LLMaterial>) +DEF_DUMMY_CHECK_FUNCTOR(std::string) +DEF_DUMMY_CHECK_FUNCTOR(std::vector<std::string>) + +template<> +bool LLCheckIdenticalFunctor<class LLFace *>::same(class LLFace* const & a, class LLFace* const & b, class LLFace* const & tolerance) \ +{ \ + (void)tolerance; \ + return a == b; \ +} + |