summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llappearance/llavatarappearance.cpp1
-rw-r--r--indra/llappearance/llavatarappearance.h9
-rw-r--r--indra/llappearance/lltexlayer.cpp7
-rw-r--r--indra/llappearance/lltexlayerparams.cpp1
-rw-r--r--indra/llappearance/llvoavatardefines.cpp3
-rw-r--r--indra/llappearance/llvoavatardefines.h2
-rw-r--r--indra/llappearance/llwearable.cpp13
-rw-r--r--indra/llappearance/llwearable.h10
-rw-r--r--indra/llappearance/llwearabletype.cpp2
-rw-r--r--indra/newview/llviewertexlayer.cpp280
-rw-r--r--indra/newview/llviewertexlayer.h2
-rw-r--r--indra/newview/llviewerwearable.cpp134
-rw-r--r--indra/newview/llviewerwearable.h14
-rwxr-xr-xindra/newview/llvoavatar.cpp1
-rwxr-xr-xindra/newview/llvoavatar.h3
15 files changed, 237 insertions, 245 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 1ca0161d7e..044ea8fbf0 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -38,7 +38,6 @@ LLAvatarAppearance::LLAvatarAppearance() :
mTexEyeColor( NULL ),
mIsDummy(FALSE)
{
- mDebugExistenceTimer.reset();
}
using namespace LLVOAvatarDefines;
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index cb2ae7aeef..1b0e0ad270 100644
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -111,15 +111,6 @@ public:
virtual BOOL isWearingWearableType(LLWearableType::EType type ) const = 0;
- //--------------------------------------------------------------------
- // Avatar Rez Metrics
- //--------------------------------------------------------------------
-public:
- F32 debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); }
-
-protected:
- LLFrameTimer mDebugExistenceTimer; // Debugging for how long the avatar has been in memory.
-
public:
static LLColor4 getDummyColor();
virtual void updateMeshTextures() = 0;
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index 3bb31d3721..6522976be1 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -33,20 +33,13 @@
#include "imageids.h"
#include "llimagej2c.h"
#include "llimagetga.h"
-//#include "llnotificationsutil.h"
#include "lldir.h"
#include "llvfile.h"
#include "llvfs.h"
-//#include "llviewerstats.h"
-//#include "llviewerregion.h"
-//#include "pipeline.h"
#include "lltexlayerparams.h"
#include "lltexturemanagerbridge.h"
#include "llui.h"
-//#include "llagentwearables.h"
#include "llwearable.h"
-//#include "llviewercontrol.h"
-//#include "llviewershadermgr.h"
#include "llviewervisualparam.h"
//#include "../tools/imdebug/imdebug.h"
diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp
index c843367357..4f0456f315 100644
--- a/indra/llappearance/lltexlayerparams.cpp
+++ b/indra/llappearance/lltexlayerparams.cpp
@@ -29,7 +29,6 @@
#include "lltexlayerparams.h"
#include "llavatarappearance.h"
-//#include "llagentcamera.h"
#include "llimagetga.h"
#include "llquantize.h"
#include "lltexlayer.h"
diff --git a/indra/llappearance/llvoavatardefines.cpp b/indra/llappearance/llvoavatardefines.cpp
index 48ef63ab64..29891986f5 100644
--- a/indra/llappearance/llvoavatardefines.cpp
+++ b/indra/llappearance/llvoavatardefines.cpp
@@ -24,11 +24,8 @@
* $/LicenseInfo$
*/
-//#include "llviewerprecompiledheaders.h"
#include "linden_common.h"
-
#include "llvoavatardefines.h"
-//#include "llviewercontrol.h" // gSavedSettings
const S32 LLVOAvatarDefines::SCRATCH_TEX_WIDTH = 512;
const S32 LLVOAvatarDefines::SCRATCH_TEX_HEIGHT = 512;
diff --git a/indra/llappearance/llvoavatardefines.h b/indra/llappearance/llvoavatardefines.h
index 7b0442bffb..7745775f9f 100644
--- a/indra/llappearance/llvoavatardefines.h
+++ b/indra/llappearance/llvoavatardefines.h
@@ -29,8 +29,8 @@
#define LLVOAVATAR_DEFINES_H
#include <vector>
-#include "lljointpickname.h"
#include "llwearable.h"
+#include "lljointpickname.h"
#include "lldictionary.h"
namespace LLVOAvatarDefines
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 64bd921ec5..77f1f27cb0 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -27,24 +27,12 @@
#include "linden_common.h"
#include "llavatarappearance.h"
-//#include "llagentwearables.h"
-//#include "lldictionary.h"
-//#include "llfloatersidepanelcontainer.h"
#include "lllocaltextureobject.h"
-//#include "llnotificationsutil.h"
-//#include "llviewertexturelist.h"
-//#include "llinventorymodel.h"
-//#include "llinventoryobserver.h"
-//#include "llsidepanelappearance.h"
#include "lltexlayer.h"
-//#include "lltexglobalcolor.h"
#include "lltexturemanagerbridge.h"
-//#include "lltrans.h"
-//#include "llviewerregion.h"
#include "llvisualparam.h"
#include "llvoavatardefines.h"
#include "llwearable.h"
-//#include "llviewercontrol.h"
using namespace LLVOAvatarDefines;
@@ -170,6 +158,7 @@ LLWearable::EImportResult LLWearable::importFile( LLFILE* file )
return LLWearable::BAD_HEADER;
}
+
// Temporary hack to allow wearables with definition version 24 to still load.
// This should only affect lindens and NDA'd testers who have saved wearables in 2.0
// the extra check for version == 24 can be removed before release, once internal testers
diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h
index 56c931e43b..8a99debac8 100644
--- a/indra/llappearance/llwearable.h
+++ b/indra/llappearance/llwearable.h
@@ -28,19 +28,16 @@
#define LL_LLWEARABLE_H
#include "llextendedstatus.h"
-//#include "lluuid.h"
-//#include "llstring.h"
#include "llpermissions.h"
#include "llsaleinfo.h"
-//#include "llassetstorage.h"
#include "llwearabletype.h"
-//#include "llfile.h"
#include "lllocaltextureobject.h"
class LLVisualParam;
class LLTexGlobalColorInfo;
class LLTexGlobalColor;
+// Abstract class.
class LLWearable
{
//--------------------------------------------------------------------
@@ -72,6 +69,8 @@ public:
public:
typedef std::vector<LLVisualParam*> visual_param_vec_t;
+ virtual void writeToAvatar() = 0;
+
enum EImportResult
{
FAILURE = 0,
@@ -81,12 +80,11 @@ public:
virtual BOOL exportFile(LLFILE* file) const;
virtual EImportResult importFile(LLFILE* file);
- virtual LLLocalTextureObject* getLocalTextureObject(S32 index) = 0;
- virtual void writeToAvatar() = 0;
static void setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; }
+ virtual LLLocalTextureObject* getLocalTextureObject(S32 index) = 0;
void addVisualParam(LLVisualParam *param);
void setVisualParamWeight(S32 index, F32 value, BOOL upload_bake);
F32 getVisualParamWeight(S32 index) const;
diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp
index d47702ff4d..009a3b631a 100644
--- a/indra/llappearance/llwearabletype.cpp
+++ b/indra/llappearance/llwearabletype.cpp
@@ -24,11 +24,9 @@
* $/LicenseInfo$
*/
-//#include "llviewerprecompiledheaders.h"
#include "linden_common.h"
#include "llwearabletype.h"
-//#include "llinventoryfunctions.h"
#include "llinventoryicon.h"
#include "lltrans.h"
diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp
index f805083aaa..3a3cae4047 100644
--- a/indra/newview/llviewertexlayer.cpp
+++ b/indra/newview/llviewertexlayer.cpp
@@ -26,19 +26,19 @@
#include "llviewerprecompiledheaders.h"
+#include "llviewertexlayer.h"
+
#include "llagent.h"
-#include "llassetuploadresponders.h"
-#include "llavatarappearance.h"
-#include "llglslshader.h"
#include "llimagej2c.h"
#include "llnotificationsutil.h"
-#include "llviewercontrol.h"
-#include "llviewerregion.h"
-#include "llviewertexlayer.h"
#include "llvfile.h"
#include "llvfs.h"
+#include "llviewerregion.h"
+#include "llglslshader.h"
#include "llvoavatarself.h"
#include "pipeline.h"
+#include "llassetuploadresponders.h"
+#include "llviewercontrol.h"
static const S32 BAKE_UPLOAD_ATTEMPTS = 7;
static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power of 2 each attempt
@@ -46,126 +46,6 @@ static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power o
// runway consolidate
extern std::string self_av_string();
-LLViewerTexLayerSet::LLViewerTexLayerSet(LLAvatarAppearance* const appearance) :
- LLTexLayerSet(appearance),
- mComposite( NULL ),
- mUpdatesEnabled( FALSE )
-{
-}
-
-// virtual
-LLViewerTexLayerSet::~LLViewerTexLayerSet()
-{
-}
-
-void LLViewerTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 width, S32 height)
-{
- memset(data, 255, width * height);
-
- for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
- {
- LLTexLayerInterface* layer = *iter;
- layer->gatherAlphaMasks(data, mComposite->getOriginX(),mComposite->getOriginY(), width, height);
- }
-
- // Set alpha back to that of our alpha masks.
- renderAlphaMaskTextures(mComposite->getOriginX(), mComposite->getOriginY(), width, height, true);
-}
-
-LLTexLayerSetBuffer* LLViewerTexLayerSet::getComposite()
-{
- if (!mComposite)
- {
- createComposite();
- }
- return mComposite;
-}
-
-const LLTexLayerSetBuffer* LLViewerTexLayerSet::getComposite() const
-{
- return mComposite;
-}
-
-// virtual
-void LLViewerTexLayerSet::requestUpdate()
-{
- if( mUpdatesEnabled )
- {
- createComposite();
- mComposite->requestUpdate();
- }
-}
-
-void LLViewerTexLayerSet::requestUpload()
-{
- createComposite();
- mComposite->requestUpload();
-}
-
-void LLViewerTexLayerSet::cancelUpload()
-{
- if(mComposite)
- {
- mComposite->cancelUpload();
- }
-}
-
-
-void LLViewerTexLayerSet::createComposite()
-{
- if(!mComposite)
- {
- S32 width = mInfo->getWidth();
- S32 height = mInfo->getHeight();
- // Composite other avatars at reduced resolution
- if( !mAvatarAppearance->isSelf() )
- {
- llerrs << "composites should not be created for non-self avatars!" << llendl;
- }
- mComposite = new LLTexLayerSetBuffer( this, width, height );
- }
-}
-
-void LLViewerTexLayerSet::updateComposite()
-{
- createComposite();
- mComposite->requestUpdateImmediate();
-}
-
-// Returns TRUE if at least one packet of data has been received for each of the textures that this layerset depends on.
-BOOL LLViewerTexLayerSet::isLocalTextureDataAvailable() const
-{
- if (!mAvatarAppearance->isSelf()) return FALSE;
- LLVOAvatarSelf* self = dynamic_cast<LLVOAvatarSelf *>(mAvatarAppearance);
- return self->isLocalTextureDataAvailable(this);
-}
-
-
-// Returns TRUE if all of the data for the textures that this layerset depends on have arrived.
-BOOL LLViewerTexLayerSet::isLocalTextureDataFinal() const
-{
- if (!mAvatarAppearance->isSelf()) return FALSE;
- LLVOAvatarSelf* self = dynamic_cast<LLVOAvatarSelf *>(mAvatarAppearance);
- return self->isLocalTextureDataFinal(this);
-}
-
-void LLViewerTexLayerSet::destroyComposite()
-{
- if( mComposite )
- {
- mComposite = NULL;
- }
-}
-
-void LLViewerTexLayerSet::setUpdatesEnabled( BOOL b )
-{
- mUpdatesEnabled = b;
-}
-
-LLVOAvatarSelf* LLViewerTexLayerSet::getAvatar() const
-{
- return dynamic_cast<LLVOAvatarSelf*> (mAvatarAppearance);
-}
//-----------------------------------------------------------------------------
// LLBakedUploadData()
@@ -693,7 +573,7 @@ void LLTexLayerSetBuffer::doUpdate()
// need to switch to using this layerset if this is the first update
// after getting the lowest LOD
- mTexLayerSet->getAvatarAppearance()->updateMeshTextures();
+ mTexLayerSet->getAvatar()->updateMeshTextures();
// Print out notification that we updated this texture.
if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
@@ -701,7 +581,7 @@ void LLTexLayerSetBuffer::doUpdate()
const BOOL highest_lod = mTexLayerSet->isLocalTextureDataFinal();
const std::string lod_str = highest_lod ? "HighRes" : "LowRes";
LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mTexLayerSet->getAvatarAppearance()->debugGetExistenceTimeElapsedF32());
+ args["EXISTENCE"] = llformat("%d",(U32)mTexLayerSet->getAvatar()->debugGetExistenceTimeElapsedF32());
args["TIME"] = llformat("%d",(U32)mNeedsUpdateTimer.getElapsedTimeF32());
args["BODYREGION"] = mTexLayerSet->getBodyRegionName();
args["RESOLUTION"] = lod_str;
@@ -786,6 +666,150 @@ void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid,
delete baked_upload_data;
}
+//-----------------------------------------------------------------------------
+// LLViewerTexLayerSet
+// An ordered set of texture layers that get composited into a single texture.
+//-----------------------------------------------------------------------------
+
+LLViewerTexLayerSet::LLViewerTexLayerSet(LLAvatarAppearance* const appearance) :
+ LLTexLayerSet(appearance),
+ mComposite( NULL ),
+ mUpdatesEnabled( FALSE )
+{
+}
+
+// virtual
+LLViewerTexLayerSet::~LLViewerTexLayerSet()
+{
+}
+
+// Returns TRUE if at least one packet of data has been received for each of the textures that this layerset depends on.
+BOOL LLViewerTexLayerSet::isLocalTextureDataAvailable() const
+{
+ if (!mAvatarAppearance->isSelf()) return FALSE;
+ return getAvatar()->isLocalTextureDataAvailable(this);
+}
+
+
+// Returns TRUE if all of the data for the textures that this layerset depends on have arrived.
+BOOL LLViewerTexLayerSet::isLocalTextureDataFinal() const
+{
+ if (!mAvatarAppearance->isSelf()) return FALSE;
+ return getAvatar()->isLocalTextureDataFinal(this);
+}
+
+// virtual
+void LLViewerTexLayerSet::requestUpdate()
+{
+ if( mUpdatesEnabled )
+ {
+ createComposite();
+ mComposite->requestUpdate();
+ }
+}
+
+void LLViewerTexLayerSet::requestUpload()
+{
+ createComposite();
+ mComposite->requestUpload();
+}
+
+void LLViewerTexLayerSet::cancelUpload()
+{
+ if(mComposite)
+ {
+ mComposite->cancelUpload();
+ }
+}
+
+void LLViewerTexLayerSet::createComposite()
+{
+ if(!mComposite)
+ {
+ S32 width = mInfo->getWidth();
+ S32 height = mInfo->getHeight();
+ // Composite other avatars at reduced resolution
+ if( !mAvatarAppearance->isSelf() )
+ {
+ llerrs << "composites should not be created for non-self avatars!" << llendl;
+ }
+ mComposite = new LLTexLayerSetBuffer( this, width, height );
+ }
+}
+
+void LLViewerTexLayerSet::destroyComposite()
+{
+ if( mComposite )
+ {
+ mComposite = NULL;
+ }
+}
+
+void LLViewerTexLayerSet::setUpdatesEnabled( BOOL b )
+{
+ mUpdatesEnabled = b;
+}
+
+void LLViewerTexLayerSet::updateComposite()
+{
+ createComposite();
+ mComposite->requestUpdateImmediate();
+}
+LLTexLayerSetBuffer* LLViewerTexLayerSet::getComposite()
+{
+ if (!mComposite)
+ {
+ createComposite();
+ }
+ return mComposite;
+}
+const LLTexLayerSetBuffer* LLViewerTexLayerSet::getComposite() const
+{
+ return mComposite;
+}
+
+void LLViewerTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 width, S32 height)
+{
+ memset(data, 255, width * height);
+
+ for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
+ {
+ LLTexLayerInterface* layer = *iter;
+ layer->gatherAlphaMasks(data, mComposite->getOriginX(),mComposite->getOriginY(), width, height);
+ }
+
+ // Set alpha back to that of our alpha masks.
+ renderAlphaMaskTextures(mComposite->getOriginX(), mComposite->getOriginY(), width, height, true);
+}
+
+
+LLVOAvatarSelf* LLViewerTexLayerSet::getAvatar() const
+{
+ return dynamic_cast<LLVOAvatarSelf*> (mAvatarAppearance);
+}
+
+
+
+const std::string LLTexLayerSetBuffer::dumpTextureInfo() const
+{
+ if (!isAgentAvatarValid()) return "";
+
+ const BOOL is_high_res = !mNeedsUpload;
+ const U32 num_low_res = mNumLowresUploads;
+ const U32 upload_time = (U32)mNeedsUploadTimer.getElapsedTimeF32();
+ const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(mTexLayerSet);
+
+ std::string status = "CREATING ";
+ if (!uploadNeeded()) status = "DONE ";
+ if (uploadInProgress()) status = "UPLOADING";
+
+ std::string text = llformat("[%s] [HiRes:%d LoRes:%d] [Elapsed:%d] %s",
+ status.c_str(),
+ is_high_res, num_low_res,
+ upload_time,
+ local_texture_info.c_str());
+ return text;
+}
diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h
index ff3def5a82..125bf82adf 100644
--- a/indra/newview/llviewertexlayer.h
+++ b/indra/newview/llviewertexlayer.h
@@ -30,8 +30,8 @@
#include "lldynamictexture.h"
#include "lltexlayer.h"
-class LLTexLayerSetBuffer;
class LLVOAvatarSelf;
+class LLTexLayerSetBuffer;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// LLViewerTexLayerSet
diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp
index b63f1f57cb..2b6649a7ec 100644
--- a/indra/newview/llviewerwearable.cpp
+++ b/indra/newview/llviewerwearable.cpp
@@ -33,11 +33,11 @@
#include "llnotificationsutil.h"
#include "llsidepanelappearance.h"
#include "lltextureentry.h"
-#include "llviewercontrol.h"
#include "llviewertexlayer.h"
-#include "llviewerwearable.h"
#include "llvoavatarself.h"
#include "llvoavatardefines.h"
+#include "llviewerwearable.h"
+#include "llviewercontrol.h"
using namespace LLVOAvatarDefines;
@@ -89,11 +89,6 @@ LLViewerWearable::~LLViewerWearable()
{
}
-void LLViewerWearable::setItemID(const LLUUID& item_id)
-{
- mItemID = item_id;
-}
-
// virtual
BOOL LLViewerWearable::exportFile(LLFILE* file) const
{
@@ -107,6 +102,40 @@ BOOL LLViewerWearable::exportFile(LLFILE* file) const
return LLWearable::exportFile(file);
}
+
+void LLViewerWearable::createVisualParams()
+{
+ for (LLViewerVisualParam* param = (LLViewerVisualParam*) gAgentAvatarp->getFirstVisualParam();
+ param;
+ param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam())
+ {
+ if (param->getWearableType() == mType)
+ {
+ addVisualParam(param->cloneParam(this));
+ }
+ }
+
+ // resync driver parameters to point to the newly cloned driven parameters
+ for (visual_param_index_map_t::iterator param_iter = mVisualParamIndexMap.begin();
+ param_iter != mVisualParamIndexMap.end();
+ ++param_iter)
+ {
+ LLVisualParam* param = param_iter->second;
+ LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam;
+ // need this line to disambiguate between versions of LLCharacter::getVisualParam()
+ LLVisualParam*(LLAvatarAppearance::*param_function)(S32)const = &LLAvatarAppearance::getVisualParam;
+ param->resetDrivenParams();
+ if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false))
+ {
+ if( !param->linkDrivenParams(boost::bind(param_function,gAgentAvatarp.get(),_1 ), true))
+ {
+ llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
+ continue;
+ }
+ }
+ }
+}
+
// virtual
LLWearable::EImportResult LLViewerWearable::importFile( LLFILE* file )
{
@@ -159,6 +188,7 @@ LLWearable::EImportResult LLViewerWearable::importFile( LLFILE* file )
return result;
}
+
// Avatar parameter and texture definitions can change over time.
// This function returns true if parameters or textures have been added or removed
// since this wearable was created.
@@ -492,6 +522,11 @@ void LLViewerWearable::copyDataFrom(const LLViewerWearable* src)
revertValues();
}
+void LLViewerWearable::setItemID(const LLUUID& item_id)
+{
+ mItemID = item_id;
+}
+
LLLocalTextureObject* LLViewerWearable::getLocalTextureObject(S32 index)
{
@@ -538,6 +573,17 @@ void LLViewerWearable::setLocalTextureObject(S32 index, LLLocalTextureObject &lt
mTEMap[index] = new LLLocalTextureObject(lto);
}
+void LLViewerWearable::setVisualParams()
+{
+ for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++)
+ {
+ S32 id = iter->first;
+ LLVisualParam *wearable_param = iter->second;
+ F32 value = wearable_param->getWeight();
+ gAgentAvatarp->setVisualParamWeight(id, value, FALSE);
+ }
+}
+
void LLViewerWearable::revertValues()
{
//update saved settings so wearable is no longer dirty
@@ -591,6 +637,19 @@ BOOL LLViewerWearable::isOnTop() const
return (this == gAgentWearables.getTopWearable(mType));
}
+void LLViewerWearable::createLayers(S32 te)
+{
+ LLViewerTexLayerSet *layer_set = gAgentAvatarp->getLayerSet((ETextureIndex)te);
+ if (layer_set)
+ {
+ layer_set->cloneTemplates(mTEMap[te], (ETextureIndex)te, this);
+ }
+ else
+ {
+ llerrs << "could not find layerset for LTO in wearable!" << llendl;
+ }
+}
+
void LLViewerWearable::saveValues()
{
//update saved settings so wearable is no longer dirty
@@ -702,7 +761,6 @@ void LLViewerWearable::setLabelUpdated() const
gInventory.addChangedMask(LLInventoryObserver::LABEL, getItemID());
}
-
void LLViewerWearable::refreshName()
{
LLUUID item_id = getItemID();
@@ -802,65 +860,6 @@ void LLViewerWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void*
}
-void LLViewerWearable::createLayers(S32 te)
-{
- LLViewerTexLayerSet *layer_set = gAgentAvatarp->getLayerSet((ETextureIndex)te);
- if (layer_set)
- {
- layer_set->cloneTemplates(mTEMap[te], (ETextureIndex)te, this);
- }
- else
- {
- llerrs << "could not find layerset for LTO in wearable!" << llendl;
- }
-}
-
-void LLViewerWearable::createVisualParams()
-{
- for (LLViewerVisualParam* param = (LLViewerVisualParam*) gAgentAvatarp->getFirstVisualParam();
- param;
- param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam())
- {
- if (param->getWearableType() == mType)
- {
- addVisualParam(param->cloneParam(this));
- }
- }
-
- // resync driver parameters to point to the newly cloned driven parameters
- for (visual_param_index_map_t::iterator param_iter = mVisualParamIndexMap.begin();
- param_iter != mVisualParamIndexMap.end();
- ++param_iter)
- {
- LLVisualParam* param = param_iter->second;
- LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam;
- // need this line to disambiguate between versions of LLCharacter::getVisualParam()
- LLVisualParam*(LLAvatarAppearance::*param_function)(S32)const = &LLAvatarAppearance::getVisualParam;
- param->resetDrivenParams();
- if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false))
- {
- if( !param->linkDrivenParams(boost::bind(param_function,gAgentAvatarp.get(),_1 ), true))
- {
- llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
- continue;
- }
- }
- }
-}
-
-void LLViewerWearable::setVisualParams()
-{
- for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++)
- {
- S32 id = iter->first;
- LLVisualParam *wearable_param = iter->second;
- F32 value = wearable_param->getWeight();
- gAgentAvatarp->setVisualParamWeight(id, value, FALSE);
- }
-}
-
-
-
std::ostream& operator<<(std::ostream &s, const LLViewerWearable &w)
{
s << "wearable " << LLWearableType::getTypeName(w.mType) << "\n";
@@ -897,4 +896,3 @@ std::string asset_id_to_filename(const LLUUID &asset_id)
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id_string) + ".wbl";
return filename;
}
-
diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h
index 857900f583..a921f82e7d 100644
--- a/indra/newview/llviewerwearable.h
+++ b/indra/newview/llviewerwearable.h
@@ -54,8 +54,6 @@ public:
void setItemID(const LLUUID& item_id);
public:
- /*virtual*/ BOOL exportFile(LLFILE* file) const;
- /*virtual*/ EImportResult importFile(LLFILE* file);
BOOL isDirty() const;
BOOL isOldVersion() const;
@@ -64,6 +62,9 @@ public:
void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); }
static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake );
+ /*virtual*/ BOOL exportFile(LLFILE* file) const;
+ /*virtual*/ EImportResult importFile(LLFILE* file);
+
void setParamsToDefaults();
void setTexturesToDefaults();
@@ -81,6 +82,7 @@ public:
const LLLocalTextureObject* getLocalTextureObject(S32 index) const;
std::vector<LLLocalTextureObject*> getLocalTextureListSeq();
void setLocalTextureObject(S32 index, LLLocalTextureObject &lto);
+ void setVisualParams();
void revertValues();
void saveValues();
@@ -96,19 +98,19 @@ public:
void refreshName();
protected:
+ typedef std::map<S32, LLLocalTextureObject*> te_map_t;
+
void createLayers(S32 te);
/*virtual*/void createVisualParams();
- void setVisualParams();
- typedef std::map<S32, LLLocalTextureObject*> te_map_t;
void syncImages(te_map_t &src, te_map_t &dst);
void destroyTextures();
- LLTransactionID mTransactionID;
LLAssetID mAssetID;
- LLUUID mItemID; // ID of the inventory item in the agent's inventory
+ LLTransactionID mTransactionID;
te_map_t mTEMap; // maps TE to LocalTextureObject
te_map_t mSavedTEMap; // last saved version of TEMap
+ LLUUID mItemID; // ID of the inventory item in the agent's inventory
};
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index dac479b2e0..e3d8f9135e 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -764,6 +764,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mRuthTimer.reset();
mRuthDebugTimer.reset();
+ mDebugExistenceTimer.reset();
mPelvisOffset = LLVector3(0.0f,0.0f,0.0f);
mLastPelvisToFoot = 0.0f;
mPelvisFixup = 0.0f;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 023711d81b..512522803a 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -1038,9 +1038,12 @@ private:
//--------------------------------------------------------------------
public:
void debugAvatarRezTime(std::string notification_name, std::string comment = "");
+ F32 debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); }
+
protected:
LLFrameTimer mRuthDebugTimer; // For tracking how long it takes for av to rez
+ LLFrameTimer mDebugExistenceTimer; // Debugging for how long the avatar has been in memory.
/** Diagnostics
** **