diff options
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rwxr-xr-x | indra/newview/llvovolume.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 941892a597..df014513ad 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1973,33 +1973,34 @@ S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow) return res; } -void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams) +void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams, U32 te) { - LL_DEBUGS("MaterialTEs") << "materialid " << pMaterialID.asString() << LL_ENDL; - for (U8 i = 0; i < getNumTEs(); i++) + 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))) { - if (getTE(i) && (getTE(i)->getMaterialID().isNull() || (getTE(i)->getMaterialID() == pMaterialID))) - { - setTEMaterialParams(i, pMaterialParams); - } + setTEMaterialParams(te, pMaterialParams); } } S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) { - S32 res = LLViewerObject::setTEMaterialID(te, pMaterialID); - LL_DEBUGS("MaterialTEs") << "te "<< (S32)te << " materialid " << pMaterialID.asString() << " res " << res - << ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" ) - << LL_ENDL; - if (res) - { - LL_DEBUGS("MaterialTEs") << " " << pMaterialID.asString() << LL_ENDL; - LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2)); - gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; - } - return res; + S32 res = LLViewerObject::setTEMaterialID(te, pMaterialID); + LL_DEBUGS("MaterialTEs") << "te "<< (S32)te << " materialid " << pMaterialID.asString() << " res " << res + << ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" ) + << LL_ENDL; + + LL_DEBUGS("MaterialTEs") << " " << pMaterialID.asString() << LL_ENDL; + // Use TE-specific version of boost CB hook-up to avoid cross-contaminatin' + LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3)); + setChanged(TEXTURE); + if (!mDrawable.isNull()) + { + gPipeline.markTextured(mDrawable); } + mFaceMappingChanged = TRUE; + return TEM_CHANGE_TEXTURE; +} S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) { @@ -2007,13 +2008,13 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << pMaterialParams->asLLSD() << " res " << res << ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" ) << LL_ENDL; - if (res) + setChanged(TEXTURE); + if (!mDrawable.isNull()) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; } - - return res; + mFaceMappingChanged = TRUE; + return TEM_CHANGE_TEXTURE; } S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t) |