summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewanim.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-03-26 14:33:48 -0400
committerLoren Shih <seraph@lindenlab.com>2010-03-26 14:33:48 -0400
commit46fe5d49caef6c8db3df9d88f0d0ec773ef28095 (patch)
tree87f8ae2f01d871b23b9d1c1ef9f9ce736dbc8c98 /indra/newview/llpreviewanim.cpp
parent0bcfbde3a4265d7963ea501622e512de8eab7f61 (diff)
EXT-6536 : Make LLVOAvatarSelf a singleton
Superficial cleanup so that all instances of gAgent.getAvatarObject() use "LLVOAvatarSelf *avatarp = gAgent.getAvatarObject".
Diffstat (limited to 'indra/newview/llpreviewanim.cpp')
-rw-r--r--indra/newview/llpreviewanim.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp
index 0cc747f789..49b297f702 100644
--- a/indra/newview/llpreviewanim.cpp
+++ b/indra/newview/llpreviewanim.cpp
@@ -110,6 +110,7 @@ void LLPreviewAnim::playAnim( void *userdata )
{
LLPreviewAnim* self = (LLPreviewAnim*) userdata;
const LLInventoryItem *item = self->getItem();
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
if(item)
{
@@ -125,10 +126,7 @@ void LLPreviewAnim::playAnim( void *userdata )
{
self->mPauseRequest = NULL;
gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_START);
-
- LLVOAvatar* avatar = gAgent.getAvatarObject();
- LLMotion* motion = avatar->findMotion(itemID);
-
+ LLMotion* motion = avatarp->findMotion(itemID);
if (motion)
{
motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLHandle<LLFloater>(self->getHandle())));
@@ -136,7 +134,7 @@ void LLPreviewAnim::playAnim( void *userdata )
}
else
{
- gAgent.getAvatarObject()->stopMotion(itemID);
+ avatarp->stopMotion(itemID);
gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_STOP);
}
}
@@ -161,10 +159,9 @@ void LLPreviewAnim::auditionAnim( void *userdata )
if (self->childGetValue("Anim audition btn").asBoolean() )
{
self->mPauseRequest = NULL;
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
gAgent.getAvatarObject()->startMotion(item->getAssetUUID());
-
- LLVOAvatar* avatar = gAgent.getAvatarObject();
- LLMotion* motion = avatar->findMotion(itemID);
+ LLMotion* motion = avatarp->findMotion(itemID);
if (motion)
{
@@ -189,8 +186,8 @@ void LLPreviewAnim::onClose(bool app_quitting)
gAgent.getAvatarObject()->stopMotion(item->getAssetUUID());
gAgent.sendAnimationRequest(item->getAssetUUID(), ANIM_REQUEST_STOP);
- LLVOAvatar* avatar = gAgent.getAvatarObject();
- LLMotion* motion = avatar->findMotion(item->getAssetUUID());
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ LLMotion* motion = avatarp->findMotion(item->getAssetUUID());
if (motion)
{