diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-12-01 16:21:52 -0500 | 
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-12-01 16:21:52 -0500 | 
| commit | fe5ff3e74a69bb7ede65d7d5865325c0a771eca6 (patch) | |
| tree | fbc52c83af483daaa9586aaa8ec6527a478a2cdb /indra/newview | |
| parent | 38a258d04a98939e12bb2cfce6caea288a7fc3a5 (diff) | |
| parent | d960676c5af26b299166bdd74744a7f513b45541 (diff) | |
merge
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/VIEWER_VERSION.txt | 2 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl | 6 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl | 9 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl | 6 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl | 8 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 22 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl | 6 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 25 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 26 | ||||
| -rwxr-xr-x | indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 25 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/newview/llappdelegate-objc.mm | 0 | ||||
| -rwxr-xr-x | indra/newview/lldrawpoolavatar.cpp | 3 | ||||
| -rwxr-xr-x | indra/newview/llfilepicker.cpp | 21 | ||||
| -rwxr-xr-x | indra/newview/llmaniprotate.cpp | 10 | ||||
| -rwxr-xr-x | indra/newview/llvoavatar.cpp | 308 | 
15 files changed, 258 insertions, 219 deletions
| diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index c6cff55cf7..b49c354524 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.21 +3.7.22 diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index bc63d07d72..767fad016c 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -40,4 +40,10 @@ mat4 getSkinnedTransform()  	ret[3] = vec4(0,0,0,1);  	return ret; + +#ifdef IS_AMD_CARD +	// If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. +	vec4 dummy1 = matrixPalette[0]; +	vec4 dummy2 = matrixPalette[44]; +#endif  } diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 57129c3bd1..6cd38d8ef5 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -63,5 +63,14 @@ mat4 getObjectSkinnedTransform()  	ret[3] = vec4(trans, 1.0);  	return ret; + +#ifdef IS_AMD_CARD +   // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. +   mat3 dummy1 = matrixPalette[0]; +   vec3 dummy2 = translationPalette[0]; +   mat3 dummy3 = matrixPalette[51]; +   vec3 dummy4 = translationPalette[51]; +#endif +  } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index a4f54dff70..5264d6e1b4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -132,5 +132,11 @@ void main()  	col.y *= col.y;  	frag_color = col; + +#ifdef IS_AMD_CARD +	// If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. +	vec3 dummy1 = kern[0]; +	vec3 dummy2 = kern[3]; +#endif  } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 236567219b..1a464fec5d 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -161,4 +161,12 @@ void main()  	frag_color.rgb = out_col;  	frag_color.a = 0.0; + +#ifdef IS_AMD_CARD +	// If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. +	vec4 dummy1 = light[0]; +	vec4 dummy2 = light_col[0]; +	vec4 dummy3 = light[LIGHT_COUNT-1]; +	vec4 dummy4 = light_col[LIGHT_COUNT-1]; +#endif  } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 0e6ab80d4d..c08e9d361a 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -127,13 +127,17 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)  	vec4 ret = texture2DLod(projectionMap, tc, lod);  	ret.rgb = srgb_to_linear(ret.rgb); -	vec2 dist = tc-vec2(0.5); +	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); -	float det = max(1.0-lod/(proj_lod*0.5), 0.0); +	float det = min(lod/(proj_lod*0.5), 1.0); -	float d = dot(dist,dist); -		 -	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); +	float d = min(dist.x, dist.y); +     +    d *= min(1, d * (proj_lod - lod)); +	 +	float edge = 0.25*det; +     +	ret *= clamp(d/edge, 0.0, 1.0);  	return ret;  } @@ -311,19 +315,17 @@ void main()  			vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;  			vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); -			stc /= stc.w; +              			if (stc.z > 0.0)  			{ -				float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); -				 -				stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); +                stc /= stc.w;  				if (stc.x < 1.0 &&  					stc.y < 1.0 &&  					stc.x > 0.0 &&  					stc.y > 0.0)  				{ -					col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb;										 +					col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity;  				}  			}  		} diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 96f9628424..018ced4cad 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -99,4 +99,10 @@ void main()  	col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z;  	frag_color.rgb = col; + +#ifdef IS_AMD_CARD +	// If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. +	vec2 dummy1 = kern[0]; +	vec2 dummy2 = kern[31]; +#endif  } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 8d8a6c9dde..f50635a139 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -130,15 +130,19 @@ vec4 correctWithGamma(vec4 col)  vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)  {  	vec4 ret = texture2DLod(projectionMap, tc, lod); -	ret = correctWithGamma(ret); +	ret.rgb = srgb_to_linear(ret.rgb); -	vec2 dist = tc-vec2(0.5); +	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); -	float det = max(1.0-lod/(proj_lod*0.5), 0.0); +	float det = min(lod/(proj_lod*0.5), 1.0); -	float d = dot(dist,dist); -		 -	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); +	float d = min(dist.x, dist.y); +     +    d *= min(1, d * (proj_lod - lod)); +	 +	float edge = 0.25*det; +     +	ret *= clamp(d/edge, 0.0, 1.0);  	return ret;  } @@ -322,19 +326,14 @@ void main()  			if (stc.z > 0.0)  			{ -				stc.xy /= stc.w; - -				float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); -				 -				//stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); -				stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); +				stc /= stc.w;  				if (stc.x < 1.0 &&  					stc.y < 1.0 &&  					stc.x > 0.0 &&  					stc.y > 0.0)  				{ -					col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb;										 +					col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity;  				}  			}  		} diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index c20e00163c..94bd07bec6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col)  vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)  {  	vec4 ret = texture2DLod(projectionMap, tc, lod); -	ret = correctWithGamma(ret); - -	vec2 dist = tc-vec2(0.5); +	ret.rgb = srgb_to_linear(ret.rgb); -	float det = max(1.0-lod/(proj_lod*0.5), 0.0); +	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); -	float d = dot(dist,dist); -		 -	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); +	float det = min(lod/(proj_lod*0.5), 1.0); +	 +	float d = min(dist.x, dist.y); +     +    d *= min(1, d * (proj_lod - lod)); +	 +	float edge = 0.25*det; +     +	ret *= clamp(d/edge, 0.0, 1.0);  	return ret;  } @@ -334,25 +338,21 @@ void main()  			vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;  			vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); -			stc /= stc.w;  			if (stc.z > 0.0)  			{ -				float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - -				stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); +                stc /= stc.w;  				if (stc.x < 1.0 &&  					stc.y < 1.0 &&  					stc.x > 0.0 &&  					stc.y > 0.0)  				{ -					col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*spec.rgb;										 +					col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;  				}  			}  		}  	} -	  	//not sure why, but this line prevents MATBUG-194  	col = max(col, vec3(0.0)); diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 7689b72d20..92e1ac95a6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col)  vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)  {  	vec4 ret = texture2DLod(projectionMap, tc, lod); -	ret = correctWithGamma(ret); +	ret.rgb = srgb_to_linear(ret.rgb); -	vec2 dist = tc-vec2(0.5); +	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); -	float det = max(1.0-lod/(proj_lod*0.5), 0.0); +	float det = min(lod/(proj_lod*0.5), 1.0); -	float d = dot(dist,dist); -		 -	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); +	float d = min(dist.x, dist.y); +     +    d *= min(1, d * (proj_lod - lod)); +	 +	float edge = 0.25*det; +     +	ret *= clamp(d/edge, 0.0, 1.0);  	return ret;  } @@ -336,19 +340,14 @@ void main()  			if (stc.z > 0.0)  			{ -				stc.xy /= stc.w; - -				float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); -				 -				//stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); -				stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); +				stc /= stc.w;  				if (stc.x < 1.0 &&  					stc.y < 1.0 &&  					stc.x > 0.0 &&  					stc.y > 0.0)  				{ -					col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb;										 +					col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;  				}  			}  		} diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 549df80fa1..549df80fa1 100644..100755 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index afd5b84537..ab96201a63 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1626,7 +1626,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*  			{  				F32 w = weight[j][k]; -				idx[k] = llclamp((S32) floorf(w), 0, 63); +				idx[k] = llclamp((S32) floorf(w), 0, JOINT_COUNT-1); +  				wght[k] = w - floorf(w);  				scale += wght[k];  			} diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 5debf71744..ef50594feb 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -600,6 +600,9 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //              allowedv->push_back("slg");              break;  #endif +        case FFLOAD_XML: +            allowedv->push_back("xml"); +            break;          case FFLOAD_RAW:              allowedv->push_back("raw");              break; @@ -702,7 +705,14 @@ bool	LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena  			creator = "\?\?\?\?";  			extension = "slg";  			break; -#endif		 +#endif	 +			 +		case FFSAVE_XML: +			type = "\?\?\?\?"; +			creator = "\?\?\?\?"; +			extension = "xml"; +			break; +			  		case FFSAVE_RAW:  			type = "\?\?\?\?";  			creator = "\?\?\?\?"; @@ -1100,6 +1110,12 @@ static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker)  	return filtername;  } +static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker) +{ +	return add_simple_pattern_filter_to_gtkchooser(picker,  "*.xml", +												   LLTrans::getString("xml_files") + " (*.xml)"); +} +  static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker)  {  	return add_simple_pattern_filter_to_gtkchooser(picker,  "*.dae", @@ -1293,6 +1309,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )  		case FFLOAD_ANIM:  			filtername = add_anim_filter_to_gtkchooser(picker);  			break; +		case FFLOAD_XML: +			filtername = add_xml_filter_to_gtkchooser(picker); +			break;  		case FFLOAD_COLLADA:  			filtername = add_collada_filter_to_gtkchooser(picker);  			break; diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 7861573908..b2350e5a75 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1240,10 +1240,10 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y )  	F32 dist_from_sphere_center = sqrt(delta_x * delta_x + delta_y * delta_y);  	LLVector3 axis = mMouseDown % mMouseCur; +	F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur);  	axis.normVec(); -	F32 angle = acos(mMouseDown * mMouseCur);  	LLQuaternion sphere_rot( angle, axis ); - +	  	if (is_approx_zero(1.f - mMouseDown * mMouseCur))  	{  		return LLQuaternion::DEFAULT; @@ -1638,9 +1638,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )  			mInSnapRegime = FALSE;  		} -		angle = acos(mMouseCur * mMouseDown); - -		F32 dir = (mMouseDown % mMouseCur) * constraint_axis;  // cross product +		LLVector3 cross_product = mMouseDown % mMouseCur; +		angle = atan2(sqrtf(cross_product * cross_product), mMouseCur * mMouseDown); +		F32 dir = cross_product * constraint_axis;  // cross product  		if( dir < 0.f )  		{  			angle *= -1.f; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 51ef2e7564..eb69458f0e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -464,7 +464,10 @@ public:  		mCharacter = character;  		BOOL success = true; -		if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) { success = false; } +		if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) +		{ +			success = false; +		}  		if ( success )  		{ @@ -814,14 +817,14 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c  //------------------------------------------------------------------------  LLVOAvatar::~LLVOAvatar()  { -		if (!mFullyLoaded) -		{ +	if (!mFullyLoaded) +	{  		debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); -		} -		else -		{ +	} +	else +	{  		debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); -		} +	}  	logPendingPhases(); @@ -975,10 +978,11 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts)  		 iter != LLCharacter::sInstances.end(); ++iter)  	{  		LLVOAvatar* inst = (LLVOAvatar*) *iter; -		if (!inst) -			continue; -		S32 rez_status = inst->getRezzedStatus(); -		counts[rez_status]++; +		if (inst) +		{ +			S32 rez_status = inst->getRezzedStatus(); +			counts[rez_status]++; +		}  	}  } @@ -1349,38 +1353,36 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)  	{  		LLViewerJointAttachment* attachment = iter->second; -		if (!attachment->getValid()) +		if (attachment->getValid())  		{ -			continue ; -		} - -		for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); -			 attachment_iter != attachment->mAttachedObjects.end(); -			 ++attachment_iter) -		{ -			const LLViewerObject* attached_object = (*attachment_iter); -			if (attached_object && !attached_object->isHUDAttachment()) +			for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); +				 attachment_iter != attachment->mAttachedObjects.end(); +				 ++attachment_iter)  			{ -				LLDrawable* drawable = attached_object->mDrawable; -				if (drawable && !drawable->isState(LLDrawable::RIGGED)) +				const LLViewerObject* attached_object = (*attachment_iter); +				if (attached_object && !attached_object->isHUDAttachment())  				{ -					LLSpatialBridge* bridge = drawable->getSpatialBridge(); -					if (bridge) +					LLDrawable* drawable = attached_object->mDrawable; +					if (drawable && !drawable->isState(LLDrawable::RIGGED))  					{ -						const LLVector4a* ext = bridge->getSpatialExtents(); -						LLVector4a distance; -						distance.setSub(ext[1], ext[0]); -						LLVector4a max_span(max_attachment_span); +						LLSpatialBridge* bridge = drawable->getSpatialBridge(); +						if (bridge) +						{ +							const LLVector4a* ext = bridge->getSpatialExtents(); +							LLVector4a distance; +							distance.setSub(ext[1], ext[0]); +							LLVector4a max_span(max_attachment_span); -						S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; +							S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; -						// Only add the prim to spatial extents calculations if it isn't a megaprim. -						// max_attachment_span calculated at the start of the function  -						// (currently 5 times our max prim size)  -						if (lt == 0x7) -						{ -							update_min_max(newMin,newMax,ext[0]); -							update_min_max(newMin,newMax,ext[1]); +							// Only add the prim to spatial extents calculations if it isn't a megaprim. +							// max_attachment_span calculated at the start of the function  +							// (currently 5 times our max prim size)  +							if (lt == 0x7) +							{ +								update_min_max(newMin,newMax,ext[0]); +								update_min_max(newMin,newMax,ext[1]); +							}  						}  					}  				} @@ -1957,7 +1959,7 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,  		if (has_name && getNVPair("FirstName"))  		{  			mDebugExistenceTimer.reset(); -		debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); +			debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived");  		}  	if(retval & LLViewerObject::INVALID_UPDATE) @@ -1969,9 +1971,6 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,  		}  	} -	//LL_INFOS() << getRotation() << LL_ENDL; -	//LL_INFOS() << getPosition() << LL_ENDL; -  	return retval;  } @@ -1987,7 +1986,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU  		result = gTextureList.findImage(uuid);  	}  	if (!result) -{ +	{  		const std::string url = getImageURL(te,uuid);  		if (url.empty()) @@ -3332,7 +3331,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)  			removeAnimationData("Walk Speed");  		}  		mMotionController.setTimeStep(time_step); -//		LL_INFOS() << "Setting timestep to " << time_quantum * pixel_area_scale << LL_ENDL; +		//		LL_INFOS() << "Setting timestep to " << time_quantum * pixel_area_scale << LL_ENDL;  	}  	if (getParent() && !mIsSitting) @@ -3473,7 +3472,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)  						fwdDir.normalize();  					}  				} -				  			}  			LLQuaternion root_rotation = mRoot->getWorldMatrix().quaternion(); @@ -3589,10 +3587,14 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)  	// update animations  	if (mSpecialRenderMode == 1) // Animation Preview +	{  		updateMotions(LLCharacter::FORCE_UPDATE); +	}  	else +	{  		updateMotions(LLCharacter::NORMAL_UPDATE); - +	} +	  	// update head position  	updateHeadOffset(); @@ -3689,10 +3691,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)  	//mesh vertices need to be reskinned  	mNeedsSkin = TRUE; - - -		 -	  	return TRUE;  }  //----------------------------------------------------------------------------- @@ -3948,13 +3946,13 @@ U32 LLVOAvatar::renderSkinned()  			if (face)  			{  				LLVertexBuffer* vb = face->getVertexBuffer(); -			if (vb) -			{ -				vb->flush(); +				if (vb) +				{ +					vb->flush(); +				}  			}  		}  	} -	}  	else  	{  		mNeedsSkin = FALSE; @@ -4134,7 +4132,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)  		{  			LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR);  			if (hair_mesh) -		{ +			{  				num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy);  			}  			first_pass = FALSE; @@ -5339,8 +5337,8 @@ BOOL LLVOAvatar::loadSkeletonNode ()  {  	if (!LLAvatarAppearance::loadSkeletonNode())  	{ -				return FALSE; -			} +		return FALSE; +	}  	// ATTACHMENTS  	{ @@ -6079,27 +6077,24 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const  			break; // Do nothing  	} -	/* switch(type) -		case LLWearableType::WT_SHIRT: -			indicator_te = TEX_UPPER_SHIRT; */  	for (LLAvatarAppearanceDictionary::Textures::const_iterator tex_iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();  		 tex_iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();  		 ++tex_iter)  	{  		const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_iter->second;  		if (texture_dict->mWearableType == type) -	{ +		{  			// Thus, you must check to see if the corresponding baked texture is defined.  			// NOTE: this is a poor substitute if you actually want to know about individual pieces of clothing  			// this works for detecting a skirt (most important), but is ineffective at any piece of clothing that  			// gets baked into a texture that always exists (upper or lower).  			if (texture_dict->mIsUsedByBakedTexture) -	{ +			{  				const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;  				return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); -	} +			}  			return FALSE; -	} +		}  	}  	return FALSE;  } @@ -6169,7 +6164,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color)  	}   	else if (global_color == mTexEyeColor)  	{ -//		LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL;  +		// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL;   		invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet);  	}  	updateMeshTextures(); @@ -6229,9 +6224,9 @@ void LLVOAvatar::updateRezzedStatusTimers()  		{  			// load level has decreased. start phase timers for higher load levels.  			for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++) -		{ +			{  				startPhase("load_" + LLVOAvatar::rezStatusToString(i)); -		} +			}  		}  		else if (rez_status > mLastRezzedStatus)  		{ @@ -6240,16 +6235,15 @@ void LLVOAvatar::updateRezzedStatusTimers()  			{  				stopPhase("load_" + LLVOAvatar::rezStatusToString(i));  				stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false); -		} +			}  			if (rez_status == 3) -		{ +			{  				// "fully loaded", mark any pending appearance change complete.  				selfStopPhase("update_appearance_from_cof");  				selfStopPhase("wear_inventory_category", false);  				selfStopPhase("process_initial_wearables_update", false);  			}  		} -		  		mLastRezzedStatus = rez_status;  	}  } @@ -6311,7 +6305,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)  void LLVOAvatar::logPendingPhases()  {  	if (!isAgentAvatarValid()) -		{ +	{  		return;  	} @@ -6327,14 +6321,14 @@ void LLVOAvatar::logPendingPhases()  			if (!completed)  			{  				logMetricsTimerRecord(phase_name, elapsed, completed); -		} +			}  		}  	} -		} +}  //static  void LLVOAvatar::logPendingPhasesAllAvatars() -		{ +{  	for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();  		 iter != LLCharacter::sInstances.end(); ++iter)  	{ @@ -6345,14 +6339,14 @@ void LLVOAvatar::logPendingPhasesAllAvatars()  		}  		inst->logPendingPhases();  	} -		} +}  void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed) -		{ +{  	if (!isAgentAvatarValid()) -		{ +	{  		return; -		} +	}  	LLSD record;  	record["timer_name"] = phase_name; @@ -6361,10 +6355,10 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse  	record["completed"] = completed;  	U32 grid_x(0), grid_y(0);  	if (getRegion()) -		{ +	{  		record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion());  		grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y); -		} +	}  	record["grid_x"] = LLSD::Integer(grid_x);  	record["grid_y"] = LLSD::Integer(grid_y);  	record["is_using_server_bakes"] = true; @@ -6425,8 +6419,8 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)  	mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE); -		if (!mPreviousFullyLoaded && !loading && mFullyLoaded) -		{ +	if (!mPreviousFullyLoaded && !loading && mFullyLoaded) +	{  		debugAvatarRezTime("AvatarRezNotification","fully loaded");  	} @@ -6482,9 +6476,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)  			LLAvatarJointMesh* mesh = (*iter);  			if (mesh)  			{ -				{ -					mesh->setColor(color); -				} +				mesh->setColor(color);  			}  		}  	} @@ -6584,7 +6576,7 @@ void LLVOAvatar::updateMeshTextures()  		LLViewerTexLayerSet* layerset = getTexLayerSet(i);  		if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() ) -	{ +		{  			LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID);  			mBakedTextureDatas[i].mIsUsed = TRUE; @@ -6593,12 +6585,12 @@ void LLVOAvatar::updateMeshTextures()  			avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();  			avatar_joint_mesh_list_t::iterator end  = mBakedTextureDatas[i].mJointMeshes.end();  			for (; iter != end; ++iter) -	{ +			{  				LLAvatarJointMesh* mesh = (*iter);  				if (mesh) -		{ +				{  					mesh->setTexture( baked_img ); -			} +				}  			}  		}  		else if (!isUsingLocalAppearance() && is_layer_baked[i]) @@ -6627,9 +6619,9 @@ void LLVOAvatar::updateMeshTextures()  				baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ),   					src_callback_list, paused ); -                               // this could add paused texture callbacks -                               mLoadedCallbacksPaused |= paused;  -                               checkTextureLoading(); +				// this could add paused texture callbacks +				mLoadedCallbacksPaused |= paused;  +				checkTextureLoading();  			}  		}  		else if (layerset && isUsingLocalAppearance()) @@ -6648,7 +6640,7 @@ void LLVOAvatar::updateMeshTextures()  				if (mesh)  				{  					mesh->setLayerSet( layerset ); -			} +				}  			}  		}  		else @@ -6670,7 +6662,7 @@ void LLVOAvatar::updateMeshTextures()  		{  			LLAvatarJointMesh* mesh = (*iter);  			if (mesh) -		{ +			{  				mesh->setColor( color );  				mesh->setTexture( hair_img );  			} @@ -6766,13 +6758,13 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com  	for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin();  		 iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter) -{ +	{  		const LLMaskedMorph* maskedMorph = (*iter);  		LLPolyMorphTarget* morph_target = dynamic_cast<LLPolyMorphTarget*>(maskedMorph->mMorphTarget);  		if (morph_target) -	{ +		{  			morph_target->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert); -} +		}  	}  } @@ -7071,9 +7063,9 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,  	outfile.open(fullpath, LL_APR_WB );  	apr_file_t* file = outfile.getFileHandle();  	if (!file) -		{ -			return; -		} +	{ +		return; +	}  	else  	{  		LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << LL_ENDL; @@ -7108,7 +7100,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,  		apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str());  	}  	apr_file_printf(file, "</textures>\n"); -	} +}  void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents)  { @@ -7637,12 +7629,12 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )  				avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();  				avatar_joint_mesh_list_t::iterator end  = mBakedTextureDatas[i].mJointMeshes.end();  				for (; iter != end; ++iter) -			{ +				{  					LLAvatarJointMesh* mesh = (*iter);  					if (mesh) -			{ +					{  						mesh->setTexture( image_baked ); -			} +					}  				}  			} @@ -7666,14 +7658,13 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )  				{  					LLAvatarJointMesh* mesh = (*iter);  					if (mesh) -				{ +					{  						mesh->setColor( LLColor4::white );  					}  				}  			}  		}  	} -  	dirtyMesh();  } @@ -7685,7 +7676,7 @@ std::string get_sequential_numbered_file_name(const std::string& prefix,  	file_num_type::iterator it = file_nums.find(prefix);  	S32 num = 0;  	if (it != file_nums.end()) -{ +	{  		num = it->second;  	}  	file_nums[prefix] = num+1; @@ -7718,65 +7709,58 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara  	LLAPRFile outfile;  	std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); -	outfile.open(fullpath, LL_APR_WB ); -	apr_file_t* file = outfile.getFileHandle(); -	if (!file) -	{ -		return; -	} -	else +	if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB ))  	{ +		apr_file_t* file = outfile.getFileHandle();  		LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL; -	} -	apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); -	apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); -	apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); +		apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); +		apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); +		apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); -	if (group_by_wearables) -	{ -		for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) -	{ -		const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); -		apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); - -			for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) +		if (group_by_wearables)  		{ -			LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; -			if( (viewer_param->getWearableType() == type) &&  -				(viewer_param->isTweakable() ) ) +			for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++)  			{ -					dump_visual_param(file, viewer_param, viewer_param->getWeight()); -			} -		} +				const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); +				apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); -		for (U8 te = 0; te < TEX_NUM_INDICES; te++) -		{ -				if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) -			{ -				// MULTIPLE_WEARABLES: extend to multiple wearables? -					LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); -				if( te_image ) +				for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam())  				{ -					std::string uuid_str; -					te_image->getID().toString( uuid_str ); -					apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); +					LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; +					if( (viewer_param->getWearableType() == type) &&  +					   (viewer_param->isTweakable() ) ) +					{ +						dump_visual_param(file, viewer_param, viewer_param->getWeight()); +					} +				} + +				for (U8 te = 0; te < TEX_NUM_INDICES; te++) +				{ +					if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) +					{ +						// MULTIPLE_WEARABLES: extend to multiple wearables? +						LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); +						if( te_image ) +						{ +							std::string uuid_str; +							te_image->getID().toString( uuid_str ); +							apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); +						} +					}  				}  			}  		} -	} -		} -	else  -	{ -		// Just dump all params sequentially. -		for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) +		else   		{ -			LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; -			dump_visual_param(file, viewer_param, viewer_param->getWeight()); -		} +			// Just dump all params sequentially. +			for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) +			{ +				LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; +				dump_visual_param(file, viewer_param, viewer_param->getWeight()); +			} -		for (U8 te = 0; te < TEX_NUM_INDICES; te++) -		{ +			for (U8 te = 0; te < TEX_NUM_INDICES; te++)  			{  				// MULTIPLE_WEARABLES: extend to multiple wearables?  				LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); @@ -7945,7 +7929,7 @@ void LLVOAvatar::startAppearanceAnimation()  // virtual  void LLVOAvatar::removeMissingBakedTextures() -			{ +{  }  //virtual @@ -8199,7 +8183,6 @@ void LLVOAvatar::calculateUpdateRenderCost()  					}  				}  			} -  		}  		// Diagnostic output to identify all avatar-related textures. @@ -8211,9 +8194,8 @@ void LLVOAvatar::calculateUpdateRenderCost()  			for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it)  			{  				LLUUID image_id = it->first; -				if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) -					continue; -				if (all_textures.find(image_id) == all_textures.end()) +				if( ! (image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) +				   && (all_textures.find(image_id) == all_textures.end()))  				{  					// attachment texture not previously seen.  					LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; @@ -8279,15 +8261,17 @@ LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high)  // static  BOOL LLVOAvatar::isIndexLocalTexture(ETextureIndex index)  { -	if (index < 0 || index >= TEX_NUM_INDICES) return false; -	return LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsLocalTexture; +	return (index < 0 || index >= TEX_NUM_INDICES) +		? false +		: LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsLocalTexture;  }  // static  BOOL LLVOAvatar::isIndexBakedTexture(ETextureIndex index)  { -	if (index < 0 || index >= TEX_NUM_INDICES) return false; -	return LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsBakedTexture; +	return (index < 0 || index >= TEX_NUM_INDICES) +		? false +		: LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsBakedTexture;  }  const std::string LLVOAvatar::getBakedStatusForPrintout() const @@ -8337,7 +8321,7 @@ BOOL LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U  	{  		return FALSE;  	} - +	  	if( !getImage( te, index ) )  	{  		LL_WARNS() << "getImage( " << te << ", " << index << " ) returned 0" << LL_ENDL; | 
