diff options
author | Nyx Linden <nyx@lindenlab.com> | 2013-10-25 16:43:36 -0400 |
---|---|---|
committer | Nyx Linden <nyx@lindenlab.com> | 2013-10-25 16:43:36 -0400 |
commit | b1838f02bc6c4a052c68fc6bbf3106e3a796a1a2 (patch) | |
tree | 7848f11c33e3c91eb8e3d85f1d42bae902fb2811 /indra | |
parent | dba221e0ac89b1505ddd3b896946286d5d1cf3d8 (diff) |
SH-4572 FIX changing clothing parameters do not take effect in edit appearance
fix, new back-end utility and restoring the necessary functionality.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llappearance/llavatarappearance.h | 7 | ||||
-rwxr-xr-x | indra/llappearance/lltexglobalcolor.cpp | 5 | ||||
-rwxr-xr-x | indra/llappearance/lltexglobalcolor.h | 2 | ||||
-rwxr-xr-x | indra/llappearance/lltexlayerparams.cpp | 19 |
4 files changed, 33 insertions, 0 deletions
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 1c212873f4..1e898026c0 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -219,6 +219,12 @@ public: ** ** *******************************************************************************/ + //-------------------------------------------------------------------- + // Composites + //-------------------------------------------------------------------- +public: + virtual void invalidateComposite(LLTexLayerSet* layerset) = 0; + /******************************************************************************** ** ** ** MESHES @@ -257,6 +263,7 @@ public: //-------------------------------------------------------------------- public: LLColor4 getGlobalColor(const std::string& color_name ) const; + virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0; protected: LLTexGlobalColor* mTexSkinColor; LLTexGlobalColor* mTexHairColor; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 0e77b29cce..432e2e9f49 100755 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -103,6 +103,11 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) return new_param; } +void LLTexParamGlobalColor::onGlobalColorChanged() +{ + mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor); +} + //----------------------------------------------------------------------------- // LLTexGlobalColorInfo //----------------------------------------------------------------------------- diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 02ba14a959..1b0c91b5ca 100755 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -74,6 +74,8 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; +protected: + /*virtual*/ void onGlobalColorChanged(); private: LLTexGlobalColor* mTexGlobalColor; }; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 36147f01e0..9608e2d391 100755 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -178,6 +178,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight) if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); mTexLayer->invalidateMorphMasks(); } } @@ -464,6 +465,24 @@ void LLTexLayerParamColor::setWeight(F32 weight) if (cur_u8 != new_u8) { mCurWeight = new_weight; + + const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); + + if (info->mNumColors <= 0) + { + // This will happen when we set the default weight the first time. + return; + } + + if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. + { + onGlobalColorChanged(); + if (mTexLayer) + { + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); + } + } + // llinfos << "param " << mName << " = " << new_weight << llendl; } } |