summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNeal Orman <nyx@lindenlab.com>2009-10-23 22:19:15 +0000
committerNeal Orman <nyx@lindenlab.com>2009-10-23 22:19:15 +0000
commit576b8fe6ec9aa4ad712de757341862c89ff7df36 (patch)
treea1651292323b876c0ae85f4b1c857a3f0092c0fc /indra
parenta5453d45feaceb713c7cece76d88c2d2b8f825c6 (diff)
EXT-1809 Wearing an item doesn't update avatar
Two part fix: prevented the copying of wearable parameters to the avatar to trigger a rebake. Then: Called wearableUpdated every time a wearable was added/removed/replaced and ensured it properly invalidated the composite Confirmed working fix on developer machine. Code reviewed by Seraph.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llagentwearables.cpp6
-rw-r--r--indra/newview/llagentwearables.h1
-rw-r--r--indra/newview/lltexlayerparams.cpp17
-rw-r--r--indra/newview/lltexlayerparams.h1
-rw-r--r--indra/newview/llvoavatarself.cpp3
5 files changed, 18 insertions, 10 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index b976e6b2bd..b9a0b4293d 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -649,6 +649,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab
else
{
wearable_vec[index] = wearable;
+ mAvatarObject->wearableUpdated(wearable->getType());
}
}
@@ -663,6 +664,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE)
{
mWearableDatas[type].push_back(wearable);
+ mAvatarObject->wearableUpdated(wearable->getType());
return mWearableDatas[type].size()-1;
}
return MAX_WEARABLES_PER_TYPE;
@@ -687,9 +689,11 @@ void LLAgentWearables::popWearable(LLWearable *wearable)
void LLAgentWearables::popWearable(const EWearableType type, U32 index)
{
- if (getWearable(type, index))
+ LLWearable *wearable = getWearable(type, index);
+ if (wearable)
{
mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
+ mAvatarObject->wearableUpdated(wearable->getType());
}
}
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index 8e1bef88c3..667cb94552 100644
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -114,6 +114,7 @@ public:
void setWearableName(const LLUUID& item_id, const std::string& new_name);
void addLocalTextureObject(const EWearableType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index);
U32 getWearableIndex(LLWearable *wearable);
+
protected:
void setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append = false);
static bool onSetWearableDialog(const LLSD& notification, const LLSD& response, LLWearable* wearable);
diff --git a/indra/newview/lltexlayerparams.cpp b/indra/newview/lltexlayerparams.cpp
index ca888899ed..e1643af71d 100644
--- a/indra/newview/lltexlayerparams.cpp
+++ b/indra/newview/lltexlayerparams.cpp
@@ -42,7 +42,8 @@
//-----------------------------------------------------------------------------
LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
mTexLayer(layer),
- mAvatar(NULL)
+ mAvatar(NULL),
+ mIsWearableParam(TRUE)
{
if (mTexLayer != NULL)
{
@@ -55,7 +56,8 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
}
LLTexLayerParam::LLTexLayerParam(LLVOAvatar *avatar) :
- mTexLayer(NULL)
+ mTexLayer(NULL),
+ mIsWearableParam(FALSE)
{
mAvatar = avatar;
}
@@ -175,16 +177,15 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL set_by_user)
{
mCurWeight = new_weight;
- LLVOAvatar* avatar = mTexLayer->getTexLayerSet()->getAvatar();
- if (avatar->getSex() & getSex())
+ if ((mAvatar->getSex() & getSex()) && !mIsWearableParam) // only trigger a baked texture update if we're changing a wearable's visual param.
{
if (gAgent.cameraCustomizeAvatar())
{
set_by_user = FALSE;
}
- avatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user);
+ mAvatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user);
mTexLayer->invalidateMorphMasks();
- avatar->updateMeshTextures();
+ mAvatar->updateMeshTextures();
}
}
}
@@ -467,14 +468,16 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL set_by_user)
return;
}
- if (mAvatar->getSex() & getSex())
+ if ((mAvatar->getSex() & getSex()) && !mIsWearableParam) // only trigger a baked texture update if we're changing a wearable's visual param.
{
onGlobalColorChanged(set_by_user);
if (mTexLayer)
{
mAvatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user);
+ mAvatar->updateMeshTextures();
}
}
+
// llinfos << "param " << mName << " = " << new_weight << llendl;
}
}
diff --git a/indra/newview/lltexlayerparams.h b/indra/newview/lltexlayerparams.h
index 98365864f9..dcb108bbf6 100644
--- a/indra/newview/lltexlayerparams.h
+++ b/indra/newview/lltexlayerparams.h
@@ -49,6 +49,7 @@ public:
protected:
LLTexLayerInterface* mTexLayer;
LLVOAvatar* mAvatar;
+ BOOL mIsWearableParam;
};
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index d05e55a501..964b16df04 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -962,8 +962,7 @@ void LLVOAvatarSelf::wearableUpdated( EWearableType type )
{
if (mBakedTextureDatas[index].mTexLayerSet)
{
- mBakedTextureDatas[index].mTexLayerSet->requestUpdate();
- mBakedTextureDatas[index].mTexLayerSet->requestUpload();
+ invalidateComposite(mBakedTextureDatas[index].mTexLayerSet, TRUE);
}
break;
}