summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-03-25 17:27:50 -0400
committerLoren Shih <seraph@lindenlab.com>2010-03-25 17:27:50 -0400
commit853d9e44534f568d4a17033c7b8ecbafddf7bd69 (patch)
treef74a2a4ac2cb05c975f34244e13848ed82833137
parent504cf0870d964de5b286621a44098af6afdf13cd (diff)
EXT-6539 : Take out mAvatarObject from LLAgentWearables
Removed mAvatarObject / gAgentWearables.mAvatarObject since it's redundant with gAgent.mAvatarObject.
-rw-r--r--indra/newview/llagent.cpp3
-rw-r--r--indra/newview/llagentcamera.cpp2
-rw-r--r--indra/newview/llagentcamera.h2
-rw-r--r--indra/newview/llagentwearables.cpp48
-rw-r--r--indra/newview/llagentwearables.h1
5 files changed, 31 insertions, 25 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 68b5a3401e..da16136652 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -1645,7 +1645,8 @@ void LLAgent::setAvatarObject(LLVOAvatarSelf *avatar)
return;
}
- gAgentCamera.setCameraAvatarObject(avatar);
+ gAgentCamera.setAvatarObject(avatar);
+ gAgentWearables.setAvatarObject(avatar);
}
// TRUE if your own avatar needs to be rendered. Usually only
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 07757c2025..e000d44ab8 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -256,7 +256,7 @@ void LLAgentCamera::cleanup()
setFocusObject(NULL);
}
-void LLAgentCamera::setCameraAvatarObject(LLVOAvatarSelf* avatar)
+void LLAgentCamera::setAvatarObject(LLVOAvatarSelf* avatar)
{
if (!mLookAt)
{
diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h
index f45cf1f5bb..6fe645e7d1 100644
--- a/indra/newview/llagentcamera.h
+++ b/indra/newview/llagentcamera.h
@@ -102,7 +102,7 @@ public:
virtual ~LLAgentCamera();
void init();
void cleanup();
- void setCameraAvatarObject(LLVOAvatarSelf* avatar);
+ void setAvatarObject(LLVOAvatarSelf* avatar);
private:
BOOL mInitialized;
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index bcb62e1b6f..c4e3b976a8 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -219,8 +219,7 @@ struct LLAgentDumper
};
LLAgentWearables::LLAgentWearables() :
- mWearablesLoaded(FALSE),
- mAvatarObject(NULL)
+ mWearablesLoaded(FALSE)
{
}
@@ -231,12 +230,10 @@ LLAgentWearables::~LLAgentWearables()
void LLAgentWearables::cleanup()
{
- mAvatarObject = NULL;
}
void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar)
{
- mAvatarObject = avatar;
if (avatar)
{
sendAgentWearablesRequest();
@@ -776,7 +773,8 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
void LLAgentWearables::wearableUpdated(LLWearable *wearable)
{
- mAvatarObject->wearableUpdated(wearable->getType(), TRUE);
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ avatarp->wearableUpdated(wearable->getType(), TRUE);
wearable->refreshName();
wearable->setLabelUpdated();
@@ -817,10 +815,11 @@ void LLAgentWearables::popWearable(LLWearable *wearable)
void LLAgentWearables::popWearable(const EWearableType type, U32 index)
{
LLWearable *wearable = getWearable(type, index);
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
if (wearable)
{
mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
- mAvatarObject->wearableUpdated(wearable->getType(), TRUE);
+ avatarp->wearableUpdated(wearable->getType(), TRUE);
wearable->setLabelUpdated();
}
}
@@ -1230,12 +1229,13 @@ void LLAgentWearables::createStandardWearables(BOOL female)
llwarns << "Creating Standard " << (female ? "female" : "male")
<< " Wearables" << llendl;
- if (mAvatarObject.isNull())
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ if (!avatarp)
{
return;
}
- mAvatarObject->setSex(female ? SEX_FEMALE : SEX_MALE);
+ avatarp->setSex(female ? SEX_FEMALE : SEX_MALE);
const BOOL create[WT_COUNT] =
{
@@ -1282,9 +1282,11 @@ void LLAgentWearables::createStandardWearables(BOOL female)
void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index)
{
llinfos << "type " << type << " index " << index << llendl;
- if (mAvatarObject)
+
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ if (avatarp)
{
- mAvatarObject->updateVisualParams();
+ avatarp->updateVisualParams();
}
}
@@ -1300,7 +1302,8 @@ void LLAgentWearables::createStandardWearablesAllDone()
updateServer();
// Treat this as the first texture entry message, if none received yet
- mAvatarObject->onFirstTEMessageReceived();
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ avatarp->onFirstTEMessageReceived();
}
// MULTI-WEARABLE: Properly handle multiwearables later.
@@ -1322,7 +1325,8 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name,
const LLDynamicArray<S32>& attachments_to_include,
BOOL rename_clothing)
{
- if (mAvatarObject.isNull())
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ if (!avatarp)
{
return;
}
@@ -1423,7 +1427,7 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name,
for (S32 i = 0; i < attachments_to_include.count(); i++)
{
S32 attachment_pt = attachments_to_include[i];
- LLViewerJointAttachment* attachment = get_if_there(mAvatarObject->mAttachmentPoints, attachment_pt, (LLViewerJointAttachment*)NULL);
+ LLViewerJointAttachment* attachment = get_if_there(avatarp->mAttachmentPoints, attachment_pt, (LLViewerJointAttachment*)NULL);
if (!attachment) continue;
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
@@ -1498,7 +1502,8 @@ private:
LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name)
{
- if (mAvatarObject.isNull())
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
+ if (!avatarp)
{
return LLUUID::null;
}
@@ -1665,6 +1670,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
BOOL remove)
{
llinfos << "setWearableOutfit() start" << llendl;
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
BOOL wearables_to_remove[WT_COUNT];
wearables_to_remove[WT_SHAPE] = FALSE;
@@ -1758,11 +1764,11 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
}
}
- if (mAvatarObject)
+ if (avatarp)
{
- mAvatarObject->setCompositeUpdatesEnabled(TRUE);
- mAvatarObject->updateVisualParams();
- mAvatarObject->invalidateAll();
+ avatarp->setCompositeUpdatesEnabled(TRUE);
+ avatarp->updateVisualParams();
+ avatarp->invalidateAll();
}
// Start rendering & update the server
@@ -2012,7 +2018,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
// already wearing and in request set -> leave alone.
// not wearing and in request set -> put on.
- LLVOAvatar* avatarp = gAgent.getAvatarObject();
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
if (!avatarp)
{
llwarns << "No avatar found." << llendl;
@@ -2083,7 +2089,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remove)
{
- LLVOAvatar* avatarp = gAgent.getAvatarObject();
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
if (!avatarp)
{
llwarns << "No avatar found." << llendl;
@@ -2111,7 +2117,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo
void LLAgentWearables::userRemoveAllAttachments()
{
- LLVOAvatar* avatarp = gAgent.getAvatarObject();
+ LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
if (!avatarp)
{
llwarns << "No avatar found." << llendl;
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index a6b73997a6..652ffd4587 100644
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -218,7 +218,6 @@ private:
static BOOL mInitialWearablesUpdateReceived;
BOOL mWearablesLoaded;
std::set<LLUUID> mItemsAwaitingWearableUpdate;
- LLPointer<LLVOAvatarSelf> mAvatarObject; // NULL until avatar object sent down from simulator
//--------------------------------------------------------------------------------
// Support classes