summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lltextureentry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive/lltextureentry.cpp')
-rw-r--r--indra/llprimitive/lltextureentry.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 691216e035..6e5d27bb94 100644
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -61,18 +61,24 @@ LLTextureEntry* LLTextureEntry::newTextureEntry()
//===============================================================
LLTextureEntry::LLTextureEntry()
: mMediaEntry(NULL)
+ , mSelected(false)
+ , mMaterialUpdatePending(false)
{
init(LLUUID::null,1.f,1.f,0.f,0.f,0.f,DEFAULT_BUMP_CODE);
}
LLTextureEntry::LLTextureEntry(const LLUUID& tex_id)
: mMediaEntry(NULL)
+ , mSelected(false)
+ , mMaterialUpdatePending(false)
{
init(tex_id,1.f,1.f,0.f,0.f,0.f,DEFAULT_BUMP_CODE);
}
LLTextureEntry::LLTextureEntry(const LLTextureEntry &rhs)
: mMediaEntry(NULL)
+ , mSelected(false)
+ , mMaterialUpdatePending(false)
{
mID = rhs.mID;
mScaleS = rhs.mScaleS;
@@ -532,8 +538,16 @@ S32 LLTextureEntry::setGlow(F32 glow)
S32 LLTextureEntry::setMaterialID(const LLMaterialID& pMaterialID)
{
- if (mMaterialID != pMaterialID)
+ if ( (mMaterialID != pMaterialID) || (mMaterialUpdatePending && !mSelected) )
{
+ if (mSelected)
+ {
+ mMaterialUpdatePending = true;
+ mMaterialID = pMaterialID;
+ return TEM_CHANGE_NONE;
+ }
+
+ mMaterialUpdatePending = false;
mMaterialID = pMaterialID;
if (mMaterialID.isNull())
{
@@ -548,6 +562,10 @@ S32 LLTextureEntry::setMaterialParams(const LLMaterialPtr pMaterialParams)
{
if (mMaterial != pMaterialParams)
{
+ if (mSelected)
+ {
+ mMaterialUpdatePending = true;
+ }
mMaterial = pMaterialParams;
return TEM_CHANGE_TEXTURE;
}