summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/llprimitive/lltextureentry.cpp7
-rw-r--r--indra/newview/llmaterialmgr.cpp1
-rwxr-xr-xindra/newview/llselectmgr.cpp2
-rwxr-xr-xindra/newview/llviewerobject.cpp23
-rwxr-xr-xindra/newview/llvovolume.cpp18
5 files changed, 27 insertions, 24 deletions
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 8365c9d7b6..597f078490 100755
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -550,12 +550,9 @@ S32 LLTextureEntry::setMaterialID(const LLMaterialID& pMaterialID)
mMaterialUpdatePending = false;
mMaterialID = pMaterialID;
+ return TEM_CHANGE_TEXTURE;
}
- if (mMaterialID.isNull())
- {
- setMaterialParams(NULL);
- }
- return TEM_CHANGE_TEXTURE;
+ return TEM_CHANGE_NONE;
}
S32 LLTextureEntry::setMaterialParams(const LLMaterialPtr pMaterialParams)
diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp
index fb8cffa4ef..f217ff160e 100644
--- a/indra/newview/llmaterialmgr.cpp
+++ b/indra/newview/llmaterialmgr.cpp
@@ -116,6 +116,7 @@ void LLMaterialsResponder::error(U32 pStatus, const std::string& pReason)
LLMaterialMgr::LLMaterialMgr()
{
+ mMaterials.insert(std::pair<LLMaterialID, LLMaterialPtr>(LLMaterialID::null, LLMaterialPtr(NULL)));
gIdleCallbacks.addFunction(&LLMaterialMgr::onIdle, NULL);
LLWorld::instance().setRegionRemovedCallback(boost::bind(&LLMaterialMgr::onRegionRemoved, this, _1));
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 3f60b5f642..e80ad6976e 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2052,7 +2052,7 @@ void LLSelectMgr::selectionRemoveMaterial()
{
LL_DEBUGS("Materials") << "Removing material from object " << object->getID() << " face " << face << LL_ENDL;
LLMaterialMgr::getInstance()->remove(object->getID(),face);
- object->setTEMaterialID(face,LLMaterialID::null);
+ object->setTEMaterialParams(face, NULL);
}
return true;
}
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index d56df96c44..4e233d479a 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4393,15 +4393,18 @@ S32 LLViewerObject::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID
<< ", material " << pMaterialID
<< LL_ENDL;
retval = LLPrimitive::setTEMaterialID(te, pMaterialID);
- }
- // Kitty would like to know if this is necessary?
- // Since we should get a setTEMaterialParams that does it anyway?
- //
- setChanged(TEXTURE);
- if (mDrawable.notNull())
+ if (retval)
{
- gPipeline.markTextured(mDrawable);
+ // Kitty would like to know if this is necessary?
+ // Since we should get a setTEMaterialParams that does it anyway?
+ //
+ setChanged(TEXTURE);
+ if (mDrawable.notNull())
+ {
+ gPipeline.markTextured(mDrawable);
+ }
}
+ }
return retval;
}
@@ -4420,11 +4423,11 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri
<< ", object " << mID
<< " (" << retval << ")"
<< LL_ENDL;
- setTENormalMap(te, tep->getMaterialParams()->getNormalID());
- setTESpecularMap(te, tep->getMaterialParams()->getSpecularID());
+ setTENormalMap(te, (pMaterialParams) ? pMaterialParams->getNormalID() : LLUUID::null);
+ setTESpecularMap(te, (pMaterialParams) ? pMaterialParams->getSpecularID() : LLUUID::null);
setChanged(TEXTURE);
- if (mDrawable.notNull())
+ if (mDrawable.notNull())
{
gPipeline.markTextured(mDrawable);
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 734ac2afc8..8e811527eb 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1991,21 +1991,23 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
<< LL_ENDL;
LL_DEBUGS("MaterialTEs") << " " << pMaterialID.asString() << LL_ENDL;
- // Use TE-specific version of boost CB hook-up to avoid cross-contaminatin'
- LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, te));
- setChanged(TEXTURE);
- if (!mDrawable.isNull())
+ if (res)
{
- gPipeline.markTextured(mDrawable);
+ LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, te));
+ setChanged(TEXTURE);
+ if (!mDrawable.isNull())
+ {
+ gPipeline.markTextured(mDrawable);
+ }
+ mFaceMappingChanged = TRUE;
}
- mFaceMappingChanged = TRUE;
- return TEM_CHANGE_TEXTURE;
+ return res;
}
S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams)
{
S32 res = LLViewerObject::setTEMaterialParams(te, pMaterialParams);
- LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << pMaterialParams->asLLSD() << " res " << res
+ LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterialParams) ? pMaterialParams->asLLSD() : LLSD("null")) << " res " << res
<< ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" )
<< LL_ENDL;
setChanged(TEXTURE);