From 2dddf959bd4b430510ceb441550cc304c80150c2 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 16 May 2013 12:45:19 -0700 Subject: NORSPEC-189 return to inefficient material update reg to avoid crashes from brundlefly solution with old reg and new callback --- indra/newview/llvovolume.cpp | 20 +++++++++++--------- indra/newview/llvovolume.h | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a9b540507f..92ee36d205 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1973,14 +1973,16 @@ S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow) return res; } -void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams, U32 te) -{ - LL_DEBUGS("MaterialTEs") << "materialid " << pMaterialID.asString() << " to TE " << te << LL_ENDL; - LLTextureEntry* texture_entry = getTE(te); - if (texture_entry && (texture_entry->getMaterialID().isNull() || (texture_entry->getMaterialID() == pMaterialID))) - { - setTEMaterialParams(te, pMaterialParams); - } +void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams) +{ + LL_DEBUGS("MaterialTEs") << "materialid " << pMaterialID.asString() << LL_ENDL; + for (U8 i = 0; i < getNumTEs(); i++) + { + if (getTE(i) && (getTE(i)->getMaterialID().isNull() || (getTE(i)->getMaterialID() == pMaterialID))) + { + setTEMaterialParams(i, pMaterialParams); + } + } } S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) @@ -1993,7 +1995,7 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) LL_DEBUGS("MaterialTEs") << " " << pMaterialID.asString() << LL_ENDL; if (res) { - LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3)); + LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2)); setChanged(TEXTURE); if (!mDrawable.isNull()) { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index a5f933c319..d1bfefdc70 100755 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -187,7 +187,7 @@ public: /*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags); /*virtual*/ S32 setTEGlow(const U8 te, const F32 glow); /*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID); - void setTEMaterialParamsCallback(const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams, U32 te); + void setTEMaterialParamsCallback(const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams); /*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams); /*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t); /*virtual*/ S32 setTEScaleS(const U8 te, const F32 s); -- cgit v1.2.3