diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-03-29 12:00:26 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-03-29 12:00:26 -0400 |
commit | 94e6e10739c8321b6fb651a109901380ef92975a (patch) | |
tree | 629fec2892c2bb0bce4f35f42ef4cad54408f174 /indra/newview/llmorphview.cpp | |
parent | 46fe5d49caef6c8db3df9d88f0d0ec773ef28095 (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/llmorphview.cpp')
-rw-r--r-- | indra/newview/llmorphview.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index cb48db15e4..6334d54e33 100644 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -89,15 +89,14 @@ void LLMorphView::initialize() mCameraYaw = 0.f; mCameraDist = -1.f; - LLVOAvatarSelf *avatarp = gAgent.getAvatarObject(); - if (!avatarp || avatarp->isDead()) + if (!isAgentAvatarValid() || gAgentAvatar->isDead()) { gAgentCamera.changeCameraToDefault(); return; } - avatarp->stopMotion( ANIM_AGENT_BODY_NOISE ); - avatarp->mSpecialRenderMode = 3; + gAgentAvatar->stopMotion( ANIM_AGENT_BODY_NOISE ); + gAgentAvatar->mSpecialRenderMode = 3; // set up camera for close look at avatar mOldCameraNearClip = LLViewerCamera::getInstance()->getNear(); @@ -111,11 +110,10 @@ void LLMorphView::shutdown() { LLVOAvatarSelf::onCustomizeEnd(); - LLVOAvatarSelf *avatarp = gAgent.getAvatarObject(); - if (avatarp && !avatarp->isDead()) + if (isAgentAvatarValid()) { - avatarp->startMotion( ANIM_AGENT_BODY_NOISE ); - avatarp->mSpecialRenderMode = 0; + gAgentAvatar->startMotion( ANIM_AGENT_BODY_NOISE ); + gAgentAvatar->mSpecialRenderMode = 0; // reset camera LLViewerCamera::getInstance()->setNear(mOldCameraNearClip); } @@ -164,15 +162,11 @@ void LLMorphView::updateCamera() { if (!mCameraTargetJoint) { - setCameraTargetJoint(gAgent.getAvatarObject()->getJoint("mHead")); - } - - LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); - if (!avatarp) - { - return; - } - LLJoint* root_joint = avatarp->getRootJoint(); + setCameraTargetJoint(gAgentAvatar->getJoint("mHead")); + } + if (!isAgentAvatarValid()) return; + + LLJoint* root_joint = gAgentAvatar->getRootJoint(); if( !root_joint ) { return; |