summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmorph.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-03-29 12:00:26 -0400
committerLoren Shih <seraph@lindenlab.com>2010-03-29 12:00:26 -0400
commit94e6e10739c8321b6fb651a109901380ef92975a (patch)
tree629fec2892c2bb0bce4f35f42ef4cad54408f174 /indra/newview/lltoolmorph.cpp
parent46fe5d49caef6c8db3df9d88f0d0ec773ef28095 (diff)
EXT-6536 : Make LLVOAvatarSelf a singleton
Superficial cleanup to replace all instances of "LLVOAvatarSelf *avatarp = gAgent.getAvatarObject" with "gAgentAvatar".
Diffstat (limited to 'indra/newview/lltoolmorph.cpp')
-rw-r--r--indra/newview/lltoolmorph.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index c42c47c486..67d696d7d7 100644
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -139,22 +139,20 @@ void LLVisualParamHint::requestHintUpdates( LLVisualParamHint* exception1, LLVis
BOOL LLVisualParamHint::needsRender()
{
- return mNeedsUpdate && mDelayFrames-- <= 0 && !gAgent.getAvatarObject()->mAppearanceAnimating && mAllowsUpdates;
+ return mNeedsUpdate && mDelayFrames-- <= 0 && !gAgentAvatar->mAppearanceAnimating && mAllowsUpdates;
}
void LLVisualParamHint::preRender(BOOL clear_depth)
{
- LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
-
mLastParamWeight = mVisualParam->getWeight();
mVisualParam->setWeight(mVisualParamWeight, FALSE);
- avatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE);
- avatarp->setVisualParamWeight("Blink_Left", 0.f);
- avatarp->setVisualParamWeight("Blink_Right", 0.f);
- avatarp->updateComposites();
- avatarp->updateVisualParams();
- avatarp->updateGeometry(avatarp->mDrawable);
- avatarp->updateLOD();
+ gAgentAvatar->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE);
+ gAgentAvatar->setVisualParamWeight("Blink_Left", 0.f);
+ gAgentAvatar->setVisualParamWeight("Blink_Right", 0.f);
+ gAgentAvatar->updateComposites();
+ gAgentAvatar->updateVisualParams();
+ gAgentAvatar->updateGeometry(gAgentAvatar->mDrawable);
+ gAgentAvatar->updateLOD();
LLViewerDynamicTexture::preRender(clear_depth);
}
@@ -165,7 +163,6 @@ void LLVisualParamHint::preRender(BOOL clear_depth)
BOOL LLVisualParamHint::render()
{
LLVisualParamReset::sDirty = TRUE;
- LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
gGL.pushUIMatrix();
gGL.loadUIIdentity();
@@ -196,7 +193,7 @@ BOOL LLVisualParamHint::render()
const std::string& cam_target_mesh_name = mVisualParam->getCameraTargetName();
if( !cam_target_mesh_name.empty() )
{
- cam_target_joint = (LLViewerJointMesh*)avatarp->getJoint( cam_target_mesh_name );
+ cam_target_joint = (LLViewerJointMesh*)gAgentAvatar->getJoint( cam_target_mesh_name );
}
if( !cam_target_joint )
{
@@ -204,11 +201,11 @@ BOOL LLVisualParamHint::render()
}
if( !cam_target_joint )
{
- cam_target_joint = (LLViewerJointMesh*)avatarp->getJoint("mHead");
+ cam_target_joint = (LLViewerJointMesh*)gAgentAvatar->getJoint("mHead");
}
LLQuaternion avatar_rotation;
- LLJoint* root_joint = avatarp->getRootJoint();
+ LLJoint* root_joint = gAgentAvatar->getRootJoint();
if( root_joint )
{
avatar_rotation = root_joint->getWorldRotation();
@@ -236,17 +233,17 @@ BOOL LLVisualParamHint::render()
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
- if (avatarp->mDrawable.notNull())
+ if (gAgentAvatar->mDrawable.notNull())
{
- LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
+ LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)gAgentAvatar->mDrawable->getFace(0)->getPool();
LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
gGL.setAlphaRejectSettings(LLRender::CF_ALWAYS);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
- avatarPoolp->renderAvatars(avatarp); // renders only one avatar
+ avatarPoolp->renderAvatars(gAgentAvatar); // renders only one avatar
gGL.setSceneBlendType(LLRender::BT_ALPHA);
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
}
- avatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight);
+ gAgentAvatar->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight);
mVisualParam->setWeight(mLastParamWeight, FALSE);
gGL.color4f(1,1,1,1);
mGLTexturep->setGLTextureCreated(true);
@@ -297,10 +294,9 @@ BOOL LLVisualParamReset::render()
{
if (sDirty)
{
- LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
- avatarp->updateComposites();
- avatarp->updateVisualParams();
- avatarp->updateGeometry(avatarp->mDrawable);
+ gAgentAvatar->updateComposites();
+ gAgentAvatar->updateVisualParams();
+ gAgentAvatar->updateGeometry(gAgentAvatar->mDrawable);
sDirty = FALSE;
}