From 76c8494525b8e2b17bbe61f0bde61645b825bb66 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Sat, 29 Jan 2011 15:50:28 +0100 Subject: Update: Henri Beauchamp: Port of SG-2.0 alpha and tattoo layers v6->v9 issue tattoo tinting does not work --- linden/indra/llcharacter/llcharacter.cpp | 4 ++-- linden/indra/llcharacter/llcharacter.h | 14 ++++++++++++++ linden/indra/llcharacter/llvisualparam.cpp | 4 ++-- linden/indra/llcharacter/llvisualparam.h | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'linden/indra/llcharacter') diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp index 46ac326..72cef83 100644 --- a/linden/indra/llcharacter/llcharacter.cpp +++ b/linden/indra/llcharacter/llcharacter.cpp @@ -379,7 +379,7 @@ void LLCharacter::clearVisualParamWeights() param; param = getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (param->isTweakable()) { param->setWeight( param->getDefaultWeight(), FALSE ); } @@ -395,7 +395,7 @@ BOOL LLCharacter::visualParamWeightsAreDefault() param; param = getNextVisualParam()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (param->isTweakable()) { if (param->getWeight() != param->getDefaultWeight()) return false; diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h index d91124b..7630760 100644 --- a/linden/indra/llcharacter/llcharacter.h +++ b/linden/indra/llcharacter/llcharacter.h @@ -231,6 +231,20 @@ public: return (mCurIterator++)->second; } + S32 getVisualParamCountInGroup(EVisualParamGroup group) + { + S32 rtn = 0; + VisualParamIndexMap_t::iterator iter; + for (iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++) + { + if (iter->second->getGroup() == group) + { + rtn++; + } + } + return rtn; + } + LLVisualParam* getVisualParam(S32 id) { VisualParamIndexMap_t::iterator iter = mVisualParamIndexMap.find(id); diff --git a/linden/indra/llcharacter/llvisualparam.cpp b/linden/indra/llcharacter/llvisualparam.cpp index d7a144e..9579ff8 100644 --- a/linden/indra/llcharacter/llvisualparam.cpp +++ b/linden/indra/llcharacter/llvisualparam.cpp @@ -238,7 +238,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value, BOOL set_by_user) { if (mInfo) { - if (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (isTweakable()) { mTargetWeight = llclamp(target_value, mInfo->mMinWeight, mInfo->mMaxWeight); } @@ -282,7 +282,7 @@ void LLVisualParam::animate( F32 delta, BOOL set_by_user ) //----------------------------------------------------------------------------- void LLVisualParam::stopAnimating(BOOL set_by_user) { - if (mIsAnimating && getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + if (mIsAnimating && isTweakable()) { mIsAnimating = FALSE; setWeight(mTargetWeight, set_by_user); diff --git a/linden/indra/llcharacter/llvisualparam.h b/linden/indra/llcharacter/llvisualparam.h index 3a0c1bb..8ec5497 100644 --- a/linden/indra/llcharacter/llvisualparam.h +++ b/linden/indra/llcharacter/llvisualparam.h @@ -51,6 +51,7 @@ enum EVisualParamGroup { VISUAL_PARAM_GROUP_TWEAKABLE, VISUAL_PARAM_GROUP_ANIMATABLE, + VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT, NUM_VISUAL_PARAM_GROUPS }; @@ -140,6 +141,7 @@ public: virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating; } BOOL getAnimating() { return mIsAnimating; } + BOOL isTweakable() { return (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) || (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT); } protected: F32 mCurWeight; // current weight -- cgit v1.1