summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-05-16 13:42:20 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-05-16 13:42:20 -0700
commit69e680a37ca9353cd33c058b8984cfc13e7b4ff4 (patch)
tree8eeac0ddb5debf053e22f1894172d2afa8af8842
parent2dddf959bd4b430510ceb441550cc304c80150c2 (diff)
Merge beta fixes
-rwxr-xr-xindra/newview/llvovolume.cpp23
-rwxr-xr-xindra/newview/llvovolume.h2
2 files changed, 13 insertions, 12 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 92ee36d205..c3c6747e99 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1973,16 +1973,17 @@ S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow)
return res;
}
-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);
- }
- }
+void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams, U32 te)
+{
+ LL_DEBUGS("MaterialTEs") << "materialid " << pMaterialID.asString() << " to TE " << te << LL_ENDL;
+ if (te >= getNumTEs())
+ return;
+
+ LLTextureEntry* texture_entry = getTE(te);
+ if (texture_entry)
+ {
+ setTEMaterialParams(te, pMaterialParams);
+ }
}
S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
@@ -1995,7 +1996,7 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
LL_DEBUGS("MaterialTEs") << " " << pMaterialID.asString() << LL_ENDL;
if (res)
{
- LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2));
+ LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3));
setChanged(TEXTURE);
if (!mDrawable.isNull())
{
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index d1bfefdc70..a5f933c319 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);
+ void setTEMaterialParamsCallback(const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams, U32 te);
/*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);