diff options
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 964b16df04..758db538a2 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -30,6 +30,12 @@ * $/LicenseInfo$ */ +#if LL_MSVC +// disable warning about boost::lexical_cast returning uninitialized data +// when it fails to parse the string +#pragma warning (disable:4701) +#endif + #include "llviewerprecompiledheaders.h" #include "llvoavatarself.h" @@ -84,7 +90,12 @@ #include "llvoicevisualizer.h" // Ventrella #include "llappearancemgr.h" -#include "boost/lexical_cast.hpp" +#if LL_MSVC +// disable boost::lexical_cast warning +#pragma warning (disable:4702) +#endif + +#include <boost/lexical_cast.hpp> using namespace LLVOAvatarDefines; @@ -182,6 +193,25 @@ void LLVOAvatarSelf::markDead() LLVOAvatar::markDead(); } +/*virtual*/ BOOL LLVOAvatarSelf::loadAvatar() +{ + BOOL success = LLVOAvatar::loadAvatar(); + + // set all parameters sotred directly in the avatar to have + // the isSelfParam to be TRUE - this is used to prevent + // them from being animated or trigger accidental rebakes + // when we copy params from the wearable to the base avatar. + for (LLViewerVisualParam* param = (LLViewerVisualParam*) getFirstVisualParam(); + param; + param = (LLViewerVisualParam*) getNextVisualParam()) + { + param->setIsDummy(TRUE); + } + + return success; +} + + BOOL LLVOAvatarSelf::loadAvatarSelf() { BOOL success = TRUE; @@ -693,16 +723,23 @@ void LLVOAvatarSelf::updateVisualParams() } } - LLWearable *shape = gAgentWearables.getWearable(WT_SHAPE,0); - if (shape) - { - F32 gender = shape->getVisualParamWeight(80); // param 80 == gender - setVisualParamWeight("male",gender ,TRUE); - } - LLVOAvatar::updateVisualParams(); } +/*virtual*/ +void LLVOAvatarSelf::idleUpdateAppearanceAnimation() +{ + // Animate all top-level wearable visual parameters + gAgentWearables.animateAllWearableParams(calcMorphAmount(), mAppearanceAnimSetByUser); + + // apply wearable visual params to avatar + updateVisualParams(); + + //allow avatar to process updates + LLVOAvatar::idleUpdateAppearanceAnimation(); + +} + // virtual void LLVOAvatarSelf::requestStopMotion(LLMotion* motion) { |