diff options
| author | Oz Linden <oz@lindenlab.com> | 2015-08-26 12:07:16 -0400 | 
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2015-08-26 12:07:16 -0400 | 
| commit | 712a4e70c81c1908e4e7668ff1695a9415ec4b71 (patch) | |
| tree | b5312334f90e4359dce19eb696954dbcca5f5fd6 /indra | |
| parent | 206ef7a1562db19a4d8a41e55b7272c917f4b62c (diff) | |
refine fix for MAINT-5560 based on review feedback and to fix VS objection
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llavatarrenderinfoaccountant.cpp | 4 | ||||
| -rwxr-xr-x | indra/newview/llspatialpartition.cpp | 3 | ||||
| -rwxr-xr-x | indra/newview/llvoavatar.cpp | 11 | ||||
| -rwxr-xr-x | indra/newview/llvoavatar.h | 4 | ||||
| -rwxr-xr-x | indra/newview/llvovolume.cpp | 6 | 
5 files changed, 14 insertions, 14 deletions
| diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 03204ea48f..d351b38653 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -268,8 +268,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio  					LLSD info = LLSD::emptyMap();                      U32 avatar_complexity = avatar->getVisualComplexity(); -					if (avatar_complexity > 0) +                    if (avatar_complexity > 0)  					{ +                        // the weight/complexity is unsigned, but LLSD only stores signed integers, +                        // so if it's over that (which would be ridiculously high), just store the maximum signed int value  						info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX);  						info[KEY_TOO_COMPLEX]  = LLSD::Boolean(avatar->isTooComplex());  						agents[avatar->getID().asString()] = info; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 11b619ba00..da3f344e00 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -862,8 +862,7 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)  	{  		if (bridge->mAvatar.notNull())  		{ -			bridge->mAvatar->modifyAttachmentGeometryBytes( -mGeometryBytes ); -			bridge->mAvatar->modifyAttachmentSurfaceArea( -mSurfaceArea ); +			bridge->mAvatar->subtractAttachmentSizes( mGeometryBytes, mSurfaceArea );  		}  	} diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 303b677dcf..5d83a20f50 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8283,15 +8283,16 @@ void LLVOAvatar::idleUpdateRenderComplexity()  	}  } -void LLVOAvatar::modifyAttachmentGeometryBytes(S32 delta) +void LLVOAvatar::addAttachmentSizes(U32 delta_bytes, F32 delta_area)  { -    mAttachmentGeometryBytes = llmax(mAttachmentGeometryBytes + delta, 0); +    mAttachmentGeometryBytes += delta_bytes; +    mAttachmentSurfaceArea   += delta_area;  } -void LLVOAvatar::modifyAttachmentSurfaceArea(F32 delta) +void LLVOAvatar::subtractAttachmentSizes(U32 delta_bytes, F32 delta_area)  { -    F32 newval = mAttachmentSurfaceArea + delta; -    mAttachmentSurfaceArea = ( newval > 0.0 ? newval : 0.0 ); +    mAttachmentGeometryBytes = delta_bytes > mAttachmentGeometryBytes ? 0 : mAttachmentGeometryBytes - delta_bytes; +    mAttachmentSurfaceArea   = delta_area > mAttachmentSurfaceArea ? 0.0 : mAttachmentSurfaceArea - delta_area;  }  void LLVOAvatar::updateVisualComplexity() diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 5f690be4c5..fb19f4eb2e 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -258,9 +258,9 @@ public:  	U32				getVisualComplexity()			{ return mVisualComplexity;				};		// Numbers calculated here by rendering AV  	S32				getAttachmentGeometryBytes()	{ return mAttachmentGeometryBytes;		};		// number of bytes in attached geometry -    void            modifyAttachmentGeometryBytes(S32 delta);  	F32				getAttachmentSurfaceArea()		{ return mAttachmentSurfaceArea;		};		// estimated surface area of attachments -    void            modifyAttachmentSurfaceArea(F32 delta); +    void            addAttachmentSizes(U32 delta_bytes, F32 delta_area); +    void            subtractAttachmentSizes(U32 delta_bytes, F32 delta_area);  	U32				getReportedVisualComplexity()					{ return mReportedVisualComplexity;				};	// Numbers as reported by the SL server  	void			setReportedVisualComplexity(U32 value)			{ mReportedVisualComplexity = value;			}; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 160e2fbdb3..44ba09c171 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4703,8 +4703,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  	if (pAvatarVO)  	{ -		pAvatarVO->modifyAttachmentGeometryBytes( -group->mGeometryBytes ); -		pAvatarVO->modifyAttachmentSurfaceArea( -group->mSurfaceArea ); +		pAvatarVO->subtractAttachmentSizes( group->mGeometryBytes, group->mSurfaceArea );  	}  	group->mGeometryBytes = 0; @@ -5258,8 +5257,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  	if (pAvatarVO)  	{ -        pAvatarVO->modifyAttachmentGeometryBytes( group->mGeometryBytes ); -		pAvatarVO->modifyAttachmentSurfaceArea( group->mSurfaceArea ); +        pAvatarVO->addAttachmentSizes( group->mGeometryBytes, group->mSurfaceArea );  	}  } | 
