diff options
author | Geenz <geenz@geenzo.com> | 2013-01-25 18:45:40 -0500 |
---|---|---|
committer | Geenz <geenz@geenzo.com> | 2013-01-25 18:45:40 -0500 |
commit | 97f9ab80f9ddce8627b9e37f973f4e683d348ac3 (patch) | |
tree | 14d92f2e145d827d574b5552955fa3089d2fd2f6 | |
parent | 5f03e197f4cfb43de93dc42b16b54beafccd376a (diff) |
setMaterialParams for LLViewerObject
-rw-r--r-- | indra/newview/llviewerobject.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 4490e51493..5c684326e2 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4369,6 +4369,26 @@ S32 LLViewerObject::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID return retval; } +S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) +{ + S32 retval = 0; + const LLTextureEntry *tep = getTE(te); + if (!tep) + { + llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl; + } + else if (pMaterialParams != tep->getMaterialParams()) + { + retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams); + setChanged(TEXTURE); + if (mDrawable.notNull() && retval) + { + gPipeline.markTextured(mDrawable); + } + } + return retval; +} + S32 LLViewerObject::setTEScale(const U8 te, const F32 s, const F32 t) { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 7b98c01243..26160d14b3 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -314,6 +314,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); + /*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams); /*virtual*/ BOOL setMaterial(const U8 material); virtual void setTEImage(const U8 te, LLViewerTexture *imagep); // Not derived from LLPrimitive virtual void changeTEImage(S32 index, LLViewerTexture* new_image) ; |