diff options
-rwxr-xr-x | indra/llprimitive/lltextureentry.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index 1d581da897..8365c9d7b6 100755 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -61,6 +61,8 @@ 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); } @@ -537,10 +539,17 @@ 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()) { @@ -551,7 +560,10 @@ S32 LLTextureEntry::setMaterialID(const LLMaterialID& pMaterialID) S32 LLTextureEntry::setMaterialParams(const LLMaterialPtr pMaterialParams) { - + if (mSelected) + { + mMaterialUpdatePending = true; + } mMaterial = pMaterialParams; return TEM_CHANGE_TEXTURE; } |