Merged in changes from Cool VL 1.26.3.2, all by/via Henri Beauchamp:

Sat, 28 Jan 2012 16:48:34 +0100

author
Ansariel
date
Sat, 28 Jan 2012 16:48:34 +0100
changeset 1618
2c0488ac9fa0
parent 1617
afcaf62a83c8
child 1619
534401934b7a

Merged in changes from Cool VL 1.26.3.2, all by/via Henri Beauchamp:
* Optimization to the rendering speed of flexible prims, backported from V3
* LLVOAvatarDictionary merged up on par with V3
* LLWearableType class backported from V3
* Minor bugfixes backported from V3
* Possibility to select worn rigged mesh while build floater is open
* Dead code cleanup

indra/llmath/llvolume.cpp file | annotate | diff | revisions
indra/llmath/llvolume.h file | annotate | diff | revisions
indra/newview/CMakeLists.txt file | annotate | diff | revisions
indra/newview/cofmgr.cpp file | annotate | diff | revisions
indra/newview/importtracker.cpp file | annotate | diff | revisions
indra/newview/llagent.cpp file | annotate | diff | revisions
indra/newview/llagent.h file | annotate | diff | revisions
indra/newview/llfloatercustomize.cpp file | annotate | diff | revisions
indra/newview/llfloatercustomize.h file | annotate | diff | revisions
indra/newview/llinventoryactions.cpp file | annotate | diff | revisions
indra/newview/llinventorybridge.cpp file | annotate | diff | revisions
indra/newview/llinventorybridge.h file | annotate | diff | revisions
indra/newview/llinventoryicon.cpp file | annotate | diff | revisions
indra/newview/llpanelmorph.cpp file | annotate | diff | revisions
indra/newview/llpanelmorph.h file | annotate | diff | revisions
indra/newview/llselectmgr.cpp file | annotate | diff | revisions
indra/newview/llselectmgr.h file | annotate | diff | revisions
indra/newview/llspatialpartition.cpp file | annotate | diff | revisions
indra/newview/lltexlayer.cpp file | annotate | diff | revisions
indra/newview/lltexlayer.h file | annotate | diff | revisions
indra/newview/llviewerinventory.cpp file | annotate | diff | revisions
indra/newview/llviewerinventory.h file | annotate | diff | revisions
indra/newview/llviewermenu.cpp file | annotate | diff | revisions
indra/newview/llviewerobject.cpp file | annotate | diff | revisions
indra/newview/llviewerobject.h file | annotate | diff | revisions
indra/newview/llviewervisualparam.cpp file | annotate | diff | revisions
indra/newview/llviewerwindow.cpp file | annotate | diff | revisions
indra/newview/llvoavatar.cpp file | annotate | diff | revisions
indra/newview/llvoavatar.h file | annotate | diff | revisions
indra/newview/llvoavatardefines.cpp file | annotate | diff | revisions
indra/newview/llvoavatardefines.h file | annotate | diff | revisions
indra/newview/llvovolume.cpp file | annotate | diff | revisions
indra/newview/llvovolume.h file | annotate | diff | revisions
indra/newview/llwearable.cpp file | annotate | diff | revisions
indra/newview/llwearable.h file | annotate | diff | revisions
indra/newview/llwearablelist.cpp file | annotate | diff | revisions
indra/newview/llwearablelist.h file | annotate | diff | revisions
indra/newview/llwearabletype.cpp file | annotate | diff | revisions
indra/newview/llwearabletype.h file | annotate | diff | revisions
indra/newview/rlvhandler.cpp file | annotate | diff | revisions
indra/newview/rlvhelper.cpp file | annotate | diff | revisions
indra/newview/rlvhelper.h file | annotate | diff | revisions
indra/newview/rlvinventory.cpp file | annotate | diff | revisions
indra/newview/rlvlocks.cpp file | annotate | diff | revisions
indra/newview/rlvlocks.h file | annotate | diff | revisions
indra/newview/skins/default/xui/en-us/strings.xml file | annotate | diff | revisions
     1.1 --- a/indra/llmath/llvolume.cpp	Sun Jan 15 13:43:22 2012 +0100
     1.2 +++ b/indra/llmath/llvolume.cpp	Sat Jan 28 16:48:34 2012 +0100
     1.3 @@ -4267,13 +4267,21 @@
     1.4  	return count;
     1.5  }
     1.6  
     1.7 -S32 LLVolume::getNumTriangles() const
     1.8 -{
     1.9 -	U32 triangle_count = 0;
    1.10 +S32 LLVolume::getNumTriangles(S32* vcount) const
    1.11 +{
    1.12 + 	U32 triangle_count = 0;
    1.13 +	U32 vertex_count = 0;
    1.14  
    1.15  	for (S32 i = 0; i < getNumVolumeFaces(); ++i)
    1.16  	{
    1.17 -		triangle_count += getVolumeFace(i).mNumIndices/3;
    1.18 +		const LLVolumeFace& face = getVolumeFace(i);
    1.19 +		triangle_count += face.mNumIndices / 3;
    1.20 +		vertex_count += face.mNumVertices;
    1.21 +	}
    1.22 +
    1.23 +	if (vcount)
    1.24 +	{
    1.25 +		*vcount = vertex_count;
    1.26  	}
    1.27  
    1.28  	return triangle_count;
    1.29 @@ -4562,23 +4570,88 @@
    1.30  
    1.31          if (LLLineSegmentBoxIntersect(start, end, box_center, box_size))
    1.32  		{
    1.33 -			if (bi_normal != NULL) // if the caller wants binormals, we may need to generate them
    1.34 +			// if the caller wants binormals, we may need to generate them
    1.35 +			if (bi_normal != NULL)
    1.36  			{
    1.37  				genBinormals(i);
    1.38  			}
    1.39  
    1.40 -			if (!face.mOctree)
    1.41 +			if (isUnique())
    1.42 +			{	// don't bother with an octree for flexi volumes
    1.43 +				U32 tri_count = face.mNumIndices / 3;
    1.44 +
    1.45 +				for (U32 j = 0; j < tri_count; ++j)
    1.46 +				{
    1.47 +					U16 idx0 = face.mIndices[j * 3];
    1.48 +					U16 idx1 = face.mIndices[j * 3 + 1];
    1.49 +					U16 idx2 = face.mIndices[j * 3 + 2];
    1.50 +
    1.51 +					const LLVector4a& v0 = face.mPositions[idx0];
    1.52 +					const LLVector4a& v1 = face.mPositions[idx1];
    1.53 +					const LLVector4a& v2 = face.mPositions[idx2];
    1.54 +
    1.55 +					F32 a,b,t;
    1.56 +
    1.57 +					if (LLTriangleRayIntersect(v0, v1, v2, start, dir, a, b, t))
    1.58 +					{
    1.59 +						if (t >= 0.f &&		// if hit is after start
    1.60 +							t <= 1.f &&		// and before end
    1.61 +							t < closest_t)	// and this hit is closer
    1.62 +						{
    1.63 +							closest_t = t;
    1.64 +							hit_face = i;
    1.65 +
    1.66 +							if (intersection != NULL)
    1.67 +							{
    1.68 +								LLVector4a intersect = dir;
    1.69 +								intersect.mul(closest_t);
    1.70 +								intersect.add(start);
    1.71 +								intersection->set(intersect.getF32ptr());
    1.72 +							}
    1.73 +
    1.74 +							if (tex_coord != NULL)
    1.75 +							{
    1.76 +								LLVector2* tc = (LLVector2*) face.mTexCoords;
    1.77 +								*tex_coord = (1.f - a - b) * tc[idx0] +
    1.78 +											 a * tc[idx1] + b * tc[idx2];
    1.79 +							}
    1.80 +
    1.81 +							if (normal != NULL)
    1.82 +							{
    1.83 +								LLVector4* norm = (LLVector4*) face.mNormals;
    1.84 +
    1.85 +								*normal = (1.f - a - b) * LLVector3(norm[idx0]) +
    1.86 +										  a * LLVector3(norm[idx1]) +
    1.87 +										  b * LLVector3(norm[idx2]);
    1.88 +							}
    1.89 +
    1.90 +							if (bi_normal != NULL)
    1.91 +							{
    1.92 +								LLVector4* binormal = (LLVector4*) face.mBinormals;
    1.93 +								*bi_normal = (1.f - a - b) * LLVector3(binormal[idx0]) +
    1.94 +											 a * LLVector3(binormal[idx1]) +
    1.95 +											 b * LLVector3(binormal[idx2]);
    1.96 +							}
    1.97 +						}
    1.98 +					}
    1.99 +				}
   1.100 +			}
   1.101 +			else
   1.102  			{
   1.103 -				face.createOctree();
   1.104 -			}
   1.105 -
   1.106 -			//LLVector4a* p = (LLVector4a*) face.mPositions;
   1.107 -
   1.108 -			LLOctreeTriangleRayIntersect intersect(start, dir, &face, &closest_t, intersection, tex_coord, normal, bi_normal);
   1.109 -			intersect.traverse(face.mOctree);
   1.110 -			if (intersect.mHitFace)
   1.111 -			{
   1.112 -				hit_face = i;
   1.113 +				if (!face.mOctree)
   1.114 +				{
   1.115 +					face.createOctree();
   1.116 +				}
   1.117 +
   1.118 +				LLOctreeTriangleRayIntersect intersect(start, dir, &face,
   1.119 +													   &closest_t, intersection,
   1.120 +													   tex_coord, normal,
   1.121 +													   bi_normal);
   1.122 +				intersect.traverse(face.mOctree);
   1.123 +				if (intersect.mHitFace)
   1.124 +				{
   1.125 +					hit_face = i;
   1.126 +				}
   1.127  			}
   1.128  		}
   1.129  	}
     2.1 --- a/indra/llmath/llvolume.h	Sun Jan 15 13:43:22 2012 +0100
     2.2 +++ b/indra/llmath/llvolume.h	Sat Jan 28 16:48:34 2012 +0100
     2.3 @@ -999,7 +999,7 @@
     2.4  	S32 getNumTriangleIndices() const;
     2.5  	static void getLoDTriangleCounts(const LLVolumeParams& params, S32* counts);
     2.6  
     2.7 -	S32 getNumTriangles() const;
     2.8 +	S32 getNumTriangles(S32* vcount = NULL) const;
     2.9  
    2.10  	void generateSilhouetteVertices(std::vector<LLVector3> &vertices, 
    2.11  									std::vector<LLVector3> &normals, 
     3.1 --- a/indra/newview/CMakeLists.txt	Sun Jan 15 13:43:22 2012 +0100
     3.2 +++ b/indra/newview/CMakeLists.txt	Sat Jan 28 16:48:34 2012 +0100
     3.3 @@ -364,7 +364,6 @@
     3.4      llpanellandobjects.cpp
     3.5      llpanellandoptions.cpp
     3.6      llpanellogin.cpp
     3.7 -    llpanelmorph.cpp
     3.8      llpanelmediahud.cpp
     3.9      llpanelmsgs.cpp
    3.10      llpanelnetwork.cpp
    3.11 @@ -522,6 +521,7 @@
    3.12      llwaterparamset.cpp
    3.13      llwearable.cpp
    3.14      llwearablelist.cpp
    3.15 +    llwearabletype.cpp
    3.16      llweb.cpp
    3.17      llmediactrl.cpp
    3.18      llwind.cpp
    3.19 @@ -845,7 +845,6 @@
    3.20      llpanellandoptions.h
    3.21      llpanelLCD.h
    3.22      llpanellogin.h
    3.23 -    llpanelmorph.h
    3.24      llpanelmediahud.h
    3.25      llpanelmsgs.h
    3.26      llpanelnetwork.h
    3.27 @@ -1009,6 +1008,7 @@
    3.28      llwaterparamset.h
    3.29      llwearable.h
    3.30      llwearablelist.h
    3.31 +    llwearabletype.h
    3.32      llweb.h
    3.33      llmediactrl.h
    3.34      llwind.h
     4.1 --- a/indra/newview/cofmgr.cpp	Sun Jan 15 13:43:22 2012 +0100
     4.2 +++ b/indra/newview/cofmgr.cpp	Sat Jan 28 16:48:34 2012 +0100
     4.3 @@ -79,9 +79,9 @@
     4.4  		}
     4.5  
     4.6  		// Add all currently worn wearables
     4.7 -		for (S32 idxType = 0; idxType < WT_COUNT; idxType++)
     4.8 +		for (S32 idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
     4.9  		{
    4.10 -			const LLUUID& idItem = gAgent.getWearableItem((EWearableType)idxType);
    4.11 +			const LLUUID& idItem = gAgent.getWearableItem((LLWearableType::EType)idxType);
    4.12  			if (idItem.isNull())
    4.13  				continue;
    4.14  			idItems.push_back(idItem);
    4.15 @@ -456,9 +456,9 @@
    4.16  
    4.17  	// Grab the item UUIDs of all currently worn wearables
    4.18  	uuid_vec_t newItems;
    4.19 -	for (S32 idxType = 0; idxType < WT_COUNT; idxType++)
    4.20 +	for (S32 idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
    4.21  	{
    4.22 -		const LLUUID& idItem = gAgent.getWearableItem((EWearableType)idxType);
    4.23 +		const LLUUID& idItem = gAgent.getWearableItem((LLWearableType::EType)idxType);
    4.24  		if (idItem.isNull())
    4.25  			continue;
    4.26  		newItems.push_back(idItem);
     5.1 --- a/indra/newview/importtracker.cpp	Sun Jan 15 13:43:22 2012 +0100
     5.2 +++ b/indra/newview/importtracker.cpp	Sat Jan 28 16:48:34 2012 +0100
     5.3 @@ -320,7 +320,7 @@
     5.4  	U32 localid;
     5.5  	LLAssetType::EType type;
     5.6  	LLInventoryType::EType inv_type;
     5.7 -	EWearableType wear_type;
     5.8 +	LLWearableType::EType wear_type;
     5.9  	LLTransactionID tid;
    5.10  	LLUUID assetid;
    5.11  	std::string name;
     6.1 --- a/indra/newview/llagent.cpp	Sun Jan 15 13:43:22 2012 +0100
     6.2 +++ b/indra/newview/llagent.cpp	Sat Jan 28 16:48:34 2012 +0100
     6.3 @@ -36,30 +36,37 @@
     6.4  #include "stdenums.h"
     6.5  
     6.6  #include "cofmgr.h"
     6.7 -#include "llagent.h" 
     6.8 +#include "llagent.h"
     6.9 +
    6.10 +#include "imageids.h"
    6.11 +#include "indra_constants.h"
    6.12 +#include "llbutton.h"
    6.13  #include "llcamera.h"
    6.14  #include "llcoordframe.h"
    6.15 -#include "indra_constants.h"
    6.16 -#include "llmath.h"
    6.17  #include "llcriticaldamp.h"
    6.18  #include "llfocusmgr.h"
    6.19  #include "llglheaders.h"
    6.20 +#include "llmath.h"
    6.21 +#include "llmenugl.h"
    6.22 +#include "llmd5.h"
    6.23  #include "llparcel.h"
    6.24  #include "llpermissions.h"
    6.25 +#include "llquantize.h"
    6.26 +#include "llquaternion.h"
    6.27  #include "llregionhandle.h"
    6.28 +#include "llrendersphere.h"
    6.29 +#include "llsdutil.h"
    6.30 +#include "llsmoothstep.h"
    6.31 +#include "llui.h"				// for make_ui_sound
    6.32  #include "m3math.h"
    6.33  #include "m4math.h"
    6.34  #include "message.h"
    6.35 -#include "llquaternion.h"
    6.36 +#include "roles_constants.h"
    6.37  #include "v3math.h"
    6.38  #include "v4math.h"
    6.39 -#include "llsmoothstep.h"
    6.40 -#include "llsdutil.h"
    6.41 -//#include "vmath.h"
    6.42 -
    6.43 -#include "imageids.h"
    6.44 +
    6.45 +#include "llappviewer.h"
    6.46  #include "llbox.h"
    6.47 -#include "llbutton.h"
    6.48  #include "llcallingcard.h"
    6.49  #include "llchatbar.h"
    6.50  #include "llconsole.h"
    6.51 @@ -82,25 +89,22 @@
    6.52  #include "llfloatersnapshot.h"
    6.53  #include "llfloatertools.h"
    6.54  #include "llfloaterworldmap.h"
    6.55 +#include "llfollowcam.h"
    6.56  #include "llgroupmgr.h"
    6.57  #include "llhomelocationresponder.h"
    6.58  #include "llhudeffectlookat.h"
    6.59  #include "llhudmanager.h"
    6.60 +#include "llimview.h"
    6.61  #include "llinventorymodel.h"
    6.62  #include "llinventoryview.h"
    6.63  #include "lljoystickbutton.h"
    6.64 -#include "llmenugl.h"
    6.65  #include "llmorphview.h"
    6.66  #include "llmoveview.h"
    6.67  #include "llnotify.h"
    6.68 -#include "llquantize.h"
    6.69 -#include "llsdutil.h"
    6.70  #include "llselectmgr.h"
    6.71  #include "llsky.h"
    6.72 -#include "llrendersphere.h"
    6.73  #include "llstatusbar.h"
    6.74  #include "llstartup.h"
    6.75 -#include "llimview.h"
    6.76  #include "lltexturestats.h"
    6.77  #include "lltool.h"
    6.78  #include "lltoolcomp.h"
    6.79 @@ -109,10 +113,11 @@
    6.80  #include "lltoolmgr.h"
    6.81  #include "lltoolpie.h"
    6.82  #include "lltoolview.h"
    6.83 -#include "llui.h"			// for make_ui_sound
    6.84  #include "llurldispatcher.h"
    6.85  #include "llviewercamera.h"
    6.86 +#include "llviewercontrol.h"
    6.87  #include "llviewerinventory.h"
    6.88 +#include "llviewerjoystick.h"
    6.89  #include "llviewermediafocus.h"
    6.90  #include "llviewermenu.h"
    6.91  #include "llviewernetwork.h"
    6.92 @@ -131,11 +136,7 @@
    6.93  #include "llworld.h"
    6.94  #include "llworldmap.h"
    6.95  #include "pipeline.h"
    6.96 -#include "roles_constants.h"
    6.97 -#include "llviewercontrol.h"
    6.98 -#include "llappviewer.h"
    6.99 -#include "llviewerjoystick.h"
   6.100 -#include "llfollowcam.h"
   6.101 +
   6.102  #include "llfloaterteleporthistory.h"
   6.103  #include "jc_lslviewerbridge.h"
   6.104  #include "llenvmanager.h"
   6.105 @@ -6201,15 +6202,30 @@
   6.106  		mesgsys->getUUIDFast(_PREHASH_WearableData, _PREHASH_TextureID, texture_id, texture_block);
   6.107  		mesgsys->getU8Fast(_PREHASH_WearableData, _PREHASH_TextureIndex, texture_index, texture_block);
   6.108  
   6.109 -		if (texture_id.notNull() 
   6.110 -			&& (S32)texture_index < BAKED_NUM_INDICES 
   6.111 -			&& gAgent.mActiveCacheQueries[ texture_index ] == query_id)
   6.112 -		{
   6.113 -			//llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl;
   6.114 -			avatarp->setCachedBakedTexture(getTextureIndex((EBakedTextureIndex)texture_index), texture_id);
   6.115 -			//avatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id );
   6.116 -			gAgent.mActiveCacheQueries[ texture_index ] = 0;
   6.117 -			num_results++;
   6.118 +		if ((S32)texture_index < TEX_NUM_INDICES)
   6.119 +		{	
   6.120 +			const LLVOAvatarDictionary::TextureEntry *texture_entry = LLVOAvatarDictionary::instance().getTexture((ETextureIndex)texture_index);
   6.121 +			if (texture_entry)
   6.122 +			{
   6.123 +				EBakedTextureIndex baked_index = texture_entry->mBakedTextureIndex;
   6.124 +
   6.125 +				if (gAgent.mActiveCacheQueries[baked_index] == query_id)
   6.126 +				{
   6.127 +					if (texture_id.notNull())
   6.128 +					{
   6.129 +						//llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl;
   6.130 +						avatarp->setCachedBakedTexture((ETextureIndex)texture_index, texture_id);
   6.131 +						//avatarp->setTETexture(LLVOAvatar::sBakedTextureIndices[texture_index], texture_id);
   6.132 +						gAgent.mActiveCacheQueries[baked_index] = 0;
   6.133 +						num_results++;
   6.134 +					}
   6.135 +				}
   6.136 +				else
   6.137 +				{
   6.138 +					// no cache of this bake. request upload.
   6.139 +					//avatarp->requestLayerSetUpload(baked_index);
   6.140 +				}
   6.141 +			}
   6.142  		}
   6.143  	}
   6.144  
   6.145 @@ -6852,7 +6868,7 @@
   6.146  {
   6.147  	// First make sure that we have inventory items for each wearable
   6.148  	S32 i;
   6.149 -	for(i=0; i < WT_COUNT; ++i)
   6.150 +	for (i = 0; i < LLWearableType::WT_COUNT; ++i)
   6.151  	{
   6.152  		LLWearable* wearable = mWearableEntry[ i ].mWearable;
   6.153  		if (wearable)
   6.154 @@ -6889,7 +6905,7 @@
   6.155  	gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
   6.156  
   6.157  	LL_DEBUGS("Wearables") << "sendAgentWearablesUpdate()" << LL_ENDL;
   6.158 -	for(i=0; i < WT_COUNT; ++i)
   6.159 +	for (i = 0; i < LLWearableType::WT_COUNT; ++i)
   6.160  	{
   6.161  		gMessageSystem->nextBlockFast(_PREHASH_WearableData);
   6.162  
   6.163 @@ -6912,16 +6928,22 @@
   6.164  		}
   6.165  		else
   6.166  		{
   6.167 -			LL_DEBUGS("Wearables") << "Not wearing wearable type " << LLWearable::typeToTypeName((EWearableType)i) << LL_ENDL;
   6.168 +			LL_DEBUGS("Wearables") << "Not wearing wearable type: "
   6.169 +								   << LLWearableType::getTypeName((LLWearableType::EType)i)
   6.170 +								   << LL_ENDL;
   6.171  			gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null );
   6.172  		}
   6.173  
   6.174 -		LL_DEBUGS("Wearables") << "       " << LLWearable::typeToTypeLabel((EWearableType)i) << " : " << (wearable ? wearable->getID() : LLUUID::null) << LL_ENDL;
   6.175 +		LL_DEBUGS("Wearables") << "       "
   6.176 +							   << LLWearableType::getTypeLabel((LLWearableType::EType)i)
   6.177 +							   << " : "
   6.178 +							   << (wearable ? wearable->getID() : LLUUID::null)
   6.179 +							   << LL_ENDL;
   6.180  	}
   6.181  	gAgent.sendReliableMessage();
   6.182  }
   6.183  
   6.184 -void LLAgent::saveWearable( EWearableType type, BOOL send_update )
   6.185 +void LLAgent::saveWearable(LLWearableType::EType type, BOOL send_update)
   6.186  {
   6.187  	LLWearable* old_wearable = mWearableEntry[(S32)type].mWearable;
   6.188  	if( old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion()) )
   6.189 @@ -6977,7 +6999,7 @@
   6.190  }
   6.191  
   6.192  void LLAgent::saveWearableAs(
   6.193 -	EWearableType type,
   6.194 +	LLWearableType::EType type,
   6.195  	const std::string& new_name,
   6.196  	BOOL save_in_lost_and_found)
   6.197  {
   6.198 @@ -7070,7 +7092,7 @@
   6.199  */
   6.200  }
   6.201  
   6.202 -void LLAgent::revertWearable( EWearableType type )
   6.203 +void LLAgent::revertWearable(LLWearableType::EType type)
   6.204  {
   6.205  	LLWearable* wearable = mWearableEntry[(S32)type].mWearable;
   6.206  	if( wearable )
   6.207 @@ -7082,9 +7104,9 @@
   6.208  
   6.209  void LLAgent::revertAllWearables()
   6.210  {
   6.211 -	for( S32 i=0; i < WT_COUNT; i++ )
   6.212 -	{
   6.213 -		revertWearable( (EWearableType)i );
   6.214 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   6.215 +	{
   6.216 +		revertWearable((LLWearableType::EType)i);
   6.217  	}
   6.218  }
   6.219  
   6.220 @@ -7095,9 +7117,9 @@
   6.221  	//	return;
   6.222  	//}
   6.223  
   6.224 -	for( S32 i=0; i < WT_COUNT; i++ )
   6.225 -	{
   6.226 -		saveWearable( (EWearableType)i, FALSE );
   6.227 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   6.228 +	{
   6.229 +		saveWearable((LLWearableType::EType)i, FALSE);
   6.230  	}
   6.231  	sendAgentWearablesUpdate();
   6.232  }
   6.233 @@ -7105,7 +7127,7 @@
   6.234  // Called when the user changes the name of a wearable inventory item that is currenlty being worn.
   6.235  void LLAgent::setWearableName( const LLUUID& item_id, const std::string& new_name )
   6.236  {
   6.237 -	for( S32 i=0; i < WT_COUNT; i++ )
   6.238 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   6.239  	{
   6.240  		if( mWearableEntry[i].mItemID == item_id )
   6.241  		{
   6.242 @@ -7130,7 +7152,7 @@
   6.243  }
   6.244  
   6.245  
   6.246 -BOOL LLAgent::isWearableModifiable(EWearableType type)
   6.247 +BOOL LLAgent::isWearableModifiable(LLWearableType::EType type)
   6.248  {
   6.249  	LLUUID item_id = getWearableItem(type);
   6.250  	if(!item_id.isNull())
   6.251 @@ -7145,7 +7167,7 @@
   6.252  	return FALSE;
   6.253  }
   6.254  
   6.255 -BOOL LLAgent::isWearableCopyable(EWearableType type)
   6.256 +BOOL LLAgent::isWearableCopyable(LLWearableType::EType type)
   6.257  {
   6.258  	LLUUID item_id = getWearableItem(type);
   6.259  	if(!item_id.isNull())
   6.260 @@ -7160,7 +7182,7 @@
   6.261  	return FALSE;
   6.262  }
   6.263  
   6.264 -U32 LLAgent::getWearablePermMask(EWearableType type)
   6.265 +U32 LLAgent::getWearablePermMask(LLWearableType::EType type)
   6.266  {
   6.267  	LLUUID item_id = getWearableItem(type);
   6.268  	if(!item_id.isNull())
   6.269 @@ -7174,7 +7196,7 @@
   6.270  	return PERM_NONE;
   6.271  }
   6.272  
   6.273 -LLInventoryItem* LLAgent::getWearableInventoryItem(EWearableType type)
   6.274 +LLInventoryItem* LLAgent::getWearableInventoryItem(LLWearableType::EType type)
   6.275  {
   6.276  	LLUUID item_id = getWearableItem(type);
   6.277  	LLInventoryItem* item = NULL;
   6.278 @@ -7187,7 +7209,7 @@
   6.279  
   6.280  LLWearable* LLAgent::getWearableFromWearableItem( const LLUUID& item_id )
   6.281  {
   6.282 -	for( S32 i=0; i < WT_COUNT; i++ )
   6.283 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   6.284  	{
   6.285  		if( mWearableEntry[i].mItemID == item_id )
   6.286  		{
   6.287 @@ -7211,7 +7233,7 @@
   6.288  // static
   6.289  BOOL LLAgent::selfHasWearable( void* userdata )
   6.290  {
   6.291 -	EWearableType type = (EWearableType)(intptr_t)userdata;
   6.292 +	LLWearableType::EType type = (LLWearableType::EType)(intptr_t)userdata;
   6.293  	return gAgent.getWearable( type ) != NULL;
   6.294  }
   6.295  
   6.296 @@ -7257,19 +7279,19 @@
   6.297  		//	 gAgent.setGenderChosen(TRUE);
   6.298  		//}
   6.299  
   6.300 -		//lldebugs << "processAgentInitialWearablesUpdate()" << llendl;
   6.301 +		//LL_DEBUGS("Wearables") << "processAgentInitialWearablesUpdate()" << LL_ENDL;
   6.302  		// Add wearables
   6.303 -		LLUUID asset_id_array[ WT_COUNT ];
   6.304 +		LLUUID asset_id_array[LLWearableType::WT_COUNT];
   6.305  		S32 i;
   6.306  		for( i=0; i < num_wearables; i++ )
   6.307  		{
   6.308  			U8 type_u8 = 0;
   6.309  			gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i );
   6.310 -			if( type_u8 >= WT_COUNT )
   6.311 +			if (type_u8 >= LLWearableType::WT_COUNT)
   6.312  			{
   6.313  				continue;
   6.314  			}
   6.315 -			EWearableType type = (EWearableType) type_u8;
   6.316 +			LLWearableType::EType type = (LLWearableType::EType) type_u8;
   6.317  
   6.318  			LLUUID item_id;
   6.319  			gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i );
   6.320 @@ -7282,7 +7304,7 @@
   6.321  			}
   6.322  			else
   6.323  			{
   6.324 -				LLAssetType::EType asset_type = LLWearable::typeToAssetType( type );
   6.325 +				LLAssetType::EType asset_type = LLWearableType::getAssetType(type);
   6.326  				if( asset_type == LLAssetType::AT_NONE )
   6.327  				{
   6.328  					continue;
   6.329 @@ -7292,13 +7314,16 @@
   6.330  				asset_id_array[type] = asset_id;
   6.331  			}
   6.332  
   6.333 -			LL_DEBUGS("Wearables") << "       " << LLWearable::typeToTypeLabel(type) << " " << asset_id << " item id " << gAgent.mWearableEntry[type].mItemID.asString() << LL_ENDL;
   6.334 +			LL_DEBUGS("Wearables") << "       " << LLWearableType::getTypeLabel(type)
   6.335 + 								   << " " << asset_id << " item id "
   6.336 + 								   << gAgent.mWearableEntry[type].mItemID.asString()
   6.337 + 								   << LL_ENDL;
   6.338  		}
   6.339  
   6.340  		LLCOFMgr::instance().fetchCOF();
   6.341  
   6.342  		// now that we have the asset ids...request the wearable assets
   6.343 -		for( i = 0; i < WT_COUNT; i++ )
   6.344 +		for (i = 0; i < LLWearableType::WT_COUNT; i++)
   6.345  		{
   6.346  			LL_DEBUGS("Wearables") << "      fetching " << asset_id_array[i] << LL_ENDL;
   6.347  			if( !gAgent.mWearableEntry[i].mItemID.isNull() )
   6.348 @@ -7306,7 +7331,7 @@
   6.349  				gWearableList.getAsset( 
   6.350  					asset_id_array[i],
   6.351  					LLStringUtil::null,
   6.352 -					LLWearable::typeToAssetType( (EWearableType) i ), 
   6.353 +					LLWearableType::getAssetType((LLWearableType::EType)i),
   6.354  					LLAgent::onInitialWearableAssetArrived, (void*)(intptr_t)i );
   6.355  			}
   6.356  		}
   6.357 @@ -7320,7 +7345,7 @@
   6.358  // static
   6.359  void LLAgent::onInitialWearableAssetArrived( LLWearable* wearable, void* userdata )
   6.360  {
   6.361 -	EWearableType type = (EWearableType)(intptr_t)userdata;
   6.362 +	LLWearableType::EType type = (LLWearableType::EType)(intptr_t)userdata;
   6.363  
   6.364  	LLVOAvatar* avatar = gAgent.getAvatarObject();
   6.365  	if( !avatar )
   6.366 @@ -7353,7 +7378,7 @@
   6.367  	if( !gAgent.mWearablesLoaded )
   6.368  	{
   6.369  		gAgent.mWearablesLoaded = TRUE;
   6.370 -		for( S32 i = 0; i < WT_COUNT; i++ )
   6.371 +		for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   6.372  		{
   6.373  			if( !gAgent.mWearableEntry[i].mItemID.isNull() && !gAgent.mWearableEntry[i].mWearable )
   6.374  			{
   6.375 @@ -7380,11 +7405,13 @@
   6.376  // Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the
   6.377  // database.  If for some reason, we can't load one of those assets, we can try to reconstruct it so that
   6.378  // the user isn't left without a shape, for example.  (We can do that only after the inventory has loaded.)
   6.379 -void LLAgent::recoverMissingWearable( EWearableType type )
   6.380 +void LLAgent::recoverMissingWearable(LLWearableType::EType type)
   6.381  {
   6.382  	// Try to recover by replacing missing wearable with a new one.
   6.383  	LLNotifications::instance().add("ReplacedMissingWearable");
   6.384 -	lldebugs << "Wearable " << LLWearable::typeToTypeLabel( type ) << " could not be downloaded.  Replaced inventory item with default wearable." << llendl;
   6.385 +	LL_DEBUGS("Wearables") << "Wearable " << LLWearableType::getTypeLabel(type)
   6.386 +						   << " could not be downloaded. Replaced inventory item with default wearable."
   6.387 +						   << LL_ENDL;
   6.388  	LLWearable* new_wearable = gWearableList.createNewWearable(type);
   6.389  
   6.390  	S32 type_s32 = (S32) type;
   6.391 @@ -7409,7 +7436,7 @@
   6.392  {
   6.393  	// Have all the wearables that the avatar was wearing at log-in arrived or been fabricated?
   6.394  	mWearablesLoaded = TRUE;
   6.395 -	for( S32 i = 0; i < WT_COUNT; i++ )
   6.396 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   6.397  	{
   6.398  		if( !mWearableEntry[i].mItemID.isNull() && !mWearableEntry[i].mWearable )
   6.399  		{
   6.400 @@ -7443,7 +7470,7 @@
   6.401  	if(female) mAvatarObject->setSex(SEX_FEMALE);
   6.402  	else mAvatarObject->setSex(SEX_MALE);
   6.403  
   6.404 -	BOOL create[WT_COUNT] = 
   6.405 +	BOOL create[LLWearableType::WT_COUNT] = 
   6.406  	{
   6.407  		TRUE,  //WT_SHAPE
   6.408  		TRUE,  //WT_SKIN
   6.409 @@ -7463,7 +7490,7 @@
   6.410  		FALSE   //WT_PHYSICS
   6.411  	};
   6.412  
   6.413 -	for( S32 i=0; i < WT_COUNT; i++ )
   6.414 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   6.415  	{
   6.416  		bool once = false;
   6.417  		LLPointer<LLRefCount> donecb = NULL;
   6.418 @@ -7475,7 +7502,7 @@
   6.419  				donecb = new createStandardWearablesAllDoneCallback;
   6.420  			}
   6.421  			llassert( mWearableEntry[i].mWearable == NULL );
   6.422 -			LLWearable* wearable = gWearableList.createNewWearable((EWearableType)i);
   6.423 +			LLWearable* wearable = gWearableList.createNewWearable((LLWearableType::EType)i);
   6.424  			mWearableEntry[i].mWearable = wearable;
   6.425  			// no need to update here...
   6.426  			LLPointer<LLInventoryCallback> cb =
   6.427 @@ -7575,7 +7602,7 @@
   6.428  						LLStringUtil::truncate(new_name, DB_INV_ITEM_NAME_STR_LEN);
   6.429  					}
   6.430  
   6.431 -					if (fUseLinks || isWearableCopyable((EWearableType)index))
   6.432 +					if (fUseLinks || isWearableCopyable((LLWearableType::EType)index))
   6.433  					{
   6.434  						LLWearable* new_wearable = gWearableList.createCopy(old_wearable);
   6.435  						if (rename_clothing)
   6.436 @@ -7598,7 +7625,7 @@
   6.437  								index,
   6.438  								new_wearable,
   6.439  								todo);
   6.440 -						if (isWearableCopyable((EWearableType)index))
   6.441 +						if (isWearableCopyable((LLWearableType::EType)index))
   6.442  						{
   6.443  							copy_inventory_item(
   6.444  								gAgent.getID(),
   6.445 @@ -7745,6 +7772,61 @@
   6.446  		cb);
   6.447  }
   6.448  
   6.449 +// *TODO: move to llagentwearables.cpp once ported
   6.450 +LLUUID LLAgent::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextureIndex baked_index,
   6.451 +										BOOL generate_valid_hash) // Set to false if you want to upload the baked texture w/o putting it in the cache
   6.452 +{
   6.453 +	LLUUID hash_id;
   6.454 +	bool hash_computed = false;
   6.455 +	LLMD5 hash;
   6.456 +	const LLVOAvatarDictionary::BakedEntry *baked_dict;
   6.457 +	baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index);
   6.458 +
   6.459 +	for (U8 i = 0; i < baked_dict->mWearables.size(); i++)
   6.460 +	{
   6.461 +		const LLWearableType::EType baked_type = baked_dict->mWearables[i];
   6.462 +#ifdef MULTIPLE_LAYERS
   6.463 +		const U32 num_wearables = getWearableCount(baked_type);
   6.464 +		for (U32 index = 0; index < num_wearables; ++index)
   6.465 +		{
   6.466 +			const LLWearable* wearable = getWearable(baked_type, index);
   6.467 +			if (wearable)
   6.468 +			{
   6.469 +				LLUUID asset_id = wearable->getID();
   6.470 +				hash.update((const unsigned char*)asset_id.mData, UUID_BYTES);
   6.471 +				hash_computed = true;
   6.472 +			}
   6.473 +		}
   6.474 +#else
   6.475 +		const LLWearable* wearable = getWearable(baked_type);
   6.476 +		if (wearable)
   6.477 +		{
   6.478 +			LLUUID asset_id = wearable->getID();
   6.479 +			hash.update((const unsigned char*)asset_id.mData, UUID_BYTES);
   6.480 +			hash_computed = true;
   6.481 +		}
   6.482 +#endif
   6.483 +	}
   6.484 +	if (hash_computed)
   6.485 +	{
   6.486 +		hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES);
   6.487 +
   6.488 +		// Add some garbage into the hash so that it becomes invalid.
   6.489 +		if (!generate_valid_hash)
   6.490 +		{
   6.491 +			if (mAvatarObject && mAvatarObject->getRegion() != NULL &&
   6.492 +				!mAvatarObject->isDead())
   6.493 +			{
   6.494 +				hash.update((const unsigned char*)mAvatarObject->getID().mData, UUID_BYTES);
   6.495 +			}
   6.496 +		}
   6.497 +		hash.finalize();
   6.498 +		hash.raw_digest(hash_id.mData);
   6.499 +	}
   6.500 +
   6.501 +	return hash_id;
   6.502 +}
   6.503 +
   6.504  //-----------------------------------------------------------------------------
   6.505  // sendAgentSetAppearance()
   6.506  //-----------------------------------------------------------------------------
   6.507 @@ -7789,10 +7871,11 @@
   6.508  
   6.509  	for(U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ )
   6.510  	{
   6.511 -		const ETextureIndex texture_index = getTextureIndex((EBakedTextureIndex)baked_index);
   6.512 +		const ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index);
   6.513  
   6.514  		// if we're not wearing a skirt, we don't need the texture to be baked
   6.515 -		if (texture_index == TEX_SKIRT_BAKED && !mAvatarObject->isWearingWearableType(WT_SKIRT))
   6.516 +		if (texture_index == TEX_SKIRT_BAKED &&
   6.517 +			!mAvatarObject->isWearingWearableType(LLWearableType::WT_SKIRT))
   6.518  		{
   6.519  			continue;
   6.520  		}
   6.521 @@ -7811,28 +7894,24 @@
   6.522  		llinfos << "TAT: Sending cached texture data" << llendl;
   6.523  		for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
   6.524  		{
   6.525 -			const LLVOAvatarDictionary::WearableDictionaryEntry *wearable_dict = LLVOAvatarDictionary::getInstance()->getWearable((EBakedTextureIndex)baked_index);
   6.526 -			LLUUID hash;
   6.527 -			for (U8 i=0; i < wearable_dict->mWearablesVec.size(); i++)
   6.528 +			BOOL generate_valid_hash = TRUE;
   6.529 +/*
   6.530 +			if (mAvatarObject && mAvatarObject->getRegion() != NULL &&
   6.531 +				!mAvatarObject->isDead() &&
   6.532 +				!mAvatarObject->isBakedTextureFinal((LLVOAvatarDefines::EBakedTextureIndex)baked_index))
   6.533  			{
   6.534 -				// EWearableType wearable_type = gBakedWearableMap[baked_index][wearable_num];
   6.535 -				const EWearableType wearable_type = wearable_dict->mWearablesVec[i];
   6.536 -				const LLWearable* wearable = getWearable(wearable_type);
   6.537 -				if (wearable)
   6.538 -				{
   6.539 -					hash ^= wearable->getID();
   6.540 -				}
   6.541 +				generate_valid_hash = FALSE;
   6.542 +				llinfos << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << llendl;
   6.543  			}
   6.544 +*/
   6.545 +			const LLUUID hash = computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash);
   6.546  			if (hash.notNull())
   6.547  			{
   6.548 -				hash ^= wearable_dict->mHashID;
   6.549 +				ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex) baked_index);
   6.550 +				msg->nextBlockFast(_PREHASH_WearableData);
   6.551 +				msg->addUUIDFast(_PREHASH_CacheID, hash);
   6.552 +				msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index);
   6.553  			}
   6.554 -
   6.555 -			const ETextureIndex texture_index = getTextureIndex((EBakedTextureIndex)baked_index);
   6.556 -
   6.557 -			msg->nextBlockFast(_PREHASH_WearableData);
   6.558 -			msg->addUUIDFast(_PREHASH_CacheID, hash);
   6.559 -			msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index);
   6.560  		}
   6.561  		msg->nextBlockFast(_PREHASH_ObjectData);
   6.562  		mAvatarObject->packTEMessage( gMessageSystem, TRUE );
   6.563 @@ -7847,7 +7926,7 @@
   6.564  	}
   6.565  
   6.566  	BOOL send_v1_message = gSavedSettings.getBOOL("PhoenixDontSendAvPhysicsParms");
   6.567 -	BOOL wearing_physics = (getWearable(WT_PHYSICS) != NULL);
   6.568 +	BOOL wearing_physics = (getWearable(LLWearableType::WT_PHYSICS) != NULL);
   6.569  	S32 transmitted_params = 0;
   6.570  	for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam();
   6.571  		 param;
   6.572 @@ -7890,12 +7969,13 @@
   6.573  	sendReliableMessage();
   6.574  }
   6.575  
   6.576 -void LLAgent::removeWearable( EWearableType type )
   6.577 +void LLAgent::removeWearable(LLWearableType::EType type)
   6.578  {
   6.579  	LLWearable* old_wearable = mWearableEntry[ type ].mWearable;
   6.580  
   6.581 -	if ( (gAgent.isTeen())
   6.582 -		 && (type == WT_UNDERSHIRT || type == WT_UNDERPANTS))
   6.583 +	if (gAgent.isTeen() &&
   6.584 +		(type == LLWearableType::WT_UNDERSHIRT ||
   6.585 +		 type == LLWearableType::WT_UNDERPANTS))
   6.586  	{
   6.587  		// Can't take off underclothing in simple UI mode or on PG accounts
   6.588  		return;
   6.589 @@ -7929,7 +8009,7 @@
   6.590  bool LLAgent::onRemoveWearableDialog(const LLSD& notification, const LLSD& response )
   6.591  {
   6.592  	S32 option = LLNotification::getSelectedOption(notification, response);
   6.593 -	EWearableType type = (EWearableType)notification["payload"]["wearable_type"].asInteger();
   6.594 +	LLWearableType::EType type = (LLWearableType::EType)notification["payload"]["wearable_type"].asInteger();
   6.595  	switch( option )
   6.596  	{
   6.597  	case 0:  // "Save"
   6.598 @@ -7952,7 +8032,7 @@
   6.599  }
   6.600  
   6.601  // Called by removeWearable() and onRemoveWearableDialog() to actually do the removal.
   6.602 -void LLAgent::removeWearableFinal( EWearableType type )
   6.603 +void LLAgent::removeWearableFinal(LLWearableType::EType type)
   6.604  {
   6.605  	LLWearable* old_wearable = mWearableEntry[ type ].mWearable;
   6.606  
   6.607 @@ -7974,7 +8054,7 @@
   6.608  	gInventory.notifyObservers();
   6.609  }
   6.610  
   6.611 -void LLAgent::copyWearableToInventory( EWearableType type )
   6.612 +void LLAgent::copyWearableToInventory(LLWearableType::EType type)
   6.613  {
   6.614  	LLWearable* wearable = mWearableEntry[ type ].mWearable;
   6.615  	if( wearable )
   6.616 @@ -8013,7 +8093,7 @@
   6.617  	LLWearable*			mNewWearable;
   6.618  };
   6.619  
   6.620 -BOOL LLAgent::needsReplacement(EWearableType  wearableType, S32 remove)
   6.621 +BOOL LLAgent::needsReplacement(LLWearableType::EType  wearableType, S32 remove)
   6.622  {
   6.623  	return TRUE;
   6.624  	/*if (remove) return TRUE;
   6.625 @@ -8027,26 +8107,26 @@
   6.626  	const LLDynamicArray< LLWearable* >& wearables,
   6.627  	BOOL remove )
   6.628  {
   6.629 -	lldebugs << "setWearableOutfit() start" << llendl;
   6.630 -
   6.631 -	BOOL wearables_to_remove[WT_COUNT];
   6.632 -	wearables_to_remove[WT_SHAPE]		= FALSE;
   6.633 -	wearables_to_remove[WT_SKIN]		= FALSE;
   6.634 -	wearables_to_remove[WT_HAIR]		= FALSE;
   6.635 -	wearables_to_remove[WT_EYES]		= FALSE;
   6.636 +	LL_DEBUGS("Wearables") << "setWearableOutfit() start" << LL_ENDL;
   6.637 +
   6.638 +	BOOL wearables_to_remove[LLWearableType::WT_COUNT];
   6.639 +	wearables_to_remove[LLWearableType::WT_SHAPE]		= FALSE;
   6.640 +	wearables_to_remove[LLWearableType::WT_SKIN]		= FALSE;
   6.641 +	wearables_to_remove[LLWearableType::WT_HAIR]		= FALSE;
   6.642 +	wearables_to_remove[LLWearableType::WT_EYES]		= FALSE;
   6.643  // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.1.3b) | Added: RLVa-0.2.2a
   6.644 -	wearables_to_remove[WT_SHIRT]		= remove && gRlvWearableLocks.canRemove(WT_SHIRT);
   6.645 -	wearables_to_remove[WT_PANTS]		= remove && gRlvWearableLocks.canRemove(WT_PANTS);
   6.646 -	wearables_to_remove[WT_SHOES]		= remove && gRlvWearableLocks.canRemove(WT_SHOES);
   6.647 -	wearables_to_remove[WT_SOCKS]		= remove && gRlvWearableLocks.canRemove(WT_SOCKS);
   6.648 -	wearables_to_remove[WT_JACKET]		= remove && gRlvWearableLocks.canRemove(WT_JACKET);
   6.649 -	wearables_to_remove[WT_GLOVES]		= remove && gRlvWearableLocks.canRemove(WT_GLOVES);
   6.650 -	wearables_to_remove[WT_UNDERSHIRT]	= (!gAgent.isTeen()) && remove && gRlvWearableLocks.canRemove(WT_UNDERSHIRT);
   6.651 -	wearables_to_remove[WT_UNDERPANTS]	= (!gAgent.isTeen()) && remove && gRlvWearableLocks.canRemove(WT_UNDERPANTS);
   6.652 -	wearables_to_remove[WT_SKIRT]		= remove && gRlvWearableLocks.canRemove(WT_SKIRT);
   6.653 -	wearables_to_remove[WT_ALPHA]		= remove && gRlvWearableLocks.canRemove(WT_ALPHA);
   6.654 -	wearables_to_remove[WT_TATTOO]		= remove && gRlvWearableLocks.canRemove(WT_TATTOO);
   6.655 -	wearables_to_remove[WT_PHYSICS]     = remove && gRlvWearableLocks.canRemove(WT_PHYSICS);
   6.656 +	wearables_to_remove[LLWearableType::WT_SHIRT]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_SHIRT);
   6.657 +	wearables_to_remove[LLWearableType::WT_PANTS]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_PANTS);
   6.658 +	wearables_to_remove[LLWearableType::WT_SHOES]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_SHOES);
   6.659 +	wearables_to_remove[LLWearableType::WT_SOCKS]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_SOCKS);
   6.660 +	wearables_to_remove[LLWearableType::WT_JACKET]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_JACKET);
   6.661 +	wearables_to_remove[LLWearableType::WT_GLOVES]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_GLOVES);
   6.662 +	wearables_to_remove[LLWearableType::WT_UNDERSHIRT]	= (!gAgent.isTeen()) && remove && gRlvWearableLocks.canRemove(LLWearableType::WT_UNDERSHIRT);
   6.663 +	wearables_to_remove[LLWearableType::WT_UNDERPANTS]	= (!gAgent.isTeen()) && remove && gRlvWearableLocks.canRemove(LLWearableType::WT_UNDERPANTS);
   6.664 +	wearables_to_remove[LLWearableType::WT_SKIRT]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_SKIRT);
   6.665 +	wearables_to_remove[LLWearableType::WT_ALPHA]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_ALPHA);
   6.666 +	wearables_to_remove[LLWearableType::WT_TATTOO]		= remove && gRlvWearableLocks.canRemove(LLWearableType::WT_TATTOO);
   6.667 +	wearables_to_remove[LLWearableType::WT_PHYSICS]     = remove && gRlvWearableLocks.canRemove(LLWearableType::WT_PHYSICS);
   6.668  // [/RLVa:KB]
   6.669  
   6.670  	S32 count = wearables.count();
   6.671 @@ -8058,7 +8138,7 @@
   6.672  		LLWearable* new_wearable = wearables[i];
   6.673  		LLPointer<LLInventoryItem> new_item = items[i];
   6.674  
   6.675 -		EWearableType type = new_wearable->getType();
   6.676 +		LLWearableType::EType type = new_wearable->getType();
   6.677  		wearables_to_remove[type] = FALSE;
   6.678  
   6.679  		LLWearable* old_wearable = mWearableEntry[ type ].mWearable;
   6.680 @@ -8068,7 +8148,9 @@
   6.681  			if( (old_wearable->getID() == new_wearable->getID()) &&
   6.682  				(old_item_id == new_item->getLinkedUUID()) )
   6.683  			{
   6.684 -				lldebugs << "No change to wearable asset and item: " << LLWearable::typeToTypeName( type ) << llendl;
   6.685 +				LL_DEBUGS("Wearables") << "No change to wearable asset and item: "
   6.686 +									   << LLWearableType::getTypeName(type)
   6.687 +									   << LL_ENDL;
   6.688  				continue;
   6.689  			}
   6.690  
   6.691 @@ -8088,7 +8170,7 @@
   6.692  
   6.693  	std::vector<LLWearable*> wearables_being_removed;
   6.694  
   6.695 -	for( i = 0; i < WT_COUNT; i++ )
   6.696 +	for (i = 0; i < LLWearableType::WT_COUNT; i++)
   6.697  	{
   6.698  		if( wearables_to_remove[i] )
   6.699  		{
   6.700 @@ -8127,14 +8209,14 @@
   6.701  	sendAgentWearablesUpdate();
   6.702  	sendAgentSetAppearance();
   6.703  
   6.704 -	lldebugs << "setWearableOutfit() end" << llendl;
   6.705 +	LL_DEBUGS("Wearables") << "setWearableOutfit() end" << LL_ENDL;
   6.706  }
   6.707  
   6.708  
   6.709  // User has picked "wear on avatar" from a menu.
   6.710  void LLAgent::setWearable( LLInventoryItem* new_item, LLWearable* new_wearable )
   6.711  {
   6.712 -	EWearableType type = new_wearable->getType();
   6.713 +	LLWearableType::EType type = new_wearable->getType();
   6.714  
   6.715  	LLWearable* old_wearable = mWearableEntry[ type ].mWearable;
   6.716  
   6.717 @@ -8152,7 +8234,9 @@
   6.718  		if( (old_wearable->getID() == new_wearable->getID()) &&
   6.719  			(old_item_id == new_item->getUUID()) )
   6.720  		{
   6.721 -			lldebugs << "No change to wearable asset and item: " << LLWearable::typeToTypeName( type ) << llendl;
   6.722 +			LL_DEBUGS("Wearables") << "No change to wearable asset and item: "
   6.723 +								   << LLWearableType::getTypeName(type)
   6.724 +								   << LL_ENDL;
   6.725  			return;
   6.726  		}
   6.727  
   6.728 @@ -8209,7 +8293,7 @@
   6.729  // Called from setWearable() and onSetWearableDialog() to actually set the wearable.
   6.730  void LLAgent::setWearableFinal( LLInventoryItem* new_item, LLWearable* new_wearable )
   6.731  {
   6.732 -	EWearableType type = new_wearable->getType();
   6.733 +	LLWearableType::EType type = new_wearable->getType();
   6.734  
   6.735  	// Replace the old wearable with a new one.
   6.736  	llassert( new_item->getAssetUUID() == new_wearable->getID() );
   6.737 @@ -8257,47 +8341,43 @@
   6.738  	S32 num_queries = 0;
   6.739  	for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ )
   6.740  	{
   6.741 -		const LLVOAvatarDictionary::WearableDictionaryEntry *wearable_dict = LLVOAvatarDictionary::getInstance()->getWearable((EBakedTextureIndex)baked_index);
   6.742 -		LLUUID hash;
   6.743 -		for (U8 i=0; i < wearable_dict->mWearablesVec.size(); i++)
   6.744 -		{
   6.745 -			// EWearableType wearable_type = gBakedWearableMap[baked_index][wearable_num];
   6.746 -			const EWearableType wearable_type = wearable_dict->mWearablesVec[i];
   6.747 -			const LLWearable* wearable = getWearable(wearable_type);
   6.748 -			if (wearable)
   6.749 -			{
   6.750 -				hash ^= wearable->getID();
   6.751 -			}
   6.752 -		}
   6.753 -		if (hash.notNull())
   6.754 -		{
   6.755 -			hash ^= wearable_dict->mHashID;
   6.756 +		LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index);
   6.757 +		if (hash_id.notNull())
   6.758 +		{
   6.759  			num_queries++;
   6.760  			// *NOTE: make sure at least one request gets packed
   6.761  
   6.762 +			ETextureIndex te_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index);
   6.763 +
   6.764  			//llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl;
   6.765  			gMessageSystem->nextBlockFast(_PREHASH_WearableData);
   6.766 -			gMessageSystem->addUUIDFast(_PREHASH_ID, hash);
   6.767 -			gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)baked_index);
   6.768 +			gMessageSystem->addUUIDFast(_PREHASH_ID, hash_id);
   6.769 +			gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)te_index);
   6.770  		}
   6.771  
   6.772  		mActiveCacheQueries[ baked_index ] = mTextureCacheQueryID;
   6.773  	}
   6.774  
   6.775 -	llinfos << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl;
   6.776 -	gMessageSystem->sendReliable(getRegion()->getHost());
   6.777 -	mNumPendingQueries++;
   6.778 -	mTextureCacheQueryID++;
   6.779 +	// VWR-22113: getRegion() can return null if invalid, seen here on logout
   6.780 +	if (getRegion())
   6.781 +	{
   6.782 +		llinfos << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl;
   6.783 +		gMessageSystem->sendReliable(getRegion()->getHost());
   6.784 +		mNumPendingQueries++;
   6.785 +		mTextureCacheQueryID++;
   6.786 +	}
   6.787  }
   6.788  
   6.789  // User has picked "remove from avatar" from a menu.
   6.790  // static
   6.791  void LLAgent::userRemoveWearable( void* userdata )
   6.792  {
   6.793 -	EWearableType type = (EWearableType)(intptr_t)userdata;
   6.794 +	LLWearableType::EType type = (LLWearableType::EType)(intptr_t)userdata;
   6.795  	
   6.796 -	if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES) ) //&&
   6.797 -		//!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) )
   6.798 +	if (type != LLWearableType::WT_SHAPE && type != LLWearableType::WT_SKIN &&
   6.799 +		type != LLWearableType::WT_HAIR && type != LLWearableType::WT_EYES)
   6.800 +		// && (!gAgent.isTeen() || (type != LLWearableType::WT_UNDERPANTS &&
   6.801 +		//						    type != LLWearableType::WT_UNDERSHIRT)))
   6.802  	{
   6.803  		gAgent.removeWearable( type );
   6.804  	}
   6.805 @@ -8320,18 +8400,17 @@
   6.806  {
   6.807  	if( proceed )
   6.808  	{
   6.809 -		gAgent.removeWearable( WT_SHIRT );
   6.810 -		gAgent.removeWearable( WT_PANTS );
   6.811 -		gAgent.removeWearable( WT_SHOES );
   6.812 -		gAgent.removeWearable( WT_SOCKS );
   6.813 -		gAgent.removeWearable( WT_JACKET );
   6.814 -		gAgent.removeWearable( WT_GLOVES );
   6.815 -		gAgent.removeWearable( WT_UNDERSHIRT );
   6.816 -		gAgent.removeWearable( WT_UNDERPANTS );
   6.817 -		gAgent.removeWearable( WT_SKIRT );
   6.818 -		gAgent.removeWearable( WT_ALPHA );
   6.819 -		gAgent.removeWearable( WT_TATTOO );
   6.820 -		gAgent.removeWearable( WT_PHYSICS );
   6.821 +		gAgent.removeWearable(LLWearableType::WT_SHIRT);
   6.822 +		gAgent.removeWearable(LLWearableType::WT_PANTS);
   6.823 +		gAgent.removeWearable(LLWearableType::WT_SHOES);
   6.824 +		gAgent.removeWearable(LLWearableType::WT_SOCKS);
   6.825 +		gAgent.removeWearable(LLWearableType::WT_JACKET);
   6.826 +		gAgent.removeWearable(LLWearableType::WT_GLOVES);
   6.827 +		gAgent.removeWearable(LLWearableType::WT_UNDERSHIRT);
   6.828 +		gAgent.removeWearable(LLWearableType::WT_UNDERPANTS);
   6.829 +		gAgent.removeWearable(LLWearableType::WT_SKIRT);
   6.830 +		gAgent.removeWearable(LLWearableType::WT_ALPHA);
   6.831 +		gAgent.removeWearable(LLWearableType::WT_TATTOO);
   6.832  	}
   6.833  }
   6.834  
     7.1 --- a/indra/newview/llagent.h	Sun Jan 15 13:43:22 2012 +0100
     7.2 +++ b/indra/newview/llagent.h	Sat Jan 28 16:48:34 2012 +0100
     7.3 @@ -61,6 +61,7 @@
     7.4  #include "v4math.h"
     7.5  //#include "vmath.h"
     7.6  #include "stdenums.h"
     7.7 +#include "llvoavatardefines.h"
     7.8  #include "llwearable.h"
     7.9  #include "llcharacter.h"
    7.10  #include "llinventory.h"
    7.11 @@ -644,6 +645,8 @@
    7.12  	void			requestEnterGodMode();
    7.13  	void			requestLeaveGodMode();
    7.14  
    7.15 +	LLUUID			computeBakedTextureHash(LLVOAvatarDefines::EBakedTextureIndex baked_index,
    7.16 +											BOOL generate_valid_hash = TRUE);
    7.17  	void			sendAgentSetAppearance();
    7.18  
    7.19  	void 			sendAgentDataUpdateRequest();
    7.20 @@ -655,28 +658,28 @@
    7.21  	//--------------------------------------------------------------------
    7.22  	// Wearables
    7.23  	//--------------------------------------------------------------------
    7.24 -	void			setWearable( LLInventoryItem* new_item, LLWearable* wearable );
    7.25 -	static bool		onSetWearableDialog( const LLSD& notification, const LLSD& response, LLWearable* wearable );
    7.26 -	void			setWearableFinal( LLInventoryItem* new_item, LLWearable* new_wearable );
    7.27 -	void			setWearableOutfit( 	const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove );
    7.28 +	void			setWearable(LLInventoryItem* new_item, LLWearable* wearable);
    7.29 +	static bool		onSetWearableDialog(const LLSD& notification, const LLSD& response, LLWearable* wearable);
    7.30 +	void			setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable);
    7.31 +	void			setWearableOutfit(	const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove);
    7.32  	void			queryWearableCache();
    7.33  
    7.34 -	BOOL			isWearableModifiable(EWearableType type);
    7.35 -	BOOL			isWearableCopyable(EWearableType type);
    7.36 -	BOOL			needsReplacement(EWearableType wearableType, S32 remove);
    7.37 -	U32				getWearablePermMask(EWearableType type);
    7.38 +	BOOL			isWearableModifiable(LLWearableType::EType type);
    7.39 +	BOOL			isWearableCopyable(LLWearableType::EType type);
    7.40 +	BOOL			needsReplacement(LLWearableType::EType wearableType, S32 remove);
    7.41 +	U32				getWearablePermMask(LLWearableType::EType type);
    7.42  
    7.43 -	LLInventoryItem* getWearableInventoryItem(EWearableType type);
    7.44 +	LLInventoryItem* getWearableInventoryItem(LLWearableType::EType type);
    7.45  
    7.46 -	LLWearable*		getWearable( EWearableType type ) { return (type < WT_COUNT) ? mWearableEntry[ type ].mWearable : NULL; }
    7.47 -	BOOL			isWearingItem( const LLUUID& item_id );
    7.48 -	LLWearable*		getWearableFromWearableItem( const LLUUID& item_id );
    7.49 -	const LLUUID&	getWearableItem( EWearableType type ) { return (type < WT_COUNT) ? mWearableEntry[ type ].mItemID : LLUUID::null; }
    7.50 +	LLWearable*		getWearable(LLWearableType::EType type) { return (type < LLWearableType::WT_COUNT) ? mWearableEntry[ type ].mWearable : NULL; }
    7.51 +	BOOL			isWearingItem(const LLUUID& item_id);
    7.52 +	LLWearable*		getWearableFromWearableItem(const LLUUID& item_id);
    7.53 +	const LLUUID&	getWearableItem(LLWearableType::EType type) { return (type < LLWearableType::WT_COUNT) ? mWearableEntry[ type ].mItemID : LLUUID::null; }
    7.54  
    7.55 -	static EWearableType getTEWearableType( S32 te );
    7.56 -	static LLUUID	getDefaultTEImageID( S32 te );
    7.57 -	
    7.58 -	void			copyWearableToInventory( EWearableType type );
    7.59 +	static LLWearableType::EType getTEWearableType(S32 te);
    7.60 +	static LLUUID	getDefaultTEImageID(S32 te);
    7.61 +
    7.62 +	void			copyWearableToInventory(LLWearableType::EType type);
    7.63  
    7.64  	void			makeNewOutfit(
    7.65  						const std::string& new_folder_name,
    7.66 @@ -685,9 +688,9 @@
    7.67  						BOOL rename_clothing);
    7.68  	void			makeNewOutfitDone(S32 index);
    7.69  
    7.70 -	void			removeWearable( EWearableType type );
    7.71 -	static bool		onRemoveWearableDialog(const LLSD& notification, const LLSD& response );
    7.72 -	void			removeWearableFinal( EWearableType type );
    7.73 +	void			removeWearable(LLWearableType::EType type);
    7.74 +	static bool		onRemoveWearableDialog(const LLSD& notification, const LLSD& response);
    7.75 +	void			removeWearableFinal(LLWearableType::EType type);
    7.76  	
    7.77  	void			sendAgentWearablesUpdate();
    7.78  
    7.79 @@ -706,14 +709,14 @@
    7.80  		const LLUUID& item_id,
    7.81  		LLWearable* wearable);
    7.82  	
    7.83 -	void			saveWearableAs( EWearableType type, const std::string& new_name, BOOL save_in_lost_and_found );
    7.84 -	void			saveWearable( EWearableType type, BOOL send_update = TRUE );
    7.85 +	void			saveWearableAs(LLWearableType::EType type, const std::string& new_name, BOOL save_in_lost_and_found);
    7.86 +	void			saveWearable(LLWearableType::EType type, BOOL send_update = TRUE);
    7.87  	void			saveAllWearables();
    7.88  	
    7.89 -	void			revertWearable( EWearableType type );
    7.90 +	void			revertWearable(LLWearableType::EType type);
    7.91  	void			revertAllWearables();
    7.92  
    7.93 -	void			setWearableName( const LLUUID& item_id, const std::string& new_name );
    7.94 +	void			setWearableName(const LLUUID& item_id, const std::string& new_name);
    7.95  	void			createStandardWearables(BOOL female);
    7.96  	void			createStandardWearablesDone(S32 index);
    7.97  	void			createStandardWearablesAllDone();
    7.98 @@ -759,7 +762,7 @@
    7.99  	// internal wearable functions
   7.100  	void			sendAgentWearablesRequest();
   7.101  	static void		onInitialWearableAssetArrived(LLWearable* wearable, void* userdata);
   7.102 -	void			recoverMissingWearable(EWearableType type);
   7.103 +	void			recoverMissingWearable(LLWearableType::EType type);
   7.104  	void			recoverMissingWearableDone();
   7.105  	void			addWearableToAgentInventory(LLPointer<LLInventoryCallback> cb,
   7.106  						LLWearable* wearable, const LLUUID& category_id = LLUUID::null,
   7.107 @@ -987,7 +990,7 @@
   7.108  		LLUUID		mItemID;	// ID of the inventory item in the agent's inventory.
   7.109  		LLWearable*	mWearable;
   7.110  	};
   7.111 -	LLWearableEntry mWearableEntry[ WT_COUNT ];
   7.112 +	LLWearableEntry mWearableEntry[LLWearableType::WT_COUNT];
   7.113  	U32				mAgentWearablesUpdateSerialNum;
   7.114  	BOOL			mWearablesLoaded;
   7.115  	S32				mTextureCacheQueryID;
     8.1 --- a/indra/newview/llfloatercustomize.cpp	Sun Jan 15 13:43:22 2012 +0100
     8.2 +++ b/indra/newview/llfloatercustomize.cpp	Sat Jan 28 16:48:34 2012 +0100
     8.3 @@ -158,12 +158,12 @@
     8.4  
     8.5  ////////////////////////////////////////////////////////////////////////////
     8.6  
     8.7 -BOOL edit_wearable_for_teens(EWearableType type)
     8.8 +BOOL edit_wearable_for_teens(LLWearableType::EType type)
     8.9  {
    8.10  	switch(type)
    8.11  	{
    8.12 -	case WT_UNDERSHIRT:
    8.13 -	case WT_UNDERPANTS:
    8.14 +		case LLWearableType::WT_UNDERSHIRT:
    8.15 +		case LLWearableType::WT_UNDERPANTS:
    8.16  		return FALSE;
    8.17  	default:
    8.18  		return TRUE;
    8.19 @@ -187,16 +187,16 @@
    8.20  		LLUICtrlFactory::getInstance()->buildFloater(this, "floater_new_outfit_dialog.xml");
    8.21  		
    8.22  		// Build list of check boxes
    8.23 -		for( S32 i = 0; i < WT_COUNT; i++ )
    8.24 +		for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ )
    8.25  		{
    8.26 -			std::string name = std::string("checkbox_") + LLWearable::typeToTypeLabel( (EWearableType)i );
    8.27 +			std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel( (LLWearableType::EType)i );
    8.28  			mCheckBoxList.push_back(std::make_pair(name,i));
    8.29  			// Hide teen items
    8.30  			if (gAgent.isTeen() &&
    8.31 -				!edit_wearable_for_teens((EWearableType)i))
    8.32 +				!edit_wearable_for_teens((LLWearableType::EType)i))
    8.33  			{
    8.34  				// hide wearable checkboxes that don't apply to this account
    8.35 -				std::string name = std::string("checkbox_") + LLWearable::typeToTypeLabel( (EWearableType)i );
    8.36 +				std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel( (LLWearableType::EType)i );
    8.37  				childSetVisible(name, FALSE);
    8.38  			}
    8.39  			else //KC: Check all by default
    8.40 @@ -262,11 +262,11 @@
    8.41  
    8.42  	void setWearableToInclude( S32 wearable, S32 enabled, S32 selected )
    8.43  	{
    8.44 -		EWearableType wtType = (EWearableType)wearable;
    8.45 -		if ( ( (0 <= wtType) && (wtType < WT_COUNT) ) && 
    8.46 -			 ( (LLAssetType::AT_BODYPART != LLWearable::typeToAssetType(wtType)) || (!gSavedSettings.getBOOL("UseOutfitFolders")) ) )
    8.47 +		LLWearableType::EType wtType = (LLWearableType::EType)wearable;
    8.48 +		if ( ( (0 <= wtType) && (wtType < LLWearableType::WT_COUNT) ) && 
    8.49 +			 ( (LLAssetType::AT_BODYPART != LLWearableType::getAssetType(wtType)) || (!gSavedSettings.getBOOL("UseOutfitFolders")) ) )
    8.50  		{
    8.51 -			std::string name = std::string("checkbox_") + LLWearable::typeToTypeLabel(wtType);
    8.52 +			std::string name = std::string("checkbox_") + LLWearableType::getTypeLabel(wtType);
    8.53  			childSetEnabled(name, enabled);
    8.54  			childSetValue(name, selected);
    8.55  		}
    8.56 @@ -278,7 +278,7 @@
    8.57  		{
    8.58  			std::string name = mCheckBoxList[i].first;
    8.59  			BOOL checked = childGetValue(name).asBoolean();
    8.60 -			if (i < WT_COUNT )
    8.61 +			if (i < LLWearableType::WT_COUNT )
    8.62  			{
    8.63  				if( checked )
    8.64  				{
    8.65 @@ -352,12 +352,12 @@
    8.66  	{
    8.67  		BOOL fUseOutfits = gSavedSettings.getBOOL("UseOutfitFolders");
    8.68  
    8.69 -		for (S32 idxType = 0; idxType < WT_COUNT; idxType++ )
    8.70 +		for (S32 idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++ )
    8.71  		{
    8.72 -			EWearableType wtType = (EWearableType)idxType;
    8.73 -			if (LLAssetType::AT_BODYPART != LLWearable::typeToAssetType(wtType))
    8.74 +			LLWearableType::EType wtType = (LLWearableType::EType)idxType;
    8.75 +			if (LLAssetType::AT_BODYPART != LLWearableType::getAssetType(wtType))
    8.76  				continue;
    8.77 -			LLCheckBoxCtrl* pCheckCtrl = getChild<LLCheckBoxCtrl>(std::string("checkbox_") + LLWearable::typeToTypeLabel(wtType));
    8.78 +			LLCheckBoxCtrl* pCheckCtrl = getChild<LLCheckBoxCtrl>(std::string("checkbox_") + LLWearableType::getTypeLabel(wtType));
    8.79  			if (!pCheckCtrl)
    8.80  				continue;
    8.81  
    8.82 @@ -438,7 +438,7 @@
    8.83  class LLPanelEditWearable : public LLPanel
    8.84  {
    8.85  public:
    8.86 -	LLPanelEditWearable( EWearableType type );
    8.87 +	LLPanelEditWearable(LLWearableType::EType type);
    8.88  	virtual ~LLPanelEditWearable();
    8.89  
    8.90  	virtual BOOL 		postBuild();
    8.91 @@ -450,8 +450,8 @@
    8.92  	void				addInvisibilityCheckbox(ETextureIndex te, const std::string& name);
    8.93  	void				addColorSwatch( ETextureIndex te, const std::string& name );
    8.94  
    8.95 -	const std::string&	getLabel()	{ return LLWearable::typeToTypeLabel( mType ); }
    8.96 -	EWearableType		getType()	{ return mType; }
    8.97 +	const std::string&		getLabel()	{ return LLWearableType::getTypeLabel(mType); }
    8.98 +	LLWearableType::EType	getType()	{ return mType; }
    8.99  
   8.100  	LLSubpart*			getCurrentSubpart() { return mSubpartList[mCurrentSubpart]; }
   8.101  	ESubpart			getDefaultSubpart();
   8.102 @@ -489,27 +489,27 @@
   8.103  
   8.104  
   8.105  private:
   8.106 -	EWearableType		mType;
   8.107 -	BOOL				mCanTakeOff;
   8.108 -	std::map<std::string, S32> mTextureList;
   8.109 -	std::map<std::string, S32> mInvisibilityList;
   8.110 -	std::map<std::string, S32> mColorList;
   8.111 -	std::map<ESubpart, LLSubpart*> mSubpartList;
   8.112 -	std::map<S32, LLUUID> mPreviousTextureList;
   8.113 -	ESubpart			mCurrentSubpart;
   8.114 +	LLWearableType::EType			mType;
   8.115 +	BOOL							mCanTakeOff;
   8.116 +	std::map<std::string, S32>		mTextureList;
   8.117 +	std::map<std::string, S32>		mInvisibilityList;
   8.118 +	std::map<std::string, S32>		mColorList;
   8.119 +	std::map<ESubpart, LLSubpart*>	mSubpartList;
   8.120 +	std::map<S32, LLUUID>			mPreviousTextureList;
   8.121 +	ESubpart						mCurrentSubpart;
   8.122  };
   8.123  
   8.124  ////////////////////////////////////////////////////////////////////////////
   8.125  
   8.126 -LLPanelEditWearable::LLPanelEditWearable( EWearableType type )
   8.127 -	: LLPanel( LLWearable::typeToTypeLabel( type ) ),
   8.128 +LLPanelEditWearable::LLPanelEditWearable(LLWearableType::EType type)
   8.129 +	: LLPanel(LLWearableType::getTypeLabel(type)),
   8.130  	  mType( type )
   8.131  {
   8.132  }
   8.133  
   8.134  BOOL LLPanelEditWearable::postBuild()
   8.135  {
   8.136 -	LLAssetType::EType asset_type = LLWearable::typeToAssetType( mType );
   8.137 +	LLAssetType::EType asset_type = LLWearableType::getAssetType(mType);
   8.138  	std::string icon_name = LLInventoryIcon::getIconName(asset_type,
   8.139  														 LLInventoryType::IT_WEARABLE,
   8.140  														 mType, FALSE);
   8.141 @@ -519,9 +519,10 @@
   8.142  	childSetAction("Create New", LLPanelEditWearable::onBtnCreateNew, this );
   8.143  
   8.144  	// If PG, can't take off underclothing or shirt
   8.145 -	mCanTakeOff =
   8.146 -		LLWearable::typeToAssetType( mType ) == LLAssetType::AT_CLOTHING &&
   8.147 -		!( gAgent.isTeen() && (mType == WT_UNDERSHIRT || mType == WT_UNDERPANTS) );
   8.148 +	mCanTakeOff = LLWearableType::getAssetType(mType) == LLAssetType::AT_CLOTHING &&
   8.149 +				  !(gAgent.isTeen() &&
   8.150 +					(mType == LLWearableType::WT_UNDERSHIRT ||
   8.151 +					 mType == LLWearableType::WT_UNDERPANTS));
   8.152  	childSetVisible("Take Off", mCanTakeOff);
   8.153  	childSetAction("Take Off", LLPanelEditWearable::onBtnTakeOff, this );
   8.154  
   8.155 @@ -703,7 +704,7 @@
   8.156  	if(avatar)
   8.157  	{
   8.158  		// Create a new wearable in the default folder for the wearable's asset type.
   8.159 -		LLWearable* wearable = gWearableList.createNewWearable( (EWearableType)notification["payload"]["wearable_type"].asInteger() );
   8.160 +		LLWearable* wearable = gWearableList.createNewWearable((LLWearableType::EType)notification["payload"]["wearable_type"].asInteger());
   8.161  		LLAssetType::EType asset_type = wearable->getAssetType();
   8.162  
   8.163  		LLUUID folder_id;
   8.164 @@ -860,7 +861,7 @@
   8.165  	if (avatar)
   8.166  	{
   8.167  		LLWearable* wearable = gAgent.getWearable(mType);
   8.168 -		if (wearable && mType == WT_ALPHA)
   8.169 +		if (wearable && mType == LLWearableType::WT_ALPHA)
   8.170  		{
   8.171  			const LLTextureEntry* current_te = avatar->getTE(te);
   8.172  			if (current_te)
   8.173 @@ -894,7 +895,7 @@
   8.174  			avatar->setLocTexTE(te, image, TRUE);
   8.175  			avatar->wearableUpdated(self->mType, FALSE);
   8.176  		}
   8.177 -		if (self->mType == WT_ALPHA && image->getID() != IMG_INVISIBLE)
   8.178 +		if (self->mType == LLWearableType::WT_ALPHA && image->getID() != IMG_INVISIBLE)
   8.179  		{
   8.180  			self->mPreviousTextureList[te] = image->getID();
   8.181  		}
   8.182 @@ -906,22 +907,22 @@
   8.183  {
   8.184  	switch( mType )
   8.185  	{
   8.186 -		case WT_SHAPE:		return SUBPART_SHAPE_WHOLE;
   8.187 -		case WT_SKIN:		return SUBPART_SKIN_COLOR;
   8.188 -		case WT_HAIR:		return SUBPART_HAIR_COLOR;
   8.189 -		case WT_EYES:		return SUBPART_EYES;
   8.190 -		case WT_SHIRT:		return SUBPART_SHIRT;
   8.191 -		case WT_PANTS:		return SUBPART_PANTS;
   8.192 -		case WT_SHOES:		return SUBPART_SHOES;
   8.193 -		case WT_SOCKS:		return SUBPART_SOCKS;
   8.194 -		case WT_JACKET:		return SUBPART_JACKET;
   8.195 -		case WT_GLOVES:		return SUBPART_GLOVES;
   8.196 -		case WT_UNDERSHIRT:	return SUBPART_UNDERSHIRT;
   8.197 -		case WT_UNDERPANTS:	return SUBPART_UNDERPANTS;
   8.198 -		case WT_SKIRT:		return SUBPART_SKIRT;
   8.199 -		case WT_ALPHA:		return SUBPART_ALPHA;
   8.200 -		case WT_TATTOO:		return SUBPART_TATTOO;
   8.201 -		case WT_PHYSICS:  return SUBPART_PHYSICS_BELLY_UPDOWN;
   8.202 +		case LLWearableType::WT_SHAPE:		return SUBPART_SHAPE_WHOLE;
   8.203 +		case LLWearableType::WT_SKIN:		return SUBPART_SKIN_COLOR;
   8.204 +		case LLWearableType::WT_HAIR:		return SUBPART_HAIR_COLOR;
   8.205 +		case LLWearableType::WT_EYES:		return SUBPART_EYES;
   8.206 +		case LLWearableType::WT_SHIRT:		return SUBPART_SHIRT;
   8.207 +		case LLWearableType::WT_PANTS:		return SUBPART_PANTS;
   8.208 +		case LLWearableType::WT_SHOES:		return SUBPART_SHOES;
   8.209 +		case LLWearableType::WT_SOCKS:		return SUBPART_SOCKS;
   8.210 +		case LLWearableType::WT_JACKET:		return SUBPART_JACKET;
   8.211 +		case LLWearableType::WT_GLOVES:		return SUBPART_GLOVES;
   8.212 +		case LLWearableType::WT_UNDERSHIRT:	return SUBPART_UNDERSHIRT;
   8.213 +		case LLWearableType::WT_UNDERPANTS:	return SUBPART_UNDERPANTS;
   8.214 +		case LLWearableType::WT_SKIRT:		return SUBPART_SKIRT;
   8.215 +		case LLWearableType::WT_ALPHA:		return SUBPART_ALPHA;
   8.216 +		case LLWearableType::WT_TATTOO:		return SUBPART_TATTOO;
   8.217 +		case LLWearableType::WT_PHYSICS:	return SUBPART_PHYSICS_BELLY_UPDOWN;
   8.218  
   8.219  		default:	llassert(0);		return SUBPART_SHAPE_WHOLE;
   8.220  	}
   8.221 @@ -1013,7 +1014,7 @@
   8.222  	{
   8.223  		// *TODO:Translate
   8.224  		childSetVisible("title_no_modify", TRUE);
   8.225 -		childSetTextArg("title_no_modify", "[DESC]", std::string(LLWearable::typeToTypeLabel( mType )));
   8.226 +		childSetTextArg("title_no_modify", "[DESC]", std::string(LLWearableType::getTypeLabel(mType)));
   8.227  		
   8.228  		hideTextureControls();
   8.229  	}
   8.230 @@ -1021,7 +1022,7 @@
   8.231  	{
   8.232  		// *TODO:Translate
   8.233  		childSetVisible("title_loading", TRUE);
   8.234 -		childSetTextArg("title_loading", "[DESC]", std::string(LLWearable::typeToTypeLabel( mType )));
   8.235 +		childSetTextArg("title_loading", "[DESC]", std::string(LLWearableType::getTypeLabel(mType)));
   8.236  			
   8.237  		std::string path;
   8.238  		const LLUUID& item_id = gAgent.getWearableItem( wearable->getType() );
   8.239 @@ -1108,7 +1109,7 @@
   8.240  	{
   8.241  		// *TODO:Translate
   8.242  		childSetVisible("title_not_worn", TRUE);
   8.243 -		childSetTextArg("title_not_worn", "[DESC]", std::string(LLWearable::typeToTypeLabel( mType )));
   8.244 +		childSetTextArg("title_not_worn", "[DESC]", std::string(LLWearableType::getTypeLabel(mType)));
   8.245  
   8.246  		hideTextureControls();
   8.247  	}
   8.248 @@ -1142,7 +1143,7 @@
   8.249  	if( wearable )
   8.250  	{
   8.251  		setUIPermissions(perm_mask, is_complete);
   8.252 -		if (mType == WT_ALPHA)
   8.253 +		if (mType == LLWearableType::WT_ALPHA)
   8.254  		{
   8.255  			initPreviousTextureList();
   8.256  		}
   8.257 @@ -1676,14 +1677,14 @@
   8.258  // LLFloaterCustomize
   8.259  
   8.260  // statics
   8.261 -EWearableType	LLFloaterCustomize::sCurrentWearableType = WT_INVALID;
   8.262 +LLWearableType::EType LLFloaterCustomize::sCurrentWearableType = LLWearableType::WT_INVALID;
   8.263  
   8.264  struct WearablePanelData
   8.265  {
   8.266 -	WearablePanelData(LLFloaterCustomize* floater, EWearableType type)
   8.267 +	WearablePanelData(LLFloaterCustomize* floater, LLWearableType::EType type)
   8.268  		: mFloater(floater), mType(type) {}
   8.269  	LLFloaterCustomize* mFloater;
   8.270 -	EWearableType mType;
   8.271 +	LLWearableType::EType mType;
   8.272  };
   8.273  
   8.274  LLFloaterCustomize::LLFloaterCustomize()
   8.275 @@ -1693,7 +1694,7 @@
   8.276  	mNextStepAfterSaveCallback( NULL ),
   8.277  	mNextStepAfterSaveUserdata( NULL )
   8.278  {
   8.279 -	memset(&mWearablePanelList[0],0,sizeof(char*)*WT_COUNT); //Initialize to 0
   8.280 +	memset(&mWearablePanelList[0], 0, sizeof(char*)*LLWearableType::WT_COUNT); //Initialize to 0
   8.281  
   8.282  	gSavedSettings.setU32("AvatarSex", (gAgent.getAvatarObject()->getSex() == SEX_MALE) );
   8.283  
   8.284 @@ -1704,22 +1705,22 @@
   8.285  	gInventory.addObserver(mInventoryObserver);
   8.286  
   8.287  	LLCallbackMap::map_t factory_map;
   8.288 -	factory_map["Shape"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SHAPE) ) );
   8.289 -	factory_map["Skin"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SKIN) ) );
   8.290 -	factory_map["Hair"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_HAIR) ) );
   8.291 -	factory_map["Eyes"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_EYES) ) );
   8.292 -	factory_map["Shirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SHIRT) ) );
   8.293 -	factory_map["Pants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_PANTS) ) );
   8.294 -	factory_map["Shoes"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SHOES) ) );
   8.295 -	factory_map["Socks"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SOCKS) ) );
   8.296 -	factory_map["Jacket"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_JACKET) ) );
   8.297 -	factory_map["Gloves"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_GLOVES) ) );
   8.298 -	factory_map["Undershirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERSHIRT) ) );
   8.299 -	factory_map["Underpants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERPANTS) ) );
   8.300 -	factory_map["Skirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SKIRT) ) );
   8.301 -	factory_map["Alpha"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_ALPHA)));
   8.302 -	factory_map["Tattoo"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_TATTOO)));
   8.303 -	factory_map["Physics"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_PHYSICS)));
   8.304 +	factory_map["Shape"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_SHAPE)));
   8.305 +	factory_map["Skin"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_SKIN)));
   8.306 +	factory_map["Hair"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_HAIR)));
   8.307 +	factory_map["Eyes"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_EYES)));
   8.308 +	factory_map["Shirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_SHIRT)));
   8.309 +	factory_map["Pants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_PANTS)));
   8.310 +	factory_map["Shoes"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_SHOES)));
   8.311 +	factory_map["Socks"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_SOCKS)));
   8.312 +	factory_map["Jacket"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_JACKET)));
   8.313 +	factory_map["Gloves"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_GLOVES)));
   8.314 +	factory_map["Undershirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_UNDERSHIRT)));
   8.315 +	factory_map["Underpants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_UNDERPANTS)));
   8.316 +	factory_map["Skirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_SKIRT)));
   8.317 +	factory_map["Alpha"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_ALPHA)));
   8.318 +	factory_map["Tattoo"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_TATTOO)));
   8.319 +	factory_map["Physics"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, LLWearableType::WT_PHYSICS)));
   8.320  
   8.321  	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_customize.xml", &factory_map);
   8.322  }
   8.323 @@ -1744,22 +1745,22 @@
   8.324  	initWearablePanels();
   8.325  
   8.326  	// Tab container
   8.327 -	childSetTabChangeCallback("customize tab container", "Shape", onTabChanged, (void*)WT_SHAPE, onTabPrecommit );
   8.328 -	childSetTabChangeCallback("customize tab container", "Skin", onTabChanged, (void*)WT_SKIN, onTabPrecommit );
   8.329 -	childSetTabChangeCallback("customize tab container", "Hair", onTabChanged, (void*)WT_HAIR, onTabPrecommit );
   8.330 -	childSetTabChangeCallback("customize tab container", "Eyes", onTabChanged, (void*)WT_EYES, onTabPrecommit );
   8.331 -	childSetTabChangeCallback("customize tab container", "Shirt", onTabChanged, (void*)WT_SHIRT, onTabPrecommit );
   8.332 -	childSetTabChangeCallback("customize tab container", "Pants", onTabChanged, (void*)WT_PANTS, onTabPrecommit );
   8.333 -	childSetTabChangeCallback("customize tab container", "Shoes", onTabChanged, (void*)WT_SHOES, onTabPrecommit );
   8.334 -	childSetTabChangeCallback("customize tab container", "Socks", onTabChanged, (void*)WT_SOCKS, onTabPrecommit );
   8.335 -	childSetTabChangeCallback("customize tab container", "Jacket", onTabChanged, (void*)WT_JACKET, onTabPrecommit );
   8.336 -	childSetTabChangeCallback("customize tab container", "Gloves", onTabChanged, (void*)WT_GLOVES, onTabPrecommit );
   8.337 -	childSetTabChangeCallback("customize tab container", "Undershirt", onTabChanged, (void*)WT_UNDERSHIRT, onTabPrecommit );
   8.338 -	childSetTabChangeCallback("customize tab container", "Underpants", onTabChanged, (void*)WT_UNDERPANTS, onTabPrecommit );
   8.339 -	childSetTabChangeCallback("customize tab container", "Skirt", onTabChanged, (void*)WT_SKIRT, onTabPrecommit );
   8.340 -	childSetTabChangeCallback("customize tab container", "Alpha", onTabChanged, (void*)WT_ALPHA, onTabPrecommit);
   8.341 -	childSetTabChangeCallback("customize tab container", "Tattoo", onTabChanged, (void*)WT_TATTOO, onTabPrecommit);
   8.342 -	childSetTabChangeCallback("customize tab container", "Physics", onTabChanged, (void*)WT_PHYSICS, onTabPrecommit);
   8.343 +	childSetTabChangeCallback("customize tab container", "Shape", onTabChanged, (void*)LLWearableType::WT_SHAPE, onTabPrecommit);
   8.344 +	childSetTabChangeCallback("customize tab container", "Skin", onTabChanged, (void*)LLWearableType::WT_SKIN, onTabPrecommit);
   8.345 +	childSetTabChangeCallback("customize tab container", "Hair", onTabChanged, (void*)LLWearableType::WT_HAIR, onTabPrecommit);
   8.346 +	childSetTabChangeCallback("customize tab container", "Eyes", onTabChanged, (void*)LLWearableType::WT_EYES, onTabPrecommit);
   8.347 +	childSetTabChangeCallback("customize tab container", "Shirt", onTabChanged, (void*)LLWearableType::WT_SHIRT, onTabPrecommit);
   8.348 +	childSetTabChangeCallback("customize tab container", "Pants", onTabChanged, (void*)LLWearableType::WT_PANTS, onTabPrecommit);
   8.349 +	childSetTabChangeCallback("customize tab container", "Shoes", onTabChanged, (void*)LLWearableType::WT_SHOES, onTabPrecommit);
   8.350 +	childSetTabChangeCallback("customize tab container", "Socks", onTabChanged, (void*)LLWearableType::WT_SOCKS, onTabPrecommit);
   8.351 +	childSetTabChangeCallback("customize tab container", "Jacket", onTabChanged, (void*)LLWearableType::WT_JACKET, onTabPrecommit);
   8.352 +	childSetTabChangeCallback("customize tab container", "Gloves", onTabChanged, (void*)LLWearableType::WT_GLOVES, onTabPrecommit);
   8.353 +	childSetTabChangeCallback("customize tab container", "Undershirt", onTabChanged, (void*)LLWearableType::WT_UNDERSHIRT, onTabPrecommit);
   8.354 +	childSetTabChangeCallback("customize tab container", "Underpants", onTabChanged, (void*)LLWearableType::WT_UNDERPANTS, onTabPrecommit);
   8.355 +	childSetTabChangeCallback("customize tab container", "Skirt", onTabChanged, (void*)LLWearableType::WT_SKIRT, onTabPrecommit);
   8.356 +	childSetTabChangeCallback("customize tab container", "Alpha", onTabChanged, (void*)LLWearableType::WT_ALPHA, onTabPrecommit);
   8.357 +	childSetTabChangeCallback("customize tab container", "Tattoo", onTabChanged, (void*)LLWearableType::WT_TATTOO, onTabPrecommit);
   8.358 +	childSetTabChangeCallback("customize tab container", "Physics", onTabChanged, (void*)LLWearableType::WT_PHYSICS, onTabPrecommit);
   8.359  
   8.360  	// Remove underwear panels for teens
   8.361  	if (gAgent.isTeen())
   8.362 @@ -1786,13 +1787,13 @@
   8.363  	LLFloater::open();
   8.364  	// childShowTab depends on gFloaterCustomize being defined and therefore must be called after the constructor. - Nyx
   8.365  	childShowTab("customize tab container", "Shape", true);
   8.366 -	setCurrentWearableType(WT_SHAPE);
   8.367 +	setCurrentWearableType(LLWearableType::WT_SHAPE);
   8.368  }
   8.369  
   8.370  ////////////////////////////////////////////////////////////////////////////
   8.371  
   8.372  // static
   8.373 -void LLFloaterCustomize::setCurrentWearableType( EWearableType type )
   8.374 +void LLFloaterCustomize::setCurrentWearableType(LLWearableType::EType type)
   8.375  {
   8.376  	if( LLFloaterCustomize::sCurrentWearableType != type )
   8.377  	{
   8.378 @@ -1838,12 +1839,12 @@
   8.379  		LLMakeOutfitDialog* dialog = new LLMakeOutfitDialog( onMakeOutfitCommit, NULL );
   8.380  		// LLMakeOutfitDialog deletes itself.
   8.381  
   8.382 -		for( S32 i = 0; i < WT_COUNT; i++ )
   8.383 +		for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ )
   8.384  		{
   8.385 -			BOOL enabled = (gAgent.getWearable( (EWearableType) i ) != NULL);
   8.386 -			BOOL selected = (enabled && (WT_SHIRT <= i) && (i < WT_COUNT)); // only select clothing by default
   8.387 +			BOOL enabled = (gAgent.getWearable( (LLWearableType::EType) i ) != NULL);
   8.388 +			BOOL selected = (enabled && (LLWearableType::WT_SHIRT <= i) && (i < LLWearableType::WT_COUNT)); // only select clothing by default
   8.389  			if (gAgent.isTeen()
   8.390 -				&& !edit_wearable_for_teens((EWearableType)i))
   8.391 +				&& !edit_wearable_for_teens((LLWearableType::EType)i))
   8.392  			{
   8.393  				dialog->setWearableToInclude( i, FALSE, FALSE );
   8.394  			}
   8.395 @@ -1877,7 +1878,7 @@
   8.396  void* LLFloaterCustomize::createWearablePanel(void* userdata)
   8.397  {
   8.398  	WearablePanelData* data = (WearablePanelData*)userdata;
   8.399 -	EWearableType type = data->mType;
   8.400 +	LLWearableType::EType type = data->mType;
   8.401  	LLPanelEditWearable* panel;
   8.402  	if ((gAgent.isTeen() && !edit_wearable_for_teens(data->mType) ))
   8.403  	{
   8.404 @@ -1898,7 +1899,7 @@
   8.405  	
   8.406  	/////////////////////////////////////////
   8.407  	// Shape
   8.408 -	LLPanelEditWearable* panel = mWearablePanelList[ WT_SHAPE ];
   8.409 +	LLPanelEditWearable* panel = mWearablePanelList[LLWearableType::WT_SHAPE];
   8.410  
   8.411  	// body
   8.412  	part = new LLSubpart();
   8.413 @@ -1973,7 +1974,7 @@
   8.414  
   8.415  	/////////////////////////////////////////
   8.416  	// Skin
   8.417 -	panel = mWearablePanelList[ WT_SKIN ];
   8.418 +	panel = mWearablePanelList[LLWearableType::WT_SKIN];
   8.419  
   8.420  	part = new LLSubpart();
   8.421  	part->mTargetJoint = "mHead";
   8.422 @@ -2009,7 +2010,7 @@
   8.423  
   8.424  	/////////////////////////////////////////
   8.425  	// Hair
   8.426 -	panel = mWearablePanelList[ WT_HAIR ];
   8.427 +	panel = mWearablePanelList[LLWearableType::WT_HAIR];
   8.428  
   8.429  	part = new LLSubpart();
   8.430  	part->mTargetJoint = "mHead";
   8.431 @@ -2046,7 +2047,7 @@
   8.432  
   8.433  	/////////////////////////////////////////
   8.434  	// Eyes
   8.435 -	panel = mWearablePanelList[ WT_EYES ];
   8.436 +	panel = mWearablePanelList[LLWearableType::WT_EYES];
   8.437  
   8.438  	part = new LLSubpart();
   8.439  	part->mTargetJoint = "mHead";
   8.440 @@ -2061,7 +2062,7 @@
   8.441  
   8.442  	/////////////////////////////////////////
   8.443  	// Shirt
   8.444 -	panel = mWearablePanelList[ WT_SHIRT ];
   8.445 +	panel = mWearablePanelList[LLWearableType::WT_SHIRT];
   8.446  
   8.447  	part = new LLSubpart();
   8.448  	part->mTargetJoint = "mTorso";
   8.449 @@ -2079,7 +2080,7 @@
   8.450  
   8.451  	/////////////////////////////////////////
   8.452  	// Pants
   8.453 -	panel = mWearablePanelList[ WT_PANTS ];
   8.454 +	panel = mWearablePanelList[LLWearableType::WT_PANTS];
   8.455  
   8.456  	part = new LLSubpart();
   8.457  	part->mTargetJoint = "mPelvis";
   8.458 @@ -2097,7 +2098,7 @@
   8.459  
   8.460  	/////////////////////////////////////////
   8.461  	// Shoes
   8.462 -	panel = mWearablePanelList[ WT_SHOES ];
   8.463 +	panel = mWearablePanelList[LLWearableType::WT_SHOES];
   8.464  
   8.465  	if (panel)
   8.466  	{
   8.467 @@ -2118,7 +2119,7 @@
   8.468  
   8.469  	/////////////////////////////////////////
   8.470  	// Socks
   8.471 -	panel = mWearablePanelList[ WT_SOCKS ];
   8.472 +	panel = mWearablePanelList[LLWearableType::WT_SOCKS];
   8.473  
   8.474  	if (panel)
   8.475  	{
   8.476 @@ -2138,7 +2139,7 @@
   8.477  
   8.478  	/////////////////////////////////////////
   8.479  	// Jacket
   8.480 -	panel = mWearablePanelList[ WT_JACKET ];
   8.481 +	panel = mWearablePanelList[LLWearableType::WT_JACKET];
   8.482  
   8.483  	if (panel)
   8.484  	{
   8.485 @@ -2161,7 +2162,7 @@
   8.486  
   8.487  	/////////////////////////////////////////
   8.488  	// Skirt
   8.489 -	panel = mWearablePanelList[ WT_SKIRT ];
   8.490 +	panel = mWearablePanelList[LLWearableType::WT_SKIRT];
   8.491  
   8.492  	if (panel)
   8.493  	{
   8.494 @@ -2182,7 +2183,7 @@
   8.495  
   8.496  	/////////////////////////////////////////
   8.497  	// Gloves
   8.498 -	panel = mWearablePanelList[ WT_GLOVES ];
   8.499 +	panel = mWearablePanelList[LLWearableType::WT_GLOVES];
   8.500  
   8.501  	if (panel)
   8.502  	{
   8.503 @@ -2203,7 +2204,7 @@
   8.504  
   8.505  	/////////////////////////////////////////
   8.506  	// Undershirt
   8.507 -	panel = mWearablePanelList[ WT_UNDERSHIRT ];
   8.508 +	panel = mWearablePanelList[LLWearableType::WT_UNDERSHIRT];
   8.509  
   8.510  	if (panel)
   8.511  	{
   8.512 @@ -2223,7 +2224,7 @@
   8.513  
   8.514  	/////////////////////////////////////////
   8.515  	// Underpants
   8.516 -	panel = mWearablePanelList[ WT_UNDERPANTS ];
   8.517 +	panel = mWearablePanelList[LLWearableType::WT_UNDERPANTS];
   8.518  
   8.519  	if (panel)
   8.520  	{
   8.521 @@ -2243,7 +2244,7 @@
   8.522  
   8.523  	/////////////////////////////////////////
   8.524  	// Alpha
   8.525 -	panel = mWearablePanelList[WT_ALPHA];
   8.526 +	panel = mWearablePanelList[LLWearableType::WT_ALPHA];
   8.527  
   8.528  	if (panel)
   8.529  	{
   8.530 @@ -2279,7 +2280,7 @@
   8.531  
   8.532  	/////////////////////////////////////////
   8.533  	// Tattoo
   8.534 -	panel = mWearablePanelList[WT_TATTOO];
   8.535 +	panel = mWearablePanelList[LLWearableType::WT_TATTOO];
   8.536  
   8.537  	if (panel)
   8.538  	{
   8.539 @@ -2304,7 +2305,7 @@
   8.540  	/////////////////////////////////////////
   8.541  	// Physics
   8.542  
   8.543 -	panel = mWearablePanelList[WT_PHYSICS];
   8.544 +	panel = mWearablePanelList[LLWearableType::WT_PHYSICS];
   8.545  	
   8.546  	if(panel)
   8.547  	{
   8.548 @@ -2407,7 +2408,7 @@
   8.549  
   8.550  BOOL LLFloaterCustomize::isDirty() const
   8.551  {
   8.552 -	for(S32 i = 0; i < WT_COUNT; i++)
   8.553 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   8.554  	{
   8.555  		if( mWearablePanelList[i]
   8.556  			&& mWearablePanelList[i]->isDirty() )
   8.557 @@ -2421,8 +2422,9 @@
   8.558  // static
   8.559  void LLFloaterCustomize::onTabPrecommit( void* userdata, bool from_click )
   8.560  {
   8.561 -	EWearableType type = (EWearableType)(intptr_t) userdata;
   8.562 -	if (type != WT_INVALID && gFloaterCustomize && gFloaterCustomize->getCurrentWearableType() != type)
   8.563 +	LLWearableType::EType type = (LLWearableType::EType)(intptr_t) userdata;
   8.564 +	if (type != LLWearableType::WT_INVALID && gFloaterCustomize &&
   8.565 +		gFloaterCustomize->getCurrentWearableType() != type)
   8.566  	{
   8.567  		gFloaterCustomize->askToSaveIfDirty(onCommitChangeTab, userdata);
   8.568  	}
   8.569 @@ -2436,8 +2438,8 @@
   8.570  // static
   8.571  void LLFloaterCustomize::onTabChanged( void* userdata, bool from_click )
   8.572  {
   8.573 -	EWearableType wearable_type = (EWearableType) (intptr_t)userdata;
   8.574 -	if (wearable_type != WT_INVALID)
   8.575 +	LLWearableType::EType wearable_type = (LLWearableType::EType) (intptr_t)userdata;
   8.576 +	if (wearable_type != LLWearableType::WT_INVALID)
   8.577  	{
   8.578  		LLFloaterCustomize::setCurrentWearableType(wearable_type);
   8.579  	}
   8.580 @@ -2515,9 +2517,9 @@
   8.581  	}
   8.582  }
   8.583  
   8.584 -void LLFloaterCustomize::setWearable(EWearableType type, LLWearable* wearable, U32 perm_mask, BOOL is_complete)
   8.585 +void LLFloaterCustomize::setWearable(LLWearableType::EType type, LLWearable* wearable, U32 perm_mask, BOOL is_complete)
   8.586  {
   8.587 -	llassert( type < WT_COUNT );
   8.588 +	llassert(type < LLWearableType::WT_COUNT);
   8.589  	gSavedSettings.setU32("AvatarSex", (gAgent.getAvatarObject()->getSex() == SEX_MALE) );
   8.590  	
   8.591  	LLPanelEditWearable* panel = mWearablePanelList[ type ];
   8.592 @@ -2565,7 +2567,7 @@
   8.593  	S32 option = LLNotification::getSelectedOption(notification, response);
   8.594  
   8.595  	BOOL proceed = FALSE;
   8.596 -	EWearableType cur = getCurrentWearableType();
   8.597 +	LLWearableType::EType cur = getCurrentWearableType();
   8.598  
   8.599  	switch( option )
   8.600  	{
   8.601 @@ -2610,9 +2612,10 @@
   8.602  	// Fetch currently worn items
   8.603  	LLInventoryFetchObserver::item_ref_t ids;
   8.604  	LLUUID item_id;
   8.605 -	for(S32 type = (S32)WT_SHAPE; type < (S32)WT_COUNT; ++type)
   8.606 +	for (S32 type = (S32)LLWearableType::WT_SHAPE;
   8.607 +		 type < (S32)LLWearableType::WT_COUNT; ++type)
   8.608  	{
   8.609 -		item_id = gAgent.getWearableItem((EWearableType)type);
   8.610 +		item_id = gAgent.getWearableItem((LLWearableType::EType)type);
   8.611  		if(item_id.notNull())
   8.612  		{
   8.613  			ids.push_back(item_id);
   8.614 @@ -2632,7 +2635,7 @@
   8.615  	U32 perm_mask = 0x0;
   8.616  	LLPanelEditWearable* panel;
   8.617  	LLViewerInventoryItem* item;
   8.618 -	for(S32 i = 0; i < WT_COUNT; ++i)
   8.619 +	for (S32 i = 0; i < LLWearableType::WT_COUNT; ++i)
   8.620  	{
   8.621  		item = NULL;
   8.622  		panel = mWearablePanelList[i];
     9.1 --- a/indra/newview/llfloatercustomize.h	Sun Jan 15 13:43:22 2012 +0100
     9.2 +++ b/indra/newview/llfloatercustomize.h	Sat Jan 28 16:48:34 2012 +0100
     9.3 @@ -80,8 +80,8 @@
     9.4  	virtual BOOL 	postBuild();
     9.5  
     9.6  	// Inherted methods from LLFloater (and above)
     9.7 -	virtual void	onClose(bool app_quitting);
     9.8 -	virtual void	draw();
     9.9 +	/*virtual*/ void onClose(bool app_quitting);
    9.10 +	/*virtual*/ void draw();
    9.11  	/*virtual*/ void open();
    9.12  
    9.13  
    9.14 @@ -93,8 +93,11 @@
    9.15  	const std::string& getEditGroup();
    9.16  	void 			updateScrollingPanelList(BOOL allow_modify);
    9.17  
    9.18 -	void			setWearable(EWearableType type, LLWearable* wearable, U32 perm_mask, BOOL is_complete);
    9.19 -	LLPanelEditWearable* getCurrentWearablePanel() { return mWearablePanelList[ sCurrentWearableType ]; }
    9.20 +	void			setWearable(LLWearableType::EType type,
    9.21 +								LLWearable* wearable,
    9.22 +								U32 perm_mask,
    9.23 +								BOOL is_complete);
    9.24 +	LLPanelEditWearable* getCurrentWearablePanel()	{ return mWearablePanelList[sCurrentWearableType]; }
    9.25  
    9.26  	virtual BOOL	isDirty() const;
    9.27  
    9.28 @@ -102,8 +105,8 @@
    9.29  
    9.30  	void			switchToDefaultSubpart();
    9.31  
    9.32 -	static void		setCurrentWearableType( EWearableType type );
    9.33 -	static EWearableType getCurrentWearableType()					{ return sCurrentWearableType; }
    9.34 +	static void		setCurrentWearableType(LLWearableType::EType type);
    9.35 +	static LLWearableType::EType getCurrentWearableType()	{ return sCurrentWearableType; }
    9.36  
    9.37  	// Callbacks
    9.38  	static void		onBtnOk( void* userdata );
    9.39 @@ -120,9 +123,9 @@
    9.40  	void updateScrollingPanelUI();
    9.41  
    9.42  protected:
    9.43 -	LLPanelEditWearable*	mWearablePanelList[ WT_COUNT ];
    9.44 +	LLPanelEditWearable*	mWearablePanelList[LLWearableType::WT_COUNT];
    9.45  
    9.46 -	static EWearableType	sCurrentWearableType;
    9.47 +	static LLWearableType::EType sCurrentWearableType;
    9.48  
    9.49  	LLScrollingPanelList*	mScrollingPanelList;
    9.50  	LLScrollableContainerView* mScrollContainer;
    10.1 --- a/indra/newview/llinventoryactions.cpp	Sun Jan 15 13:43:22 2012 +0100
    10.2 +++ b/indra/newview/llinventoryactions.cpp	Sat Jan 28 16:48:34 2012 +0100
    10.3 @@ -377,82 +377,82 @@
    10.4  	else if ("shirt" == type)
    10.5  	{
    10.6  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
    10.7 -		LLFolderBridge::createWearable(parent_id, WT_SHIRT);
    10.8 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_SHIRT);
    10.9  	}
   10.10  	else if ("pants" == type)
   10.11  	{
   10.12  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.13 -		LLFolderBridge::createWearable(parent_id, WT_PANTS);
   10.14 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_PANTS);
   10.15  	}
   10.16  	else if ("shoes" == type)
   10.17  	{
   10.18  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.19 -		LLFolderBridge::createWearable(parent_id, WT_SHOES);
   10.20 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_SHOES);
   10.21  	}
   10.22  	else if ("socks" == type)
   10.23  	{
   10.24  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.25 -		LLFolderBridge::createWearable(parent_id, WT_SOCKS);
   10.26 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_SOCKS);
   10.27  	}
   10.28  	else if ("jacket" == type)
   10.29  	{
   10.30  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.31 -		LLFolderBridge::createWearable(parent_id, WT_JACKET);
   10.32 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_JACKET);
   10.33  	}
   10.34  	else if ("skirt" == type)
   10.35  	{
   10.36  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.37 -		LLFolderBridge::createWearable(parent_id, WT_SKIRT);
   10.38 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_SKIRT);
   10.39  	}
   10.40  	else if ("gloves" == type)
   10.41  	{
   10.42  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.43 -		LLFolderBridge::createWearable(parent_id, WT_GLOVES);
   10.44 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_GLOVES);
   10.45  	}
   10.46  	else if ("undershirt" == type)
   10.47  	{
   10.48  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.49 -		LLFolderBridge::createWearable(parent_id, WT_UNDERSHIRT);
   10.50 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_UNDERSHIRT);
   10.51  	}
   10.52  	else if ("underpants" == type)
   10.53  	{
   10.54  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.55 -		LLFolderBridge::createWearable(parent_id, WT_UNDERPANTS);
   10.56 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_UNDERPANTS);
   10.57  	}
   10.58  	else if ("alpha" == type)
   10.59  	{
   10.60  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.61 -		LLFolderBridge::createWearable(parent_id, WT_ALPHA);
   10.62 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_ALPHA);
   10.63  	}
   10.64  	else if ("tattoo" == type)
   10.65  	{
   10.66  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.67 -		LLFolderBridge::createWearable(parent_id, WT_TATTOO);
   10.68 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_TATTOO);
   10.69  	}
   10.70  	else if ("physics" == type)
   10.71  	{
   10.72  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
   10.73 -		LLFolderBridge::createWearable(parent_id, WT_PHYSICS);
   10.74 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_PHYSICS);
   10.75  	}
   10.76  	else if ("shape" == type)
   10.77  	{
   10.78  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
   10.79 -		LLFolderBridge::createWearable(parent_id, WT_SHAPE);
   10.80 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_SHAPE);
   10.81  	}
   10.82  	else if ("skin" == type)
   10.83  	{
   10.84  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
   10.85 -		LLFolderBridge::createWearable(parent_id, WT_SKIN);
   10.86 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_SKIN);
   10.87  	}
   10.88  	else if ("hair" == type)
   10.89  	{
   10.90  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
   10.91 -		LLFolderBridge::createWearable(parent_id, WT_HAIR);
   10.92 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_HAIR);
   10.93  	}
   10.94  	else if ("eyes" == type)
   10.95  	{
   10.96  		LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_BODYPART);
   10.97 -		LLFolderBridge::createWearable(parent_id, WT_EYES);
   10.98 +		LLFolderBridge::createWearable(parent_id, LLWearableType::WT_EYES);
   10.99  	}
  10.100  
  10.101  	ptr->getRootFolder()->setNeedsAutoRename(TRUE);	
    11.1 --- a/indra/newview/llinventorybridge.cpp	Sun Jan 15 13:43:22 2012 +0100
    11.2 +++ b/indra/newview/llinventorybridge.cpp	Sat Jan 28 16:48:34 2012 +0100
    11.3 @@ -870,7 +870,7 @@
    11.4  			warn = true;
    11.5  		}
    11.6  		new_listener = new LLWearableBridge(inventory, uuid, asset_type,
    11.7 -											inv_type, (EWearableType)flags);
    11.8 +											inv_type, (LLWearableType::EType)flags);
    11.9  		break;
   11.10  
   11.11  	case LLAssetType::AT_CATEGORY:
   11.12 @@ -2494,86 +2494,86 @@
   11.13  
   11.14  void LLFolderBridge::createNewShirt(void* user_data)
   11.15  {
   11.16 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHIRT);
   11.17 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_SHIRT);
   11.18  }
   11.19  
   11.20  void LLFolderBridge::createNewPants(void* user_data)
   11.21  {
   11.22 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_PANTS);
   11.23 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_PANTS);
   11.24  }
   11.25  
   11.26  void LLFolderBridge::createNewShoes(void* user_data)
   11.27  {
   11.28 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHOES);
   11.29 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_SHOES);
   11.30  }
   11.31  
   11.32  void LLFolderBridge::createNewSocks(void* user_data)
   11.33  {
   11.34 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SOCKS);
   11.35 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_SOCKS);
   11.36  }
   11.37  
   11.38  void LLFolderBridge::createNewJacket(void* user_data)
   11.39  {
   11.40 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_JACKET);
   11.41 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_JACKET);
   11.42  }
   11.43  
   11.44  void LLFolderBridge::createNewSkirt(void* user_data)
   11.45  {
   11.46 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SKIRT);
   11.47 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_SKIRT);
   11.48  }
   11.49  
   11.50  void LLFolderBridge::createNewGloves(void* user_data)
   11.51  {
   11.52 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_GLOVES);
   11.53 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_GLOVES);
   11.54  }
   11.55  
   11.56  void LLFolderBridge::createNewUndershirt(void* user_data)
   11.57  {
   11.58 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_UNDERSHIRT);
   11.59 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_UNDERSHIRT);
   11.60  }
   11.61  
   11.62  void LLFolderBridge::createNewUnderpants(void* user_data)
   11.63  {
   11.64 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_UNDERPANTS);
   11.65 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_UNDERPANTS);
   11.66  }
   11.67  
   11.68  void LLFolderBridge::createNewAlpha(void* user_data)
   11.69  {
   11.70 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_ALPHA);
   11.71 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_ALPHA);
   11.72  }
   11.73  
   11.74  void LLFolderBridge::createNewTattoo(void* user_data)
   11.75  {
   11.76 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_TATTOO);
   11.77 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_TATTOO);
   11.78  }
   11.79  
   11.80  void LLFolderBridge::createNewShape(void* user_data)
   11.81  {
   11.82 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHAPE);
   11.83 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_SHAPE);
   11.84  }
   11.85  
   11.86  void LLFolderBridge::createNewSkin(void* user_data)
   11.87  {
   11.88 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SKIN);
   11.89 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_SKIN);
   11.90  }
   11.91  
   11.92  void LLFolderBridge::createNewHair(void* user_data)
   11.93  {
   11.94 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_HAIR);
   11.95 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_HAIR);
   11.96  }
   11.97  
   11.98  void LLFolderBridge::createNewEyes(void* user_data)
   11.99  {
  11.100 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_EYES);
  11.101 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_EYES);
  11.102  }
  11.103  
  11.104  void LLFolderBridge::createNewPhysics(void* user_data)
  11.105  {
  11.106 -	LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_PHYSICS);
  11.107 +	LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_PHYSICS);
  11.108  }
  11.109  
  11.110  // static
  11.111 -void LLFolderBridge::createWearable(LLFolderBridge* bridge, EWearableType type)
  11.112 +void LLFolderBridge::createWearable(LLFolderBridge* bridge, LLWearableType::EType type)
  11.113  {
  11.114  	if(!bridge) return;
  11.115  	LLUUID parent_id = bridge->getUUID();
  11.116 @@ -2583,7 +2583,7 @@
  11.117  // Separate function so can be called by global menu as well as right-click
  11.118  // menu.
  11.119  // static
  11.120 -void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type)
  11.121 +void LLFolderBridge::createWearable(LLUUID parent_id, LLWearableType::EType type)
  11.122  {
  11.123  	LLWearable* wearable = gWearableList.createNewWearable(type);
  11.124  	LLAssetType::EType asset_type = wearable->getAssetType();
  11.125 @@ -4893,7 +4893,7 @@
  11.126  
  11.127  	// For each wearable type, find the first instance in the category
  11.128  	// that we recursed through.
  11.129 -	for( S32 i = 0; i < WT_COUNT; i++ )
  11.130 +	for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ )
  11.131  	{
  11.132  		for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin();
  11.133  			 iter != holder->mFoundList.end(); ++iter)
  11.134 @@ -4906,18 +4906,6 @@
  11.135  				item = (LLViewerInventoryItem*)gInventory.getLinkedItem(data->mItemID);
  11.136  				if( item && (item->getAssetUUID() == wearable->getID()) )
  11.137  				{
  11.138 -				//RN: after discussing with Brashears, I disabled this code
  11.139 -				//Metadata should reside in the item, not the asset
  11.140 -				//And this code does not handle failed asset uploads properly
  11.141 -//					if(!wearable->isMatchedToInventoryItem(item ))
  11.142 -//					{
  11.143 -//						wearable = gWearableList.createWearableMatchedToInventoryItem( wearable, item );
  11.144 -//						// Now that we have an asset that matches the
  11.145 -//						// item, update the item to point to the new
  11.146 -//						// asset.
  11.147 -//						item->setAssetUUID(wearable->getID());
  11.148 -//						item->updateAssetOnServer();
  11.149 -//					}
  11.150  // [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.1.3b) | Modified: RLVa-1.1.4a
  11.151  					if (!gRlvWearableLocks.canWear(item))
  11.152  					{
  11.153 @@ -5360,21 +5348,6 @@
  11.154  		{
  11.155  			if(item->getAssetUUID() == wearable->getID())
  11.156  			{
  11.157 -				//RN: after discussing with Brashears, I disabled this code
  11.158 -				//Metadata should reside in the item, not the asset
  11.159 -				//And this code does not handle failed asset uploads properly
  11.160 -
  11.161 -//				if(!wearable->isMatchedToInventoryItem(item))
  11.162 -//				{
  11.163 -//					LLWearable* new_wearable = gWearableList.createWearableMatchedToInventoryItem( wearable, item );
  11.164 -//
  11.165 -//					// Now that we have an asset that matches the
  11.166 -//					// item, update the item to point to the new
  11.167 -//					// asset.
  11.168 -//					item->setAssetUUID(new_wearable->getID());
  11.169 -//					item->updateAssetOnServer();
  11.170 -//					wearable = new_wearable;
  11.171 -//				}
  11.172  				gAgent.setWearable(item, wearable);
  11.173  				gInventory.notifyObservers();
  11.174  				//self->getFolderItem()->refreshFromRoot();
  11.175 @@ -5464,10 +5437,12 @@
  11.176  	{
  11.177  		if (gAgent.isWearingItem(item_id))
  11.178  		{
  11.179 -			EWearableType type = wearable->getType();
  11.180 -	
  11.181 -			if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES) ) //&&
  11.182 -				//!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) )
  11.183 +			LLWearableType::EType type = wearable->getType();
  11.184 +
  11.185 +			if (type != LLWearableType::WT_SHAPE && type != LLWearableType::WT_SKIN &&
  11.186 +				type != LLWearableType::WT_HAIR && type != LLWearableType::WT_EYES)
  11.187 +				// && (!gAgent.isTeen() || (type != LLWearableType::WT_UNDERPANTS &&
  11.188 +				//						    type != LLWearableType::WT_UNDERSHIRT)))
  11.189  			{
  11.190  				gAgent.removeWearable( type );
  11.191  			}
    12.1 --- a/indra/newview/llinventorybridge.h	Sun Jan 15 13:43:22 2012 +0100
    12.2 +++ b/indra/newview/llinventorybridge.h	Sat Jan 28 16:48:34 2012 +0100
    12.3 @@ -306,8 +306,8 @@
    12.4  	virtual BOOL isItemMovable();
    12.5  	virtual BOOL isUpToDate() const;
    12.6  
    12.7 -	static void createWearable(LLFolderBridge* bridge, EWearableType type);
    12.8 -	static void createWearable(LLUUID parent_folder_id, EWearableType type);
    12.9 +	static void createWearable(LLFolderBridge* bridge, LLWearableType::EType type);
   12.10 +	static void createWearable(LLUUID parent_folder_id, LLWearableType::EType type);
   12.11  
   12.12  	LLViewerInventoryCategory* getCategory() const;
   12.13  
   12.14 @@ -617,17 +617,21 @@
   12.15  	static void		onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata );
   12.16  
   12.17  protected:
   12.18 -	LLWearableBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLAssetType::EType asset_type, LLInventoryType::EType inv_type, EWearableType  wearable_type) :
   12.19 -		LLItemBridge(inventory, uuid),
   12.20 -		mAssetType( asset_type ),
   12.21 +	LLWearableBridge(LLInventoryPanel* inventory,
   12.22 +					 const LLUUID& uuid,
   12.23 +					 LLAssetType::EType asset_type,
   12.24 +					 LLInventoryType::EType inv_type,
   12.25 +					 LLWearableType::EType  wearable_type)
   12.26 +	:	LLItemBridge(inventory, uuid),
   12.27 +		mAssetType(asset_type),
   12.28  		mInvType(inv_type),
   12.29  		mWearableType(wearable_type)
   12.30  		{}
   12.31  
   12.32  protected:
   12.33 -	LLAssetType::EType mAssetType;
   12.34 -	LLInventoryType::EType mInvType;
   12.35 -	EWearableType  mWearableType;
   12.36 +	LLAssetType::EType		mAssetType;
   12.37 +	LLInventoryType::EType	mInvType;
   12.38 +	LLWearableType::EType	mWearableType;
   12.39  };
   12.40  
   12.41  class LLLinkItemBridge : public LLItemBridge
    13.1 --- a/indra/newview/llinventoryicon.cpp	Sun Jan 15 13:43:22 2012 +0100
    13.2 +++ b/indra/newview/llinventoryicon.cpp	Sat Jan 28 16:48:34 2012 +0100
    13.3 @@ -37,7 +37,7 @@
    13.4  #include "lldictionary.h"
    13.5  #include "llinventory.h"
    13.6  #include "llui.h"
    13.7 -#include "llwearable.h"
    13.8 +#include "llwearabletype.h"
    13.9  
   13.10  struct IconEntry : public LLDictionaryEntry
   13.11  {
   13.12 @@ -187,28 +187,6 @@
   13.13  
   13.14  LLInventoryIcon::EIconName LLInventoryIcon::assignWearableIcon(U32 misc_flag)
   13.15  {
   13.16 -	const EWearableType wearable_type = (EWearableType)(LLInventoryItem::II_FLAGS_WEARABLES_MASK & misc_flag);
   13.17 -	EIconName res;
   13.18 -	// *TODO: change to use LLWearableType::getIconName() once it is implemented.
   13.19 -	switch (wearable_type)
   13.20 -	{
   13.21 -		case WT_SHAPE:		res = ICONNAME_BODYPART_SHAPE;		break;
   13.22 -		case WT_SKIN:		res = ICONNAME_BODYPART_SKIN;		break;
   13.23 -		case WT_HAIR:		res = ICONNAME_BODYPART_HAIR;		break;
   13.24 -		case WT_EYES:		res = ICONNAME_BODYPART_EYES;		break;
   13.25 -		case WT_SHIRT:		res = ICONNAME_CLOTHING_SHIRT;		break;
   13.26 -		case WT_PANTS:		res = ICONNAME_CLOTHING_PANTS;		break;
   13.27 -		case WT_SHOES:		res = ICONNAME_CLOTHING_SHOES;		break;
   13.28 -		case WT_SOCKS:		res = ICONNAME_CLOTHING_SOCKS;		break;
   13.29 -		case WT_JACKET:		res = ICONNAME_CLOTHING_JACKET;		break;
   13.30 -		case WT_GLOVES:		res = ICONNAME_CLOTHING_GLOVES;		break;
   13.31 -		case WT_UNDERSHIRT:	res = ICONNAME_CLOTHING_UNDERSHIRT;	break;
   13.32 -		case WT_UNDERPANTS:	res = ICONNAME_CLOTHING_UNDERPANTS;	break;
   13.33 -		case WT_SKIRT:		res = ICONNAME_CLOTHING_SKIRT;		break;
   13.34 -		case WT_ALPHA:		res = ICONNAME_CLOTHING_ALPHA;		break;
   13.35 -		case WT_TATTOO:		res = ICONNAME_CLOTHING_TATTOO;		break;
   13.36 -		case WT_PHYSICS:	res = ICONNAME_CLOTHING_PHYSICS;	break;
   13.37 -		default:			res = ICONNAME_NONE;				break;
   13.38 -	}
   13.39 -	return res;
   13.40 +	const LLWearableType::EType wearable_type = LLWearableType::EType(LLInventoryItem::II_FLAGS_WEARABLES_MASK & misc_flag);
   13.41 +	return LLWearableType::getIconName(wearable_type);
   13.42  }
    14.1 --- a/indra/newview/llpanelmorph.cpp	Sun Jan 15 13:43:22 2012 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,351 +0,0 @@
    14.4 -/** 
    14.5 - * @file llpanelmorph.cpp
    14.6 - * @brief LLPanelMorph class implementation
    14.7 - *
    14.8 - * $LicenseInfo:firstyear=2001&license=viewergpl$
    14.9 - * 
   14.10 - * Copyright (c) 2001-2009, Linden Research, Inc.
   14.11 - * 
   14.12 - * Second Life Viewer Source Code
   14.13 - * The source code in this file ("Source Code") is provided by Linden Lab
   14.14 - * to you under the terms of the GNU General Public License, version 2.0
   14.15 - * ("GPL"), unless you have obtained a separate licensing agreement
   14.16 - * ("Other License"), formally executed by you and Linden Lab.  Terms of
   14.17 - * the GPL can be found in doc/GPL-license.txt in this distribution, or
   14.18 - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
   14.19 - * 
   14.20 - * There are special exceptions to the terms and conditions of the GPL as
   14.21 - * it is applied to this Source Code. View the full text of the exception
   14.22 - * in the file doc/FLOSS-exception.txt in this software distribution, or
   14.23 - * online at
   14.24 - * http://secondlifegrid.net/programs/open_source/licensing/flossexception
   14.25 - * 
   14.26 - * By copying, modifying or distributing this software, you acknowledge
   14.27 - * that you have read and understood your obligations described above,
   14.28 - * and agree to abide by those obligations.
   14.29 - * 
   14.30 - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
   14.31 - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
   14.32 - * COMPLETENESS OR PERFORMANCE.
   14.33 - * $/LicenseInfo$
   14.34 - */
   14.35 -
   14.36 -// file include
   14.37 -#include "llviewerprecompiledheaders.h"
   14.38 -
   14.39 -/*
   14.40 -#include "llpanelmorph.h"
   14.41 -
   14.42 -// library includes
   14.43 -#include "llerror.h"
   14.44 -#include "llrect.h"
   14.45 -#include "llstring.h"
   14.46 -#include "llfontgl.h"
   14.47 -
   14.48 -// project includes
   14.49 -#include "llui.h"
   14.50 -#include "llspinctrl.h"
   14.51 -#include "llcheckboxctrl.h"
   14.52 -#include "lltextbox.h"
   14.53 -#include "llbutton.h"
   14.54 -//#include "lldraghandle.h"
   14.55 -
   14.56 -#include "llviewerwindow.h"
   14.57 -#include "llviewerobject.h"
   14.58 -#include "llresmgr.h"
   14.59 -
   14.60 -#include "llcontrol.h"
   14.61 -
   14.62 -#include "llagent.h"
   14.63 -#include "llvoavatar.h"
   14.64 -#include "lltoolmgr.h"
   14.65 -#include "lltoolmorph.h"
   14.66 -#include "llquantize.h"
   14.67 -
   14.68 -//
   14.69 -// Constants
   14.70 -//
   14.71 -const S32 VPAD = 2;
   14.72 -const S32 HPAD = 4;
   14.73 -
   14.74 -const S32 TITLE_WIDTH = 100;
   14.75 -const S32 TITLE_HEIGHT = 16;
   14.76 -
   14.77 -const S32 CLOSE_BOX_SIZE = 16;
   14.78 -
   14.79 -const S32 LABEL_HOFF = 8;
   14.80 -const S32 LABEL_WIDTH = 140;
   14.81 -const S32 SPIN_WIDTH = 250;
   14.82 -
   14.83 -// minimum and maximum morph weight values (a UI/network constraint, not inherent to morphs)
   14.84 -const F32 MORPH_WEIGHT_MIN = (-1.f);
   14.85 -const F32 MORPH_WEIGHT_MAX = (1.f);
   14.86 -// this is the magic number that morph values are quantized to for network transmission purposes
   14.87 -// the 200 value is a result of encoding the weights as a string (and avoiding NULL terminators
   14.88 -// and avoiding \n (the between-NV-pair delimiter).  Map -1 to 1 to 50-250.  HACK.  JC
   14.89 -const S32 MORPH_WEIGHT_OFFSET = (50);
   14.90 -const S32 MORPH_WEIGHT_QUANTUM = ((MORPH_WEIGHT_MAX - MORPH_WEIGHT_MIN) / MAXSTRINGVAL);
   14.91 -
   14.92 -//#define MORPH_PANEL_SHOW_SPINNERS
   14.93 -
   14.94 -//
   14.95 -// Globals
   14.96 -//
   14.97 -LLPanelMorph *gPanelMorph = NULL;
   14.98 -
   14.99 -//
  14.100 -// Methods
  14.101 -//
  14.102 -
  14.103 -//static
  14.104 -//-----------------------------------------------------------------------------
  14.105 -// LLPanelMorph()
  14.106 -//-----------------------------------------------------------------------------
  14.107 -LLPanelMorph::LLPanelMorph(const std::string& name, const LLRect& rect)
  14.108 -:	LLPanel( name, rect )
  14.109 -{
  14.110 -	mParamSpinners = NULL;
  14.111 -	mSexRadioGroup = NULL;
  14.112 -	mRect = rect;
  14.113 -	mMesh = NULL;
  14.114 -	setBackgroundVisible( TRUE );
  14.115 -}
  14.116 -
  14.117 -//-----------------------------------------------------------------------------
  14.118 -// ~LLPanelMorph()
  14.119 -//-----------------------------------------------------------------------------
  14.120 -LLPanelMorph::~LLPanelMorph()
  14.121 -{
  14.122 -#ifdef MORPH_PANEL_SHOW_SPINNERS
  14.123 -	for (S32 i = 0; i < mNumParamSpinners; i++)
  14.124 -	{
  14.125 -		removeChild(mParamSpinners[i]);
  14.126 -		delete mParamSpinners[i];
  14.127 -	}
  14.128 -	delete [] mParamSpinners;
  14.129 -#endif
  14.130 -}
  14.131 -
  14.132 -// static
  14.133 -//-----------------------------------------------------------------------------
  14.134 -// onCommitSexChange()
  14.135 -//-----------------------------------------------------------------------------
  14.136 -void LLPanelMorph::onCommitSexChange( void *data)
  14.137 -{
  14.138 -//	LLRadioGroup *group = (LLRadioGroup *)data;
  14.139 -
  14.140 -//	LLVOAvatar *avatarp = gAgent.getAvatarObject();
  14.141 -//	
  14.142 -//	LLNameValue* avatarSexNV = avatarp->getNVPair("AvatarSex");
  14.143 -//	if (!avatarSexNV)
  14.144 -//	{
  14.145 -//		avatarp->addNVPair( "AvatarSex U32 READ_WRITE SIM_SPACE_VIEWER 0");
  14.146 -//		avatarSexNV = avatarp->getNVPair("AvatarSex");
  14.147 -//	}
  14.148 -//
  14.149 -//	avatarSexNV->setU32(gSavedSettings.getU32("AvatarSex"));
  14.150 -//
  14.151 -//	avatarp->sendNVPairToSimulator("AvatarSex");
  14.152 -//
  14.153 -//	// preemptively update sex based on local value
  14.154 -//	avatarp->updateSex();
  14.155 -//
  14.156 -//	LLVisualParamHint::requestHintUpdates();
  14.157 -
  14.158 -}
  14.159 -
  14.160 -
  14.161 -// static
  14.162 -//-----------------------------------------------------------------------------
  14.163 -// onCommitMorphChange()
  14.164 -//-----------------------------------------------------------------------------
  14.165 -void LLPanelMorph::onCommitMorphChange( LLUICtrl* ctrl, void* userdata )
  14.166 -{
  14.167 -//#ifdef MORPH_PANEL_SHOW_SPINNERS
  14.168 -//	LLVOAvatar *avatarp = gAgent.getAvatarObject();
  14.169 -//
  14.170 -//	LLPanelMorph* self = (LLPanelMorph*) userdata;
  14.171 -//
  14.172 -//	S32 i = 0;
  14.173 -//	for(LLPolyMorphTarget* morphTargetp = self->mMesh->getFirstVisualParam();
  14.174 -//	morphTargetp;
  14.175 -//	morphTargetp = self->mMesh->getNextVisualParam())
  14.176 -//	{
  14.177 -//		for(S32 j = 0; j < self->mNumParamSpinners; j++)
  14.178 -//		{
  14.179 -//			if (!strcmp(self->mParamSpinners[j]->getName(), morphTargetp->getName()))
  14.180 -//			{
  14.181 -//				avatarp->mHeadMesh0.getMesh()->setDistortionWeight(morphTargetp, self->mParamSpinners[j]->get());
  14.182 -//			}
  14.183 -//		}
  14.184 -//		i++;
  14.185 -//	}
  14.186 -//	avatarp->updateDistortions();
  14.187 -//	avatarp->sendVisualParams();
  14.188 -//#endif
  14.189 -}
  14.190 -
  14.191 -//-----------------------------------------------------------------------------
  14.192 -// updateSpinners()
  14.193 -//-----------------------------------------------------------------------------
  14.194 -void LLPanelMorph::updateSpinners(LLPolyMesh *mesh)
  14.195 -{
  14.196 -	if (mesh != mMesh) return;
  14.197 -#ifdef MORPH_PANEL_SHOW_SPINNERS
  14.198 -
  14.199 -	for(LLViewerVisualParam *param = (LLViewerVisualParam*)gAgent.getAvatarObject()->getFirstVisualParam();
  14.200 -		param;
  14.201 -		param = gAgent.getAvatarObject()->getNextVisualParam())
  14.202 -	{
  14.203 -		if (param->getID() == -1 ||
  14.204 -			!param->isTweakable()) continue;
  14.205 -
  14.206 -		F32 paramWeight = gAgent.getAvatarObject()->getVisualParamWeight(morphTargetp);
  14.207 -
  14.208 -		for (S32 i = 0; i < mNumParamSpinners; i++)
  14.209 -		{
  14.210 -			if (!strcmp(mParamSpinners[i]->getName() , morphTargetp->getName()))
  14.211 -			{
  14.212 -				mParamSpinners[i]->set(paramWeight);
  14.213 -			}
  14.214 -		}
  14.215 -	}
  14.216 -#endif
  14.217 -}
  14.218 -
  14.219 -//-----------------------------------------------------------------------------
  14.220 -// createSpinners()
  14.221 -//-----------------------------------------------------------------------------
  14.222 -void LLPanelMorph::createSpinners(LLPolyMesh *mesh)
  14.223 -{
  14.224 -	const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL );
  14.225 -	S32 cur_y;
  14.226 -	S32 new_height;
  14.227 -	S32 control_focus = -1;
  14.228 -
  14.229 -	if (mSexRadioGroup)
  14.230 -	{
  14.231 -		removeChild(mSexRadioGroup);
  14.232 -		delete mSexRadioGroup;
  14.233 -	}
  14.234 -
  14.235 -	if (mParamSpinners)
  14.236 -	{
  14.237 -		for (S32 i = 0; i < mNumParamSpinners; i++)
  14.238 -		{
  14.239 -			if (mParamSpinners[i]->hasFocus())
  14.240 -			{
  14.241 -				control_focus = i;
  14.242 -				mParamSpinners[i]->setFocus(FALSE);
  14.243 -			}
  14.244 -		}
  14.245 -		for (i = 0; i < mNumParamSpinners; i++)
  14.246 -		{
  14.247 -			removeChild(mParamSpinners[i]);
  14.248 -			delete mParamSpinners[i];
  14.249 -		}
  14.250 -		delete [] mParamSpinners;
  14.251 -		mParamSpinners = NULL;
  14.252 -	}
  14.253 -	
  14.254 -#ifdef MORPH_PANEL_SHOW_SPINNERS
  14.255 -	S32 numSpinners = 0;
  14.256 -
  14.257 -	for(LLViewerVisualParam *param = (LLViewerVisualParam*)gAgent.getAvatarObject()->getFirstVisualParam();
  14.258 -		param;
  14.259 -		param = gAgent.getAvatarObject()->getNextVisualParam())
  14.260 -	{
  14.261 -		if(param->getID() != -1 &&
  14.262 -			param->isTweakable())
  14.263 -		{
  14.264 -			numSpinners++;
  14.265 -		}
  14.266 -	}
  14.267 -
  14.268 -	if (numSpinners != 0)
  14.269 -	{
  14.270 -		mParamSpinners = new LLSpinCtrl*[numSpinners];
  14.271 -	}
  14.272 -
  14.273 -	// set focus back to control #n
  14.274 -	if (control_focus >= 0 && control_focus < numSpinners)
  14.275 -	{
  14.276 -		mParamSpinners[control_focus]->setFocus(TRUE);
  14.277 -	}
  14.278 -	new_height = numSpinners * (SPINCTRL_HEIGHT + VPAD) + (VPAD * 3) + CHECKBOXCTRL_HEIGHT + VPAD + VPAD;
  14.279 -
  14.280 -#else
  14.281 -	new_height = (VPAD * 3) + CHECKBOXCTRL_HEIGHT + VPAD + VPAD;
  14.282 -#endif
  14.283 -
  14.284 -	LLRect panelRect = getRect();
  14.285 -	reshape(panelRect.getWidth(), new_height, TRUE);
  14.286 -
  14.287 -	cur_y = new_height - VPAD - VPAD;
  14.288 -
  14.289 -	LLRect radio_rect;
  14.290 -	radio_rect.setLeftTopAndSize(HPAD + LABEL_HOFF, 
  14.291 -		cur_y, 
  14.292 -		getRect().getWidth() - HPAD - HPAD - LABEL_HOFF, 
  14.293 -		CHECKBOXCTRL_HEIGHT + VPAD);
  14.294 -	mSexRadioGroup = new LLRadioGroup("sex radio", 
  14.295 -		radio_rect, 
  14.296 -		"AvatarSex", 
  14.297 -		&LLPanelMorph::onCommitSexChange, 
  14.298 -		(void *)this);
  14.299 -	addChild(mSexRadioGroup);
  14.300 -	
  14.301 -	radio_rect.setLeftTopAndSize(HPAD + LABEL_HOFF, 
  14.302 -		0, 
  14.303 -		(getRect().getWidth() - HPAD - HPAD - LABEL_HOFF) / 2.f, 
  14.304 -		0);
  14.305 -	mSexRadioGroup->addRadioButton("Female", "Female", radio_rect, font);
  14.306 -
  14.307 -	radio_rect.setLeftTopAndSize(((getRect().getWidth() - HPAD - HPAD - LABEL_HOFF) / 2.f) + HPAD + LABEL_HOFF, 
  14.308 -		0, 
  14.309 -		(getRect().getWidth() - HPAD - HPAD - LABEL_HOFF) / 2.f, 
  14.310 -		0);
  14.311 -	mSexRadioGroup->addRadioButton("Male", "Male", radio_rect, font);
  14.312 -
  14.313 -	cur_y -= CHECKBOXCTRL_HEIGHT + VPAD + VPAD;
  14.314 -
  14.315 -#ifdef MORPH_PANEL_SHOW_SPINNERS
  14.316 -	S32 i = 0;
  14.317 -
  14.318 -	for(LLViewerVisualParam *param = (LLViewerVisualParam*)gAgent.getAvatarObject()->getFirstVisualParam();
  14.319 -		param;
  14.320 -		param = gAgent.getAvatarObject()->getNextVisualParam())
  14.321 -	{
  14.322 -		if (param->getID() == -1 ||
  14.323 -			!param->isTweakable()) continue;
  14.324 -		LLRect spinnerRect;
  14.325 -		spinnerRect.setLeftTopAndSize(HPAD + LABEL_HOFF, 
  14.326 -			cur_y, 
  14.327 -			getRect().getWidth() - HPAD - HPAD - LABEL_HOFF, 
  14.328 -			cur_y - SPINCTRL_HEIGHT);
  14.329 -		mParamSpinners[i] = new LLSpinCtrl(param->getName(),
  14.330 -			spinnerRect,
  14.331 -			font,
  14.332 -			param->getName(),
  14.333 -			&LLPanelMorph::onCommitMorphChange, 
  14.334 -			this,
  14.335 -			param->getWeight(),
  14.336 -			param->getMinWeight(), 
  14.337 -			param->getMaxWeight(), 
  14.338 -			MORPH_WEIGHT_QUANTUM * 2, 
  14.339 -			NULL, 
  14.340 -			LABEL_WIDTH );
  14.341 -
  14.342 -		mParamSpinners[i]->setPrecision(2);
  14.343 -		mParamSpinners[i]->setFollowsTop();
  14.344 -		mParamSpinners[i]->setFollowsLeft();
  14.345 -		addChild(mParamSpinners[i]); 
  14.346 -		cur_y -= VPAD + SPINCTRL_HEIGHT;
  14.347 -		i++;
  14.348 -	}
  14.349 -
  14.350 -	mNumParamSpinners = numSpinners;
  14.351 -#endif
  14.352 -	mMesh = mesh;
  14.353 -}
  14.354 -*/
    15.1 --- a/indra/newview/llpanelmorph.h	Sun Jan 15 13:43:22 2012 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,66 +0,0 @@
    15.4 -/** 
    15.5 - * @file llpanelmorph.h
    15.6 - * @brief LLPanelMorph class definition
    15.7 - *
    15.8 - * $LicenseInfo:firstyear=2001&license=viewergpl$
    15.9 - * 
   15.10 - * Copyright (c) 2001-2009, Linden Research, Inc.
   15.11 - * 
   15.12 - * Second Life Viewer Source Code
   15.13 - * The source code in this file ("Source Code") is provided by Linden Lab
   15.14 - * to you under the terms of the GNU General Public License, version 2.0
   15.15 - * ("GPL"), unless you have obtained a separate licensing agreement
   15.16 - * ("Other License"), formally executed by you and Linden Lab.  Terms of
   15.17 - * the GPL can be found in doc/GPL-license.txt in this distribution, or
   15.18 - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
   15.19 - * 
   15.20 - * There are special exceptions to the terms and conditions of the GPL as
   15.21 - * it is applied to this Source Code. View the full text of the exception
   15.22 - * in the file doc/FLOSS-exception.txt in this software distribution, or
   15.23 - * online at
   15.24 - * http://secondlifegrid.net/programs/open_source/licensing/flossexception
   15.25 - * 
   15.26 - * By copying, modifying or distributing this software, you acknowledge
   15.27 - * that you have read and understood your obligations described above,
   15.28 - * and agree to abide by those obligations.
   15.29 - * 
   15.30 - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
   15.31 - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
   15.32 - * COMPLETENESS OR PERFORMANCE.
   15.33 - * $/LicenseInfo$
   15.34 - */
   15.35 -
   15.36 -/*
   15.37 -#ifndef LL_LLPANELMORPH_H
   15.38 -#define LL_LLPANELMORPH_H
   15.39 -
   15.40 -
   15.41 -#include "llfloater.h"
   15.42 -#include "llpolymesh.h"
   15.43 -#include "llradiogroup.h"
   15.44 -#include "llquantize.h"
   15.45 -
   15.46 -class LLSpinCtrl;
   15.47 -
   15.48 -class LLPanelMorph : public LLPanel
   15.49 -{
   15.50 -public:
   15.51 -	LLPanelMorph(const std::string& name, const LLRect& rect);
   15.52 -	~LLPanelMorph();
   15.53 -	static void				onCommitSexChange( void *data);
   15.54 -	static void 			onCommitMorphChange(LLUICtrl* ctrl, void* userdata);
   15.55 -	void					updateSpinners(LLPolyMesh *mesh);
   15.56 -	void					createSpinners(LLPolyMesh *mesh);
   15.57 -	
   15.58 -protected:					
   15.59 -	S32						mNumParamSpinners;
   15.60 -	LLRadioGroup*			mSexRadioGroup;
   15.61 -	LLSpinCtrl**			mParamSpinners;
   15.62 -	LLRect					mRect;
   15.63 -	LLPolyMesh*				mMesh;
   15.64 -};
   15.65 -
   15.66 -extern LLPanelMorph *gPanelMorph;
   15.67 -
   15.68 -#endif
   15.69 -*/
    16.1 --- a/indra/newview/llselectmgr.cpp	Sun Jan 15 13:43:22 2012 +0100
    16.2 +++ b/indra/newview/llselectmgr.cpp	Sat Jan 28 16:48:34 2012 +0100
    16.3 @@ -6421,7 +6421,7 @@
    16.4  	return cost;
    16.5  }
    16.6  
    16.7 -U32 LLObjectSelection::getSelectedObjectTriangleCount()
    16.8 +U32 LLObjectSelection::getSelectedObjectTriangleCount(S32* vcount)
    16.9  {
   16.10  	U32 count = 0;
   16.11  	for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
   16.12 @@ -6431,7 +6431,7 @@
   16.13  
   16.14  		if (object)
   16.15  		{
   16.16 -			count += object->getTriangleCount();
   16.17 +			count += object->getTriangleCount(vcount);
   16.18  		}
   16.19  	}
   16.20  
    17.1 --- a/indra/newview/llselectmgr.h	Sun Jan 15 13:43:22 2012 +0100
    17.2 +++ b/indra/newview/llselectmgr.h	Sat Jan 28 16:48:34 2012 +0100
    17.3 @@ -311,7 +311,7 @@
    17.4  	F32 getSelectedLinksetPhysicsCost();
    17.5  
    17.6  	F32 getSelectedObjectStreamingCost(S32* total_bytes = NULL, S32* visible_bytes = NULL);
    17.7 -	U32 getSelectedObjectTriangleCount();
    17.8 +	U32 getSelectedObjectTriangleCount(S32* vcount = NULL);
    17.9  
   17.10  	S32 getTECount();
   17.11  	S32 getRootObjectCount();
    18.1 --- a/indra/newview/llspatialpartition.cpp	Sun Jan 15 13:43:22 2012 +0100
    18.2 +++ b/indra/newview/llspatialpartition.cpp	Sat Jan 28 16:48:34 2012 +0100
    18.3 @@ -43,6 +43,7 @@
    18.4  #include "llappviewer.h"
    18.5  #include "llcamera.h"
    18.6  #include "llface.h"
    18.7 +#include "llfloatertools.h"
    18.8  #include "llmeshrepository.h"
    18.9  #include "llphysicsshapebuilderutil.h"
   18.10  #include "lltexturecache.h"
   18.11 @@ -4140,7 +4141,27 @@
   18.12  			if (vobj)
   18.13  			{
   18.14  				LLVector3 intersection;
   18.15 -				if (vobj->lineSegmentIntersect(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mBinormal))
   18.16 +				bool skip_check = false;
   18.17 +				if (vobj->isAvatar())
   18.18 +				{
   18.19 +					LLVOAvatar* avatar = (LLVOAvatar*) vobj;
   18.20 +					if (avatar->isSelf() && gFloaterTools->getVisible())
   18.21 +					{
   18.22 +						LLViewerObject* hit = avatar->lineSegmentIntersectRiggedAttachments(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mBinormal);
   18.23 +						if (hit)
   18.24 +						{
   18.25 +							mEnd = intersection;
   18.26 +							if (mIntersection)
   18.27 +							{
   18.28 +								*mIntersection = intersection;
   18.29 +							}
   18.30 +							mHit = hit->mDrawable;
   18.31 +							skip_check = true;
   18.32 +						}
   18.33 +					}
   18.34 +				}
   18.35 +				if (!skip_check &&
   18.36 +					vobj->lineSegmentIntersect(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mBinormal))
   18.37  				{
   18.38  					mEnd = intersection;  // shorten ray so we only find CLOSER hits
   18.39  					if (mIntersection)
    19.1 --- a/indra/newview/lltexlayer.cpp	Sun Jan 15 13:43:22 2012 +0100
    19.2 +++ b/indra/newview/lltexlayer.cpp	Sat Jan 28 16:48:34 2012 +0100
    19.3 @@ -50,6 +50,7 @@
    19.4  #include "llviewerstats.h"
    19.5  #include "llviewerwindow.h"
    19.6  #include "llvoavatar.h"
    19.7 +#include "llwearable.h"
    19.8  #include "llxmltree.h"
    19.9  #include "pipeline.h"
   19.10  #include "v4coloru.h"
   19.11 @@ -69,17 +70,17 @@
   19.12  LLBakedUploadData::LLBakedUploadData(LLVOAvatar* avatar,
   19.13  									 LLTexLayerSet* layerset, 
   19.14  									 LLTexLayerSetBuffer* layerset_buffer, 
   19.15 -									 const LLUUID & id) : 
   19.16 -	mAvatar(avatar),
   19.17 +									 const LLUUID & id)
   19.18 +:	mAvatar(avatar),
   19.19  	mTexLayerSet(layerset),
   19.20  	mLayerSetBuffer(layerset_buffer),
   19.21  	mID(id)
   19.22  { 
   19.23  	mStartTime = LLFrameTimer::getTotalTime();		// Record starting time
   19.24 -	for( S32 i = 0; i < WT_COUNT; i++ )
   19.25 +	for(S32 i = 0; i < LLWearableType::WT_COUNT; i++)
   19.26  	{
   19.27 -		LLWearable* wearable = gAgent.getWearable( (EWearableType)i);
   19.28 -		if( wearable )
   19.29 +		LLWearable* wearable = gAgent.getWearable((LLWearableType::EType)i);
   19.30 +		if(wearable)
   19.31  		{
   19.32  			mWearableAssets[i] = wearable->getID();
   19.33  		}
   19.34 @@ -196,7 +197,7 @@
   19.35  	BOOL needs_update = (mNeedsUpdate || upload_now) && !avatar->mAppearanceAnimating;
   19.36  	if (needs_update)
   19.37  	{
   19.38 -		BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == TEX_SKIRT_BAKED && !avatar->isWearingWearableType(WT_SKIRT);
   19.39 +		BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == TEX_SKIRT_BAKED && !avatar->isWearingWearableType(LLWearableType::WT_SKIRT);
   19.40  		if (invalid_skirt)
   19.41  		{
   19.42  			// we were trying to create a skirt texture
   19.43 @@ -2008,8 +2009,8 @@
   19.44  		}
   19.45  	}
   19.46  
   19.47 -	EWearableType type = (EWearableType)getWearableType();
   19.48 -	if( (type != WT_INVALID) && !avatar->isWearingWearableType( type ) )
   19.49 +	LLWearableType::EType type = (LLWearableType::EType)getWearableType();
   19.50 +	if((type != LLWearableType::WT_INVALID) && !avatar->isWearingWearableType(type))
   19.51  	{
   19.52  		return TRUE;
   19.53  	}
    20.1 --- a/indra/newview/lltexlayer.h	Sun Jan 15 13:43:22 2012 +0100
    20.2 +++ b/indra/newview/lltexlayer.h	Sat Jan 28 16:48:34 2012 +0100
    20.3 @@ -42,7 +42,7 @@
    20.4  #include "llviewertexture.h"
    20.5  #include "llviewervisualparam.h"
    20.6  #include "llvoavatardefines.h"
    20.7 -#include "llwearable.h"
    20.8 +#include "llwearabletype.h"
    20.9  #include "v4color.h"
   20.10  #include "llfloater.h"
   20.11  
   20.12 @@ -557,7 +557,7 @@
   20.13  	LLVOAvatar*				mAvatar;	 // just backlink, don't LLPointer 
   20.14  	LLTexLayerSet*			mTexLayerSet;
   20.15  	LLTexLayerSetBuffer*	mLayerSetBuffer;
   20.16 -	LLUUID					mWearableAssets[WT_COUNT];
   20.17 +	LLUUID					mWearableAssets[LLWearableType::WT_COUNT];
   20.18  	U64						mStartTime;		// Used to measure time baked texture upload requires
   20.19  };
   20.20  
    21.1 --- a/indra/newview/llviewerinventory.cpp	Sun Jan 15 13:43:22 2012 +0100
    21.2 +++ b/indra/newview/llviewerinventory.cpp	Sat Jan 28 16:48:34 2012 +0100
    21.3 @@ -360,13 +360,13 @@
    21.4  	return (getInventoryType() == LLInventoryType::IT_WEARABLE);
    21.5  }
    21.6  
    21.7 -EWearableType LLViewerInventoryItem::getWearableType() const
    21.8 +LLWearableType::EType LLViewerInventoryItem::getWearableType() const
    21.9  {
   21.10  	if (!isWearableType())
   21.11  	{
   21.12 -		return WT_INVALID;
   21.13 +		return LLWearableType::WT_INVALID;
   21.14  	}
   21.15 -	return EWearableType(getFlags() & II_FLAGS_WEARABLES_MASK);
   21.16 +	return LLWearableType::EType(getFlags() & II_FLAGS_WEARABLES_MASK);
   21.17  }
   21.18  // [/RLVa:KB]
   21.19  
   21.20 @@ -807,7 +807,7 @@
   21.21  						   const LLUUID& parent, const LLTransactionID& transaction_id,
   21.22  						   const std::string& name,
   21.23  						   const std::string& desc, LLAssetType::EType asset_type,
   21.24 -						   LLInventoryType::EType inv_type, EWearableType wtype,
   21.25 +						   LLInventoryType::EType inv_type, LLWearableType::EType wtype,
   21.26  						   U32 next_owner_perm,
   21.27  						   LLPointer<LLInventoryCallback> cb)
   21.28  {
    22.1 --- a/indra/newview/llviewerinventory.h	Sun Jan 15 13:43:22 2012 +0100
    22.2 +++ b/indra/newview/llviewerinventory.h	Sat Jan 28 16:48:34 2012 +0100
    22.3 @@ -35,7 +35,7 @@
    22.4  
    22.5  #include "llinventory.h"
    22.6  #include "llframetimer.h"
    22.7 -#include "llwearable.h"
    22.8 +#include "llwearabletype.h"
    22.9  
   22.10  class LLViewerInventoryCategory;
   22.11  
   22.12 @@ -127,7 +127,7 @@
   22.13  	//void updateAssetOnServer() const;
   22.14  // [RLVa:KB] - Checked: 2010-09-27 (RLVa-1.1.3a) | Added: RLVa-1.1.3a
   22.15  	virtual bool isWearableType() const;
   22.16 -	virtual EWearableType getWearableType() const;
   22.17 +	virtual LLWearableType::EType getWearableType() const;
   22.18  // [/RLVa:KB]
   22.19  
   22.20  	virtual void packMessage(LLMessageSystem* msg) const;
   22.21 @@ -272,13 +272,13 @@
   22.22  extern LLInventoryCallbackManager gInventoryCallbacks;
   22.23  
   22.24  
   22.25 -#define NOT_WEARABLE (EWearableType)0
   22.26 +#define NOT_WEARABLE (LLWearableType::EType)0
   22.27  
   22.28  void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id,
   22.29  						   const LLUUID& parent, const LLTransactionID& transaction_id,
   22.30  						   const std::string& name,
   22.31  						   const std::string& desc, LLAssetType::EType asset_type,
   22.32 -						   LLInventoryType::EType inv_type, EWearableType wtype,
   22.33 +						   LLInventoryType::EType inv_type, LLWearableType::EType wtype,
   22.34  						   U32 next_owner_perm,
   22.35  						   LLPointer<LLInventoryCallback> cb);
   22.36  
    23.1 --- a/indra/newview/llviewermenu.cpp	Sun Jan 15 13:43:22 2012 +0100
    23.2 +++ b/indra/newview/llviewermenu.cpp	Sat Jan 28 16:48:34 2012 +0100
    23.3 @@ -8832,56 +8832,56 @@
    23.4  		bool new_value = false;
    23.5  		if (clothing == "shirt")
    23.6  		{
    23.7 -			new_value = LLAgent::selfHasWearable((void *)WT_SHIRT);
    23.8 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_SHIRT);
    23.9  		}
   23.10  		if (clothing == "pants")
   23.11  		{
   23.12 -			new_value = LLAgent::selfHasWearable((void *)WT_PANTS);
   23.13 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_PANTS);
   23.14  		}
   23.15  		if (clothing == "shoes")
   23.16  		{
   23.17 -			new_value = LLAgent::selfHasWearable((void *)WT_SHOES);
   23.18 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_SHOES);
   23.19  		}
   23.20  		if (clothing == "socks")
   23.21  		{
   23.22 -			new_value = LLAgent::selfHasWearable((void *)WT_SOCKS);
   23.23 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_SOCKS);
   23.24  		}
   23.25  		if (clothing == "jacket")
   23.26  		{
   23.27 -			new_value = LLAgent::selfHasWearable((void *)WT_JACKET);
   23.28 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_JACKET);
   23.29  		}
   23.30  		if (clothing == "gloves")
   23.31  		{
   23.32 -			new_value = LLAgent::selfHasWearable((void *)WT_GLOVES);
   23.33 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_GLOVES);
   23.34  		}
   23.35  		if (clothing == "undershirt")
   23.36  		{
   23.37 -			new_value = LLAgent::selfHasWearable((void *)WT_UNDERSHIRT);
   23.38 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_UNDERSHIRT);
   23.39  		}
   23.40  		if (clothing == "underpants")
   23.41  		{
   23.42 -			new_value = LLAgent::selfHasWearable((void *)WT_UNDERPANTS);
   23.43 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_UNDERPANTS);
   23.44  		}
   23.45  		if (clothing == "skirt")
   23.46  		{
   23.47 -			new_value = LLAgent::selfHasWearable((void *)WT_SKIRT);
   23.48 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_SKIRT);
   23.49  		}
   23.50  		if (clothing == "alpha")
   23.51  		{
   23.52 -			new_value = LLAgent::selfHasWearable((void *)WT_ALPHA);
   23.53 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_ALPHA);
   23.54  		}
   23.55  		if (clothing == "tattoo")
   23.56  		{
   23.57 -			new_value = LLAgent::selfHasWearable((void *)WT_TATTOO);
   23.58 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_TATTOO);
   23.59  		}
   23.60  		if (clothing == "physics")
   23.61  		{
   23.62 -			new_value = LLAgent::selfHasWearable((void *)WT_PHYSICS);
   23.63 +			new_value = LLAgent::selfHasWearable((void *)LLWearableType::WT_PHYSICS);
   23.64  		}
   23.65  
   23.66  // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.1.3b) | Modified: RLVa-1.1.3b | OK
   23.67  		// Why aren't they using LLWearable::typeNameToType()? *confuzzled*
   23.68 -		if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(LLWearable::typeNameToType(clothing))) )
   23.69 +		if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(LLWearableType::typeNameToType(clothing))) )
   23.70  		{
   23.71  			new_value = false;
   23.72  		}
   23.73 @@ -8899,51 +8899,51 @@
   23.74  		std::string clothing = userdata.asString();
   23.75  		if (clothing == "shirt")
   23.76  		{
   23.77 -			LLAgent::userRemoveWearable((void*)WT_SHIRT);
   23.78 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_SHIRT);
   23.79  		}
   23.80  		else if (clothing == "pants")
   23.81  		{
   23.82 -			LLAgent::userRemoveWearable((void*)WT_PANTS);
   23.83 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_PANTS);
   23.84  		}
   23.85  		else if (clothing == "shoes")
   23.86  		{
   23.87 -			LLAgent::userRemoveWearable((void*)WT_SHOES);
   23.88 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_SHOES);
   23.89  		}
   23.90  		else if (clothing == "socks")
   23.91  		{
   23.92 -			LLAgent::userRemoveWearable((void*)WT_SOCKS);
   23.93 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_SOCKS);
   23.94  		}
   23.95  		else if (clothing == "jacket")
   23.96  		{
   23.97 -			LLAgent::userRemoveWearable((void*)WT_JACKET);
   23.98 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_JACKET);
   23.99  		}
  23.100  		else if (clothing == "gloves")
  23.101  		{
  23.102 -			LLAgent::userRemoveWearable((void*)WT_GLOVES);
  23.103 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_GLOVES);
  23.104  		}
  23.105  		else if (clothing == "undershirt")
  23.106  		{
  23.107 -			LLAgent::userRemoveWearable((void*)WT_UNDERSHIRT);
  23.108 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_UNDERSHIRT);
  23.109  		}
  23.110  		else if (clothing == "underpants")
  23.111  		{
  23.112 -			LLAgent::userRemoveWearable((void*)WT_UNDERPANTS);
  23.113 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_UNDERPANTS);
  23.114  		}
  23.115  		else if (clothing == "skirt")
  23.116  		{
  23.117 -			LLAgent::userRemoveWearable((void*)WT_SKIRT);
  23.118 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_SKIRT);
  23.119  		}
  23.120  		else if (clothing == "alpha")
  23.121  		{
  23.122 -			LLAgent::userRemoveWearable((void*)WT_ALPHA);
  23.123 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_ALPHA);
  23.124  		}
  23.125  		else if (clothing == "tattoo")
  23.126  		{
  23.127 -			LLAgent::userRemoveWearable((void*)WT_TATTOO);
  23.128 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_TATTOO);
  23.129  		}
  23.130  		else if (clothing == "physics")
  23.131  		{
  23.132 -			LLAgent::userRemoveWearable((void*)WT_PHYSICS);
  23.133 +			LLAgent::userRemoveWearable((void*)LLWearableType::WT_PHYSICS);
  23.134  		}
  23.135  		else if (clothing == "all")
  23.136  		{
    24.1 --- a/indra/newview/llviewerobject.cpp	Sun Jan 15 13:43:22 2012 +0100
    24.2 +++ b/indra/newview/llviewerobject.cpp	Sat Jan 28 16:48:34 2012 +0100
    24.3 @@ -3011,7 +3011,7 @@
    24.4  	return 0.f;
    24.5  }
    24.6  
    24.7 -U32 LLViewerObject::getTriangleCount()
    24.8 +U32 LLViewerObject::getTriangleCount(S32* vcount) const
    24.9  {
   24.10  	return 0;
   24.11  }
    25.1 --- a/indra/newview/llviewerobject.h	Sun Jan 15 13:43:22 2012 +0100
    25.2 +++ b/indra/newview/llviewerobject.h	Sat Jan 28 16:48:34 2012 +0100
    25.3 @@ -328,7 +328,7 @@
    25.4  	virtual void setScale(const LLVector3 &scale, BOOL damped = FALSE);
    25.5  
    25.6  	virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
    25.7 -	virtual U32 getTriangleCount();
    25.8 +	virtual U32 getTriangleCount(S32* vcount = NULL) const;
    25.9  	virtual U32 getHighLODTriangleCount();
   25.10  
   25.11  	void setObjectCost(F32 cost);
    26.1 --- a/indra/newview/llviewervisualparam.cpp	Sun Jan 15 13:43:22 2012 +0100
    26.2 +++ b/indra/newview/llviewervisualparam.cpp	Sat Jan 28 16:48:34 2012 +0100
    26.3 @@ -38,18 +38,17 @@
    26.4  #include "llviewervisualparam.h"
    26.5  #include "llxmltree.h"
    26.6  #include "llui.h"
    26.7 -#include "llwearable.h"
    26.8 +#include "llwearabletype.h"
    26.9  
   26.10  //-----------------------------------------------------------------------------
   26.11  // LLViewerVisualParamInfo()
   26.12  //-----------------------------------------------------------------------------
   26.13  LLViewerVisualParamInfo::LLViewerVisualParamInfo()
   26.14 -	:
   26.15 -	mWearableType( WT_INVALID ),
   26.16 -	mCamDist( 0.5f ),
   26.17 -	mCamAngle( 0.f ),
   26.18 -	mCamElevation( 0.f ),
   26.19 -	mEditGroupDisplayOrder( 0 ),
   26.20 +:	mWearableType(LLWearableType::WT_INVALID),
   26.21 +	mCamDist(0.5f),
   26.22 +	mCamAngle(0.f),
   26.23 +	mCamElevation(0.f),
   26.24 +	mEditGroupDisplayOrder(0),
   26.25  	mShowSimple(FALSE),
   26.26  	mSimpleMin(0.f),
   26.27  	mSimpleMax(100.f)
   26.28 @@ -76,7 +75,7 @@
   26.29  	static LLStdStringHandle wearable_string = LLXmlTree::addAttributeString("wearable");
   26.30  	if( node->getFastAttributeString( wearable_string, wearable) )
   26.31  	{
   26.32 -		mWearableType = LLWearable::typeNameToType( wearable );
   26.33 +		mWearableType = LLWearableType::typeNameToType(wearable);
   26.34  	}
   26.35  
   26.36  	static LLStdStringHandle edit_group_string = LLXmlTree::addAttributeString("edit_group");
    27.1 --- a/indra/newview/llviewerwindow.cpp	Sun Jan 15 13:43:22 2012 +0100
    27.2 +++ b/indra/newview/llviewerwindow.cpp	Sat Jan 28 16:48:34 2012 +0100
    27.3 @@ -406,6 +406,7 @@
    27.4  			{
    27.5  				F32 cost = 0.f;
    27.6  				S32 count = 0;
    27.7 +				S32 vcount = 0;
    27.8  				S32 object_count = 0;
    27.9  				S32 total_bytes = 0;
   27.10  				S32 visible_bytes = 0;
   27.11 @@ -426,7 +427,9 @@
   27.12  								S32 bytes = 0;	
   27.13  								S32 visible = 0;
   27.14  								cost += object->getStreamingCost(&bytes, &visible);
   27.15 -								count += object->getTriangleCount();
   27.16 +								S32 vt = 0;
   27.17 +								count += object->getTriangleCount(&vt);
   27.18 +								vcount += vt;
   27.19  								total_bytes += bytes;
   27.20  								visible_bytes += visible;
   27.21  							}
   27.22 @@ -437,15 +440,16 @@
   27.23  				{
   27.24  					label = "Selection";
   27.25  					cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectStreamingCost(&total_bytes, &visible_bytes);
   27.26 -					count = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount();
   27.27 +					count = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount(&vcount);
   27.28  					object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
   27.29  				}
   27.30  
   27.31  				addText(xpos,ypos, llformat("%s streaming cost: %.1f", label, cost));
   27.32  				ypos += y_inc;
   27.33  
   27.34 -				addText(xpos, ypos, llformat("%.1f KTris, %.1f/%.1f KB, %d objects",
   27.35 -											 count / 1024.f,
   27.36 +				addText(xpos, ypos, llformat("%.1f KTris, %.3f KVerts, %.1f/%.1f KB, %d objects",
   27.37 +											 count / 1000.f,
   27.38 +											 vcount / 1000.f,
   27.39  											 visible_bytes / 1024.f,
   27.40  											 total_bytes / 1024.f,
   27.41  											 object_count));
    28.1 --- a/indra/newview/llvoavatar.cpp	Sun Jan 15 13:43:22 2012 +0100
    28.2 +++ b/indra/newview/llvoavatar.cpp	Sat Jan 28 16:48:34 2012 +0100
    28.3 @@ -117,6 +117,7 @@
    28.4  #include "llvoiceclient.h"
    28.5  #include "llvoicevisualizer.h"		// Ventrella
    28.6  #include "llvovolume.h"
    28.7 +#include "llwearable.h"
    28.8  #include "llworld.h"
    28.9  #include "noise.h"
   28.10  #include "pipeline.h"
   28.11 @@ -862,12 +863,10 @@
   28.12  		mBakedTextureData[i].mIsLoaded = false;
   28.13  		mBakedTextureData[i].mIsUsed = false;
   28.14  		mBakedTextureData[i].mMaskTexName = 0;
   28.15 -		mBakedTextureData[i].mTextureIndex = getTextureIndex((EBakedTextureIndex)i);
   28.16 +		mBakedTextureData[i].mTextureIndex = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)i);
   28.17  	}
   28.18  
   28.19  	mDirtyMesh = 2;	// Dirty geometry, need to regenerate.
   28.20 -	mShadow0Facep = NULL;
   28.21 -	mShadow1Facep = NULL;
   28.22  	mHeadp = NULL;
   28.23  
   28.24  	mIsBuilt = FALSE;
   28.25 @@ -915,10 +914,6 @@
   28.26  
   28.27  	mRippleTimeLast = 0.f;
   28.28  
   28.29 -	mShadowImagep = LLViewerTextureManager::getFetchedTextureFromFile("foot_shadow.j2c");
   28.30 -	gGL.getTexUnit(0)->bind(mShadowImagep.get());
   28.31 -	mShadowImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
   28.32 -
   28.33  	mInAir = FALSE;
   28.34  
   28.35  	mStepOnLand = TRUE;
   28.36 @@ -940,13 +935,12 @@
   28.37  	//-------------------------------------------------------------------------
   28.38  	mRoot.setName( "mRoot" );
   28.39  
   28.40 -	for (LLVOAvatarDictionary::mesh_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin();
   28.41 +	for (LLVOAvatarDictionary::Meshes::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin();
   28.42  		 iter != LLVOAvatarDictionary::getInstance()->getMeshes().end();
   28.43  		 iter++)
   28.44  	{
   28.45  		const EMeshIndex mesh_index = iter->first;
   28.46 -		const LLVOAvatarDictionary::MeshDictionaryEntry *mesh_dict = iter->second;
   28.47 -
   28.48 +		const LLVOAvatarDictionary::MeshEntry *mesh_dict = iter->second;
   28.49  		LLViewerJoint* joint = new LLViewerJoint();
   28.50  		joint->setName(mesh_dict->mName);
   28.51  		joint->setMeshID(mesh_index);
   28.52 @@ -986,12 +980,12 @@
   28.53  	//-------------------------------------------------------------------------
   28.54  	// associate baked textures with meshes
   28.55  	//-------------------------------------------------------------------------
   28.56 -	for (LLVOAvatarDictionary::mesh_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin();
   28.57 +	for (LLVOAvatarDictionary::Meshes::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin();
   28.58  		 iter != LLVOAvatarDictionary::getInstance()->getMeshes().end();
   28.59  		 iter++)
   28.60  	{
   28.61  		const EMeshIndex mesh_index = iter->first;
   28.62 -		const LLVOAvatarDictionary::MeshDictionaryEntry *mesh_dict = iter->second;
   28.63 +		const LLVOAvatarDictionary::MeshEntry *mesh_dict = iter->second;
   28.64  		const EBakedTextureIndex baked_texture_index = mesh_dict->mBakedID;
   28.65  
   28.66  		// Skip it if there's no associated baked texture.
   28.67 @@ -1179,8 +1173,8 @@
   28.68  
   28.69  	for (U32 i = 0; i < mBakedTextureData.size(); i++)
   28.70  	{
   28.71 -		if (!isTextureDefined(mBakedTextureData[i].mTextureIndex)
   28.72 -			&& ( (i != BAKED_SKIRT) || isWearingWearableType(WT_SKIRT) ) )
   28.73 +		if (!isTextureDefined(mBakedTextureData[i].mTextureIndex) &&
   28.74 +			(i != BAKED_SKIRT || isWearingWearableType(LLWearableType::WT_SKIRT)))
   28.75  		{
   28.76  			return FALSE;
   28.77  		}
   28.78 @@ -1343,11 +1337,11 @@
   28.79  		{
   28.80  			llcont << " Unbaked (";
   28.81  
   28.82 -			for (LLVOAvatarDictionary::baked_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
   28.83 +			for (LLVOAvatarDictionary::BakedTextures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
   28.84  				 iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end();
   28.85  				 iter++)
   28.86  			{
   28.87 -				const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = iter->second;
   28.88 +				const LLVOAvatarDictionary::BakedEntry *baked_dict = iter->second;
   28.89  				const ETextureIndex index = baked_dict->mTextureIndex;
   28.90  				if (!inst->isTextureDefined(index))
   28.91  				{
   28.92 @@ -1807,15 +1801,15 @@
   28.93  	}
   28.94  }
   28.95  
   28.96 -BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
   28.97 +BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start,
   28.98 +									  const LLVector3& end,
   28.99  									  S32 face,
  28.100  									  BOOL pick_transparent,
  28.101  									  S32* face_hit,
  28.102  									  LLVector3* intersection,
  28.103  									  LLVector2* tex_coord,
  28.104  									  LLVector3* normal,
  28.105 -									  LLVector3* bi_normal
  28.106 -		)
  28.107 +									  LLVector3* bi_normal)
  28.108  {
  28.109  
  28.110  	if ((mIsSelf && !gAgent.needsRenderAvatar()) || !LLPipeline::sPickAvatar)
  28.111 @@ -1864,6 +1858,31 @@
  28.112  				return TRUE;
  28.113  			}
  28.114  		}
  28.115 +
  28.116 +		if (isSelf())
  28.117 +		{
  28.118 +			for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); 
  28.119 +			 iter != mAttachmentPoints.end(); ++iter)
  28.120 +			{
  28.121 +				LLViewerJointAttachment* attachment = iter->second;
  28.122 +
  28.123 +				for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
  28.124 +					 attachment_iter != attachment->mAttachedObjects.end();
  28.125 +					 ++attachment_iter)
  28.126 +				{
  28.127 +					LLViewerObject* attached_object = (*attachment_iter);
  28.128 +
  28.129 +					if (attached_object && !attached_object->isDead() && attachment->getValid())
  28.130 +					{
  28.131 +						LLDrawable* drawable = attached_object->mDrawable;
  28.132 +						if (drawable->isState(LLDrawable::RIGGED))
  28.133 +						{	//regenerate octree for rigged attachment
  28.134 +							gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_RIGGED, TRUE);
  28.135 +						}
  28.136 +					}
  28.137 +				}
  28.138 +			}
  28.139 +		}
  28.140  	}
  28.141  
  28.142  	LLVector3 position;
  28.143 @@ -1880,6 +1899,55 @@
  28.144  	return FALSE;
  28.145  }
  28.146  
  28.147 +LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector3& start,
  28.148 +																  const LLVector3& end,
  28.149 +																  S32 face,
  28.150 +																  BOOL pick_transparent,
  28.151 +																  S32* face_hit,
  28.152 +																  LLVector3* intersection,
  28.153 +																  LLVector2* tex_coord,
  28.154 +																  LLVector3* normal,
  28.155 +																  LLVector3* bi_normal)
  28.156 +{
  28.157 +	if (isSelf() && !gAgent.needsRenderAvatar())
  28.158 +	{
  28.159 +		return NULL;
  28.160 +	}
  28.161 +
  28.162 +	LLViewerObject* hit = NULL;
  28.163 +
  28.164 +	if (lineSegmentBoundingBox(start, end))
  28.165 +	{
  28.166 +		LLVector3 local_end = end;
  28.167 +		LLVector3 local_intersection;
  28.168 +
  28.169 +		for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); 
  28.170 +			iter != mAttachmentPoints.end(); ++iter)
  28.171 +		{
  28.172 +			LLViewerJointAttachment* attachment = iter->second;
  28.173 +
  28.174 +			for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
  28.175 +					attachment_iter != attachment->mAttachedObjects.end();
  28.176 +					++attachment_iter)
  28.177 +			{
  28.178 +				LLViewerObject* attached_object = (*attachment_iter);
  28.179 +
  28.180 +				if (attached_object->lineSegmentIntersect(start, local_end, face, pick_transparent, face_hit, &local_intersection, tex_coord, normal, bi_normal))
  28.181 +				{
  28.182 +					local_end = local_intersection;
  28.183 +					if (intersection)
  28.184 +					{
  28.185 +						*intersection = local_intersection;
  28.186 +					}
  28.187 +					hit = attached_object;
  28.188 +				}
  28.189 +			}
  28.190 +		}
  28.191 +	}
  28.192 +
  28.193 +	return hit;
  28.194 +}
  28.195 +
  28.196  //-----------------------------------------------------------------------------
  28.197  // parseSkeletonFile()
  28.198  //-----------------------------------------------------------------------------
  28.199 @@ -4186,6 +4254,7 @@
  28.200  
  28.201  	// No beam for media textures
  28.202  	// TODO: this will change for Media on a Prim
  28.203 +	/* Disabled -Ansa
  28.204  	if(pick.getObject() && pick.mObjectFace >= 0)
  28.205  	{
  28.206  		const LLTextureEntry* tep = pick.getObject()->getTE(pick.mObjectFace);
  28.207 @@ -4194,6 +4263,7 @@
  28.208  			return;
  28.209  		}
  28.210  	}
  28.211 +	*/
  28.212  
  28.213  	LLColor4U rgb = gLggBeamMaps.getCurrentColor(LLColor4U(gAgent.getEffectColor()));
  28.214  
  28.215 @@ -5111,7 +5181,7 @@
  28.216  			mMeshLOD[MESH_ID_LOWER_BODY]->updateJointGeometry();
  28.217  			mMeshLOD[MESH_ID_UPPER_BODY]->updateJointGeometry();
  28.218  
  28.219 -			if( isWearingWearableType( WT_SKIRT ) )
  28.220 +			if (isWearingWearableType(LLWearableType::WT_SKIRT))
  28.221  			{
  28.222  				mMeshLOD[MESH_ID_SKIRT]->updateJointGeometry();
  28.223  			}
  28.224 @@ -5283,7 +5353,8 @@
  28.225  U32 LLVOAvatar::renderTransparent(BOOL first_pass)
  28.226  {
  28.227  	U32 num_indices = 0;
  28.228 -	if( isWearingWearableType( WT_SKIRT ) && (mIsDummy || isTextureVisible(TEX_SKIRT_BAKED)) )
  28.229 +	if (isWearingWearableType(LLWearableType::WT_SKIRT) &&
  28.230 +		(mIsDummy || isTextureVisible(TEX_SKIRT_BAKED)))
  28.231  	{
  28.232  		gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.25f);
  28.233  		num_indices += mMeshLOD[MESH_ID_SKIRT]->render(mAdjustedPixelArea, FALSE);
  28.234 @@ -5364,54 +5435,6 @@
  28.235  	return num_indices;
  28.236  }
  28.237  
  28.238 -U32 LLVOAvatar::renderFootShadows()
  28.239 -{
  28.240 -	U32 num_indices = 0;
  28.241 -
  28.242 -	if (!mIsBuilt)
  28.243 -	{
  28.244 -		return 0;
  28.245 -	}
  28.246 -
  28.247 -	if (mIsSelf && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead()))
  28.248 -	{
  28.249 -		return 0;
  28.250 -	}
  28.251 -
  28.252 -	if (!mIsBuilt)
  28.253 -	{
  28.254 -		return 0;
  28.255 -	}
  28.256 -
  28.257 -	// Don't render foot shadows if your lower body is completely invisible.
  28.258 -	// (non-humanoid avatars rule!)
  28.259 -	if (! isTextureVisible(TEX_LOWER_BAKED))
  28.260 -	{
  28.261 -		return 0;
  28.262 -	}
  28.263 -
  28.264 -	// Update the shadow, tractor, and text label geometry.
  28.265 -	if (mDrawable->isState(LLDrawable::REBUILD_SHADOW) && !isImpostor())
  28.266 -	{
  28.267 -		updateShadowFaces();
  28.268 -		mDrawable->clearState(LLDrawable::REBUILD_SHADOW);
  28.269 -	}
  28.270 -
  28.271 -	U32 foot_mask = LLVertexBuffer::MAP_VERTEX |
  28.272 -					LLVertexBuffer::MAP_TEXCOORD0;
  28.273 -
  28.274 -	LLGLDepthTest test(GL_TRUE, GL_FALSE);
  28.275 -	//render foot shadows
  28.276 -	LLGLEnable blend(GL_BLEND);
  28.277 -	gGL.getTexUnit(0)->bind(mShadowImagep.get(), TRUE);
  28.278 -	glColor4fv(mShadow0Facep->getRenderColor().mV);
  28.279 -	mShadow0Facep->renderIndexed(foot_mask);
  28.280 -	glColor4fv(mShadow1Facep->getRenderColor().mV);
  28.281 -	mShadow1Facep->renderIndexed(foot_mask);
  28.282 -
  28.283 -	return num_indices;
  28.284 -}
  28.285 -
  28.286  U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
  28.287  {
  28.288  	if (!mImpostor.isComplete())
  28.289 @@ -5488,54 +5511,20 @@
  28.290  		}
  28.291  	}
  28.292  
  28.293 -	/*
  28.294 -	// JAMESDEBUG
  28.295 -	if (mIsSelf)
  28.296 -	{
  28.297 -		S32 null_count = 0;
  28.298 -		S32 default_count = 0;
  28.299 -		for (U32 i = 0; i < getNumTEs(); i++)
  28.300 -		{
  28.301 -			const LLTextureEntry* te = getTE(i);
  28.302 -			if (te)
  28.303 -			{
  28.304 -				if (te->getID() == LLUUID::null)
  28.305 -				{
  28.306 -					null_count++;
  28.307 -				}
  28.308 -				else if (te->getID() == IMG_DEFAULT_AVATAR)
  28.309 -				{
  28.310 -					default_count++;
  28.311 -				}
  28.312 -			}
  28.313 -		}
  28.314 -		llinfos << "JAMESDEBUG my avatar TE null " << null_count << " default " << default_count << llendl;
  28.315 -	}
  28.316 -	*/
  28.317 -
  28.318  	mMaxPixelArea = 0.f;
  28.319  	mMinPixelArea = 99999999.f;
  28.320  	mHasGrey = FALSE; // debug
  28.321 -	for (U32 index = 0; index < getNumTEs(); index++)
  28.322 -	{
  28.323 -		LLViewerFetchedTexture *imagep = LLViewerTextureManager::staticCastToFetchedTexture(getTEImage(index));
  28.324 +	for (U32 texture_index = 0; texture_index < getNumTEs(); texture_index++)
  28.325 +	{
  28.326 +		LLViewerFetchedTexture *imagep = LLViewerTextureManager::staticCastToFetchedTexture(getTEImage(texture_index));
  28.327  		if (imagep)
  28.328  		{
  28.329 -			// Debugging code - maybe non-self avatars are downloading textures?
  28.330 -			//llinfos << "avatar self " << mIsSelf << " tex " << index
  28.331 -			//	<< " decode " << imagep->getDecodePriority()
  28.332 -			//	<< " boost " << imagep->getBoostLevel()
  28.333 -			//	<< " size " << imagep->getWidth() << "x" << imagep->getHeight()
  28.334 -			//	<< " discard " << imagep->getDiscardLevel()
  28.335 -			//	<< " desired " << imagep->getDesiredDiscardLevel()
  28.336 -			//	<< llendl;
  28.337 -
  28.338 -			const LLTextureEntry *te = getTE(index);
  28.339 +			const LLTextureEntry *te = getTE(texture_index);
  28.340  			F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT);
  28.341  			S32 boost_level = mIsSelf ? LLViewerTexture::BOOST_AVATAR_BAKED_SELF : LLViewerTexture::BOOST_AVATAR_BAKED;
  28.342  
  28.343  			// Spam if this is a baked texture, not set to default image, without valid host info
  28.344 -			if (isIndexBakedTexture((ETextureIndex)index)
  28.345 +			if (isIndexBakedTexture((ETextureIndex)texture_index)
  28.346  				&& imagep->getID() != IMG_DEFAULT_AVATAR
  28.347  				&& imagep->getID() != IMG_INVISIBLE
  28.348  				&& !imagep->getTargetHost().isOk())
  28.349 @@ -5546,16 +5535,13 @@
  28.350  					<< " on host " << getRegion()->getHost() << llendl;
  28.351  			}
  28.352  
  28.353 -			/* switch(index)
  28.354 -				case TEX_HEAD_BODYPAINT:
  28.355 -					addLocalTextureStats( LOCTEX_HEAD_BODYPAINT, imagep, texel_area_ratio, render_avatar, head_baked ); */
  28.356 -			const LLVOAvatarDictionary::TextureDictionaryEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)index);
  28.357 +			const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)texture_index);
  28.358  			if (texture_dict->mIsUsedByBakedTexture)
  28.359  			{
  28.360  				const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
  28.361  				if (texture_dict->mIsLocalTexture)
  28.362  				{
  28.363 -					addLocalTextureStats((ETextureIndex)index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]);
  28.364 +					addLocalTextureStats((ETextureIndex)texture_index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]);
  28.365  					// SNOW-8 : temporary snowglobe1.0 fix for baked textures
  28.366  					if (render_avatar && !gGLManager.mIsDisabled )
  28.367  					{
  28.368 @@ -5578,11 +5564,6 @@
  28.369  	{
  28.370  		setDebugText(llformat("%4.0f:%4.0f", (F32)sqrt(mMinPixelArea), (F32)sqrt(mMaxPixelArea)));
  28.371  	}
  28.372 -
  28.373 -	if( render_avatar )
  28.374 -	{
  28.375 -		mShadowImagep->addTextureStats(mPixelArea);
  28.376 -	}
  28.377  }
  28.378  
  28.379  
  28.380 @@ -6473,11 +6454,11 @@
  28.381  				return FALSE;
  28.382  			}
  28.383  			bool found_baked_entry = false;
  28.384 -			for (LLVOAvatarDictionary::baked_map_t::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.385 +			for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.386  				 baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end();
  28.387  				 baked_iter++)
  28.388  			{
  28.389 -				const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = baked_iter->second;
  28.390 +				const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second;
  28.391  				if (layer_set->isBodyRegion(baked_dict->mName))
  28.392  				{
  28.393  					mBakedTextureData[baked_iter->first].mTexLayerSet = layer_set;
  28.394 @@ -6678,12 +6659,12 @@
  28.395  			switch(lod)
  28.396  			  case 0:
  28.397  				mesh = &mHairMesh0; */
  28.398 -		for (LLVOAvatarDictionary::mesh_map_t::const_iterator mesh_iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin();
  28.399 +		for (LLVOAvatarDictionary::Meshes::const_iterator mesh_iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin();
  28.400  			 mesh_iter != LLVOAvatarDictionary::getInstance()->getMeshes().end();
  28.401  			 mesh_iter++)
  28.402  		{
  28.403  			const EMeshIndex mesh_index = mesh_iter->first;
  28.404 -			const LLVOAvatarDictionary::MeshDictionaryEntry *mesh_dict = mesh_iter->second;
  28.405 +			const LLVOAvatarDictionary::MeshEntry *mesh_dict = mesh_iter->second;
  28.406  			if (type.compare(mesh_dict->mName) == 0)
  28.407  			{
  28.408  				mesh_id = mesh_index;
  28.409 @@ -6915,15 +6896,6 @@
  28.410  	mDrawable->addFace(poolp, NULL);
  28.411  	mDrawable->setRenderType(LLPipeline::RENDER_TYPE_AVATAR);
  28.412  
  28.413 -	LLFace *facep;
  28.414 -
  28.415 -	// Add faces for the foot shadows
  28.416 -	facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep);
  28.417 -	mShadow0Facep = facep;
  28.418 -
  28.419 -	facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep);
  28.420 -	mShadow1Facep = facep;
  28.421 -
  28.422  	mNumInitFaces = mDrawable->getNumFaces();
  28.423  
  28.424  	dirtyMesh(2);
  28.425 @@ -6964,107 +6936,6 @@
  28.426  }
  28.427  
  28.428  //-----------------------------------------------------------------------------
  28.429 -// updateShadowFaces()
  28.430 -//-----------------------------------------------------------------------------
  28.431 -void LLVOAvatar::updateShadowFaces()
  28.432 -{
  28.433 -	LLFace *face0p = mShadow0Facep;
  28.434 -	LLFace *face1p = mShadow1Facep;
  28.435 -
  28.436 -	//
  28.437 -	// render avatar shadows
  28.438 -	//
  28.439 -	if (mInAir || mUpdatePeriod >= IMPOSTOR_PERIOD)
  28.440 -	{
  28.441 -		face0p->setSize(0, 0);
  28.442 -		face1p->setSize(0, 0);
  28.443 -		return;
  28.444 -	}
  28.445 -
  28.446 -	LLSprite sprite(mShadowImagep.notNull() ? mShadowImagep->getID() : LLUUID::null);
  28.447 -	sprite.setFollow(FALSE);
  28.448 -	const F32 cos_angle = gSky.getSunDirection().mV[2];
  28.449 -	F32 cos_elev = sqrt(1 - cos_angle * cos_angle);
  28.450 -	if (cos_angle < 0) cos_elev = -cos_elev;
  28.451 -	sprite.setSize(0.4f + cos_elev * 0.8f, 0.3f);
  28.452 -	LLVector3 sun_vec = gSky.mVOSkyp ? gSky.mVOSkyp->getToSun() : LLVector3(0.f, 0.f, 0.f);
  28.453 -
  28.454 -	if (mShadowImagep->hasGLTexture())
  28.455 -	{
  28.456 -		LLVector3 normal;
  28.457 -		LLVector3d shadow_pos;
  28.458 -		LLVector3 shadow_pos_agent;
  28.459 -		F32 foot_height;
  28.460 -
  28.461 -		if (mFootLeftp)
  28.462 -		{
  28.463 -			LLVector3 joint_world_pos = mFootLeftp->getWorldPosition();
  28.464 -			// this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now
  28.465 -			// but we make an explicit ray trace call in expectation of future improvements
  28.466 -			resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos),
  28.467 -				gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal);
  28.468 -			shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos);
  28.469 -			foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ];
  28.470 -
  28.471 -			// Pull sprite in direction of surface normal
  28.472 -			shadow_pos_agent += normal * SHADOW_OFFSET_AMT;
  28.473 -
  28.474 -			// Render sprite
  28.475 -			sprite.setNormal(normal);
  28.476 -			if (mIsSelf && gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK)
  28.477 -			{
  28.478 -				sprite.setColor(0.f, 0.f, 0.f, 0.f);
  28.479 -			}
  28.480 -			else
  28.481 -			{
  28.482 -				sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f));
  28.483 -			}
  28.484 -			sprite.setPosition(shadow_pos_agent);
  28.485 -
  28.486 -			LLVector3 foot_to_knee = mKneeLeftp->getWorldPosition() - joint_world_pos;
  28.487 -			//foot_to_knee.normalize();
  28.488 -			foot_to_knee -= projected_vec(foot_to_knee, sun_vec);
  28.489 -			sprite.setYaw(azimuth(sun_vec - foot_to_knee));
  28.490 -
  28.491 -			sprite.updateFace(*face0p);
  28.492 -		}
  28.493 -
  28.494 -		if (mFootRightp)
  28.495 -		{
  28.496 -			LLVector3 joint_world_pos = mFootRightp->getWorldPosition();
  28.497 -			// this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now
  28.498 -			// but we make an explicit ray trace call in expectation of future improvements
  28.499 -			resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos),
  28.500 -				gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal);
  28.501 -			shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos);
  28.502 -			foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ];
  28.503 -
  28.504 -			// Pull sprite in direction of surface normal
  28.505 -			shadow_pos_agent += normal * SHADOW_OFFSET_AMT;
  28.506 -
  28.507 -			// Render sprite
  28.508 -			sprite.setNormal(normal);
  28.509 -			if (mIsSelf && gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK)
  28.510 -			{
  28.511 -				sprite.setColor(0.f, 0.f, 0.f, 0.f);
  28.512 -			}
  28.513 -			else
  28.514 -			{
  28.515 -				sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f));
  28.516 -			}
  28.517 -			sprite.setPosition(shadow_pos_agent);
  28.518 -
  28.519 -			LLVector3 foot_to_knee = mKneeRightp->getWorldPosition() - joint_world_pos;
  28.520 -			//foot_to_knee.normalize();
  28.521 -			foot_to_knee -= projected_vec(foot_to_knee, sun_vec);
  28.522 -			sprite.setYaw(azimuth(sun_vec - foot_to_knee));
  28.523 -
  28.524 -			sprite.updateFace(*face1p);
  28.525 -		}
  28.526 -	}
  28.527 -}
  28.528 -
  28.529 -//-----------------------------------------------------------------------------
  28.530  // updateSexDependentLayerSets()
  28.531  //-----------------------------------------------------------------------------
  28.532  void LLVOAvatar::updateSexDependentLayerSets( BOOL set_by_user )
  28.533 @@ -7121,7 +6992,7 @@
  28.534  		case LOCTEX_UPPER_SHIRT:
  28.535  			if( mUpperBodyLayerSet )
  28.536  				mUpperBodyLayerSet->requestUpdate(); */
  28.537 -	const LLVOAvatarDictionary::TextureDictionaryEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.538 +	const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.539  	if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture)
  28.540  		return;
  28.541  	const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
  28.542 @@ -7375,6 +7246,7 @@
  28.543  		// Then make sure the inventory is in sync with the avatar.
  28.544  		gInventory.addChangedMask(LLInventoryObserver::LABEL, viewer_object->getAttachmentItemID());
  28.545  		gInventory.notifyObservers();
  28.546 +		updateLODRiggedAttachments();		
  28.547  
  28.548  		// Should just be the last object added
  28.549  		if (attachment->isObjectAttached(viewer_object))
  28.550 @@ -7897,8 +7769,8 @@
  28.551  {
  28.552  	for (U32 i = 0; i < mBakedTextureData.size(); i++)
  28.553  	{
  28.554 -		if ( mBakedTextureData[i].mTexLayerSet
  28.555 -			&& ((i != BAKED_SKIRT) || isWearingWearableType( WT_SKIRT )) )
  28.556 +		if (mBakedTextureData[i].mTexLayerSet &&
  28.557 +			(i != BAKED_SKIRT || isWearingWearableType(LLWearableType::WT_SKIRT)))
  28.558  		{
  28.559  			mBakedTextureData[i].mTexLayerSet->updateComposite();
  28.560  		}
  28.561 @@ -8031,7 +7903,7 @@
  28.562  	LLVOAvatar* self = gAgent.getAvatarObject();
  28.563  	if(self)
  28.564  	{
  28.565 -		if(!self->isWearingWearableType(WT_HAIR))
  28.566 +		if(!self->isWearingWearableType(LLWearableType::WT_HAIR))
  28.567  		{	
  28.568  			// Ansariel: Debug info to track down hair issue
  28.569  			llinfos << "TAT: Applying ruth hair fix" << llendl;
  28.570 @@ -8080,7 +7952,7 @@
  28.571  	// If this is a texture corresponding to one of our baked entries,
  28.572  	// just rebake that layer set.
  28.573  	BOOL found = FALSE;
  28.574 -	if(!self->isWearingWearableType(WT_HAIR))
  28.575 +	if(!self->isWearingWearableType(LLWearableType::WT_HAIR))
  28.576  	{
  28.577  		//wear some hair
  28.578  		LLViewerInventoryCategory::createBasicHair();
  28.579 @@ -8089,12 +7961,12 @@
  28.580  	/* ETextureIndex baked_texture_indices[BAKED_NUM_INDICES] =
  28.581  			TEX_HEAD_BAKED,
  28.582  			TEX_UPPER_BAKED, */
  28.583 -	for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.584 +	for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.585  		 iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
  28.586  		 iter++)
  28.587  	{
  28.588  		const ETextureIndex index = iter->first;
  28.589 -		const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second;
  28.590 +		const LLVOAvatarDictionary::TextureEntry *text_dict = iter->second;
  28.591  		if (text_dict->mIsBakedTexture)
  28.592  		{
  28.593  			if (texture_id == self->getTEImage(index)->getID())
  28.594 @@ -8638,12 +8510,12 @@
  28.595  	/* // Head
  28.596  	   BOOL head_baked_ready = (is_layer_baked[BAKED_HEAD] && mBakedTextureData[BAKED_HEAD].mIsLoaded) || other_culled;
  28.597  	   setLocalTexture( TEX_HEAD_BODYPAINT, getTEImage( TEX_HEAD_BODYPAINT ), head_baked_ready ); */
  28.598 -	for (LLVOAvatarDictionary::baked_map_t::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.599 +	for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.600  		 baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end();
  28.601  		 baked_iter++)
  28.602  	{
  28.603  		const EBakedTextureIndex baked_index = baked_iter->first;
  28.604 -		const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = baked_iter->second;
  28.605 +		const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second;
  28.606  
  28.607  		for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
  28.608  			 local_tex_iter != baked_dict->mLocalTextures.end();
  28.609 @@ -8790,7 +8662,7 @@
  28.610  	{
  28.611  		if (layerset == mBakedTextureData[i].mTexLayerSet)
  28.612  		{
  28.613 -			const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i);
  28.614 +			const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i);
  28.615  			for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
  28.616  				 local_tex_iter != baked_dict->mLocalTextures.end();
  28.617  				 local_tex_iter++)
  28.618 @@ -8817,7 +8689,7 @@
  28.619  {
  28.620  	/* if( layerset == mBakedTextureData[BAKED_HEAD].mTexLayerSet )
  28.621  	   return getLocalDiscardLevel( TEX_HEAD_BODYPAINT ) >= 0; */
  28.622 -	for (LLVOAvatarDictionary::baked_map_t::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.623 +	for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.624  		 baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end();
  28.625  		 baked_iter++)
  28.626  	{
  28.627 @@ -8825,7 +8697,7 @@
  28.628  		if (layerset == mBakedTextureData[baked_index].mTexLayerSet)
  28.629  		{
  28.630  			bool ret = true;
  28.631 -			const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = baked_iter->second;
  28.632 +			const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second;
  28.633  			for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
  28.634  				 local_tex_iter != baked_dict->mLocalTextures.end();
  28.635  				 local_tex_iter++)
  28.636 @@ -8882,7 +8754,7 @@
  28.637  	/* switch(te)
  28.638  		case TEX_HEAD_BAKED:
  28.639  			llinfos << "New baked texture: HEAD" << llendl; */
  28.640 -	const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(te);
  28.641 +	const LLVOAvatarDictionary::TextureEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(te);
  28.642  	if (text_dict->mIsBakedTexture)
  28.643  	{
  28.644  		llinfos << "New baked texture: " << text_dict->mName << " UUID: " << uuid <<llendl;
  28.645 @@ -8953,14 +8825,15 @@
  28.646  
  28.647  	for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
  28.648  	{
  28.649 -		const LLVOAvatarDictionary::BakedDictionaryEntry * bakedDicEntry = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
  28.650 +		const LLVOAvatarDictionary::BakedEntry * bakedDicEntry = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
  28.651  		// skip if this is a skirt and av is not wearing one, or if we don't have a baked texture UUID
  28.652  		if(baked_index == BAKED_HEAD)
  28.653                  continue;
  28.654  		if(baked_index == BAKED_EYES)
  28.655                  continue;
  28.656 -		if (!isTextureDefined(bakedDicEntry->mTextureIndex)
  28.657 -			&& ( (baked_index != BAKED_SKIRT) || isWearingWearableType(WT_SKIRT) ))
  28.658 +		if (!isTextureDefined(bakedDicEntry->mTextureIndex) &&
  28.659 +			(baked_index != BAKED_SKIRT ||
  28.660 +			 isWearingWearableType(LLWearableType::WT_SKIRT)))
  28.661  		{
  28.662  			continue;
  28.663  		}
  28.664 @@ -9125,11 +8998,11 @@
  28.665  			"TEX_HEAD_BODYPAINT   ",
  28.666  			"TEX_UPPER_SHIRT      ", */
  28.667  	llinfos << (mIsSelf ? "Self: " : "Other: ") << context << llendl;
  28.668 -	for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.669 +	for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.670  		 iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
  28.671  		 iter++)
  28.672  	{
  28.673 -		const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second;
  28.674 +		const LLVOAvatarDictionary::TextureEntry *text_dict = iter->second;
  28.675  		const LLViewerTexture* te_image = getTEImage(iter->first);
  28.676  		if( !te_image )
  28.677  		{
  28.678 @@ -9200,7 +9073,7 @@
  28.679  {
  28.680  	/* switch( index )
  28.681  		case TEX_UPPER_SHIRT:		return LLUUID( gSavedSettings.getString("UIImgDefaultShirtUUID") ); */
  28.682 -	const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.683 +	const LLVOAvatarDictionary::TextureEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.684  	const std::string &default_image_name = text_dict->mDefaultImageName;
  28.685  	if (default_image_name == "")
  28.686  	{
  28.687 @@ -9240,39 +9113,39 @@
  28.688  
  28.689  // Given a texture entry, determine which wearable type owns it.
  28.690  // static
  28.691 -EWearableType LLVOAvatar::getTEWearableType(ETextureIndex index )
  28.692 +LLWearableType::EType LLVOAvatar::getTEWearableType(ETextureIndex index)
  28.693  {
  28.694  	/* switch(index)
  28.695  		case TEX_UPPER_SHIRT:
  28.696 -			return WT_SHIRT; */
  28.697 +			return LLWearableType::WT_SHIRT; */
  28.698  	return LLVOAvatarDictionary::getInstance()->getTexture(index)->mWearableType;
  28.699  }
  28.700  
  28.701  // Unlike most wearable functions, this works for both self and other.
  28.702 -BOOL LLVOAvatar::isWearingWearableType( EWearableType type )
  28.703 +BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type)
  28.704  {
  28.705  	if (mIsDummy) return TRUE;
  28.706  
  28.707  	switch( type )
  28.708  	{
  28.709 -		case WT_SHAPE:
  28.710 -		case WT_SKIN:
  28.711 -		//case WT_HAIR:
  28.712 -		case WT_EYES:
  28.713 +		case LLWearableType::WT_SHAPE:
  28.714 +		case LLWearableType::WT_SKIN:
  28.715 +		//case LLWearableType::WT_HAIR:
  28.716 +		case LLWearableType::WT_EYES:
  28.717  			return TRUE;  // everyone has all bodyparts
  28.718  		default:
  28.719  			break; // Do nothing
  28.720  	}
  28.721  
  28.722  	/* switch(type)
  28.723 -		case WT_SHIRT:
  28.724 +		case LLWearableType::WT_SHIRT:
  28.725  			indicator_te = TEX_UPPER_SHIRT; */
  28.726 -	for (LLVOAvatarDictionary::texture_map_t::const_iterator tex_iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.727 +	for (LLVOAvatarDictionary::Textures::const_iterator tex_iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.728  		 tex_iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
  28.729  		 tex_iter++)
  28.730  	{
  28.731  		const LLVOAvatarDefines::ETextureIndex index = tex_iter->first;
  28.732 -		const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = tex_iter->second;
  28.733 +		const LLVOAvatarDictionary::TextureEntry *text_dict = tex_iter->second;
  28.734  		if (text_dict->mWearableType == type)
  28.735  		{
  28.736  			// If you're checking your own clothing, check the component texture
  28.737 @@ -9294,11 +9167,11 @@
  28.738  			// this works for detecting a skirt (most important), but is ineffective at any piece of clothing that
  28.739  			// gets baked into a texture that always exists (upper or lower).
  28.740  			const std::string name = text_dict->mName;
  28.741 -			for (LLVOAvatarDictionary::baked_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.742 +			for (LLVOAvatarDictionary::BakedTextures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.743  				iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end();
  28.744  				iter++)
  28.745  			{
  28.746 -				const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = iter->second;
  28.747 +				const LLVOAvatarDictionary::BakedEntry *baked_dict = iter->second;
  28.748  				if (baked_dict->mName == name)
  28.749  				{
  28.750  					if (isTextureDefined(baked_dict->mTextureIndex))
  28.751 @@ -9318,25 +9191,24 @@
  28.752  }
  28.753  
  28.754  //-----------------------------------------------------------------------------
  28.755 -// updatedWearable( EWearableType type )
  28.756 +// wearableUpdated(LLWearableType::EType type, BOOL upload_result)
  28.757  // forces an update to any baked textures relevant to type.
  28.758  // Should be called only on saving the wearable
  28.759  //-----------------------------------------------------------------------------
  28.760 -void LLVOAvatar::wearableUpdated(EWearableType type, BOOL upload_result)
  28.761 -{
  28.762 -	for (LLVOAvatarDictionary::wearable_map_t::const_iterator wearable_iter = LLVOAvatarDictionary::getInstance()->getWearables().begin();
  28.763 -		wearable_iter != LLVOAvatarDictionary::getInstance()->getWearables().end();
  28.764 -		wearable_iter++)
  28.765 -	{
  28.766 -		const LLVOAvatarDictionary::WearableDictionaryEntry *wearable_dict = wearable_iter->second;
  28.767 -		const LLVOAvatarDefines::EBakedTextureIndex index = wearable_iter->first;
  28.768 -		if (wearable_dict)
  28.769 -		{
  28.770 -			for (LLVOAvatarDefines::wearables_vec_t::const_iterator type_iter = wearable_dict->mWearablesVec.begin();
  28.771 -				type_iter != wearable_dict->mWearablesVec.end();
  28.772 -				type_iter++)
  28.773 -			{
  28.774 -				const EWearableType comp_type = *type_iter;
  28.775 +void LLVOAvatar::wearableUpdated(LLWearableType::EType type, BOOL upload_result)
  28.776 +{
  28.777 +	for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin();
  28.778 +		 baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end();
  28.779 +		 ++baked_iter)
  28.780 +	{
  28.781 +		const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second;
  28.782 +		const LLVOAvatarDefines::EBakedTextureIndex index = baked_iter->first;
  28.783 +		if (baked_dict)
  28.784 +		{
  28.785 +			for (LLVOAvatarDefines::wearables_vec_t::const_iterator type_iter = baked_dict->mWearables.begin();
  28.786 +				 type_iter != baked_dict->mWearables.end(); ++type_iter)
  28.787 +			{
  28.788 +				const LLWearableType::EType comp_type = *type_iter;
  28.789  				if (comp_type == type)
  28.790  				{
  28.791  					if (mBakedTextureData[index].mTexLayerSet)
  28.792 @@ -9352,9 +9224,9 @@
  28.793  
  28.794  	// Physics type has no associated baked textures, but change of params needs to be sent to
  28.795  	// other avatars.
  28.796 -	if (isSelf() && type == WT_PHYSICS)
  28.797 -	{
  28.798 -	gAgent.sendAgentSetAppearance();
  28.799 +	if (isSelf() && type == LLWearableType::WT_PHYSICS)
  28.800 +	{
  28.801 +		gAgent.sendAgentSetAppearance();
  28.802  	}
  28.803  }
  28.804  
  28.805 @@ -9739,12 +9611,12 @@
  28.806  					 self->mBakedTextureData[BAKED_HEAD].mTexLayerSet->applyMorphMask(aux_src->getData(), aux_src->getWidth(), aux_src->getHeight(), 1);
  28.807  					 maskData->mLastDiscardLevel = discard_level; */
  28.808  			bool found_texture_id = false;
  28.809 -			for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.810 +			for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.811  				 iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
  28.812  				 iter++)
  28.813  			{
  28.814  
  28.815 -				const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second;
  28.816 +				const LLVOAvatarDictionary::TextureEntry *text_dict = iter->second;
  28.817  				if (text_dict->mIsUsedByBakedTexture)
  28.818  				{
  28.819  					const ETextureIndex texture_index = iter->first;
  28.820 @@ -9857,7 +9729,7 @@
  28.821  			{
  28.822  				mBakedTextureData[i].mTexLayerSet->destroyComposite();
  28.823  			}
  28.824 -			const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i);
  28.825 +			const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i);
  28.826  			for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
  28.827  				 local_tex_iter != baked_dict->mLocalTextures.end();
  28.828  				 local_tex_iter++)
  28.829 @@ -9914,9 +9786,10 @@
  28.830  	apr_file_printf( file, "\n\t<archetype name=\"???\">\n" );
  28.831  
  28.832  	// only body parts, not clothing.
  28.833 -	for( S32 type = WT_SHAPE; type <= WT_EYES; type++ )
  28.834 -	{
  28.835 -		const std::string& wearable_name = LLWearable::typeToTypeName( (EWearableType) type );
  28.836 +	for (S32 type = LLWearableType::WT_SHAPE;
  28.837 +		 type <= LLWearableType::WT_EYES; type++)
  28.838 +	{
  28.839 +		const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type);
  28.840  		apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() );
  28.841  
  28.842  		for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
  28.843 @@ -10083,11 +9956,11 @@
  28.844  	/* switch(index)
  28.845  		case TEX_EYES_BAKED:
  28.846  			textures.push_back(TEX_EYES_IRIS); */
  28.847 -	const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.848 +	const LLVOAvatarDictionary::TextureEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.849  	if (!text_dict->mIsUsedByBakedTexture) return FALSE;
  28.850  
  28.851  	const EBakedTextureIndex baked_index = text_dict->mBakedTextureIndex;
  28.852 -	const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index);
  28.853 +	const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index);
  28.854  	for (texture_vec_t::const_iterator iter = baked_dict->mLocalTextures.begin();
  28.855  		 iter != baked_dict->mLocalTextures.end();
  28.856  		 iter++)
  28.857 @@ -10142,11 +10015,11 @@
  28.858  	/* ETextureIndex baked_equiv[] = {
  28.859  		TEX_UPPER_BAKED,
  28.860  	   if (isTextureDefined(baked_equiv[i])) */
  28.861 -	for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.862 +	for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.863  		 iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
  28.864  		 iter++)
  28.865  	{
  28.866 -		const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second;
  28.867 +		const LLVOAvatarDictionary::TextureEntry *text_dict = iter->second;
  28.868  		if (!text_dict->mIsLocalTexture || !text_dict->mIsUsedByBakedTexture)
  28.869  			continue;
  28.870  
  28.871 @@ -10214,10 +10087,17 @@
  28.872  	for (U32 i = 0; i < mBakedTextureData.size(); i++)
  28.873  	{
  28.874  		const S32 te = mBakedTextureData[i].mTextureIndex;
  28.875 -		if (getTEImage(te)->isMissingAsset())
  28.876 -		{
  28.877 -			setTEImage(te, LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR));
  28.878 -			removed = TRUE;
  28.879 +		const LLViewerTexture* tex = getTEImage(te);
  28.880 +
  28.881 +		if (!tex || tex->isMissingAsset())
  28.882 +		{
  28.883 +			LLViewerTexture* imagep;
  28.884 +			imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR);
  28.885 +			if (imagep)
  28.886 +			{
  28.887 +				setTEImage(te, imagep);
  28.888 +				removed = TRUE;
  28.889 +			}
  28.890  		}
  28.891  	}
  28.892  
  28.893 @@ -10225,6 +10105,7 @@
  28.894  	{
  28.895  		for(U32 i = 0; i < mBakedTextureData.size(); i++)
  28.896  		{
  28.897 +			mBakedTextureData[i].mTexLayerSet->setUpdatesEnabled(TRUE);
  28.898  			invalidateComposite(mBakedTextureData[i].mTexLayerSet, FALSE);
  28.899  		}
  28.900  		updateMeshTextures();
  28.901 @@ -10727,7 +10608,7 @@
  28.902  		case TEX_HEAD_BAKED:
  28.903  		case TEX_HEAD_BODYPAINT:
  28.904  			return mHeadLayerSet; */
  28.905 -	const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.906 +	const LLVOAvatarDictionary::TextureEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index);
  28.907  	if (text_dict->mIsUsedByBakedTexture)
  28.908  	{
  28.909  		const EBakedTextureIndex baked_index = text_dict->mBakedTextureIndex;
  28.910 @@ -10881,9 +10762,10 @@
  28.911  
  28.912  	for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
  28.913  	{
  28.914 -		const LLVOAvatarDictionary::BakedDictionaryEntry* baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
  28.915 +		const LLVOAvatarDictionary::BakedEntry* baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
  28.916  		ETextureIndex tex_index = baked_dict->mTextureIndex;
  28.917 -		if (tex_index != TEX_SKIRT_BAKED || isWearingWearableType(WT_SKIRT))
  28.918 +		if (tex_index != TEX_SKIRT_BAKED ||
  28.919 +			isWearingWearableType(LLWearableType::WT_SKIRT))
  28.920  		{
  28.921  			if (isTextureVisible(tex_index))
  28.922  			{
  28.923 @@ -11007,12 +10889,12 @@
  28.924  {
  28.925  	std::string line;
  28.926  
  28.927 -	for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.928 +	for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
  28.929  		 iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
  28.930  		 iter++)
  28.931  	{
  28.932  		const ETextureIndex index = iter->first;
  28.933 -		const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second;
  28.934 +		const LLVOAvatarDictionary::TextureEntry *text_dict = iter->second;
  28.935  		if (text_dict->mIsBakedTexture)
  28.936  		{
  28.937  			line += text_dict->mName;
    29.1 --- a/indra/newview/llvoavatar.h	Sun Jan 15 13:43:22 2012 +0100
    29.2 +++ b/indra/newview/llvoavatar.h	Sat Jan 28 16:48:34 2012 +0100
    29.3 @@ -50,7 +50,7 @@
    29.4  #include "llviewerobject.h"
    29.5  #include "llvoavatardefines.h"
    29.6  #include "llavatarname.h"
    29.7 -#include "llwearable.h"
    29.8 +#include "llwearabletype.h"
    29.9  
   29.10  #ifdef OLD_BREAST_PHYSICS
   29.11  #include "phoenixboobutils.h"
   29.12 @@ -158,8 +158,17 @@
   29.13  										  LLVector3* intersection = NULL,         // return the intersection point
   29.14  										  LLVector2* tex_coord = NULL,            // return the texture coordinates of the intersection point
   29.15  										  LLVector3* normal = NULL,               // return the surface normal at the intersection point
   29.16 -										  LLVector3* bi_normal = NULL             // return the surface bi-normal at the intersection point
   29.17 -		);
   29.18 +										  LLVector3* bi_normal = NULL);            // return the surface bi-normal at the intersection point
   29.19 +
   29.20 +	LLViewerObject*	lineSegmentIntersectRiggedAttachments(const LLVector3& start,
   29.21 +														  const LLVector3& end,
   29.22 +														  S32 face = -1,                    // which face to check, -1 = ALL_SIDES
   29.23 +														  BOOL pick_transparent = FALSE,
   29.24 +														  S32* face_hit = NULL,             // which face was hit
   29.25 +														  LLVector3* intersection = NULL,   // return the intersection point
   29.26 +														  LLVector2* tex_coord = NULL,      // return the texture coordinates of the intersection point
   29.27 +														  LLVector3* normal = NULL,         // return the surface normal at the intersection point
   29.28 +														  LLVector3* bi_normal = NULL);     // return the surface bi-normal at the intersection point
   29.29  
   29.30  	/*virtual*/ void updateTextures();
   29.31  	// If setting a baked texture, need to request it from a non-local sim.
   29.32 @@ -384,8 +393,8 @@
   29.33  	static void		destroyGL();
   29.34  	static void		restoreGL();
   29.35  	static void		resetImpostors();
   29.36 -	static enum EWearableType	getTEWearableType(LLVOAvatarDefines::ETextureIndex te );
   29.37 -	static LLUUID			getDefaultTEImageID(LLVOAvatarDefines::ETextureIndex te );
   29.38 +	static enum LLWearableType::EType getTEWearableType(LLVOAvatarDefines::ETextureIndex te);
   29.39 +	static LLUUID	getDefaultTEImageID(LLVOAvatarDefines::ETextureIndex te);
   29.40  	static void		onChangeSelfInvisible(BOOL newvalue);
   29.41  	void			setInvisible(BOOL newvalue);
   29.42  	static LLColor4 getDummyColor();
   29.43 @@ -400,8 +409,8 @@
   29.44  	LLColor4		getClothesColor( LLVOAvatarDefines::ETextureIndex te );
   29.45  	BOOL			teToColorParams( LLVOAvatarDefines::ETextureIndex te, const char* param_name[3] );
   29.46  
   29.47 -	BOOL			isWearingWearableType( EWearableType type );
   29.48 -	void			wearableUpdated(EWearableType type, BOOL upload_result = TRUE);
   29.49 +	BOOL			isWearingWearableType(LLWearableType::EType type);
   29.50 +	void			wearableUpdated(LLWearableType::EType type, BOOL upload_result = TRUE);
   29.51  	//--------------------------------------------------------------------
   29.52  	// texture compositing
   29.53  	//--------------------------------------------------------------------
   29.54 @@ -498,17 +507,6 @@
   29.55  	AnimationSourceMap mAnimationSources; // object ids that triggered anim ids
   29.56  
   29.57  	//--------------------------------------------------------------------
   29.58 -	// Shadowing
   29.59 -	//--------------------------------------------------------------------
   29.60 -public:
   29.61 -	void updateShadowFaces();
   29.62 -	LLDrawable*		mShadow;
   29.63 -private:
   29.64 -	LLFace* mShadow0Facep;
   29.65 -	LLFace* mShadow1Facep;
   29.66 -	LLPointer<LLViewerFetchedTexture> mShadowImagep;
   29.67 -
   29.68 -	//--------------------------------------------------------------------
   29.69  	// Keeps track of foot step state for generating sounds
   29.70  	//--------------------------------------------------------------------
   29.71  public:
    30.1 --- a/indra/newview/llvoavatardefines.cpp	Sun Jan 15 13:43:22 2012 +0100
    30.2 +++ b/indra/newview/llvoavatardefines.cpp	Sat Jan 28 16:48:34 2012 +0100
    30.3 @@ -1,6 +1,6 @@
    30.4  /** 
    30.5 - * @file llvoavatar.cpp
    30.6 - * @brief Implementation of LLVOAvatar class which is a derivation fo LLViewerObject
    30.7 + * @file llvoavatardefines.cpp
    30.8 + * @brief Implementation of LLVOAvatarDefines class
    30.9   *
   30.10   * $LicenseInfo:firstyear=2001&license=viewergpl$
   30.11   * 
   30.12 @@ -31,8 +31,11 @@
   30.13   */
   30.14  
   30.15  #include "llviewerprecompiledheaders.h"
   30.16 +
   30.17  #include "llvoavatardefines.h"
   30.18  
   30.19 +#include "llviewercontrol.h"	// gSavedSettings
   30.20 +
   30.21  const S32 LLVOAvatarDefines::SCRATCH_TEX_WIDTH = 512;
   30.22  const S32 LLVOAvatarDefines::SCRATCH_TEX_HEIGHT = 512;
   30.23  const S32 LLVOAvatarDefines::IMPOSTOR_PERIOD = 2;
   30.24 @@ -42,64 +45,127 @@
   30.25  /*********************************************************************************
   30.26   * Edit this function to add/remove/change textures and mesh definitions for avatars.
   30.27   */
   30.28 -void LLVOAvatarDictionary::initData()
   30.29 +
   30.30 +LLVOAvatarDictionary::Textures::Textures()
   30.31  {
   30.32 -	// Textures
   30.33 -	mTextureMap[TEX_HEAD_BODYPAINT] =            new TextureDictionaryEntry("head bodypaint",   TRUE,  BAKED_NUM_INDICES, "",                          WT_SKIN);
   30.34 -	mTextureMap[TEX_UPPER_SHIRT] =               new TextureDictionaryEntry("shirt",            TRUE,  BAKED_NUM_INDICES, "UIImgDefaultShirtUUID",     WT_SHIRT);
   30.35 -	mTextureMap[TEX_LOWER_PANTS] =               new TextureDictionaryEntry("pants",            TRUE,  BAKED_NUM_INDICES, "UIImgDefaultPantsUUID",     WT_PANTS);
   30.36 -	mTextureMap[TEX_EYES_IRIS] =                 new TextureDictionaryEntry("iris",             TRUE,  BAKED_NUM_INDICES, "UIImgDefaultEyesUUID",      WT_EYES);
   30.37 -	mTextureMap[TEX_HAIR] =                      new TextureDictionaryEntry("hair",             TRUE,  BAKED_NUM_INDICES, "UIImgDefaultHairUUID",      WT_HAIR);
   30.38 -	mTextureMap[TEX_UPPER_BODYPAINT] =           new TextureDictionaryEntry("upper bodypaint",  TRUE,  BAKED_NUM_INDICES, "",                          WT_SKIN);
   30.39 -	mTextureMap[TEX_LOWER_BODYPAINT] =           new TextureDictionaryEntry("lower bodypaint",  TRUE,  BAKED_NUM_INDICES, "",                          WT_SKIN);
   30.40 -	mTextureMap[TEX_LOWER_SHOES] =               new TextureDictionaryEntry("shoes",            TRUE,  BAKED_NUM_INDICES, "UIImgDefaultShoesUUID",     WT_SHOES);
   30.41 -	mTextureMap[TEX_LOWER_SOCKS] =               new TextureDictionaryEntry("socks",            TRUE,  BAKED_NUM_INDICES, "UIImgDefaultSocksUUID",     WT_SOCKS);
   30.42 -	mTextureMap[TEX_UPPER_JACKET] =              new TextureDictionaryEntry("upper jacket",     TRUE,  BAKED_NUM_INDICES, "UIImgDefaultJacketUUID",    WT_JACKET);
   30.43 -	mTextureMap[TEX_LOWER_JACKET] =              new TextureDictionaryEntry("lower jacket",     TRUE,  BAKED_NUM_INDICES, "UIImgDefaultJacketUUID",    WT_JACKET);
   30.44 -	mTextureMap[TEX_UPPER_GLOVES] =              new TextureDictionaryEntry("gloves",           TRUE,  BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID",    WT_GLOVES);
   30.45 -	mTextureMap[TEX_UPPER_UNDERSHIRT] =          new TextureDictionaryEntry("undershirt",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERSHIRT);
   30.46 -	mTextureMap[TEX_LOWER_UNDERPANTS] =          new TextureDictionaryEntry("underpants",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERPANTS);
   30.47 -	mTextureMap[TEX_SKIRT] =                     new TextureDictionaryEntry("skirt",            TRUE,  BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID",     WT_SKIRT);
   30.48 -	mTextureMap[TEX_LOWER_ALPHA] =               new TextureDictionaryEntry("lower_alpha",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     WT_ALPHA);
   30.49 -	mTextureMap[TEX_UPPER_ALPHA] =               new TextureDictionaryEntry("upper_alpha",      TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     WT_ALPHA);
   30.50 -	mTextureMap[TEX_HEAD_ALPHA] =                new TextureDictionaryEntry("head_alpha",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     WT_ALPHA);
   30.51 -	mTextureMap[TEX_EYES_ALPHA] =                new TextureDictionaryEntry("eyes_alpha",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     WT_ALPHA);
   30.52 -	mTextureMap[TEX_HAIR_ALPHA] =                new TextureDictionaryEntry("hair_alpha",       TRUE,  BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",     WT_ALPHA);
   30.53 -	mTextureMap[TEX_HEAD_TATTOO] =               new TextureDictionaryEntry("head_tattoo",      TRUE,  BAKED_NUM_INDICES, "",     WT_TATTOO);
   30.54 -	mTextureMap[TEX_UPPER_TATTOO] =              new TextureDictionaryEntry("upper_tattoo",     TRUE,  BAKED_NUM_INDICES, "",     WT_TATTOO);
   30.55 -	mTextureMap[TEX_LOWER_TATTOO] =              new TextureDictionaryEntry("lower_tattoo",     TRUE,  BAKED_NUM_INDICES, "",     WT_TATTOO);
   30.56 -	mTextureMap[TEX_HEAD_BAKED] =                new TextureDictionaryEntry("head-baked",       FALSE, BAKED_HEAD);
   30.57 -	mTextureMap[TEX_UPPER_BAKED] =               new TextureDictionaryEntry("upper-baked",      FALSE, BAKED_UPPER);
   30.58 -	mTextureMap[TEX_LOWER_BAKED] =               new TextureDictionaryEntry("lower-baked",      FALSE, BAKED_LOWER);
   30.59 -	mTextureMap[TEX_EYES_BAKED] =                new TextureDictionaryEntry("eyes-baked",       FALSE, BAKED_EYES);
   30.60 -	mTextureMap[TEX_HAIR_BAKED] =                new TextureDictionaryEntry("hair-baked",       FALSE, BAKED_HAIR);
   30.61 -	mTextureMap[TEX_SKIRT_BAKED] =               new TextureDictionaryEntry("skirt-baked",      FALSE, BAKED_SKIRT);
   30.62 +	addEntry(TEX_HEAD_BODYPAINT,	new TextureEntry("head_bodypaint",	TRUE,	BAKED_NUM_INDICES, "",							LLWearableType::WT_SKIN));
   30.63 +	addEntry(TEX_UPPER_SHIRT,		new TextureEntry("shirt",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultShirtUUID",		LLWearableType::WT_SHIRT));
   30.64 +	addEntry(TEX_LOWER_PANTS,		new TextureEntry("pants",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultPantsUUID",		LLWearableType::WT_PANTS));
   30.65 +	addEntry(TEX_EYES_IRIS,			new TextureEntry("iris",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultEyesUUID",		LLWearableType::WT_EYES));
   30.66 +	addEntry(TEX_HAIR,				new TextureEntry("hair",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultHairUUID",		LLWearableType::WT_HAIR));
   30.67 +	addEntry(TEX_UPPER_BODYPAINT,	new TextureEntry("upper_bodypaint",	TRUE,	BAKED_NUM_INDICES, "",							LLWearableType::WT_SKIN));
   30.68 +	addEntry(TEX_LOWER_BODYPAINT,	new TextureEntry("lower_bodypaint",	TRUE,	BAKED_NUM_INDICES, "",							LLWearableType::WT_SKIN));
   30.69 +	addEntry(TEX_LOWER_SHOES,		new TextureEntry("shoes",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultShoesUUID",		LLWearableType::WT_SHOES));
   30.70 +	addEntry(TEX_LOWER_SOCKS,		new TextureEntry("socks",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultSocksUUID",		LLWearableType::WT_SOCKS));
   30.71 +	addEntry(TEX_UPPER_JACKET,		new TextureEntry("upper_jacket",	TRUE,	BAKED_NUM_INDICES, "UIImgDefaultJacketUUID",	LLWearableType::WT_JACKET));
   30.72 +	addEntry(TEX_LOWER_JACKET,		new TextureEntry("lower_jacket",	TRUE,	BAKED_NUM_INDICES, "UIImgDefaultJacketUUID",	LLWearableType::WT_JACKET));
   30.73 +	addEntry(TEX_UPPER_GLOVES,		new TextureEntry("gloves",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID",	LLWearableType::WT_GLOVES));
   30.74 +	addEntry(TEX_UPPER_UNDERSHIRT,	new TextureEntry("undershirt",		TRUE,	BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID",	LLWearableType::WT_UNDERSHIRT));
   30.75 +	addEntry(TEX_LOWER_UNDERPANTS,	new TextureEntry("underpants",		TRUE,	BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID",	LLWearableType::WT_UNDERPANTS));
   30.76 +	addEntry(TEX_SKIRT,				new TextureEntry("skirt",			TRUE,	BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", 	LLWearableType::WT_SKIRT));
   30.77  
   30.78 +	addEntry(TEX_LOWER_ALPHA,		new TextureEntry("lower_alpha",		TRUE,	BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",		LLWearableType::WT_ALPHA));
   30.79 +	addEntry(TEX_UPPER_ALPHA,		new TextureEntry("upper_alpha",		TRUE,	BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",		LLWearableType::WT_ALPHA));
   30.80 +	addEntry(TEX_HEAD_ALPHA,		new TextureEntry("head_alpha",		TRUE,	BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",		LLWearableType::WT_ALPHA));
   30.81 +	addEntry(TEX_EYES_ALPHA,		new TextureEntry("eyes_alpha",		TRUE,	BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",		LLWearableType::WT_ALPHA));
   30.82 +	addEntry(TEX_HAIR_ALPHA,		new TextureEntry("hair_alpha",		TRUE,	BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID",		LLWearableType::WT_ALPHA));
   30.83 +
   30.84 +	addEntry(TEX_HEAD_TATTOO,		new TextureEntry("head_tattoo",		TRUE,	BAKED_NUM_INDICES, "",							LLWearableType::WT_TATTOO));
   30.85 +	addEntry(TEX_UPPER_TATTOO,		new TextureEntry("upper_tattoo",	TRUE,	BAKED_NUM_INDICES, "",							LLWearableType::WT_TATTOO));
   30.86 +	addEntry(TEX_LOWER_TATTOO,		new TextureEntry("lower_tattoo",	TRUE,	BAKED_NUM_INDICES, "",							LLWearableType::WT_TATTOO));
   30.87 +
   30.88 +	addEntry(TEX_HEAD_BAKED,		new TextureEntry("head-baked",		FALSE,	BAKED_HEAD));
   30.89 +	addEntry(TEX_UPPER_BAKED,		new TextureEntry("upper-baked",		FALSE,	BAKED_UPPER));
   30.90 +	addEntry(TEX_LOWER_BAKED,		new TextureEntry("lower-baked",		FALSE,	BAKED_LOWER));
   30.91 +	addEntry(TEX_EYES_BAKED,		new TextureEntry("eyes-baked",		FALSE,	BAKED_EYES));
   30.92 +	addEntry(TEX_HAIR_BAKED,		new TextureEntry("hair-baked",		FALSE,	BAKED_HAIR));
   30.93 +	addEntry(TEX_SKIRT_BAKED,		new TextureEntry("skirt-baked",		FALSE,	BAKED_SKIRT));
   30.94 +}
   30.95 + 
   30.96 +LLVOAvatarDictionary::BakedTextures::BakedTextures()
   30.97 +{
   30.98  	// Baked textures
   30.99 -	mBakedTextureMap[BAKED_HEAD] =     new BakedDictionaryEntry(TEX_HEAD_BAKED,  "head",       3, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA);
  30.100 -	mBakedTextureMap[BAKED_UPPER] =    new BakedDictionaryEntry(TEX_UPPER_BAKED, "upper_body", 7, TEX_UPPER_SHIRT, TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET, TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA);
  30.101 -	mBakedTextureMap[BAKED_LOWER] =    new BakedDictionaryEntry(TEX_LOWER_BAKED, "lower_body", 8, TEX_LOWER_PANTS, TEX_LOWER_BODYPAINT, TEX_LOWER_SHOES, TEX_LOWER_SOCKS, TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA);
  30.102 -	mBakedTextureMap[BAKED_EYES] =     new BakedDictionaryEntry(TEX_EYES_BAKED,  "eyes",       2, TEX_EYES_IRIS, TEX_EYES_ALPHA);
  30.103 -	mBakedTextureMap[BAKED_SKIRT] =    new BakedDictionaryEntry(TEX_SKIRT_BAKED, "skirt",      1, TEX_SKIRT);
  30.104 -	mBakedTextureMap[BAKED_HAIR] =     new BakedDictionaryEntry(TEX_HAIR_BAKED,  "hair",       2, TEX_HAIR, TEX_HAIR_ALPHA);
  30.105 +	addEntry(BAKED_HEAD,	new BakedEntry(TEX_HEAD_BAKED, "head",
  30.106 +										   "a4b9dc38-e13b-4df9-b284-751efb0566ff",
  30.107 +										   3, TEX_HEAD_BODYPAINT,
  30.108 +											  TEX_HEAD_TATTOO,
  30.109 +											  TEX_HEAD_ALPHA,
  30.110 +										   5, LLWearableType::WT_SHAPE,
  30.111 +											  LLWearableType::WT_SKIN,
  30.112 +											  LLWearableType::WT_HAIR,
  30.113 +											  LLWearableType::WT_TATTOO,
  30.114 +											  LLWearableType::WT_ALPHA));
  30.115 +
  30.116 +	addEntry(BAKED_UPPER,	new BakedEntry(TEX_UPPER_BAKED, "upper_body",
  30.117 +										   "5943ff64-d26c-4a90-a8c0-d61f56bd98d4",
  30.118 +										   7, TEX_UPPER_SHIRT,
  30.119 +											  TEX_UPPER_BODYPAINT,
  30.120 +											  TEX_UPPER_JACKET,
  30.121 +											  TEX_UPPER_GLOVES,
  30.122 +											  TEX_UPPER_UNDERSHIRT,
  30.123 +											  TEX_UPPER_TATTOO,
  30.124 +											  TEX_UPPER_ALPHA,
  30.125 +										   8, LLWearableType::WT_SHAPE,
  30.126 +											  LLWearableType::WT_SKIN,
  30.127 +											  LLWearableType::WT_SHIRT,
  30.128 +											  LLWearableType::WT_JACKET,
  30.129 +											  LLWearableType::WT_GLOVES,
  30.130 +											  LLWearableType::WT_UNDERSHIRT,
  30.131 +											  LLWearableType::WT_TATTOO,
  30.132 +											  LLWearableType::WT_ALPHA));											  
  30.133 +
  30.134 +	addEntry(BAKED_LOWER,	new BakedEntry(TEX_LOWER_BAKED, "lower_body",
  30.135 +										   "2944ee70-90a7-425d-a5fb-d749c782ed7d",
  30.136 +										   8, TEX_LOWER_PANTS,
  30.137 +											  TEX_LOWER_BODYPAINT,
  30.138 +											  TEX_LOWER_SHOES,
  30.139 +											  TEX_LOWER_SOCKS,
  30.140 +											  TEX_LOWER_JACKET,
  30.141 +											  TEX_LOWER_UNDERPANTS,
  30.142 +											  TEX_LOWER_TATTOO,
  30.143 +											  TEX_LOWER_ALPHA,
  30.144 +										   9, LLWearableType::WT_SHAPE,
  30.145 +											  LLWearableType::WT_SKIN,
  30.146 +											  LLWearableType::WT_PANTS,
  30.147 +											  LLWearableType::WT_SHOES,
  30.148 +											  LLWearableType::WT_SOCKS,
  30.149 +											  LLWearableType::WT_JACKET,
  30.150 +											  LLWearableType::WT_UNDERPANTS,
  30.151 +											  LLWearableType::WT_TATTOO,
  30.152 +											  LLWearableType::WT_ALPHA));
  30.153 +
  30.154 +	addEntry(BAKED_EYES,	new BakedEntry(TEX_EYES_BAKED, "eyes",
  30.155 +										   "27b1bc0f-979f-4b13-95fe-b981c2ba9788",
  30.156 +										   2, TEX_EYES_IRIS,
  30.157 +											  TEX_EYES_ALPHA,
  30.158 +										   2, LLWearableType::WT_EYES,
  30.159 +											  LLWearableType::WT_ALPHA));
  30.160 +
  30.161 +	addEntry(BAKED_SKIRT,	new BakedEntry(TEX_SKIRT_BAKED, "skirt",
  30.162 +										   "03e7e8cb-1368-483b-b6f3-74850838ba63",
  30.163 +										   1, TEX_SKIRT,
  30.164 +										   1, LLWearableType::WT_SKIRT));
  30.165 +
  30.166 +	addEntry(BAKED_HAIR,	new BakedEntry(TEX_HAIR_BAKED, "hair",
  30.167 +										   "a60e85a9-74e8-48d8-8a2d-8129f28d9b61",
  30.168 +										   2, TEX_HAIR,
  30.169 +											  TEX_HAIR_ALPHA,
  30.170 +										   2, LLWearableType::WT_HAIR,
  30.171 +											  LLWearableType::WT_ALPHA));
  30.172 +}
  30.173 +
  30.174 +LLVOAvatarDictionary::Meshes::Meshes()
  30.175 +{
  30.176  		
  30.177  	// Meshes
  30.178 -	mMeshMap[MESH_ID_HAIR] =           new MeshDictionaryEntry(BAKED_HAIR,  "hairMesh",         6, LLViewerJoint::PN_4);
  30.179 -	mMeshMap[MESH_ID_HEAD] =           new MeshDictionaryEntry(BAKED_HEAD,  "headMesh",         5, LLViewerJoint::PN_5);
  30.180 -	mMeshMap[MESH_ID_EYELASH] =        new MeshDictionaryEntry(BAKED_HEAD,  "eyelashMesh",      1, LLViewerJoint::PN_0); // no baked mesh associated currently
  30.181 -	mMeshMap[MESH_ID_UPPER_BODY] =     new MeshDictionaryEntry(BAKED_UPPER, "upperBodyMesh",    5, LLViewerJoint::PN_1);
  30.182 -	mMeshMap[MESH_ID_LOWER_BODY] =     new MeshDictionaryEntry(BAKED_LOWER, "lowerBodyMesh",    5, LLViewerJoint::PN_2);
  30.183 -	mMeshMap[MESH_ID_EYEBALL_LEFT] =   new MeshDictionaryEntry(BAKED_EYES,  "eyeBallLeftMesh",  2, LLViewerJoint::PN_3);
  30.184 -	mMeshMap[MESH_ID_EYEBALL_RIGHT] =  new MeshDictionaryEntry(BAKED_EYES,  "eyeBallRightMesh", 2, LLViewerJoint::PN_3);
  30.185 -	mMeshMap[MESH_ID_SKIRT] =          new MeshDictionaryEntry(BAKED_SKIRT, "skirtMesh",        5, LLViewerJoint::PN_5);
  30.186 -
  30.187 -	// Wearables
  30.188 -	mWearableMap[BAKED_HEAD] =   new WearableDictionaryEntry("18ded8d6-bcfc-e415-8539-944c0f5ea7a6", 5, WT_SHAPE, WT_SKIN, WT_HAIR, WT_TATTOO, WT_ALPHA);
  30.189 -	mWearableMap[BAKED_UPPER] =  new WearableDictionaryEntry("338c29e3-3024-4dbb-998d-7c04cf4fa88f", 8, WT_SHAPE, WT_SKIN, WT_SHIRT, WT_JACKET, WT_GLOVES, WT_UNDERSHIRT, WT_TATTOO, WT_ALPHA);
  30.190 -	mWearableMap[BAKED_LOWER] =  new WearableDictionaryEntry("91b4a2c7-1b1a-ba16-9a16-1f8f8dcc1c3f", 9, WT_SHAPE, WT_SKIN, WT_PANTS, WT_SHOES, WT_SOCKS, WT_JACKET, WT_UNDERPANTS, WT_TATTOO, WT_ALPHA);
  30.191 -	mWearableMap[BAKED_EYES] =   new WearableDictionaryEntry("b2cf28af-b840-1071-3c6a-78085d8128b5", 2, WT_EYES, WT_ALPHA);
  30.192 -	mWearableMap[BAKED_SKIRT] =  new WearableDictionaryEntry("ea800387-ea1a-14e0-56cb-24f2022f969a", 1, WT_SKIRT);
  30.193 -	mWearableMap[BAKED_HAIR] =   new WearableDictionaryEntry("0af1ef7c-ad24-11dd-8790-001f5bf833e8", 2, WT_HAIR, WT_ALPHA);
  30.194 +	addEntry(MESH_ID_HAIR,             new MeshEntry(BAKED_HAIR,  "hairMesh",         6, LLViewerJoint::PN_4));
  30.195 +	addEntry(MESH_ID_HEAD,             new MeshEntry(BAKED_HEAD,  "headMesh",         5, LLViewerJoint::PN_5));
  30.196 +	addEntry(MESH_ID_EYELASH,          new MeshEntry(BAKED_HEAD,  "eyelashMesh",      1, LLViewerJoint::PN_0)); // no baked mesh associated currently
  30.197 +	addEntry(MESH_ID_UPPER_BODY,       new MeshEntry(BAKED_UPPER, "upperBodyMesh",    5, LLViewerJoint::PN_1));
  30.198 +	addEntry(MESH_ID_LOWER_BODY,       new MeshEntry(BAKED_LOWER, "lowerBodyMesh",    5, LLViewerJoint::PN_2));
  30.199 +	addEntry(MESH_ID_EYEBALL_LEFT,     new MeshEntry(BAKED_EYES,  "eyeBallLeftMesh",  2, LLViewerJoint::PN_3));
  30.200 +	addEntry(MESH_ID_EYEBALL_RIGHT,    new MeshEntry(BAKED_EYES,  "eyeBallRightMesh", 2, LLViewerJoint::PN_3));
  30.201 +	addEntry(MESH_ID_SKIRT,            new MeshEntry(BAKED_SKIRT, "skirtMesh",        5, LLViewerJoint::PN_5));
  30.202  }
  30.203  
  30.204  /*
  30.205 @@ -108,18 +174,23 @@
  30.206  
  30.207  LLVOAvatarDictionary::LLVOAvatarDictionary()
  30.208  {
  30.209 -	initData();
  30.210  	createAssociations();
  30.211  }
  30.212  
  30.213 +//virtual 
  30.214 +LLVOAvatarDictionary::~LLVOAvatarDictionary()
  30.215 +{
  30.216 +}
  30.217 +
  30.218  // Baked textures are composites of textures; for each such composited texture,
  30.219  // map it to the baked texture.
  30.220  void LLVOAvatarDictionary::createAssociations()
  30.221  {
  30.222 -	for (baked_map_t::const_iterator iter = mBakedTextureMap.begin(); iter != mBakedTextureMap.end(); iter++)
  30.223 +	for (BakedTextures::const_iterator iter = mBakedTextures.begin();
  30.224 +		 iter != mBakedTextures.end(); iter++)
  30.225  	{
  30.226  		const EBakedTextureIndex baked_index = (iter->first);
  30.227 -		const BakedDictionaryEntry *dict = (iter->second);
  30.228 +		const BakedEntry *dict = (iter->second);
  30.229  
  30.230  		// For each texture that this baked texture index affects, associate those textures
  30.231  		// with this baked texture index.
  30.232 @@ -127,20 +198,20 @@
  30.233  			 local_texture_iter != dict->mLocalTextures.end();
  30.234  			 local_texture_iter++)
  30.235  		{
  30.236 -			const ETextureIndex local_texture_index = (ETextureIndex) *local_texture_iter;
  30.237 -			mTextureMap[local_texture_index]->mIsUsedByBakedTexture = true;
  30.238 -			mTextureMap[local_texture_index]->mBakedTextureIndex = baked_index;
  30.239 +			const ETextureIndex local_texture_index = (ETextureIndex)*local_texture_iter;
  30.240 +			mTextures[local_texture_index]->mIsUsedByBakedTexture = true;
  30.241 +			mTextures[local_texture_index]->mBakedTextureIndex = baked_index;
  30.242  		}
  30.243  	}
  30.244  		
  30.245  }
  30.246  
  30.247 -LLVOAvatarDictionary::TextureDictionaryEntry::TextureDictionaryEntry(const std::string &name, 
  30.248 -																	 bool is_local_texture, 
  30.249 -																	 EBakedTextureIndex baked_texture_index,
  30.250 -																	 const std::string &default_image_name,
  30.251 -																	 EWearableType wearable_type) :
  30.252 -	mName(name),
  30.253 +LLVOAvatarDictionary::TextureEntry::TextureEntry(const std::string &name, 
  30.254 +												 bool is_local_texture, 
  30.255 +												 EBakedTextureIndex baked_texture_index,
  30.256 +												 const std::string &default_image_name,
  30.257 +												 LLWearableType::EType wearable_type)
  30.258 +:	LLDictionaryEntry(name),
  30.259  	mIsLocalTexture(is_local_texture),
  30.260  	mIsBakedTexture(!is_local_texture),
  30.261  	mIsUsedByBakedTexture(baked_texture_index != BAKED_NUM_INDICES),
  30.262 @@ -150,87 +221,86 @@
  30.263  {
  30.264  }
  30.265  
  30.266 -LLVOAvatarDictionary::MeshDictionaryEntry::MeshDictionaryEntry(EBakedTextureIndex baked_index, 
  30.267 -															   const std::string &name, 
  30.268 -															   U8 level,
  30.269 -															   LLViewerJoint::PickName pick) :
  30.270 +LLVOAvatarDictionary::MeshEntry::MeshEntry(EBakedTextureIndex baked_index, 
  30.271 +										   const std::string &name, 
  30.272 +										   U8 level,
  30.273 +										   LLViewerJoint::PickName pick)
  30.274 +:	LLDictionaryEntry(name),
  30.275  	mBakedID(baked_index),
  30.276 -	mName(name),
  30.277  	mLOD(level),
  30.278  	mPickName(pick)
  30.279  {
  30.280  }
  30.281 -LLVOAvatarDictionary::BakedDictionaryEntry::BakedDictionaryEntry(ETextureIndex tex_index, 
  30.282 -																 const std::string &name, 
  30.283 -																 U32 num_local_textures, ... ) :
  30.284 -	mName(name),
  30.285 +
  30.286 +LLVOAvatarDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index, 
  30.287 +											 const std::string &name, 
  30.288 +											 const std::string &hash_name,
  30.289 +											 U32 num_local_textures, ... )
  30.290 +:	LLDictionaryEntry(name),
  30.291 +	mWearablesHashID(LLUUID(hash_name)),
  30.292  	mTextureIndex(tex_index)
  30.293 -
  30.294  {
  30.295  	va_list argp;
  30.296  	va_start(argp, num_local_textures);
  30.297 -	for (U8 i=0; i < num_local_textures; i++)
  30.298 +
  30.299 +	// Read in local textures
  30.300 +	for (U8 i = 0; i < num_local_textures; i++)
  30.301  	{
  30.302 -		ETextureIndex t = (ETextureIndex)va_arg(argp,int);
  30.303 +		ETextureIndex t = (ETextureIndex)va_arg(argp, int);
  30.304  		mLocalTextures.push_back(t);
  30.305  	}
  30.306 +
  30.307 +	// Read in number of wearables
  30.308 +	const U32 num_wearables = (U32)va_arg(argp, int);
  30.309 +	// Read in wearables
  30.310 +	for (U8 i = 0; i < num_wearables; i++)
  30.311 +	{
  30.312 +		LLWearableType::EType t = (LLWearableType::EType)va_arg(argp, int);
  30.313 +		mWearables.push_back(t);
  30.314 +	}
  30.315  }
  30.316  
  30.317 -LLVOAvatarDictionary::WearableDictionaryEntry::WearableDictionaryEntry(const std::string &hash_name, 
  30.318 -																	   U32 num_wearables, ... ) :
  30.319 -	mHashID(LLUUID(hash_name))
  30.320 +// static
  30.321 +ETextureIndex LLVOAvatarDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index)
  30.322  {
  30.323 -	va_list argp;
  30.324 -	va_start(argp, num_wearables);
  30.325 -	for (U8 i=0; i < num_wearables; i++)
  30.326 +	return LLVOAvatarDictionary::getInstance()->getBakedTexture(index)->mTextureIndex;
  30.327 +}
  30.328 +
  30.329 +//static 
  30.330 +EBakedTextureIndex LLVOAvatarDictionary::findBakedByRegionName(std::string name)
  30.331 +{
  30.332 +	U8 index = 0;
  30.333 +	while (index < BAKED_NUM_INDICES)
  30.334  	{
  30.335 -		EWearableType t = (EWearableType)va_arg(argp,int);
  30.336 -		mWearablesVec.push_back(t);
  30.337 +		const BakedEntry *be = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
  30.338 +		if (be && be->mName.compare(name) == 0)
  30.339 +		{
  30.340 +			// baked texture found
  30.341 +			return (EBakedTextureIndex) index;
  30.342 +		}
  30.343 +		index++;
  30.344 +	}
  30.345 +	// baked texture could not be found
  30.346 +	return BAKED_NUM_INDICES;
  30.347 +}
  30.348 +
  30.349 +//static
  30.350 +const LLUUID LLVOAvatarDictionary::getDefaultTextureImageID(ETextureIndex index)
  30.351 +{
  30.352 +	const TextureEntry *texture_dict = getInstance()->getTexture(index);
  30.353 +	const std::string &default_image_name = texture_dict->mDefaultImageName;
  30.354 +	if (default_image_name == "")
  30.355 +	{
  30.356 +		return IMG_DEFAULT_AVATAR;
  30.357 +	}
  30.358 +	else
  30.359 +	{
  30.360 +		return LLUUID(gSavedSettings.getString(default_image_name));
  30.361  	}
  30.362  }
  30.363  
  30.364 -//virtual 
  30.365 -LLVOAvatarDictionary::~LLVOAvatarDictionary()
  30.366 +// static
  30.367 +LLWearableType::EType LLVOAvatarDictionary::getTEWearableType(ETextureIndex index )
  30.368  {
  30.369 -	for (mesh_map_t::iterator iter = mMeshMap.begin(); iter != mMeshMap.end(); iter++)
  30.370 -		delete (iter->second);
  30.371 -	for (baked_map_t::iterator iter = mBakedTextureMap.begin(); iter != mBakedTextureMap.end(); iter++)
  30.372 -		delete (iter->second);
  30.373 -	for (texture_map_t::iterator iter = mTextureMap.begin(); iter != mTextureMap.end(); iter++)
  30.374 -		delete (iter->second);
  30.375 +	return getInstance()->getTexture(index)->mWearableType;
  30.376  }
  30.377 -
  30.378 -const LLVOAvatarDictionary::MeshDictionaryEntry *LLVOAvatarDictionary::getMesh(EMeshIndex index) const
  30.379 -{
  30.380 -	mesh_map_t::const_iterator mesh_iter = mMeshMap.find(index);
  30.381 -	if (mesh_iter == mMeshMap.end()) return NULL;
  30.382 -	return mesh_iter->second; 
  30.383 -}
  30.384 -
  30.385 -const LLVOAvatarDictionary::BakedDictionaryEntry *LLVOAvatarDictionary::getBakedTexture(EBakedTextureIndex index) const
  30.386 -{
  30.387 -	baked_map_t::const_iterator baked_iter = mBakedTextureMap.find(index);
  30.388 -	if (baked_iter == mBakedTextureMap.end()) return NULL;
  30.389 -	return baked_iter->second; 
  30.390 -}
  30.391 -
  30.392 -const LLVOAvatarDictionary::TextureDictionaryEntry *LLVOAvatarDictionary::getTexture(ETextureIndex index) const
  30.393 -{
  30.394 -	texture_map_t::const_iterator texture_iter = mTextureMap.find(index);
  30.395 -	if (texture_iter == mTextureMap.end()) return NULL;
  30.396 -	return texture_iter->second;
  30.397 -}
  30.398 -
  30.399 -const LLVOAvatarDictionary::WearableDictionaryEntry *LLVOAvatarDictionary::getWearable(EBakedTextureIndex index) const
  30.400 -{
  30.401 -	wearable_map_t::const_iterator wearable_iter = mWearableMap.find(index);
  30.402 -	if (wearable_iter == mWearableMap.end()) return NULL;
  30.403 -	return wearable_iter->second;
  30.404 -}
  30.405 -
  30.406 -
  30.407 -
  30.408 -ETextureIndex LLVOAvatarDefines::getTextureIndex(EBakedTextureIndex index)
  30.409 -{
  30.410 -	return LLVOAvatarDictionary::getInstance()->getBakedTexture(index)->mTextureIndex;
  30.411 -}
    31.1 --- a/indra/newview/llvoavatardefines.h	Sun Jan 15 13:43:22 2012 +0100
    31.2 +++ b/indra/newview/llvoavatardefines.h	Sat Jan 28 16:48:34 2012 +0100
    31.3 @@ -1,6 +1,6 @@
    31.4  /** 
    31.5 - * @file llvoavatar.h
    31.6 - * @brief Declaration of LLVOAvatar class which is a derivation fo
    31.7 + * @file llvoavatardefines.h
    31.8 + * @brief Declaration of LLVOAvatarDefines class
    31.9   * LLViewerObject
   31.10   *
   31.11   * $LicenseInfo:firstyear=2001&license=viewergpl$
   31.12 @@ -37,6 +37,7 @@
   31.13  #include <vector>
   31.14  #include "llwearable.h"
   31.15  #include "llviewerjoint.h"
   31.16 +#include "lldictionary.h"
   31.17  
   31.18  namespace LLVOAvatarDefines
   31.19  {
   31.20 @@ -61,7 +62,7 @@
   31.21  	TEX_HEAD_BAKED,			// Pre-composited
   31.22  	TEX_UPPER_BAKED,		// Pre-composited
   31.23  	TEX_LOWER_BAKED,		// Pre-composited
   31.24 -	TEX_EYES_BAKED,		// Pre-composited
   31.25 +	TEX_EYES_BAKED,			// Pre-composited
   31.26  	TEX_LOWER_SOCKS,
   31.27  	TEX_UPPER_JACKET,
   31.28  	TEX_LOWER_JACKET,
   31.29 @@ -70,7 +71,7 @@
   31.30  	TEX_LOWER_UNDERPANTS,
   31.31  	TEX_SKIRT,
   31.32  	TEX_SKIRT_BAKED,		// Pre-composited
   31.33 -	TEX_HAIR_BAKED,     // Pre-composited
   31.34 +	TEX_HAIR_BAKED,			// Pre-composited
   31.35  	TEX_LOWER_ALPHA,
   31.36  	TEX_UPPER_ALPHA,
   31.37  	TEX_HEAD_ALPHA,
   31.38 @@ -82,8 +83,6 @@
   31.39  	TEX_NUM_INDICES
   31.40  };
   31.41  
   31.42 -typedef std::vector<ETextureIndex> texture_vec_t;
   31.43 -	
   31.44  enum EBakedTextureIndex
   31.45  {
   31.46  	BAKED_HEAD = 0,
   31.47 @@ -94,7 +93,6 @@
   31.48  	BAKED_HAIR,
   31.49  	BAKED_NUM_INDICES
   31.50  };
   31.51 -typedef std::vector<EBakedTextureIndex> bakedtexture_vec_t;
   31.52  
   31.53  // Reference IDs for each mesh. Used as indices for vector of joints
   31.54  enum EMeshIndex
   31.55 @@ -109,18 +107,14 @@
   31.56  	MESH_ID_SKIRT,
   31.57  	MESH_ID_NUM_INDICES
   31.58  };
   31.59 +
   31.60 +//--------------------------------------------------------------------
   31.61 +// Vector Types
   31.62 +//--------------------------------------------------------------------
   31.63 +typedef std::vector<ETextureIndex> texture_vec_t;
   31.64 +typedef std::vector<EBakedTextureIndex> bakedtexture_vec_t;
   31.65  typedef std::vector<EMeshIndex> mesh_vec_t;
   31.66 -
   31.67 -typedef std::vector<EWearableType> wearables_vec_t;
   31.68 -
   31.69 -//--------------------------------------------------------------------------------
   31.70 -// Convenience Functions
   31.71 -//--------------------------------------------------------------------------------
   31.72 -
   31.73 -// Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED
   31.74 -ETextureIndex getTextureIndex(EBakedTextureIndex t);
   31.75 -
   31.76 -
   31.77 +typedef std::vector<LLWearableType::EType> wearables_vec_t;
   31.78  
   31.79  //------------------------------------------------------------------------
   31.80  // LLVOAvatarDictionary
   31.81 @@ -132,84 +126,107 @@
   31.82  //------------------------------------------------------------------------
   31.83  class LLVOAvatarDictionary : public LLSingleton<LLVOAvatarDictionary>
   31.84  {
   31.85 +	//--------------------------------------------------------------------
   31.86 +	// Constructors and Destructors
   31.87 +	//--------------------------------------------------------------------
   31.88  public:
   31.89  	LLVOAvatarDictionary();
   31.90  	virtual ~LLVOAvatarDictionary();
   31.91  	
   31.92 -	struct TextureDictionaryEntry
   31.93 +private:
   31.94 +	void createAssociations();
   31.95 +
   31.96 +	//--------------------------------------------------------------------
   31.97 +	// Local and baked textures
   31.98 +	//--------------------------------------------------------------------
   31.99 +public:
  31.100 +	struct TextureEntry: public LLDictionaryEntry
  31.101  	{
  31.102 -		TextureDictionaryEntry(const std::string &name, 
  31.103 -							   bool is_local_texture, 
  31.104 -							   EBakedTextureIndex baked_texture_index = BAKED_NUM_INDICES,
  31.105 -							   const std::string &default_image_name = "",
  31.106 -							   EWearableType wearable_type = WT_INVALID);
  31.107 -		const std::string mName;
  31.108 -		const std::string mDefaultImageName;
  31.109 -		const EWearableType mWearableType;
  31.110 +		TextureEntry(const std::string &name,  // this must match the xml name used by LLTexLayerInfo::parseXml
  31.111 +					 bool is_local_texture, 
  31.112 +					 EBakedTextureIndex baked_texture_index = BAKED_NUM_INDICES,
  31.113 +					 const std::string &default_image_name = "",
  31.114 +					 LLWearableType::EType wearable_type = LLWearableType::WT_INVALID);
  31.115 +		const std::string			mDefaultImageName;
  31.116 +		const LLWearableType::EType	mWearableType;
  31.117  		// It's either a local texture xor baked
  31.118 -		BOOL mIsLocalTexture;
  31.119 -		BOOL mIsBakedTexture;
  31.120 +		BOOL						mIsLocalTexture;
  31.121 +		BOOL						mIsBakedTexture;
  31.122  		// If it's a local texture, it may be used by a baked texture
  31.123 -		BOOL mIsUsedByBakedTexture;
  31.124 -		EBakedTextureIndex mBakedTextureIndex;
  31.125 +		BOOL						mIsUsedByBakedTexture;
  31.126 +		EBakedTextureIndex			mBakedTextureIndex;
  31.127  	};
  31.128  	
  31.129 -	struct MeshDictionaryEntry
  31.130 +	struct Textures : public LLDictionary<ETextureIndex, TextureEntry>
  31.131  	{
  31.132 -		MeshDictionaryEntry(EBakedTextureIndex baked_index, 
  31.133 -							const std::string &name, 
  31.134 -							U8 level,
  31.135 -							LLViewerJoint::PickName pick);
  31.136 -		const std::string mName; // names of mesh types as they are used in avatar_lad.xml
  31.137 -		// Levels of Detail for each mesh.  Must match levels of detail present in avatar_lad.xml
  31.138 +		Textures();
  31.139 +	} mTextures;
  31.140 +	const TextureEntry*	getTexture(ETextureIndex index) const	{ return mTextures.lookup(index); }
  31.141 +	const Textures&		getTextures() const						{ return mTextures; }
  31.142 +
  31.143 +	//--------------------------------------------------------------------
  31.144 +	// Meshes
  31.145 +	//--------------------------------------------------------------------
  31.146 +public:
  31.147 +	struct MeshEntry : public LLDictionaryEntry
  31.148 +	{
  31.149 +		MeshEntry(EBakedTextureIndex baked_index, 
  31.150 +				  const std::string &name,  // names of mesh types as they are used in avatar_lad.xml
  31.151 +				  U8 level,
  31.152 +				  LLViewerJoint::PickName pick);
  31.153 +		// Levels of Detail for each mesh. Must match levels of detail present in avatar_lad.xml
  31.154          // Otherwise meshes will be unable to be found, or levels of detail will be ignored
  31.155  		const U8 mLOD;
  31.156  		const EBakedTextureIndex mBakedID;
  31.157  		const LLViewerJoint::PickName mPickName;
  31.158  	};
  31.159  
  31.160 -	struct BakedDictionaryEntry
  31.161 +	struct Meshes : public LLDictionary<EMeshIndex, MeshEntry>
  31.162  	{
  31.163 -		BakedDictionaryEntry(ETextureIndex tex_index, 
  31.164 -							 const std::string &name, 
  31.165 -							 U32 num_local_textures, ... );
  31.166 +		Meshes();
  31.167 +	} mMeshes;
  31.168 +	const MeshEntry*	getMesh(EMeshIndex index) const	{ return mMeshes.lookup(index); }
  31.169 +	const Meshes&		getMeshes() const				{ return mMeshes; }
  31.170 +
  31.171 +	//--------------------------------------------------------------------
  31.172 +	// Baked Textures
  31.173 +	//--------------------------------------------------------------------
  31.174 +public:
  31.175 +	struct BakedEntry : public LLDictionaryEntry
  31.176 +	{
  31.177 +		BakedEntry(ETextureIndex tex_index, 
  31.178 +				   const std::string &name,  // unused, but necessary for templating.
  31.179 +				   const std::string &hash_name,
  31.180 +				   U32 num_local_textures, ... ); // # local textures, local texture list, # wearables, wearable list
  31.181 +		// Local Textures
  31.182  		const ETextureIndex mTextureIndex;
  31.183 -		const std::string mName;
  31.184 -		texture_vec_t mLocalTextures;
  31.185 -	};
  31.186 -	
  31.187 -	struct WearableDictionaryEntry
  31.188 -	{
  31.189 -		WearableDictionaryEntry(const std::string &hash_name,
  31.190 -								U32 num_wearables, ... );
  31.191 -		const LLUUID mHashID;
  31.192 -		wearables_vec_t mWearablesVec;
  31.193 +		texture_vec_t		mLocalTextures;
  31.194 +		// Wearables
  31.195 +		const LLUUID 		mWearablesHashID;
  31.196 +		wearables_vec_t 	mWearables;
  31.197  	};
  31.198  
  31.199 -	typedef std::map<EBakedTextureIndex, BakedDictionaryEntry*> baked_map_t;
  31.200 -	typedef std::map<ETextureIndex, TextureDictionaryEntry*> texture_map_t;
  31.201 -	typedef std::map<EMeshIndex, MeshDictionaryEntry*> mesh_map_t;
  31.202 -	typedef std::map<EBakedTextureIndex, WearableDictionaryEntry*> wearable_map_t;
  31.203 +	struct BakedTextures: public LLDictionary<EBakedTextureIndex, BakedEntry>
  31.204 +	{
  31.205 +		BakedTextures();
  31.206 +	} mBakedTextures;
  31.207 +	const BakedEntry*		getBakedTexture(EBakedTextureIndex index) const	{ return mBakedTextures.lookup(index); }
  31.208 +	const BakedTextures&	getBakedTextures() const						{ return mBakedTextures; }
  31.209  
  31.210 -	const MeshDictionaryEntry *getMesh(EMeshIndex index) const;
  31.211 -	const BakedDictionaryEntry *getBakedTexture(EBakedTextureIndex index) const;
  31.212 -	const TextureDictionaryEntry *getTexture(ETextureIndex index) const;
  31.213 -	const WearableDictionaryEntry *getWearable(EBakedTextureIndex index) const;
  31.214 +	//--------------------------------------------------------------------
  31.215 +	// Convenience Functions
  31.216 +	//--------------------------------------------------------------------
  31.217 +public:
  31.218 +	// Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED
  31.219 +	static ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t);
  31.220  
  31.221 -	const texture_map_t &getTextures() const { return mTextureMap; }
  31.222 -	const baked_map_t &getBakedTextures() const { return mBakedTextureMap; }
  31.223 -	const mesh_map_t &getMeshes() const { return mMeshMap; }
  31.224 -	const wearable_map_t &getWearables() const { return mWearableMap; }
  31.225 -	
  31.226 -private:
  31.227 -	void initData();
  31.228 -	void createAssociations();
  31.229 +	// find a baked texture index based on its name
  31.230 +	static EBakedTextureIndex findBakedByRegionName(std::string name);
  31.231  
  31.232 -	texture_map_t mTextureMap;
  31.233 -	baked_map_t mBakedTextureMap;
  31.234 -	mesh_map_t mMeshMap;
  31.235 -	wearable_map_t mWearableMap;
  31.236 +	static const LLUUID getDefaultTextureImageID(ETextureIndex index);
  31.237  
  31.238 +	// Given a texture entry, determine which wearable type owns it.
  31.239 +	static LLWearableType::EType getTEWearableType(ETextureIndex index);
  31.240  }; // End LLVOAvatarDictionary
  31.241  
  31.242  } // End namespace LLVOAvatarDefines
    32.1 --- a/indra/newview/llvovolume.cpp	Sun Jan 15 13:43:22 2012 +0100
    32.2 +++ b/indra/newview/llvovolume.cpp	Sat Jan 28 16:48:34 2012 +0100
    32.3 @@ -3217,13 +3217,13 @@
    32.4  	}	
    32.5  }
    32.6  
    32.7 -U32 LLVOVolume::getTriangleCount()
    32.8 +U32 LLVOVolume::getTriangleCount(S32* vcount) const
    32.9  {
   32.10  	U32 count = 0;
   32.11  	LLVolume* volume = getVolume();
   32.12  	if (volume)
   32.13  	{
   32.14 -		count = volume->getNumTriangles();
   32.15 +		count = volume->getNumTriangles(vcount);
   32.16  	}
   32.17  
   32.18  	return count;
   32.19 @@ -3467,7 +3467,7 @@
   32.20  
   32.21  	if (mDrawable->isState(LLDrawable::RIGGED))
   32.22  	{
   32.23 -		if (gSavedSettings.getBOOL("BuildBtnState") && getAvatar()->isSelf())
   32.24 +		if (gFloaterTools->getVisible() && getAvatar()->isSelf())
   32.25  		{
   32.26  			updateRiggedVolume();
   32.27  			genBBoxes(FALSE);
   32.28 @@ -3615,8 +3615,8 @@
   32.29  
   32.30  bool LLVOVolume::treatAsRigged()
   32.31  {
   32.32 -	return gSavedSettings.getBOOL("BuildBtnState") &&
   32.33 -		   isAttachment() && getAvatar() && getAvatar()->isSelf() &&
   32.34 +	return gFloaterTools->getVisible() && isAttachment() &&
   32.35 +		   getAvatar() && getAvatar()->isSelf() &&
   32.36  		   mDrawable.notNull() && mDrawable->isState(LLDrawable::RIGGED);
   32.37  }
   32.38  
    33.1 --- a/indra/newview/llvovolume.h	Sun Jan 15 13:43:22 2012 +0100
    33.2 +++ b/indra/newview/llvovolume.h	Sat Jan 28 16:48:34 2012 +0100
    33.3 @@ -201,7 +201,7 @@
    33.4  				typedef std::map<LLUUID, S32> texture_cost_t;
    33.5  				U32 	getRenderCost(texture_cost_t& textures) const;
    33.6  	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
    33.7 -	/*virtual*/ U32		getTriangleCount();
    33.8 +	/*virtual*/ U32		getTriangleCount(S32* vcount = NULL) const;
    33.9  	/*virtual*/ U32		getHighLODTriangleCount();
   33.10  	/*virtual*/	const LLMatrix4	getRenderMatrix() const;
   33.11  
    34.1 --- a/indra/newview/llwearable.cpp	Sun Jan 15 13:43:22 2012 +0100
    34.2 +++ b/indra/newview/llwearable.cpp	Sat Jan 28 16:48:34 2012 +0100
    34.3 @@ -32,113 +32,37 @@
    34.4  
    34.5  #include "llviewerprecompiledheaders.h"
    34.6  
    34.7 -#include "imageids.h"
    34.8 -#include "llassetstorage.h"
    34.9 -#include "lldbstrings.h"
   34.10 +#include "llwearable.h"
   34.11 +
   34.12  #include "lldir.h"
   34.13 -#include "llquantize.h"
   34.14  
   34.15  #include "llagent.h"
   34.16 -#include "llassetuploadresponders.h"
   34.17 -#include "llviewerwindow.h"
   34.18  #include "llfloatercustomize.h"
   34.19  #include "llinventorymodel.h"
   34.20 -#include "llviewertexturelist.h"
   34.21  #include "llviewerinventory.h"
   34.22  #include "llviewerregion.h"
   34.23  #include "llvoavatar.h"
   34.24 -#include "llwearable.h"
   34.25  
   34.26  using namespace LLVOAvatarDefines;
   34.27  
   34.28  // static
   34.29  S32 LLWearable::sCurrentDefinitionVersion = 1;
   34.30  
   34.31 -// static
   34.32 -const std::string LLWearable::sTypeName[ WT_COUNT+1 ] =
   34.33 -{
   34.34 -	"shape",
   34.35 -	"skin",
   34.36 -	"hair",
   34.37 -	"eyes",
   34.38 -	"shirt",
   34.39 -	"pants",
   34.40 -	"shoes",
   34.41 -	"socks",
   34.42 -	"jacket",
   34.43 -	"gloves",
   34.44 -	"undershirt",
   34.45 -	"underpants",
   34.46 -	"skirt",
   34.47 -	"alpha",
   34.48 -	"tattoo",
   34.49 -	"physics",
   34.50 -	"invalid"
   34.51 -};
   34.52 -
   34.53 -// static
   34.54 -const std::string LLWearable::sTypeLabel[ WT_COUNT+1 ] =
   34.55 -{
   34.56 -	"Shape",
   34.57 -	"Skin",
   34.58 -	"Hair",
   34.59 -	"Eyes",
   34.60 -	"Shirt",
   34.61 -	"Pants",
   34.62 -	"Shoes",
   34.63 -	"Socks",
   34.64 -	"Jacket",
   34.65 -	"Gloves",
   34.66 -	"Undershirt",
   34.67 -	"Underpants",
   34.68 -	"Skirt",
   34.69 -	"Alpha",
   34.70 -	"Tattoo",
   34.71 -	"Physics",
   34.72 -	"invalid"
   34.73 -};
   34.74 -
   34.75 -
   34.76 -// static
   34.77 -LLAssetType::EType LLWearable::typeToAssetType(EWearableType wearable_type)
   34.78 -{
   34.79 -	switch( wearable_type )
   34.80 -	{
   34.81 -	case WT_SHAPE:
   34.82 -	case WT_SKIN:
   34.83 -	case WT_HAIR:
   34.84 -	case WT_EYES:
   34.85 -		return LLAssetType::AT_BODYPART;
   34.86 -	case WT_SHIRT:
   34.87 -	case WT_PANTS:
   34.88 -	case WT_SHOES:
   34.89 -	case WT_SOCKS:
   34.90 -	case WT_JACKET:
   34.91 -	case WT_GLOVES:
   34.92 -	case WT_UNDERSHIRT:
   34.93 -	case WT_UNDERPANTS:
   34.94 -	case WT_SKIRT:
   34.95 -	case WT_ALPHA:
   34.96 -	case WT_TATTOO:
   34.97 -	case WT_PHYSICS:
   34.98 -		return LLAssetType::AT_CLOTHING;
   34.99 -	default:
  34.100 -		return LLAssetType::AT_NONE;
  34.101 -	}
  34.102 -}
  34.103 -
  34.104 +// Private local functions
  34.105 +static std::string terse_F32_to_string(F32 f);
  34.106 +static std::string asset_id_to_filename(const LLUUID &asset_id);
  34.107  
  34.108  LLWearable::LLWearable(const LLTransactionID& transaction_id) :
  34.109  	mDefinitionVersion(LLWearable::sCurrentDefinitionVersion),
  34.110 -	mType(WT_SHAPE)
  34.111 +	mType(LLWearableType::WT_SHAPE)
  34.112  {
  34.113  	mTransactionID = transaction_id;
  34.114  	mAssetID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());
  34.115  }
  34.116  
  34.117  LLWearable::LLWearable(const LLAssetID& asset_id) :
  34.118 -	mDefinitionVersion( LLWearable::sCurrentDefinitionVersion ),
  34.119 -	mType(WT_SHAPE)
  34.120 +	mDefinitionVersion(LLWearable::sCurrentDefinitionVersion),
  34.121 +	mType(LLWearableType::WT_SHAPE)
  34.122  {
  34.123  	mAssetID = asset_id;
  34.124  	mTransactionID.setNull();
  34.125 @@ -148,53 +72,19 @@
  34.126  {
  34.127  }
  34.128  
  34.129 -
  34.130 -// static
  34.131 -EWearableType LLWearable::typeNameToType( const std::string& type_name )
  34.132 +const std::string& LLWearable::getTypeLabel() const
  34.133  {
  34.134 -	for( S32 i = 0; i < WT_COUNT; i++ )
  34.135 -	{
  34.136 -		if( type_name == LLWearable::sTypeName[ i ] )
  34.137 -		{
  34.138 -			return (EWearableType)i;
  34.139 -		}
  34.140 -	}
  34.141 -	return WT_INVALID;
  34.142 +	return LLWearableType::getTypeLabel(mType);
  34.143  }
  34.144  
  34.145 +const std::string& LLWearable::getTypeName() const
  34.146 +{
  34.147 +	return LLWearableType::getTypeName(mType);
  34.148 +}
  34.149  
  34.150 -std::string terse_F32_to_string( F32 f )
  34.151 +LLAssetType::EType LLWearable::getAssetType() const
  34.152  {
  34.153 -	std::string r = llformat( "%.2f", f );
  34.154 -
  34.155 -	// "1.20"  -> "1.2"
  34.156 -	// "24.00" -> "24."
  34.157 -	S32 len = r.length();
  34.158 -	while( len > 0 && '0' == r[len - 1] )
  34.159 -	{
  34.160 -		r.erase(len-1, 1);
  34.161 -		len--;
  34.162 -	}
  34.163 -
  34.164 -	if( '.' == r[len - 1] )
  34.165 -	{
  34.166 -		// "24." -> "24"
  34.167 -		r.erase(len-1, 1);
  34.168 -	}
  34.169 -	else
  34.170 -	if( ('-' == r[0]) && ('0' == r[1]) )
  34.171 -	{
  34.172 -		// "-0.59" -> "-.59"
  34.173 -		r.erase(1, 1);
  34.174 -	}
  34.175 -	else
  34.176 -	if( '0' == r[0] )
  34.177 -	{
  34.178 -		// "0.59" -> ".59"
  34.179 -		r.erase(0, 1);
  34.180 -	}
  34.181 -
  34.182 -	return r;
  34.183 +	return LLWearableType::getAssetType(mType);
  34.184  }
  34.185  
  34.186  BOOL LLWearable::exportFile( LLFILE* file )
  34.187 @@ -296,9 +186,16 @@
  34.188  		return FALSE;
  34.189  	}
  34.190  
  34.191 -	if( mDefinitionVersion > LLWearable::sCurrentDefinitionVersion )
  34.192 +	// Temoprary hack to allow wearables with definition version 24 to still load.
  34.193 +	// This should only affect lindens and NDA'd testers who have saved wearables in 2.0
  34.194 +	// the extra check for version == 24 can be removed before release, once internal testers
  34.195 +	// have loaded these wearables again. See hack pt 2 at bottom of function to ensure that
  34.196 +	// these wearables get re-saved with version definition 22.
  34.197 +	if (mDefinitionVersion > LLWearable::sCurrentDefinitionVersion && mDefinitionVersion != 24)
  34.198  	{
  34.199 -		llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
  34.200 +		llwarns << "Wearable asset has newer version (" << mDefinitionVersion
  34.201 +				<< ") than XML (" << LLWearable::sCurrentDefinitionVersion
  34.202 +				<< ")" << llendl;
  34.203  		return FALSE;
  34.204  	}
  34.205  
  34.206 @@ -397,13 +294,13 @@
  34.207  		llwarns << "Bad Wearable asset: bad type" << llendl;
  34.208  		return FALSE;
  34.209  	}
  34.210 -	if( 0 <= type && type < WT_COUNT )
  34.211 +	if (0 <= type && type < LLWearableType::WT_COUNT)
  34.212  	{
  34.213 -		mType = (EWearableType)type;
  34.214 +		mType = (LLWearableType::EType)type;
  34.215  	}
  34.216  	else
  34.217  	{
  34.218 -		mType = WT_COUNT;
  34.219 +		mType = LLWearableType::WT_COUNT;
  34.220  		llwarns << "Bad Wearable asset: bad type #" << type <<  llendl;
  34.221  		return FALSE;
  34.222  	}
  34.223 @@ -743,7 +640,7 @@
  34.224  
  34.225  // Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values.
  34.226  // static 
  34.227 -void LLWearable::removeFromAvatar( EWearableType type, BOOL set_by_user )
  34.228 +void LLWearable::removeFromAvatar(LLWearableType::EType type, BOOL set_by_user)
  34.229  {
  34.230  	LLVOAvatar* avatar = gAgent.getAvatarObject();
  34.231  	llassert( avatar );
  34.232 @@ -752,11 +649,8 @@
  34.233  		return;
  34.234  	}
  34.235  
  34.236 -	// You can't just remove body parts.
  34.237 -	if( (type == WT_SHAPE) ||
  34.238 -		(type == WT_SKIN) ||
  34.239 -		(type == WT_HAIR) ||
  34.240 -		(type == WT_EYES) )
  34.241 +	if (type == LLWearableType::WT_SHAPE || type == LLWearableType::WT_SKIN ||
  34.242 +		type == LLWearableType::WT_HAIR || type == LLWearableType::WT_EYES)
  34.243  	{
  34.244  		return;
  34.245  	}
  34.246 @@ -895,7 +789,7 @@
  34.247  
  34.248  struct LLWearableSaveData
  34.249  {
  34.250 -	EWearableType mType;
  34.251 +	LLWearableType::EType mType;
  34.252  };
  34.253  
  34.254  void LLWearable::saveNewAsset()
  34.255 @@ -903,10 +797,7 @@
  34.256  //	llinfos << "LLWearable::saveNewAsset() type: " << getTypeName() << llendl;
  34.257  	//llinfos << *this << llendl;
  34.258  
  34.259 -	std::string new_asset_id_string;
  34.260 -	mAssetID.toString(new_asset_id_string);
  34.261 -	std::string filename;
  34.262 -	filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string) + ".wbl";
  34.263 +	const std::string filename = asset_id_to_filename(mAssetID);
  34.264  	LLFILE* fp = LLFile::fopen(filename, "wb");		/* Flawfinder: ignore */
  34.265  	BOOL successful_save = FALSE;
  34.266  	if(fp && exportFile(fp))
  34.267 @@ -938,7 +829,7 @@
  34.268  		{
  34.269  			llinfos << "Update Agent Inventory via capability" << llendl;
  34.270  			LLSD body;
  34.271 -			body["folder_id"] = gInventory.findCategoryUUIDForType(getAssetType());
  34.272 +			body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetToFolderType(getAssetType()));
  34.273  			body["asset_type"] = LLAssetType::lookup(getAssetType());
  34.274  			body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE);
  34.275  			body["name"] = getName();
  34.276 @@ -961,8 +852,8 @@
  34.277  void LLWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void* userdata, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
  34.278  {
  34.279  	LLWearableSaveData* data = (LLWearableSaveData*)userdata;
  34.280 -	const std::string& type_name = LLWearable::typeToTypeName(data->mType);
  34.281 -	if(0 == status)
  34.282 +	const std::string& type_name = LLWearableType::getTypeName(data->mType);
  34.283 +	if (0 == status)
  34.284  	{
  34.285  		// Success
  34.286  		llinfos << "Saved wearable " << type_name << llendl;
  34.287 @@ -977,28 +868,16 @@
  34.288  	}
  34.289  
  34.290  	// Delete temp file
  34.291 -	std::string new_asset_id_string;
  34.292 -	new_asset_id.toString(new_asset_id_string);
  34.293 -	std::string src_filename;
  34.294 -	src_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string) + ".wbl";
  34.295 +	const std::string src_filename = asset_id_to_filename(new_asset_id);
  34.296  	LLFile::remove(src_filename);
  34.297  
  34.298  	// delete the context data
  34.299  	delete data;
  34.300  }
  34.301  
  34.302 -BOOL LLWearable::isMatchedToInventoryItem( LLViewerInventoryItem* item )
  34.303 -{
  34.304 -	return 
  34.305 -		( mName == item->getName() ) &&
  34.306 -		( mDescription == item->getDescription() ) &&
  34.307 -		( mPermissions == item->getPermissions() ) &&
  34.308 -		( mSaleInfo == item->getSaleInfo() );
  34.309 -}
  34.310 -
  34.311  std::ostream& operator<<(std::ostream &s, const LLWearable &w)
  34.312  {
  34.313 -	s << "wearable " << LLWearable::typeToTypeName( w.mType ) << "\n";
  34.314 +	s << "wearable " << LLWearableType::getTypeName(w.mType) << "\n";
  34.315  	s << "    Name: " << w.mName << "\n";
  34.316  	s << "    Desc: " << w.mDescription << "\n";
  34.317  	//w.mPermissions
  34.318 @@ -1024,4 +903,42 @@
  34.319  	return s;
  34.320  }
  34.321  
  34.322 +std::string terse_F32_to_string(F32 f)
  34.323 +{
  34.324 +	std::string r = llformat("%.2f", f);
  34.325 +	S32 len = r.length();
  34.326  
  34.327 +	// "1.20"  -> "1.2"
  34.328 +	// "24.00" -> "24."
  34.329 +	while (len > 0 && r[len - 1] == '0')
  34.330 +	{
  34.331 +		r.erase(len - 1, 1);
  34.332 +		len--;
  34.333 +	}
  34.334 +
  34.335 +	if (r[len - 1] == '.')
  34.336 +	{
  34.337 +		// "24." -> "24"
  34.338 +		r.erase(len - 1, 1);
  34.339 +	}
  34.340 +	else if (r[0] == '-' && r[1] == '0')
  34.341 +	{
  34.342 +		// "-0.59" -> "-.59"
  34.343 +		r.erase(1, 1);
  34.344 +	}
  34.345 +	else if (r[0] == '0')
  34.346 +	{
  34.347 +		// "0.59" -> ".59"
  34.348 +		r.erase(0, 1);
  34.349 +	}
  34.350 +
  34.351 +	return r;
  34.352 +}
  34.353 +
  34.354 +std::string asset_id_to_filename(const LLUUID &asset_id)
  34.355 +{
  34.356 +	std::string asset_id_string;
  34.357 +	asset_id.toString(asset_id_string);
  34.358 +	std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, asset_id_string) + ".wbl";
  34.359 +	return filename;
  34.360 +}
    35.1 --- a/indra/newview/llwearable.h	Sun Jan 15 13:43:22 2012 +0100
    35.2 +++ b/indra/newview/llwearable.h	Sat Jan 28 16:48:34 2012 +0100
    35.3 @@ -39,112 +39,89 @@
    35.4  #include "llsaleinfo.h"
    35.5  #include "llassetstorage.h"
    35.6  
    35.7 +#include "llwearabletype.h"
    35.8 +
    35.9  class LLViewerInventoryItem;
   35.10  
   35.11 -enum	EWearableType  // If you change this, update LLWearable::getTypeName(), getTypeLabel(), and LLVOAvatar::getTEWearableType()
   35.12 -{
   35.13 -	WT_SHAPE	= 0,
   35.14 -	WT_SKIN		= 1,
   35.15 -	WT_HAIR		= 2,
   35.16 -	WT_EYES		= 3,
   35.17 -	WT_SHIRT	= 4,
   35.18 -	WT_PANTS	= 5,
   35.19 -	WT_SHOES	= 6,
   35.20 -	WT_SOCKS	= 7,
   35.21 -	WT_JACKET	= 8,
   35.22 -	WT_GLOVES	= 9,
   35.23 -	WT_UNDERSHIRT = 10,
   35.24 -	WT_UNDERPANTS = 11,
   35.25 -	WT_SKIRT	= 12,
   35.26 -	WT_ALPHA	= 13,
   35.27 -	WT_TATTOO	= 14,
   35.28 -	WT_PHYSICS	= 15,
   35.29 -	WT_COUNT	= 16,
   35.30 -	WT_INVALID	= 255
   35.31 -};
   35.32 -
   35.33  class LLWearable
   35.34  {
   35.35  	friend class LLWearableList;
   35.36 +
   35.37 +	//--------------------------------------------------------------------
   35.38 +	// Constructors and destructors
   35.39 +	//--------------------------------------------------------------------
   35.40 +private:
   35.41 +	// Private constructor used by LLWearableList
   35.42 +	// Ansariel: Must be public for importtracker
   35.43 +	//LLWearable(const LLTransactionID& transactionID);
   35.44 +	//LLWearable(const LLAssetID& assetID);
   35.45 +
   35.46  public:
   35.47  	~LLWearable();
   35.48 +	LLWearable(const LLTransactionID& transactionID);
   35.49 +	LLWearable(const LLAssetID& assetID);
   35.50  
   35.51 -	const LLAssetID&		getID() const { return mAssetID; }
   35.52 -	const LLTransactionID&		getTransactionID() const { return mTransactionID; }
   35.53 +	//--------------------------------------------------------------------
   35.54 +	// Accessors
   35.55 +	//--------------------------------------------------------------------
   35.56 +public:
   35.57 +	const LLAssetID&		getID() const							{ return mAssetID; }
   35.58 +	const LLTransactionID&	getTransactionID() const				{ return mTransactionID; }
   35.59 +	LLWearableType::EType	getType() const							{ return mType; }
   35.60 +	void					setType(LLWearableType::EType type)		{ mType = type; }
   35.61 +	const std::string&		getName() const							{ return mName; }
   35.62 +	void					setName(const std::string& name)		{ mName = name; }
   35.63 +	const std::string&		getDescription() const					{ return mDescription; }
   35.64 +	void					setDescription(const std::string& desc)	{ mDescription = desc; }
   35.65 +	const LLPermissions&	getPermissions() const					{ return mPermissions; }
   35.66 +	void					setPermissions(const LLPermissions& p)	{ mPermissions = p; }
   35.67 +	const LLSaleInfo&		getSaleInfo() const						{ return mSaleInfo; }
   35.68 +	void					setSaleInfo(const LLSaleInfo& info)		{ mSaleInfo = info; }
   35.69 +	const std::string&		getTypeLabel() const;
   35.70 +	const std::string&		getTypeName() const;
   35.71 +	LLAssetType::EType		getAssetType() const;
   35.72 +	S32						getDefinitionVersion() const			{ return mDefinitionVersion; }
   35.73 +	void					setDefinitionVersion(S32 new_version)	{ mDefinitionVersion = new_version; }
   35.74  
   35.75 +public:
   35.76  	BOOL				isDirty();
   35.77  	BOOL				isOldVersion();
   35.78  
   35.79 -	void				writeToAvatar( BOOL set_by_user );
   35.80 +	void				writeToAvatar(BOOL set_by_user);
   35.81  	void				readFromAvatar();
   35.82 -	void				removeFromAvatar( BOOL set_by_user )	{ LLWearable::removeFromAvatar( mType, set_by_user ); }
   35.83 -	static void			removeFromAvatar( EWearableType type, BOOL set_by_user ); 
   35.84 +	void				removeFromAvatar(BOOL set_by_user)	{ LLWearable::removeFromAvatar(mType, set_by_user); }
   35.85 +	static void			removeFromAvatar(LLWearableType::EType type, BOOL set_by_user); 
   35.86  
   35.87  	BOOL				exportFile(LLFILE* file);
   35.88  	BOOL				importFile(LLFILE* file);
   35.89  
   35.90 -	EWearableType		getType() const							{ return mType; }
   35.91 -	void				setType( EWearableType type )			{ mType = type; }
   35.92 -
   35.93 -	void				setName( const std::string& name )			{ mName = name; }
   35.94 -	const std::string&	getName() const								{ return mName; }
   35.95 -
   35.96 -	void				setDescription( const std::string& desc )	{ mDescription = desc; }
   35.97 -	const std::string&	getDescription() const						{ return mDescription; }
   35.98 -
   35.99 -	void				setPermissions( const LLPermissions& p ) { mPermissions = p; }
  35.100 -	const LLPermissions& getPermissions() const						{ return mPermissions; }
  35.101 -
  35.102 -	void				setSaleInfo( const LLSaleInfo& info )	{ mSaleInfo = info; }
  35.103 -	const LLSaleInfo&	getSaleInfo() const							{ return mSaleInfo; }
  35.104 -
  35.105 -	const std::string&	getTypeLabel() const					{ return LLWearable::sTypeLabel[ mType ]; }
  35.106 -	const std::string&	getTypeName() const						{ return LLWearable::sTypeName[ mType ]; }
  35.107 -
  35.108  	void				setParamsToDefaults();
  35.109  	void				setTexturesToDefaults();
  35.110  
  35.111 -	LLAssetType::EType	getAssetType() const					{ return LLWearable::typeToAssetType( mType ); }
  35.112 +	void				saveNewAsset();
  35.113 +	static void			onSaveNewAssetComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status);
  35.114  
  35.115 -	static EWearableType typeNameToType( const std::string& type_name );
  35.116 -	static const std::string& typeToTypeName( EWearableType type )	{ return LLWearable::sTypeName[llmin(type,WT_COUNT)]; }
  35.117 -	static const std::string& typeToTypeLabel( EWearableType type )	{ return LLWearable::sTypeLabel[llmin(type,WT_COUNT)]; }
  35.118 -	static LLAssetType::EType typeToAssetType( EWearableType wearable_type );
  35.119 +	void				copyDataFrom(LLWearable* src);
  35.120  
  35.121 -	void				saveNewAsset();
  35.122 -	static void			onSaveNewAssetComplete( const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status );
  35.123 -
  35.124 -	BOOL				isMatchedToInventoryItem( LLViewerInventoryItem* item );
  35.125 -
  35.126 -	void				copyDataFrom( LLWearable* src );
  35.127 -
  35.128 -	static void			setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; }
  35.129 +	static void			setCurrentDefinitionVersion(S32 version) { LLWearable::sCurrentDefinitionVersion = version; }
  35.130  
  35.131  	friend std::ostream& operator<<(std::ostream &s, const LLWearable &w);
  35.132  
  35.133 -
  35.134 -	// Private constructor used by LLWearableList
  35.135 -	LLWearable(const LLTransactionID& transactionID);
  35.136 -	LLWearable(const LLAssetID& assetID);
  35.137 -
  35.138  private:
  35.139 -	static S32			sCurrentDefinitionVersion;	// Depends on the current state of the avatar_lad.xml.
  35.140 -	S32					mDefinitionVersion;			// Depends on the state of the avatar_lad.xml when this asset was created.
  35.141 -	std::string			mName;
  35.142 -	std::string			mDescription;
  35.143 -	LLPermissions		mPermissions;
  35.144 -	LLSaleInfo			mSaleInfo;
  35.145 -	LLAssetID mAssetID;
  35.146 -	LLTransactionID		mTransactionID;
  35.147 -	EWearableType		mType;
  35.148 +	static S32				sCurrentDefinitionVersion;	// Depends on the current state of the avatar_lad.xml.
  35.149 +	S32						mDefinitionVersion;			// Depends on the state of the avatar_lad.xml when this asset was created.
  35.150 +	std::string				mName;
  35.151 +	std::string				mDescription;
  35.152 +	LLPermissions			mPermissions;
  35.153 +	LLSaleInfo				mSaleInfo;
  35.154 +	LLAssetID				mAssetID;
  35.155 +	LLTransactionID			mTransactionID;
  35.156 +	LLWearableType::EType	mType;
  35.157  
  35.158  	typedef std::map<S32, F32> param_map_t;
  35.159  	param_map_t mVisualParamMap;	// maps visual param id to weight
  35.160  	typedef std::map<S32, LLUUID> te_map_t;
  35.161  	te_map_t mTEMap;				// maps TE to Image ID
  35.162 -
  35.163 -	static const std::string sTypeName[ WT_COUNT+1 ];
  35.164 -	static const std::string sTypeLabel[ WT_COUNT+1 ];
  35.165  };
  35.166  
  35.167  #endif  // LL_LLWEARABLE_H
    36.1 --- a/indra/newview/llwearablelist.cpp	Sun Jan 15 13:43:22 2012 +0100
    36.2 +++ b/indra/newview/llwearablelist.cpp	Sat Jan 28 16:48:34 2012 +0100
    36.3 @@ -42,6 +42,7 @@
    36.4  #include "llviewerinventory.h"
    36.5  #include "llviewerstats.h"
    36.6  #include "llvoavatar.h"
    36.7 +#include "llwearabletype.h"
    36.8  
    36.9  // Globals
   36.10  LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent.
   36.11 @@ -125,7 +126,7 @@
   36.12  			bool res = wearable->importFile( fp );
   36.13  			if (!res)
   36.14  			{
   36.15 -				if (wearable->getType() == WT_COUNT)
   36.16 +				if (wearable->getType() == LLWearableType::WT_COUNT)
   36.17  				{
   36.18  					isNewWearable = TRUE;
   36.19  				}
   36.20 @@ -214,28 +215,10 @@
   36.21  }
   36.22  
   36.23  
   36.24 -// Creates a new wearable just like the old_wearable but with data copied over from item
   36.25 -LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item )
   36.26 +LLWearable* LLWearableList::createCopyFromAvatar(LLWearable* old_wearable,
   36.27 +												 const std::string& new_name)
   36.28  {
   36.29 -	lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl;
   36.30 -
   36.31 -	LLWearable* wearable = generateNewWearable();
   36.32 -	wearable->copyDataFrom( old_wearable );
   36.33 -
   36.34 -	wearable->setName( item->getName() );
   36.35 -	wearable->setDescription( item->getDescription() );
   36.36 -	wearable->setPermissions( item->getPermissions() );
   36.37 -	wearable->setSaleInfo( item->getSaleInfo() );
   36.38 -
   36.39 -	// Send to the dataserver
   36.40 -	wearable->saveNewAsset();
   36.41 -
   36.42 -	return wearable;
   36.43 -}
   36.44 -
   36.45 -LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name )
   36.46 -{
   36.47 -	lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl;
   36.48 +	LL_DEBUGS("Wearables") << "LLWearableList::createCopyFromAvatar()" << LL_ENDL;
   36.49  	
   36.50  	LLWearable* wearable = generateNewWearable();
   36.51  	wearable->copyDataFrom( old_wearable );
   36.52 @@ -255,7 +238,7 @@
   36.53  
   36.54  LLWearable* LLWearableList::createCopy( LLWearable* old_wearable )
   36.55  {
   36.56 -	lldebugs << "LLWearableList::createCopy()" << llendl;
   36.57 +	LL_DEBUGS("Wearables") << "LLWearableList::createCopy()" << LL_ENDL;
   36.58  
   36.59  	LLWearable *wearable = generateNewWearable();
   36.60  	wearable->copyDataFrom(old_wearable);
   36.61 @@ -271,9 +254,9 @@
   36.62  	return wearable;
   36.63  }
   36.64  
   36.65 -LLWearable* LLWearableList::createNewWearable( EWearableType type )
   36.66 +LLWearable* LLWearableList::createNewWearable(LLWearableType::EType type)
   36.67  {
   36.68 -	lldebugs << "LLWearableList::createNewWearable()" << llendl;
   36.69 +	LL_DEBUGS("Wearables") << "LLWearableList::createNewWearable()" << LL_ENDL;
   36.70  
   36.71  	LLWearable *wearable = generateNewWearable();
   36.72  	wearable->setType( type );
    37.1 --- a/indra/newview/llwearablelist.h	Sun Jan 15 13:43:22 2012 +0100
    37.2 +++ b/indra/newview/llwearablelist.h	Sat Jan 28 16:48:34 2012 +0100
    37.3 @@ -45,19 +45,22 @@
    37.4  
    37.5  	S32					getLength() { return mList.size(); }
    37.6  
    37.7 -	void				getAsset(const LLAssetID& assetID,
    37.8 -								 const std::string& wearable_name,
    37.9 -								 LLAssetType::EType asset_type,
   37.10 -								 void(*asset_arrived_callback)(LLWearable*, void* userdata),
   37.11 -								 void* userdata);
   37.12 +	void		getAsset(const LLAssetID& assetID,
   37.13 +						 const std::string& wearable_name,
   37.14 +						 LLAssetType::EType asset_type,
   37.15 +						 void(*asset_arrived_callback)(LLWearable*, void* userdata),
   37.16 +						 void* userdata);
   37.17  
   37.18 -	LLWearable*			createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item );
   37.19 -	LLWearable*			createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name = std::string() );
   37.20 -	LLWearable*			createCopy( LLWearable* old_wearable );
   37.21 -	LLWearable*			createNewWearable( EWearableType type );
   37.22 +	LLWearable*	createCopyFromAvatar(LLWearable* old_wearable,
   37.23 +									 const std::string& new_name = std::string());
   37.24 +	LLWearable*	createCopy(LLWearable* old_wearable);
   37.25 +	LLWearable*	createNewWearable(LLWearableType::EType type);
   37.26  	
   37.27  	// Callback
   37.28 -	static void	 	    processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status);
   37.29 +	static void	processGetAssetReply(const char* filename,
   37.30 +									 const LLAssetID& assetID,
   37.31 +									 void* user_data, S32 status,
   37.32 +									 LLExtStat ext_status);
   37.33  
   37.34  protected:
   37.35  	LLWearable* generateNewWearable(); // used for the create... functions
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/indra/newview/llwearabletype.cpp	Sat Jan 28 16:48:34 2012 +0100
    38.3 @@ -0,0 +1,162 @@
    38.4 +/** 
    38.5 + * @file llwearabletype.cpp
    38.6 + * @brief LLWearableType class implementation
    38.7 + *
    38.8 + * $LicenseInfo:firstyear=2002&license=viewergpl$
    38.9 + * 
   38.10 + * Copyright (c) 2010, Linden Research, Inc.
   38.11 + * 
   38.12 + * Second Life Viewer Source Code
   38.13 + * The source code in this file ("Source Code") is provided by Linden Lab
   38.14 + * to you under the terms of the GNU General Public License, version 2.0
   38.15 + * ("GPL"), unless you have obtained a separate licensing agreement
   38.16 + * ("Other License"), formally executed by you and Linden Lab.  Terms of
   38.17 + * the GPL can be found in doc/GPL-license.txt in this distribution, or
   38.18 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
   38.19 + * 
   38.20 + * There are special exceptions to the terms and conditions of the GPL as
   38.21 + * it is applied to this Source Code. View the full text of the exception
   38.22 + * in the file doc/FLOSS-exception.txt in this software distribution, or
   38.23 + * online at
   38.24 + * http://secondlifegrid.net/programs/open_source/licensing/flossexception
   38.25 + * 
   38.26 + * By copying, modifying or distributing this software, you acknowledge
   38.27 + * that you have read and understood your obligations described above,
   38.28 + * and agree to abide by those obligations.
   38.29 + * 
   38.30 + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
   38.31 + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
   38.32 + * COMPLETENESS OR PERFORMANCE.
   38.33 + * $/LicenseInfo$
   38.34 + */
   38.35 +
   38.36 +#include "llviewerprecompiledheaders.h"
   38.37 +#include "llwearabletype.h"
   38.38 +#include "lltrans.h"
   38.39 +
   38.40 +struct WearableEntry : public LLDictionaryEntry
   38.41 +{
   38.42 +	WearableEntry(const std::string &name,
   38.43 +				  const std::string& default_new_name,
   38.44 +				  LLAssetType::EType assetType,
   38.45 +				  LLInventoryIcon::EIconName iconName,
   38.46 +				  BOOL disable_camera_switch = FALSE,
   38.47 +				  BOOL allow_multiwear = TRUE)
   38.48 +	:	LLDictionaryEntry(name),
   38.49 +		mAssetType(assetType),
   38.50 +		mDefaultNewName(default_new_name),
   38.51 +		mLabel(LLTrans::getString(name)),
   38.52 +		mIconName(iconName),
   38.53 +		mDisableCameraSwitch(disable_camera_switch),
   38.54 +		mAllowMultiwear(allow_multiwear)
   38.55 +	{
   38.56 +	}
   38.57 +	const LLAssetType::EType mAssetType;
   38.58 +	const std::string mLabel;
   38.59 +	const std::string mDefaultNewName; //keep mLabel for backward compatibility
   38.60 +	LLInventoryIcon::EIconName mIconName;
   38.61 +	BOOL mDisableCameraSwitch;
   38.62 +	BOOL mAllowMultiwear;
   38.63 +};
   38.64 +
   38.65 +class LLWearableDictionary : public LLSingleton<LLWearableDictionary>,
   38.66 +							 public LLDictionary<LLWearableType::EType, WearableEntry>
   38.67 +{
   38.68 +public:
   38.69 +	LLWearableDictionary();
   38.70 +};
   38.71 +
   38.72 +LLWearableDictionary::LLWearableDictionary()
   38.73 +{
   38.74 +	addEntry(LLWearableType::WT_SHAPE,        new WearableEntry("shape",       "New Shape",			LLAssetType::AT_BODYPART, 	LLInventoryIcon::ICONNAME_BODYPART_SHAPE, FALSE, FALSE));
   38.75 +	addEntry(LLWearableType::WT_SKIN,         new WearableEntry("skin",        "New Skin",			LLAssetType::AT_BODYPART, 	LLInventoryIcon::ICONNAME_BODYPART_SKIN, FALSE, FALSE));
   38.76 +	addEntry(LLWearableType::WT_HAIR,         new WearableEntry("hair",        "New Hair",			LLAssetType::AT_BODYPART, 	LLInventoryIcon::ICONNAME_BODYPART_HAIR, FALSE, FALSE));
   38.77 +	addEntry(LLWearableType::WT_EYES,         new WearableEntry("eyes",        "New Eyes",			LLAssetType::AT_BODYPART, 	LLInventoryIcon::ICONNAME_BODYPART_EYES, FALSE, FALSE));
   38.78 +	addEntry(LLWearableType::WT_SHIRT,        new WearableEntry("shirt",       "New Shirt",			LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_SHIRT, FALSE, TRUE));
   38.79 +	addEntry(LLWearableType::WT_PANTS,        new WearableEntry("pants",       "New Pants",			LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_PANTS, FALSE, TRUE));
   38.80 +	addEntry(LLWearableType::WT_SHOES,        new WearableEntry("shoes",       "New Shoes",			LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_SHOES, FALSE, TRUE));
   38.81 +	addEntry(LLWearableType::WT_SOCKS,        new WearableEntry("socks",       "New Socks",			LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_SOCKS, FALSE, TRUE));
   38.82 +	addEntry(LLWearableType::WT_JACKET,       new WearableEntry("jacket",      "New Jacket",		LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_JACKET, FALSE, TRUE));
   38.83 +	addEntry(LLWearableType::WT_GLOVES,       new WearableEntry("gloves",      "New Gloves",		LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_GLOVES, FALSE, TRUE));
   38.84 +	addEntry(LLWearableType::WT_UNDERSHIRT,   new WearableEntry("undershirt",  "New Undershirt",	LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_UNDERSHIRT, FALSE, TRUE));
   38.85 +	addEntry(LLWearableType::WT_UNDERPANTS,   new WearableEntry("underpants",  "New Underpants",	LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_UNDERPANTS, FALSE, TRUE));
   38.86 +	addEntry(LLWearableType::WT_SKIRT,        new WearableEntry("skirt",       "New Skirt",			LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE));
   38.87 +	addEntry(LLWearableType::WT_ALPHA,        new WearableEntry("alpha",       "New Alpha",			LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE));
   38.88 +	addEntry(LLWearableType::WT_TATTOO,       new WearableEntry("tattoo",      "New Tattoo",		LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE));
   38.89 +
   38.90 +	addEntry(LLWearableType::WT_PHYSICS,      new WearableEntry("physics",     "New Physics",		LLAssetType::AT_CLOTHING, 	LLInventoryIcon::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE));
   38.91 +
   38.92 +	addEntry(LLWearableType::WT_INVALID,      new WearableEntry("invalid",     "Invalid Wearable", 	LLAssetType::AT_NONE, 		LLInventoryIcon::ICONNAME_NONE, FALSE, FALSE));
   38.93 +	addEntry(LLWearableType::WT_NONE,      	  new WearableEntry("none",        "Invalid Wearable", 	LLAssetType::AT_NONE, 		LLInventoryIcon::ICONNAME_NONE, FALSE, FALSE));
   38.94 +}
   38.95 +
   38.96 +// static
   38.97 +LLWearableType::EType LLWearableType::typeNameToType(const std::string& type_name)
   38.98 +{
   38.99 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.100 +	const LLWearableType::EType wearable = dict->lookup(type_name);
  38.101 +	return wearable;
  38.102 +}
  38.103 +
  38.104 +// static 
  38.105 +const std::string& LLWearableType::getTypeName(LLWearableType::EType type)
  38.106 +{ 
  38.107 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.108 +	const WearableEntry *entry = dict->lookup(type);
  38.109 +	if (!entry) return getTypeName(WT_INVALID);
  38.110 +	return entry->mName;
  38.111 +}
  38.112 +
  38.113 +//static 
  38.114 +const std::string& LLWearableType::getTypeDefaultNewName(LLWearableType::EType type)
  38.115 +{ 
  38.116 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.117 +	const WearableEntry *entry = dict->lookup(type);
  38.118 +	if (!entry) return getTypeDefaultNewName(WT_INVALID);
  38.119 +	return entry->mDefaultNewName;
  38.120 +}
  38.121 +
  38.122 +// static 
  38.123 +const std::string& LLWearableType::getTypeLabel(LLWearableType::EType type)
  38.124 +{ 
  38.125 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.126 +	const WearableEntry *entry = dict->lookup(type);
  38.127 +	if (!entry) return getTypeLabel(WT_INVALID);
  38.128 +	return entry->mLabel;
  38.129 +}
  38.130 +
  38.131 +// static 
  38.132 +LLAssetType::EType LLWearableType::getAssetType(LLWearableType::EType type)
  38.133 +{
  38.134 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.135 +	const WearableEntry *entry = dict->lookup(type);
  38.136 +	if (!entry) return getAssetType(WT_INVALID);
  38.137 +	return entry->mAssetType;
  38.138 +}
  38.139 +
  38.140 +// static 
  38.141 +LLInventoryIcon::EIconName LLWearableType::getIconName(LLWearableType::EType type)
  38.142 +{
  38.143 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.144 +	const WearableEntry *entry = dict->lookup(type);
  38.145 +	if (!entry) return getIconName(WT_INVALID);
  38.146 +	return entry->mIconName;
  38.147 +} 
  38.148 +
  38.149 +// static 
  38.150 +BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type)
  38.151 +{
  38.152 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.153 +	const WearableEntry *entry = dict->lookup(type);
  38.154 +	if (!entry) return FALSE;
  38.155 +	return entry->mDisableCameraSwitch;
  38.156 +}
  38.157 +
  38.158 +// static 
  38.159 +BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type)
  38.160 +{
  38.161 +	const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
  38.162 +	const WearableEntry *entry = dict->lookup(type);
  38.163 +	if (!entry) return FALSE;
  38.164 +	return entry->mAllowMultiwear;
  38.165 +}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/indra/newview/llwearabletype.h	Sat Jan 28 16:48:34 2012 +0100
    39.3 @@ -0,0 +1,82 @@
    39.4 +/** 
    39.5 + * @file llwearabletype.h
    39.6 + * @brief LLWearableType class header file
    39.7 + *
    39.8 + * $LicenseInfo:firstyear=2002&license=viewergpl$
    39.9 + * 
   39.10 + * Copyright (c) 2010, Linden Research, Inc.
   39.11 + * 
   39.12 + * Second Life Viewer Source Code
   39.13 + * The source code in this file ("Source Code") is provided by Linden Lab
   39.14 + * to you under the terms of the GNU General Public License, version 2.0
   39.15 + * ("GPL"), unless you have obtained a separate licensing agreement
   39.16 + * ("Other License"), formally executed by you and Linden Lab.  Terms of
   39.17 + * the GPL can be found in doc/GPL-license.txt in this distribution, or
   39.18 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
   39.19 + * 
   39.20 + * There are special exceptions to the terms and conditions of the GPL as
   39.21 + * it is applied to this Source Code. View the full text of the exception
   39.22 + * in the file doc/FLOSS-exception.txt in this software distribution, or
   39.23 + * online at
   39.24 + * http://secondlifegrid.net/programs/open_source/licensing/flossexception
   39.25 + * 
   39.26 + * By copying, modifying or distributing this software, you acknowledge
   39.27 + * that you have read and understood your obligations described above,
   39.28 + * and agree to abide by those obligations.
   39.29 + * 
   39.30 + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
   39.31 + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
   39.32 + * COMPLETENESS OR PERFORMANCE.
   39.33 + * $/LicenseInfo$
   39.34 + */
   39.35 +
   39.36 +#ifndef LL_LLWEARABLETYPE_H
   39.37 +#define LL_LLWEARABLETYPE_H
   39.38 +
   39.39 +#include "llassettype.h"
   39.40 +#include "lldictionary.h"
   39.41 +#include "llinventoryicon.h"
   39.42 +#include "llsingleton.h"
   39.43 +
   39.44 +class LLWearableType
   39.45 +{
   39.46 +public: 
   39.47 +	enum EType
   39.48 +	{
   39.49 +		WT_SHAPE	  = 0,
   39.50 +		WT_SKIN		  = 1,
   39.51 +		WT_HAIR		  = 2,
   39.52 +		WT_EYES		  = 3,
   39.53 +		WT_SHIRT	  = 4,
   39.54 +		WT_PANTS	  = 5,
   39.55 +		WT_SHOES	  = 6,
   39.56 +		WT_SOCKS	  = 7,
   39.57 +		WT_JACKET	  = 8,
   39.58 +		WT_GLOVES	  = 9,
   39.59 +		WT_UNDERSHIRT = 10,
   39.60 +		WT_UNDERPANTS = 11,
   39.61 +		WT_SKIRT	  = 12,
   39.62 +		WT_ALPHA	  = 13,
   39.63 +		WT_TATTOO	  = 14,
   39.64 +		WT_PHYSICS	  = 15,
   39.65 +		WT_COUNT	  = 16,
   39.66 +
   39.67 +		WT_INVALID	  = 255,
   39.68 +		WT_NONE		  = -1,
   39.69 +	};
   39.70 +
   39.71 +	static const std::string& 			getTypeName(EType type);
   39.72 +	static const std::string& 			getTypeDefaultNewName(EType type);
   39.73 +	static const std::string& 			getTypeLabel(EType type);
   39.74 +	static LLAssetType::EType 			getAssetType(EType type);
   39.75 +	static EType 						typeNameToType(const std::string& type_name);
   39.76 +	static LLInventoryIcon::EIconName 	getIconName(EType type);
   39.77 +	static BOOL 						getDisableCameraSwitch(EType type);
   39.78 +	static BOOL 						getAllowMultiwear(EType type);
   39.79 +
   39.80 +protected:
   39.81 +	LLWearableType() {}
   39.82 +	~LLWearableType() {}
   39.83 +};
   39.84 +
   39.85 +#endif  // LL_LLWEARABLETYPE_H
    40.1 --- a/indra/newview/rlvhandler.cpp	Sun Jan 15 13:43:22 2012 +0100
    40.2 +++ b/indra/newview/rlvhandler.cpp	Sat Jan 28 16:48:34 2012 +0100
    40.3 @@ -782,11 +782,11 @@
    40.4  		// Example: #RLV/Separates/Shoes/ChiChi Pumps/.[shoes] with items: "Shoe Base", "Shoe (left foot)" and "Shoe (right foot)"
    40.5  		//   -> as long as "Shoe Base" is worn, @getattach should not reflect "left foot", nor "right foot"
    40.6  		std::string strComposite; LLViewerInventoryCategory* pFolder;
    40.7 -		EWearableType type; S32 idxAttachPt;
    40.8 +		LLWearableType::EType type; S32 idxAttachPt;
    40.9  		if ( (getCompositeInfo(idItem, &strComposite, &pFolder)) && (cstrItemType != strComposite) )
   40.10  		{
   40.11  			LLUUID idCompositeItem;
   40.12 -			if ((type = LLWearable::typeNameToType(strComposite)) != WT_INVALID)
   40.13 +			if ((type = LLWearableType::typeNameToType(strComposite)) != WT_INVALID)
   40.14  			{
   40.15  				idCompositeItem = gAgent.getWearableItem(type);
   40.16  			}
   40.17 @@ -884,7 +884,7 @@
   40.18  				case LLAssetType::AT_CLOTHING:
   40.19  					{
   40.20  						// NOTE: without its asset we don't know what type the wearable is so we need to look at the item's flags instead
   40.21 -						EWearableType wtType = (EWearableType)(pItem->getFlags() & LLInventoryItem::II_FLAGS_WEARABLES_MASK);
   40.22 +						LLWearableType::EType wtType = (LLWearableType::EType)(pItem->getFlags() & LLInventoryItem::II_FLAGS_WEARABLES_MASK);
   40.23  						LLViewerInventoryCategory* pFolder;
   40.24  						if ( (!isWearable(wtType)) ||
   40.25  							 ( (gAgent.getWearable(wtType)) && (!isRemovable(wtType)) ) || 
   40.26 @@ -1015,14 +1015,14 @@
   40.27  				RlvForceWear::instance().done();
   40.28  
   40.29  				ERlvLockMask eLock = (RLV_BHVR_ADDOUTFIT == eBhvr) ? RLV_LOCK_ADD : RLV_LOCK_REMOVE;
   40.30 -				for (int idxType = 0; idxType < WT_COUNT; idxType++)
   40.31 +				for (int idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
   40.32  				{
   40.33 -					if ( (rlvCmdOption.isEmpty()) || ((EWearableType)idxType == rlvCmdOption.getWearableType()) )
   40.34 +					if ( (rlvCmdOption.isEmpty()) || ((LLWearableType::EType)idxType == rlvCmdOption.getWearableType()) )
   40.35  					{
   40.36  						if (RLV_TYPE_ADD == eType)
   40.37 -							gRlvWearableLocks.addWearableTypeLock((EWearableType)idxType, rlvCmd.getObjectID(), eLock);
   40.38 +							gRlvWearableLocks.addWearableTypeLock((LLWearableType::EType)idxType, rlvCmd.getObjectID(), eLock);
   40.39  						else
   40.40 -							gRlvWearableLocks.removeWearableTypeLock((EWearableType)idxType, rlvCmd.getObjectID(), eLock);
   40.41 +							gRlvWearableLocks.removeWearableTypeLock((LLWearableType::EType)idxType, rlvCmd.getObjectID(), eLock);
   40.42  					}
   40.43  				}
   40.44  			}
   40.45 @@ -1754,10 +1754,10 @@
   40.46  	if ( (!rlvCmdOption.isWearableType()) && (!rlvCmdOption.isEmpty()) )
   40.47  		return RLV_RET_FAILED_OPTION;
   40.48  
   40.49 -	for (int idxType = 0; idxType < WT_COUNT; idxType++)
   40.50 +	for (int idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
   40.51  	{
   40.52 -		if ( (rlvCmdOption.isEmpty()) || ((EWearableType)idxType == rlvCmdOption.getWearableType()))
   40.53 -			RlvForceWear::instance().forceRemove((EWearableType)idxType);
   40.54 +		if ( (rlvCmdOption.isEmpty()) || ((LLWearableType::EType)idxType == rlvCmdOption.getWearableType()))
   40.55 +			RlvForceWear::instance().forceRemove((LLWearableType::EType)idxType);
   40.56  	}
   40.57  	return RLV_RET_SUCCESS;
   40.58  }
   40.59 @@ -2183,25 +2183,25 @@
   40.60  	RLV_ASSERT(RLV_BHVR_GETOUTFIT == rlvCmd.getBehaviourType());
   40.61  
   40.62  	// (Compatibility: RLV-1.16.1 will execute @getoutfit=<channel> if <layer> is invalid while we just return failure)
   40.63 -	EWearableType wtType = LLWearable::typeNameToType(rlvCmd.getOption());
   40.64 -	if ( (WT_INVALID == wtType) && (!rlvCmd.getOption().empty()) )
   40.65 +	LLWearableType::EType wtType = LLWearableType::typeNameToType(rlvCmd.getOption());
   40.66 +	if ( (LLWearableType::WT_INVALID == wtType) && (!rlvCmd.getOption().empty()) )
   40.67  		return RLV_RET_FAILED_OPTION;
   40.68  
   40.69 -	const EWearableType wtRlvTypes[] =
   40.70 +	const LLWearableType::EType wtRlvTypes[] =
   40.71  		{ 
   40.72 -			WT_GLOVES, WT_JACKET, WT_PANTS, WT_SHIRT, WT_SHOES, WT_SKIRT, WT_SOCKS, 
   40.73 -			WT_UNDERPANTS, WT_UNDERSHIRT, WT_SKIN, WT_EYES, WT_HAIR, WT_SHAPE, WT_ALPHA, WT_TATTOO, WT_PHYSICS
   40.74 +			LLWearableType::WT_GLOVES, LLWearableType::WT_JACKET, LLWearableType::WT_PANTS, LLWearableType::WT_SHIRT, LLWearableType::WT_SHOES, LLWearableType::WT_SKIRT, LLWearableType::WT_SOCKS, 
   40.75 +			LLWearableType::WT_UNDERPANTS, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_SKIN, LLWearableType::WT_EYES, LLWearableType::WT_HAIR, LLWearableType::WT_SHAPE, LLWearableType::WT_ALPHA, LLWearableType::WT_TATTOO, LLWearableType::WT_PHYSICS
   40.76  		};
   40.77  
   40.78 -	for (int idxType = 0, cntType = sizeof(wtRlvTypes) / sizeof(EWearableType); idxType < cntType; idxType++)
   40.79 +	for (int idxType = 0, cntType = sizeof(wtRlvTypes) / sizeof(LLWearableType::EType); idxType < cntType; idxType++)
   40.80  	{
   40.81 -		if ( (WT_INVALID == wtType) || (wtRlvTypes[idxType] == wtType) )
   40.82 +		if ( (LLWearableType::WT_INVALID == wtType) || (wtRlvTypes[idxType] == wtType) )
   40.83  		{
   40.84  			// We never hide body parts, even if they're "locked" and we're hiding locked layers
   40.85  			// (nor do we hide a layer if the issuing object is the only one that has this layer locked)
   40.86  			bool fWorn = (gAgent.getWearable(wtRlvTypes[idxType])) && 
   40.87  				( (!RlvSettings::getHideLockedLayers()) || 
   40.88 -				  (LLAssetType::AT_BODYPART == LLWearable::typeToAssetType(wtRlvTypes[idxType])) ||
   40.89 +				  (LLAssetType::AT_BODYPART == LLWearableType::getAssetType(wtRlvTypes[idxType])) ||
   40.90  				  (RlvForceWear::isForceRemovable(wtRlvTypes[idxType], true, rlvCmd.getObjectID())) );
   40.91  			strReply.push_back( (fWorn) ? '1' : '0' );
   40.92  		}
   40.93 @@ -2221,9 +2221,9 @@
   40.94  		return RLV_RET_FAILED_OPTION;
   40.95  
   40.96  	// RELEASE-RLVa: [SL-2.0.0] Needs revisiting/rewriting once 'LLAgentWearables::MAX_WEARABLES_PER_TYPE > 1'
   40.97 -	for (int idxType = 0; idxType < WT_COUNT; idxType++)
   40.98 +	for (int idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
   40.99  	{
  40.100 -		bool fAdd = false; EWearableType wtType = (EWearableType)idxType;
  40.101 +		bool fAdd = false; LLWearableType::EType wtType = (LLWearableType::EType)idxType;
  40.102  		switch (rlvCmd.getBehaviourType())
  40.103  		{
  40.104  			case RLV_BHVR_GETOUTFITNAMES:		// Every layer that's worn
  40.105 @@ -2245,7 +2245,7 @@
  40.106  		{
  40.107  			if (!strReply.empty())
  40.108  				strReply.push_back(',');
  40.109 -			strReply.append(LLWearable::typeToTypeName((EWearableType)idxType));
  40.110 +			strReply.append(LLWearableType::getTypeName((LLWearableType::EType)idxType));
  40.111  		}
  40.112  	}
  40.113  	return RLV_RET_SUCCESS;
    41.1 --- a/indra/newview/rlvhelper.cpp	Sun Jan 15 13:43:22 2012 +0100
    41.2 +++ b/indra/newview/rlvhelper.cpp	Sat Jan 28 16:48:34 2012 +0100
    41.3 @@ -189,12 +189,12 @@
    41.4  // Checked: 2010-09-28 (RLVa-1.1.3a) | Added: RLVa-1.2.1c
    41.5  RlvCommandOptionGeneric::RlvCommandOptionGeneric(const std::string& strOption)
    41.6  {
    41.7 -	EWearableType wtType(WT_INVALID); LLUUID idOption; ERlvAttachGroupType eAttachGroup(RLV_ATTACHGROUP_INVALID);
    41.8 +	LLWearableType::EType wtType(LLWearableType::WT_INVALID); LLUUID idOption; ERlvAttachGroupType eAttachGroup(RLV_ATTACHGROUP_INVALID);
    41.9  	LLViewerJointAttachment* pAttachPt = NULL; LLViewerInventoryCategory* pFolder = NULL;
   41.10  
   41.11  	if (!(m_fEmpty = strOption.empty()))														// <option> could be an empty string
   41.12  	{
   41.13 -		if ((wtType = LLWearable::typeNameToType(strOption)) != WT_INVALID)
   41.14 +		if ((wtType = LLWearableType::typeNameToType(strOption)) != LLWearableType::WT_INVALID)
   41.15  			m_varOption = wtType;																// ... or specify a clothing layer
   41.16  		else if ((pAttachPt = RlvAttachPtLookup::getAttachPoint(strOption)) != NULL)
   41.17  			m_varOption = pAttachPt;															// ... or specify an attachment point
   41.18 @@ -255,7 +255,7 @@
   41.19  }
   41.20  
   41.21  // Checked: 2010-11-30 (RLVa-1.3.0b) | Modified: RLVa-1.3.0b
   41.22 -bool RlvCommandOptionGetPath::getItemIDs(EWearableType wtType, uuid_vec_t& idItems, bool fClear)
   41.23 +bool RlvCommandOptionGetPath::getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems, bool fClear)
   41.24  {
   41.25  	if (fClear)
   41.26  		idItems.clear();
   41.27 @@ -622,7 +622,7 @@
   41.28  }
   41.29  
   41.30  // Checked: 2010-03-19 (RLVa-1.1.3b) | Added: RLVa-1.2.0a
   41.31 -bool RlvForceWear::isForceRemovable(EWearableType wtType, bool fCheckComposite /*=true*/, const LLUUID& idExcept /*=LLUUID::null*/)
   41.32 +bool RlvForceWear::isForceRemovable(LLWearableType::EType wtType, bool fCheckComposite /*=true*/, const LLUUID& idExcept /*=LLUUID::null*/)
   41.33  {
   41.34  	// Wearable type can be removed by an RLV command if there's at least one currently worn wearable that can be removed
   41.35  	if (isForceRemovable(gAgent.getWearable(wtType), fCheckComposite, idExcept))
   41.36 @@ -657,7 +657,7 @@
   41.37  }
   41.38  
   41.39  // Checked: 2010-03-19 (RLVa-1.1.3a) | Added: RLVa-1.2.0a
   41.40 -void RlvForceWear::forceRemove(EWearableType wtType)
   41.41 +void RlvForceWear::forceRemove(LLWearableType::EType wtType)
   41.42  {
   41.43  	forceRemove(gAgent.getWearable(wtType));
   41.44  }
    42.1 --- a/indra/newview/rlvhelper.h	Sun Jan 15 13:43:22 2012 +0100
    42.2 +++ b/indra/newview/rlvhelper.h	Sat Jan 28 16:48:34 2012 +0100
    42.3 @@ -123,7 +123,7 @@
    42.4  	bool isSharedFolder() const			{ return (!isEmpty()) && (typeid(LLViewerInventoryCategory*) == m_varOption.type()); }
    42.5  	bool isString() const				{ return (!isEmpty()) && (typeid(std::string) == m_varOption.type()); }
    42.6  	bool isUUID() const					{ return (!isEmpty()) && (typeid(LLUUID) == m_varOption.type()); }
    42.7 -	bool isWearableType() const			{ return (!isEmpty()) && (typeid(EWearableType) == m_varOption.type()); }
    42.8 +	bool isWearableType() const			{ return (!isEmpty()) && (typeid(LLWearableType::EType) == m_varOption.type()); }
    42.9  
   42.10  	LLViewerJointAttachment*   getAttachmentPoint() const
   42.11  		{ return (isAttachmentPoint()) ? boost::get<LLViewerJointAttachment*>(m_varOption) : NULL; }
   42.12 @@ -135,12 +135,12 @@
   42.13  		{ return (isString()) ? boost::get<std::string>(m_varOption) : LLStringUtil::null; }
   42.14  	const LLUUID&              getUUID() const
   42.15  		{ return (isUUID()) ? boost::get<LLUUID>(m_varOption) : LLUUID::null; }
   42.16 -	EWearableType              getWearableType() const
   42.17 -		{ return (isWearableType()) ? boost::get<EWearableType>(m_varOption) : WT_INVALID; }
   42.18 +	LLWearableType::EType      getWearableType() const
   42.19 +	{ return (isWearableType()) ? boost::get<LLWearableType::EType>(m_varOption) : LLWearableType::WT_INVALID; }
   42.20  
   42.21  protected:
   42.22  	bool m_fEmpty;
   42.23 -	boost::variant<LLViewerJointAttachment*, ERlvAttachGroupType, LLViewerInventoryCategory*, std::string, LLUUID, EWearableType> m_varOption;
   42.24 +	boost::variant<LLViewerJointAttachment*, ERlvAttachGroupType, LLViewerInventoryCategory*, std::string, LLUUID, LLWearableType::EType> m_varOption;
   42.25  };
   42.26  
   42.27  struct RlvCommandOptionGetPath : public RlvCommandOption
   42.28 @@ -151,7 +151,7 @@
   42.29  	const uuid_vec_t& getItemIDs() const { return m_idItems; }
   42.30  
   42.31  	static bool getItemIDs(const LLViewerJointAttachment* pAttachPt, uuid_vec_t& idItems, bool fClear = true);
   42.32 -	static bool getItemIDs(EWearableType wtType, uuid_vec_t& idItems, bool fClear = true);
   42.33 +	static bool getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems, bool fClear = true);
   42.34  
   42.35  protected:
   42.36  	uuid_vec_t m_idItems;
   42.37 @@ -244,9 +244,9 @@
   42.38  
   42.39  	// Wearables
   42.40  	static bool isForceRemovable(const LLWearable* pWearable, bool fCheckComposite = true, const LLUUID& idExcept = LLUUID::null);
   42.41 -	static bool isForceRemovable(EWearableType wtType, bool fCheckComposite = true, const LLUUID& idExcept = LLUUID::null);
   42.42 +	static bool isForceRemovable(LLWearableType::EType wtType, bool fCheckComposite = true, const LLUUID& idExcept = LLUUID::null);
   42.43  	void forceRemove(const LLWearable* pWearable);
   42.44 -	void forceRemove(EWearableType wtType);
   42.45 +	void forceRemove(LLWearableType::EType wtType);
   42.46  
   42.47  public:
   42.48  	void done();
   42.49 @@ -289,8 +289,8 @@
   42.50  	}
   42.51  
   42.52  protected:
   42.53 -	typedef std::pair<EWearableType, LLInventoryModel::item_array_t> addwearable_pair_t;
   42.54 -	typedef std::map<EWearableType, LLInventoryModel::item_array_t> addwearables_map_t;
   42.55 +	typedef std::pair<LLWearableType::EType, LLInventoryModel::item_array_t> addwearable_pair_t;
   42.56 +	typedef std::map<LLWearableType::EType, LLInventoryModel::item_array_t> addwearables_map_t;
   42.57  	addwearables_map_t               m_addWearables;
   42.58  	typedef std::pair<S32, LLInventoryModel::item_array_t> addattachment_pair_t;
   42.59  	typedef std::map<S32, LLInventoryModel::item_array_t> addattachments_map_t;
    43.1 --- a/indra/newview/rlvinventory.cpp	Sun Jan 15 13:43:22 2012 +0100
    43.2 +++ b/indra/newview/rlvinventory.cpp	Sat Jan 28 16:48:34 2012 +0100
    43.3 @@ -170,9 +170,9 @@
    43.4  	uuid_vec_t idItems;
    43.5  
    43.6  	// Fetch all currently worn clothing layers and body parts
    43.7 -	for (int type = 0; type < WT_COUNT; type++)
    43.8 +	for (int type = 0; type < LLWearableType::WT_COUNT; type++)
    43.9  	{
   43.10 -		const LLUUID& idItem = gAgent.getWearableItem((EWearableType)type);
   43.11 +		const LLUUID& idItem = gAgent.getWearableItem((LLWearableType::EType)type);
   43.12  		if (idItem.notNull())
   43.13  			idItems.push_back(idItem);
   43.14  	}
    44.1 --- a/indra/newview/rlvlocks.cpp	Sun Jan 15 13:43:22 2012 +0100
    44.2 +++ b/indra/newview/rlvlocks.cpp	Sat Jan 28 16:48:34 2012 +0100
    44.3 @@ -806,7 +806,7 @@
    44.4  RlvWearableLocks gRlvWearableLocks;
    44.5  
    44.6  // Checked: 2010-03-18 (RLVa-1.2.0c) | Added: RLVa-1.2.0a
    44.7 -void RlvWearableLocks::addWearableTypeLock(EWearableType eType, const LLUUID& idRlvObj, ERlvLockMask eLock)
    44.8 +void RlvWearableLocks::addWearableTypeLock(LLWearableType::EType eType, const LLUUID& idRlvObj, ERlvLockMask eLock)
    44.9  {
   44.10  /*
   44.11  	// Sanity check - make sure it's an object we know about
   44.12 @@ -816,13 +816,13 @@
   44.13  
   44.14  	// NOTE: m_WearableTypeXXX can contain duplicate <eType, idRlvObj> pairs (ie @remoutfit:shirt=n,remoutfit=n from the same object)
   44.15  	if (eLock & RLV_LOCK_REMOVE)
   44.16 -		m_WearableTypeRem.insert(std::pair<EWearableType, LLUUID>(eType, idRlvObj));
   44.17 +		m_WearableTypeRem.insert(std::pair<LLWearableType::EType, LLUUID>(eType, idRlvObj));
   44.18  	if (eLock & RLV_LOCK_ADD)
   44.19 -		m_WearableTypeAdd.insert(std::pair<EWearableType, LLUUID>(eType, idRlvObj));
   44.20 +		m_WearableTypeAdd.insert(std::pair<LLWearableType::EType, LLUUID>(eType, idRlvObj));
   44.21  }
   44.22  
   44.23  // Checked: 2010-03-19 (RLVa-1.1.3b) | Added: RLVa-1.2.0a
   44.24 -bool RlvWearableLocks::canRemove(EWearableType eType) const
   44.25 +bool RlvWearableLocks::canRemove(LLWearableType::EType eType) const
   44.26  {
   44.27  	// NOTE: we return TRUE if the wearable type has at least one wearable that can be removed by the user
   44.28  	LLWearable* pWearable = gAgent.getWearable(eType);
   44.29 @@ -832,7 +832,7 @@
   44.30  }
   44.31  
   44.32  // Checked: 2010-03-19 (RLVa-1.1.3b) | Added: RLVa-1.2.0a
   44.33 -bool RlvWearableLocks::hasLockedWearable(EWearableType eType) const
   44.34 +bool RlvWearableLocks::hasLockedWearable(LLWearableType::EType eType) const
   44.35  {
   44.36  	// NOTE: we return TRUE if there is at least 1 non-removable wearable currently worn on this wearable type
   44.37  	LLWearable* pWearable = gAgent.getWearable(eType);
   44.38 @@ -852,7 +852,7 @@
   44.39  }
   44.40  
   44.41  // Checked: 2010-03-19 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
   44.42 -bool RlvWearableLocks::isLockedWearableTypeExcept(EWearableType eType, ERlvLockMask eLock, const LLUUID& idRlvObj) const
   44.43 +bool RlvWearableLocks::isLockedWearableTypeExcept(LLWearableType::EType eType, ERlvLockMask eLock, const LLUUID& idRlvObj) const
   44.44  {
   44.45  	if (idRlvObj.isNull())
   44.46  		return isLockedWearableType(eType, eLock);
   44.47 @@ -880,7 +880,7 @@
   44.48  }
   44.49  
   44.50  // Checked: 2010-03-18 (RLVa-1.2.0c) | Added: RLVa-1.2.0a
   44.51 -void RlvWearableLocks::removeWearableTypeLock(EWearableType eType, const LLUUID& idRlvObj, ERlvLockMask eLock)
   44.52 +void RlvWearableLocks::removeWearableTypeLock(LLWearableType::EType eType, const LLUUID& idRlvObj, ERlvLockMask eLock)
   44.53  {
   44.54  /*
   44.55  	// Sanity check - make sure it's an object we know about
   44.56 @@ -1013,13 +1013,13 @@
   44.57  		case ST_WEARABLETYPE:
   44.58  			{
   44.59  				RLV_ASSERT( ((ST_ATTACHMENTPOINT == lockSource.first) && (typeid(S32) == lockSource.second.type())) || 
   44.60 -					        ((ST_WEARABLETYPE == lockSource.first) && (typeid(EWearableType) == lockSource.second.type())) );
   44.61 +					        ((ST_WEARABLETYPE == lockSource.first) && (typeid(LLWearableType::EType) == lockSource.second.type())) );
   44.62  
   44.63  				uuid_vec_t idItems;
   44.64  				if (ST_ATTACHMENTPOINT == lockSource.first)
   44.65  					RlvCommandOptionGetPath::getItemIDs(RlvAttachPtLookup::getAttachPoint(boost::get<S32>(lockSource.second)), idItems);
   44.66  				else if (ST_WEARABLETYPE == lockSource.first)
   44.67 -					RlvCommandOptionGetPath::getItemIDs(boost::get<EWearableType>(lockSource.second), idItems);
   44.68 +					RlvCommandOptionGetPath::getItemIDs(boost::get<LLWearableType::EType>(lockSource.second), idItems);
   44.69  
   44.70  				LLInventoryModel::cat_array_t itemFolders;
   44.71  				if (RlvInventory::instance().getPath(idItems, itemFolders))
    45.1 --- a/indra/newview/rlvlocks.h	Sun Jan 15 13:43:22 2012 +0100
    45.2 +++ b/indra/newview/rlvlocks.h	Sat Jan 28 16:48:34 2012 +0100
    45.3 @@ -234,16 +234,16 @@
    45.4  {
    45.5  public:
    45.6  	// Adds an eLock type lock (held by idRlvObj) for the wearable type
    45.7 -	void addWearableTypeLock(EWearableType eType, const LLUUID& idRlvObj, ERlvLockMask eLock);
    45.8 +	void addWearableTypeLock(LLWearableType::EType eType, const LLUUID& idRlvObj, ERlvLockMask eLock);
    45.9  
   45.10  	// Returns TRUE if there is at least 1 non-removable wearable currently worn on this wearable type
   45.11 -	bool hasLockedWearable(EWearableType eType) const;
   45.12 +	bool hasLockedWearable(LLWearableType::EType eType) const;
   45.13  	// Returns TRUE if there is at least 1 eLock type locked wearable type (RLV_LOCK_ANY = RLV_LOCK_ADD *or* RLV_LOCK_REMOVE)
   45.14  	//   - RLV_LOCK_REMOVE: specific wearable locked *or* any wearable type locked (regardless of whether it currently has wearables)
   45.15  	bool hasLockedWearableType(ERlvLockMask eLock) const;
   45.16  
   45.17  	// Removes an eLock type lock (held by idRlvObj) for the wearable type
   45.18 -	void removeWearableTypeLock(EWearableType eType, const LLUUID& idRlvObj, ERlvLockMask eLock);
   45.19 +	void removeWearableTypeLock(LLWearableType::EType eType, const LLUUID& idRlvObj, ERlvLockMask eLock);
   45.20  
   45.21  	// Returns TRUE if the wearable is RLV_LOCK_REMOVE locked
   45.22  	bool isLockedWearable(const LLWearable* pWearable) const;
   45.23 @@ -253,9 +253,9 @@
   45.24  	// NOTE: isLockedWearableType doesn't check if a worn wearable is a specific wearable lock so don't let these be called by the outside
   45.25  protected:
   45.26  	// Returns TRUE if the wearable type is eLock type locked
   45.27 -	bool isLockedWearableType(EWearableType eType, ERlvLockMask eLock) const;
   45.28 +	bool isLockedWearableType(LLWearableType::EType eType, ERlvLockMask eLock) const;
   45.29  	// Returns TRUE if the wearable type is eLock type locked by anything other than idRlvObj
   45.30 -	bool isLockedWearableTypeExcept(EWearableType eType, ERlvLockMask eLock, const LLUUID& idRlvObj) const;
   45.31 +	bool isLockedWearableTypeExcept(LLWearableType::EType eType, ERlvLockMask eLock, const LLUUID& idRlvObj) const;
   45.32  
   45.33  	/*
   45.34  	 * canWear/canRemove trivial helper functions (note that a more approriate name might be userCanWear/userCanRemove)
   45.35 @@ -264,18 +264,18 @@
   45.36  	// Returns whether the inventory item can be worn by the user
   45.37  	ERlvWearMask canWear(const LLViewerInventoryItem* pItem) const;
   45.38  	// Returns whether the wearable type can be worn to by the user
   45.39 -	ERlvWearMask canWear(EWearableType eType) const;
   45.40 +	ERlvWearMask canWear(LLWearableType::EType eType) const;
   45.41  
   45.42  	// Returns TRUE if the inventory item can be removed by the user
   45.43  	bool canRemove(const LLInventoryItem* pItem) const;
   45.44  	// Returns TRUE if the wearable type has at least one wearable that can be removed by the user
   45.45 -	bool canRemove(EWearableType eType) const;
   45.46 +	bool canRemove(LLWearableType::EType eType) const;
   45.47  
   45.48  	/*
   45.49  	 * Member variables
   45.50  	 */
   45.51  public:
   45.52 -	typedef std::multimap<EWearableType, LLUUID> rlv_wearabletypelock_map_t;
   45.53 +	typedef std::multimap<LLWearableType::EType, LLUUID> rlv_wearabletypelock_map_t;
   45.54  	// Accessors for RlvFloaterLocks
   45.55  	const rlv_wearabletypelock_map_t& getWearableTypeLocks(ERlvLockMask eLock) { return (RLV_LOCK_ADD == eLock) ? m_WearableTypeAdd : m_WearableTypeRem; }
   45.56  protected:
   45.57 @@ -301,7 +301,7 @@
   45.58  		ST_ATTACHMENT = 0x01, ST_ATTACHMENTPOINT = 0x02, ST_FOLDER = 0x04, ST_ROOTFOLDER = 0x08,
   45.59  		ST_SHAREDPATH = 0x10, ST_WEARABLETYPE = 0x20, ST_NONE= 0x00, ST_MASK_ANY = 0xFF
   45.60  	};
   45.61 -	typedef boost::variant<LLUUID, std::string, S32, EWearableType> lock_source_t;
   45.62 +	typedef boost::variant<LLUUID, std::string, S32, LLWearableType::EType> lock_source_t;
   45.63  	typedef std::pair<ELockSourceType, lock_source_t> folderlock_source_t;
   45.64  	// Specifies options for the folder lock
   45.65  	enum ELockPermission { PERM_ALLOW = 0x1, PERM_DENY = 0x2, PERM_MASK_ANY = 0x3 };
   45.66 @@ -536,7 +536,7 @@
   45.67  }
   45.68  
   45.69  // Checked: 2010-05-14 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
   45.70 -inline ERlvWearMask RlvWearableLocks::canWear(EWearableType eType) const
   45.71 +inline ERlvWearMask RlvWearableLocks::canWear(LLWearableType::EType eType) const
   45.72  {
   45.73  	// The specified wearable type can be worn on if:
   45.74  	//   - the wearable type itself isn't RLV_LOCK_ADD locked => RLV_WEAR_ADD
   45.75 @@ -571,7 +571,7 @@
   45.76  }
   45.77  
   45.78  // Checked: 2010-03-19 (RLVa-1.2.0c) | Added: RLVa-1.2.0a
   45.79 -inline bool RlvWearableLocks::isLockedWearableType(EWearableType eType, ERlvLockMask eLock) const
   45.80 +inline bool RlvWearableLocks::isLockedWearableType(LLWearableType::EType eType, ERlvLockMask eLock) const
   45.81  {
   45.82  	return
   45.83  		( (eLock & RLV_LOCK_REMOVE) && (m_WearableTypeRem.find(eType) != m_WearableTypeRem.end()) ) ||
    46.1 --- a/indra/newview/skins/default/xui/en-us/strings.xml	Sun Jan 15 13:43:22 2012 +0100
    46.2 +++ b/indra/newview/skins/default/xui/en-us/strings.xml	Sat Jan 28 16:48:34 2012 +0100
    46.3 @@ -226,6 +226,26 @@
    46.4  	<!-- Legacy strings, almost never used -->
    46.5  	<string name="Fullbright">Fullbright (Legacy)</string>	<!-- used in the Build > materials dropdown-->
    46.6  
    46.7 +	<!-- Wearable Types -->
    46.8 +	<string name="shape">Shape</string>
    46.9 +	<string name="skin">Skin</string>
   46.10 +	<string name="hair">Hair</string>
   46.11 +	<string name="eyes">Eyes</string>
   46.12 +	<string name="shirt">Shirt</string>
   46.13 +	<string name="pants">Pants</string>
   46.14 +	<string name="shoes">Shoes</string>
   46.15 +	<string name="socks">Socks</string>
   46.16 +	<string name="jacket">Jacket</string>
   46.17 +	<string name="gloves">Gloves</string>
   46.18 +	<string name="undershirt">Undershirt</string>
   46.19 +	<string name="underpants">Underpants</string>
   46.20 +	<string name="skirt">Skirt</string>
   46.21 +	<string name="alpha">Alpha</string>
   46.22 +	<string name="tattoo">Tattoo</string>
   46.23 +	<string name="physics">Physics</string>
   46.24 +	<string name="invalid">invalid</string>
   46.25 +	<string name="none">none</string>
   46.26 +
   46.27  	<!-- LSL Usage Hover Tips -->
   46.28    <string name="LSLTipSleepTime">
   46.29  Sleeps script for [SLEEP_TIME] seconds.

mercurial