summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-09-06 03:04:10 +0000
committerDon Kjer <don@lindenlab.com>2012-09-06 03:04:10 +0000
commit2e933100bb6bf27c0307dc6831142dcc0860fb7b (patch)
tree27de2cf2d447b693ae2b20560d1432ca8324defd
parent85d0bcc0630bfbf8b50be3a47a113c4f8d6ec9df (diff)
parentb146490e1b46799ccb35e156b4751eddea3a23ce (diff)
Merge
-rw-r--r--indra/llappearance/llavatarappearance.cpp38
-rw-r--r--indra/llappearance/llavatarappearance.h41
-rwxr-xr-xindra/newview/llvoavatar.cpp139
-rwxr-xr-xindra/newview/llvoavatar.h38
-rwxr-xr-xindra/newview/llvoavatarself.cpp57
-rwxr-xr-xindra/newview/llvoavatarself.h2
6 files changed, 192 insertions, 123 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 0f0942d8dc..2c03f8ba02 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -26,7 +26,10 @@
#include "linden_common.h"
+
#include "llavatarappearance.h"
+#include "llavatarappearancedefines.h"
+#include "imageids.h"
#include "lldeleteutils.h"
#include "lltexglobalcolor.h"
#include "llwearabledata.h"
@@ -42,6 +45,16 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
mWearableData(wearable_data)
{
llassert(mWearableData);
+ mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
+ for (U32 i = 0; i < mBakedTextureDatas.size(); i++ )
+ {
+ mBakedTextureDatas[i].mLastTextureIndex = IMG_DEFAULT_AVATAR;
+ mBakedTextureDatas[i].mTexLayerSet = NULL;
+ mBakedTextureDatas[i].mIsLoaded = false;
+ mBakedTextureDatas[i].mIsUsed = false;
+ mBakedTextureDatas[i].mMaskTexName = 0;
+ mBakedTextureDatas[i].mTextureIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((LLAvatarAppearanceDefines::EBakedTextureIndex)i);
+ }
}
// virtual
@@ -50,6 +63,19 @@ LLAvatarAppearance::~LLAvatarAppearance()
deleteAndClear(mTexSkinColor);
deleteAndClear(mTexHairColor);
deleteAndClear(mTexEyeColor);
+
+ for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
+ {
+ deleteAndClear(mBakedTextureDatas[i].mTexLayerSet);
+ mBakedTextureDatas[i].mMeshes.clear();
+
+ for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
+ iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); iter2++)
+ {
+ LLMaskedMorph* masked_morph = (*iter2);
+ delete masked_morph;
+ }
+ }
}
using namespace LLAvatarAppearanceDefines;
@@ -65,6 +91,18 @@ BOOL LLAvatarAppearance::isValid() const
return TRUE;
}
+
+// adds a morph mask to the appropriate baked texture structure
+void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer)
+{
+ if (index < BAKED_NUM_INDICES)
+ {
+ LLMaskedMorph *morph = new LLMaskedMorph(morph_target, invert, layer);
+ mBakedTextureDatas[index].mMaskedMorphs.push_front(morph);
+ }
+}
+
+
//static
BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
{
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index 2209ede927..b2ab6b069f 100644
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -30,6 +30,7 @@
#include "llcharacter.h"
//#include "llframetimer.h"
#include "llavatarappearancedefines.h"
+#include "lljoint.h"
class LLTexLayerSet;
class LLTexGlobalColor;
@@ -84,6 +85,7 @@ public:
// Morph masks
//--------------------------------------------------------------------
public:
+ void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer);
virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0;
/** Rendering
@@ -157,6 +159,45 @@ public:
private:
LLWearableData* mWearableData;
+
+/********************************************************************************
+ ** **
+ ** BAKED TEXTURES
+ **/
+protected:
+ struct LLMaskedMorph;
+ typedef std::deque<LLMaskedMorph *> morph_list_t;
+ struct BakedTextureData
+ {
+ LLUUID mLastTextureIndex;
+ LLTexLayerSet* mTexLayerSet; // Only exists for self
+ bool mIsLoaded;
+ bool mIsUsed;
+ LLAvatarAppearanceDefines::ETextureIndex mTextureIndex;
+ U32 mMaskTexName;
+ // Stores pointers to the joint meshes that this baked texture deals with
+ std::vector< LLJoint* > mMeshes; // std::vector<LLViewerJointMesh> mJoints[i]->mMeshParts
+ morph_list_t mMaskedMorphs;
+ };
+ typedef std::vector<BakedTextureData> bakedtexturedata_vec_t;
+ bakedtexturedata_vec_t mBakedTextureDatas;
+
+
+/********************************************************************************
+ ** **
+ ** SUPPORT CLASSES
+ **/
+
+ class LLMaskedMorph
+ {
+ public:
+ LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer);
+
+ LLVisualParam *mMorphTarget;
+ BOOL mInvert;
+ std::string mLayer;
+ };
+
};
#endif // LL_AVATAR_APPEARANCE_H
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 2309ea3488..f6cac6d2d6 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -703,17 +703,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mPelvisp = NULL;
- mBakedTextureDatas.resize(BAKED_NUM_INDICES);
- for (U32 i = 0; i < mBakedTextureDatas.size(); i++ )
- {
- mBakedTextureDatas[i].mLastTextureIndex = IMG_DEFAULT_AVATAR;
- mBakedTextureDatas[i].mTexLayerSet = NULL;
- mBakedTextureDatas[i].mIsLoaded = false;
- mBakedTextureDatas[i].mIsUsed = false;
- mBakedTextureDatas[i].mMaskTexName = 0;
- mBakedTextureDatas[i].mTextureIndex = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)i);
- }
-
mDirtyMesh = 2; // Dirty geometry, need to regenerate.
mMeshTexturesDirty = FALSE;
mHeadp = NULL;
@@ -821,19 +810,6 @@ LLVOAvatar::~LLVOAvatar()
mNumJoints = 0;
- for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
- {
- deleteAndClear(mBakedTextureDatas[i].mTexLayerSet);
- mBakedTextureDatas[i].mMeshes.clear();
-
- for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
- iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); iter2++)
- {
- LLMaskedMorph* masked_morph = (*iter2);
- delete masked_morph;
- }
- }
-
std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer());
mAttachmentPoints.clear();
@@ -1102,7 +1078,7 @@ void LLVOAvatar::restoreGL()
gAgentAvatarp->setCompositeUpdatesEnabled(TRUE);
for (U32 i = 0; i < gAgentAvatarp->mBakedTextureDatas.size(); i++)
{
- gAgentAvatarp->invalidateComposite(gAgentAvatarp->mBakedTextureDatas[i].mTexLayerSet, FALSE);
+ gAgentAvatarp->invalidateComposite(gAgentAvatarp->getTexLayerSet(i), FALSE);
}
gAgentAvatarp->updateMeshTextures();
}
@@ -5518,9 +5494,9 @@ BOOL LLVOAvatar::loadAvatar()
EBakedTextureIndex baked = LLAvatarAppearanceDictionary::findBakedByRegionName(info->mRegion);
if (baked != BAKED_NUM_INDICES)
{
- LLPolyMorphTarget *morph_param;
+ LLVisualParam* morph_param;
const std::string *name = &info->mName;
- morph_param = (LLPolyMorphTarget *)(getVisualParam(name->c_str()));
+ morph_param = getVisualParam(name->c_str());
if (morph_param)
{
BOOL invert = info->mInvert;
@@ -6480,7 +6456,11 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
LLColor4 color = mTexHairColor->getColor();
for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++)
{
- mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] );
+ LLViewerJointMesh* mesh = dynamic_cast<LLViewerJointMesh*>(mBakedTextureDatas[BAKED_HAIR].mMeshes[i]);
+ if (mesh)
+ {
+ mesh->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] );
+ }
}
}
}
@@ -6697,15 +6677,16 @@ void LLVOAvatar::updateMeshTextures()
// When an avatar is changing clothes and not in Appearance mode,
// use the last-known good baked texture until it finish the first
// render of the new layerset.
- const BOOL layerset_invalid = mBakedTextureDatas[i].mTexLayerSet
- && ( !mBakedTextureDatas[i].mTexLayerSet->getViewerComposite()->isInitialized()
- || !mBakedTextureDatas[i].mTexLayerSet->isLocalTextureDataAvailable() );
+ LLViewerTexLayerSet* layerset = getTexLayerSet(i);
+ const BOOL layerset_invalid = layerset
+ && ( !layerset->getViewerComposite()->isInitialized()
+ || !layerset->isLocalTextureDataAvailable() );
use_lkg_baked_layer[i] = (!is_layer_baked[i]
&& (mBakedTextureDatas[i].mLastTextureIndex != IMG_DEFAULT_AVATAR)
&& layerset_invalid);
if (use_lkg_baked_layer[i])
{
- mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(TRUE);
+ layerset->setUpdatesEnabled(TRUE);
}
}
else
@@ -6718,6 +6699,7 @@ void LLVOAvatar::updateMeshTextures()
for (U32 i=0; i < mBakedTextureDatas.size(); i++)
{
+ LLViewerTexLayerSet* layerset = getTexLayerSet(i);
if (use_lkg_baked_layer[i] && !mUseLocalAppearance )
{
LLViewerFetchedTexture* baked_img;
@@ -6741,7 +6723,11 @@ void LLVOAvatar::updateMeshTextures()
mBakedTextureDatas[i].mIsUsed = TRUE;
for (U32 k=0; k < mBakedTextureDatas[i].mMeshes.size(); k++)
{
- mBakedTextureDatas[i].mMeshes[k]->setTexture( baked_img );
+ LLViewerJointMesh* mesh = dynamic_cast<LLViewerJointMesh*>(mBakedTextureDatas[i].mMeshes[k]);
+ if (mesh)
+ {
+ mesh->setTexture( baked_img );
+ }
}
}
else if (!mUseLocalAppearance && is_layer_baked[i])
@@ -6764,14 +6750,18 @@ void LLVOAvatar::updateMeshTextures()
src_callback_list, paused );
}
}
- else if (mBakedTextureDatas[i].mTexLayerSet && mUseLocalAppearance)
+ else if (layerset && mUseLocalAppearance)
{
- mBakedTextureDatas[i].mTexLayerSet->createComposite();
- mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled( TRUE );
+ layerset->createComposite();
+ layerset->setUpdatesEnabled( TRUE );
mBakedTextureDatas[i].mIsUsed = FALSE;
for (U32 k=0; k < mBakedTextureDatas[i].mMeshes.size(); k++)
{
- mBakedTextureDatas[i].mMeshes[k]->setLayerSet( mBakedTextureDatas[i].mTexLayerSet );
+ LLViewerJointMesh* mesh = dynamic_cast<LLViewerJointMesh*>(mBakedTextureDatas[i].mMeshes[k]);
+ if (mesh)
+ {
+ mesh->setLayerSet( layerset );
+ }
}
}
}
@@ -6785,8 +6775,12 @@ void LLVOAvatar::updateMeshTextures()
LLViewerTexture* hair_img = getImage( TEX_HAIR, 0 );
for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++)
{
- mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] );
- mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setTexture( hair_img );
+ LLViewerJointMesh* mesh = dynamic_cast<LLViewerJointMesh*>(mBakedTextureDatas[BAKED_HAIR].mMeshes[i]);
+ if (mesh)
+ {
+ mesh->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] );
+ mesh->setTexture( hair_img );
+ }
}
}
@@ -6859,16 +6853,28 @@ void LLVOAvatar::clearChat()
mChats.clear();
}
-// adds a morph mask to the appropriate baked texture structure
-void LLVOAvatar::addMaskedMorph(EBakedTextureIndex index, LLPolyMorphTarget* morph_target, BOOL invert, std::string layer)
+
+void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index)
{
- if (index < BAKED_NUM_INDICES)
+ if (index >= BAKED_NUM_INDICES)
{
- LLMaskedMorph *morph = new LLMaskedMorph(morph_target, invert, layer);
- mBakedTextureDatas[index].mMaskedMorphs.push_front(morph);
+ llwarns << "invalid baked texture index passed to applyMorphMask" << llendl;
+ return;
+ }
+
+ for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin();
+ iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter)
+ {
+ const LLMaskedMorph* maskedMorph = (*iter);
+ LLPolyMorphTarget* morph_target = dynamic_cast<LLPolyMorphTarget*>(maskedMorph->mMorphTarget);
+ if (morph_target)
+ {
+ morph_target->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert);
+ }
}
}
+
// returns TRUE if morph masks are present and not valid for a given baked texture, FALSE otherwise
BOOL LLVOAvatar::morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index)
{
@@ -6881,7 +6887,7 @@ BOOL LLVOAvatar::morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIn
{
if (isSelf())
{
- LLViewerTexLayerSet *layer_set = mBakedTextureDatas[index].mTexLayerSet;
+ LLViewerTexLayerSet *layer_set = getTexLayerSet(index);
if (layer_set)
{
return !layer_set->isMorphValid();
@@ -6896,23 +6902,6 @@ BOOL LLVOAvatar::morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIn
return FALSE;
}
-void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index)
-{
- if (index >= BAKED_NUM_INDICES)
- {
- llwarns << "invalid baked texture index passed to applyMorphMask" << llendl;
- return;
- }
-
- for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin();
- iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter)
- {
- const LLMaskedMorph* maskedMorph = (*iter);
- maskedMorph->mMorphTarget->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert);
- }
-}
-
-
//-----------------------------------------------------------------------------
// releaseComponentTextures()
// release any component texture UUIDs for which we have a baked texture
@@ -7550,7 +7539,11 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
mBakedTextureDatas[i].mIsUsed = true;
for (U32 k = 0; k < mBakedTextureDatas[i].mMeshes.size(); k++)
{
- mBakedTextureDatas[i].mMeshes[k]->setTexture( image_baked );
+ LLViewerJointMesh* mesh = dynamic_cast<LLViewerJointMesh*>(mBakedTextureDatas[i].mMeshes[k]);
+ if (mesh)
+ {
+ mesh->setTexture( image_baked );
+ }
}
if (mBakedTextureDatas[i].mTexLayerSet)
{
@@ -7571,7 +7564,11 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
{
for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++)
{
- mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f );
+ LLViewerJointMesh* mesh = dynamic_cast<LLViewerJointMesh*>(mBakedTextureDatas[BAKED_HAIR].mMeshes[i]);
+ if (mesh)
+ {
+ mesh->setColor( 1.f, 1.f, 1.f, 1.f );
+ }
}
}
}
@@ -8623,3 +8620,17 @@ BOOL LLVOAvatar::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type,
return FALSE;
}
+//virtual
+LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer) :
+ mMorphTarget(morph_target),
+ mInvert(invert),
+ mLayer(layer)
+{
+ LLPolyMorphTarget *target = dynamic_cast<LLPolyMorphTarget*>(morph_target);
+ if (target)
+ {
+ target->addPendingMorphMask();
+ }
+}
+
+
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 54719d2671..dd8663f4dc 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -48,6 +48,7 @@
#include "llavatarappearancedefines.h"
#include "lltexglobalcolor.h"
#include "lldriverparam.h"
+#include "llviewertexlayer.h"
#include "material_codes.h" // LL_MCODE_END
#include "llviewerstats.h"
@@ -63,7 +64,6 @@ extern const LLUUID ANIM_AGENT_PELVIS_FIX;
extern const LLUUID ANIM_AGENT_TARGET;
extern const LLUUID ANIM_AGENT_WALK_ADJUST;
-class LLViewerTexLayerSet;
class LLViewerWearable;
class LLVoiceVisualizer;
class LLHUDNameTag;
@@ -87,7 +87,6 @@ public:
friend class LLVOAvatarSelf;
protected:
struct LLVOAvatarXmlInfo;
- struct LLMaskedMorph;
/********************************************************************************
** **
@@ -460,9 +459,8 @@ private:
// Morph masks
//--------------------------------------------------------------------
public:
+ /*virtual*/ void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
BOOL morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
- void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLPolyMorphTarget* morph_target, BOOL invert, std::string layer);
- /*virtual*/void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
//--------------------------------------------------------------------
@@ -590,22 +588,9 @@ protected:
static void onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
virtual void removeMissingBakedTextures();
void useBakedTexture(const LLUUID& id);
+ LLViewerTexLayerSet* getTexLayerSet(const U32 index) const { return dynamic_cast<LLViewerTexLayerSet*>(mBakedTextureDatas[index].mTexLayerSet); }
+
- typedef std::deque<LLMaskedMorph *> morph_list_t;
- struct BakedTextureData
- {
- LLUUID mLastTextureIndex;
- LLViewerTexLayerSet* mTexLayerSet; // Only exists for self
- bool mIsLoaded;
- bool mIsUsed;
- LLAvatarAppearanceDefines::ETextureIndex mTextureIndex;
- U32 mMaskTexName;
- // Stores pointers to the joint meshes that this baked texture deals with
- std::vector< LLViewerJointMesh * > mMeshes; // std::vector<LLViewerJointMesh> mJoints[i]->mMeshParts
- morph_list_t mMaskedMorphs;
- };
- typedef std::vector<BakedTextureData> bakedtexturedata_vec_t;
- bakedtexturedata_vec_t mBakedTextureDatas;
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ;
BOOL mLoadedCallbacksPaused;
//--------------------------------------------------------------------
@@ -1125,21 +1110,6 @@ protected: // Shared with LLVOAvatarSelf
morph_info_list_t mMorphMaskInfoList;
};
- struct LLMaskedMorph
- {
- LLMaskedMorph(LLPolyMorphTarget *morph_target, BOOL invert, std::string layer) :
- mMorphTarget(morph_target),
- mInvert(invert),
- mLayer(layer)
- {
- morph_target->addPendingMorphMask();
- }
-
- LLPolyMorphTarget *mMorphTarget;
- BOOL mInvert;
- std::string mLayer;
- };
-
/** Support classes
** **
*******************************************************************************/
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index c1984fa738..fc52347041 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -887,8 +887,9 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
{
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
- mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(TRUE);
- invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, FALSE);
+ LLViewerTexLayerSet *layerset = getTexLayerSet(i);
+ layerset->setUpdatesEnabled(TRUE);
+ invalidateComposite(layerset, FALSE);
}
updateMeshTextures();
if (getRegion() && !getRegion()->getCentralBakeVersion())
@@ -1094,10 +1095,11 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re
const LLWearableType::EType comp_type = *type_iter;
if (comp_type == type)
{
- if (mBakedTextureDatas[index].mTexLayerSet)
+ LLViewerTexLayerSet *layerset = getLayerSet(index);
+ if (layerset)
{
- mBakedTextureDatas[index].mTexLayerSet->setUpdatesEnabled(true);
- invalidateComposite(mBakedTextureDatas[index].mTexLayerSet, upload_result);
+ layerset->setUpdatesEnabled(true);
+ invalidateComposite(layerset, upload_result);
}
break;
}
@@ -1521,7 +1523,7 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const
BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const
{
- const LLViewerTexLayerSet *layerset = mBakedTextureDatas[index].mTexLayerSet;
+ const LLViewerTexLayerSet *layerset = getLayerSet(index);
if (!layerset) return FALSE;
const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite();
if (!layerset_buffer) return FALSE;
@@ -1601,9 +1603,10 @@ void LLVOAvatarSelf::requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedText
{
ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex;
const BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index));
- if (!layer_baked && mBakedTextureDatas[i].mTexLayerSet)
+ LLViewerTexLayerSet *layerset = getLayerSet(i);
+ if (!layer_baked && layerset)
{
- mBakedTextureDatas[i].mTexLayerSet->requestUpload();
+ layerset->requestUpload();
}
}
@@ -1617,7 +1620,7 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const
{
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
- LLViewerTexLayerSet* layerset = mBakedTextureDatas[i].mTexLayerSet;
+ LLViewerTexLayerSet* layerset = getTexLayerSet(i);
if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending())
{
return true;
@@ -1652,7 +1655,8 @@ void LLVOAvatarSelf::invalidateAll()
{
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
- invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, TRUE);
+ LLViewerTexLayerSet *layerset = getTexLayerSet(i);
+ invalidateComposite(layerset, TRUE);
}
//mDebugSelfLoadTimer.reset();
}
@@ -1670,17 +1674,19 @@ void LLVOAvatarSelf::setCompositeUpdatesEnabled( bool b )
void LLVOAvatarSelf::setCompositeUpdatesEnabled(U32 index, bool b)
{
- if (mBakedTextureDatas[index].mTexLayerSet )
+ LLViewerTexLayerSet *layerset = getTexLayerSet(index);
+ if (layerset )
{
- mBakedTextureDatas[index].mTexLayerSet->setUpdatesEnabled( b );
+ layerset->setUpdatesEnabled( b );
}
}
bool LLVOAvatarSelf::isCompositeUpdateEnabled(U32 index)
{
- if (mBakedTextureDatas[index].mTexLayerSet)
+ LLViewerTexLayerSet *layerset = getTexLayerSet(index);
+ if (layerset)
{
- return mBakedTextureDatas[index].mTexLayerSet->getUpdatesEnabled();
+ return layerset->getUpdatesEnabled();
}
return false;
}
@@ -1691,9 +1697,10 @@ void LLVOAvatarSelf::setupComposites()
{
ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex;
BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index));
- if (mBakedTextureDatas[i].mTexLayerSet)
+ LLViewerTexLayerSet *layerset = getTexLayerSet(i);
+ if (layerset)
{
- mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(!layer_baked);
+ layerset->setUpdatesEnabled(!layer_baked);
}
}
}
@@ -1702,10 +1709,11 @@ void LLVOAvatarSelf::updateComposites()
{
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
- if (mBakedTextureDatas[i].mTexLayerSet
+ LLViewerTexLayerSet *layerset = getTexLayerSet(i);
+ if (layerset
&& ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT)))
{
- mBakedTextureDatas[i].mTexLayerSet->updateComposite();
+ layerset->updateComposite();
}
}
}
@@ -1989,14 +1997,14 @@ BOOL LLVOAvatarSelf::getIsCloud() const
if (!mPreviousFullyLoaded)
{
- if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_LOWER].mTexLayerSet) &&
+ if (!isLocalTextureDataAvailable(getLayerSet(BAKED_LOWER)) &&
(!isTextureDefined(TEX_LOWER_BAKED, 0)))
{
lldebugs << "Lower textures not baked" << llendl;
return TRUE;
}
- if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_UPPER].mTexLayerSet) &&
+ if (!isLocalTextureDataAvailable(getLayerSet(BAKED_UPPER)) &&
(!isTextureDefined(TEX_UPPER_BAKED, 0)))
{
lldebugs << "Upper textures not baked" << llendl;
@@ -2554,7 +2562,8 @@ void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid
mHeadLayerSet->cancelUpload(); */
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
- if ( mBakedTextureDatas[i].mTextureIndex == te && mBakedTextureDatas[i].mTexLayerSet)
+ LLViewerTexLayerSet *layerset = getTexLayerSet(i);
+ if ( mBakedTextureDatas[i].mTextureIndex == te && layerset)
{
if (mInitialBakeIDs[i] != LLUUID::null)
{
@@ -2568,7 +2577,7 @@ void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid
}
mInitialBakeIDs[i] = LLUUID::null;
}
- mBakedTextureDatas[i].mTexLayerSet->cancelUpload();
+ layerset->cancelUpload();
}
}
}
@@ -2681,7 +2690,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const
if (texture_dict->mIsUsedByBakedTexture)
{
const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
- return mBakedTextureDatas[baked_index].mTexLayerSet;
+ return getLayerSet(baked_index);
}
return NULL;
}
@@ -2694,7 +2703,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index)
return mHeadLayerSet; */
if (baked_index >= 0 && baked_index < BAKED_NUM_INDICES)
{
- return mBakedTextureDatas[baked_index].mTexLayerSet;
+ return getTexLayerSet(baked_index);
}
return NULL;
}
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 2fe960cd1e..75c2743ab0 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -389,7 +389,7 @@ public:
BOOL isAllLocalTextureDataFinal() const;
- const LLViewerTexLayerSet* debugGetLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex index) const { return mBakedTextureDatas[index].mTexLayerSet; }
+ const LLViewerTexLayerSet* debugGetLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex index) const { return (LLViewerTexLayerSet*)(mBakedTextureDatas[index].mTexLayerSet); }
const std::string debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer
const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD
LLSD metricsData();