diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-06-11 17:18:20 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-06-11 17:18:20 -0700 |
commit | 96f7f6d01bb652fb049cd64b55b2933aa436f9d2 (patch) | |
tree | 0c25d25d7bb834c32acbcb5f9b58d9d0a97ba69c /indra/newview/llviewerobject.cpp | |
parent | 7fcbb7c177ba0c7fe3c0e97f95544481a279bf7f (diff) |
NORSPEC-258 and NORSPEC-226 make tex picker close refresh build tool UI correctly and fix issues with transition from no-bumps to normal maps
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 198b13ee06..6c20f638e5 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4389,17 +4389,7 @@ S32 LLViewerObject::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID << ", material " << pMaterialID << LL_ENDL; retval = LLPrimitive::setTEMaterialID(te, pMaterialID); - if (retval) - { - // 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); - } - } + refreshMaterials(); } return retval; } @@ -4414,23 +4404,28 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri return 0; } - retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams); - LL_DEBUGS("Material") << "Changing material params for te " << (S32)te - << ", object " << mID - << " (" << retval << ")" - << LL_ENDL; - setTENormalMap(te, (pMaterialParams) ? pMaterialParams->getNormalID() : LLUUID::null); - setTESpecularMap(te, (pMaterialParams) ? pMaterialParams->getSpecularID() : LLUUID::null); - - setChanged(TEXTURE); - if (mDrawable.notNull()) - { - gPipeline.markTextured(mDrawable); - } + retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams); + LL_DEBUGS("Material") << "Changing material params for te " << (S32)te + << ", object " << mID + << " (" << retval << ")" + << LL_ENDL; + setTENormalMap(te, (pMaterialParams) ? pMaterialParams->getNormalID() : LLUUID::null); + setTESpecularMap(te, (pMaterialParams) ? pMaterialParams->getSpecularID() : LLUUID::null); + refreshMaterials(); return retval; } +void LLViewerObject::refreshMaterials() +{ + setChanged(ALL_CHANGED); + if (mDrawable.notNull()) + { + gPipeline.markTextured(mDrawable); + gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL); + dirtySpatialGroup(TRUE); + } +} S32 LLViewerObject::setTEScale(const U8 te, const F32 s, const F32 t) { |