aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-12-09 22:25:37 -0600
committerJacek Antonelli2008-12-09 22:25:41 -0600
commit22b861982f2efd5d16097a012627e73b9fb85834 (patch)
tree6152a84b92c682e271bdd52d46cd1728454f679a /linden/indra/newview/llvoavatar.cpp
parentSecond Life viewer sources 1.22.1-RC (diff)
downloadmeta-impy-22b861982f2efd5d16097a012627e73b9fb85834.zip
meta-impy-22b861982f2efd5d16097a012627e73b9fb85834.tar.gz
meta-impy-22b861982f2efd5d16097a012627e73b9fb85834.tar.bz2
meta-impy-22b861982f2efd5d16097a012627e73b9fb85834.tar.xz
Second Life viewer sources 1.22.2-RC
Diffstat (limited to 'linden/indra/newview/llvoavatar.cpp')
-rw-r--r--linden/indra/newview/llvoavatar.cpp73
1 files changed, 51 insertions, 22 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index c3ad4f9..557a6d9 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -272,6 +272,7 @@ LLUUID LLVOAvatar::sStepSounds[LL_MCODE_END] =
272 LLUUID(SND_RUBBER_RUBBER) 272 LLUUID(SND_RUBBER_RUBBER)
273}; 273};
274 274
275// static
275S32 LLVOAvatar::sRenderName = RENDER_NAME_ALWAYS; 276S32 LLVOAvatar::sRenderName = RENDER_NAME_ALWAYS;
276BOOL LLVOAvatar::sRenderGroupTitles = TRUE; 277BOOL LLVOAvatar::sRenderGroupTitles = TRUE;
277S32 LLVOAvatar::sNumVisibleChatBubbles = 0; 278S32 LLVOAvatar::sNumVisibleChatBubbles = 0;
@@ -284,9 +285,10 @@ BOOL LLVOAvatar::sVisibleInFirstPerson = FALSE;
284F32 LLVOAvatar::sLODFactor = 1.f; 285F32 LLVOAvatar::sLODFactor = 1.f;
285BOOL LLVOAvatar::sUseImpostors = FALSE; 286BOOL LLVOAvatar::sUseImpostors = FALSE;
286BOOL LLVOAvatar::sJointDebug = FALSE; 287BOOL LLVOAvatar::sJointDebug = FALSE;
287
288S32 LLVOAvatar::sCurJoint = 0; 288S32 LLVOAvatar::sCurJoint = 0;
289S32 LLVOAvatar::sCurVolume = 0; 289S32 LLVOAvatar::sCurVolume = 0;
290F32 LLVOAvatar::sUnbakedTime = 0.f;
291F32 LLVOAvatar::sGreyTime = 0.f;
290 292
291struct LLAvatarTexData 293struct LLAvatarTexData
292{ 294{
@@ -1070,8 +1072,10 @@ void LLVOAvatar::deleteLayerSetCaches()
1070} 1072}
1071 1073
1072// static 1074// static
1073BOOL LLVOAvatar::areAllNearbyInstancesBaked() 1075BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
1074{ 1076{
1077 BOOL res = TRUE;
1078 grey_avatars = 0;
1075 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); 1079 for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
1076 iter != LLCharacter::sInstances.end(); ++iter) 1080 iter != LLCharacter::sInstances.end(); ++iter)
1077 { 1081 {
@@ -1080,18 +1084,22 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked()
1080 { 1084 {
1081 continue; 1085 continue;
1082 } 1086 }
1083 else 1087// else
1084 if( inst->getPixelArea() < MIN_PIXEL_AREA_FOR_COMPOSITE ) 1088// if( inst->getPixelArea() < MIN_PIXEL_AREA_FOR_COMPOSITE )
1085 { 1089// {
1086 return TRUE; // Assumes sInstances is sorted by pixel area. 1090// return res; // Assumes sInstances is sorted by pixel area.
1087 } 1091// }
1088 else 1092 else
1089 if( !inst->isFullyBaked() ) 1093 if( !inst->isFullyBaked() )
1090 { 1094 {
1091 return FALSE; 1095 res = FALSE;
1096 if (inst->mHasGrey)
1097 {
1098 ++grey_avatars;
1099 }
1092 } 1100 }
1093 } 1101 }
1094 return TRUE; 1102 return res;
1095} 1103}
1096 1104
1097// static 1105// static
@@ -1602,7 +1610,7 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
1602 ) 1610 )
1603{ 1611{
1604 1612
1605 if (mIsSelf && !gAgent.needsRenderAvatar()) 1613 if (mIsSelf && !gAgent.needsRenderAvatar() || !LLPipeline::sPickAvatar)
1606 { 1614 {
1607 return FALSE; 1615 return FALSE;
1608 } 1616 }
@@ -4523,6 +4531,7 @@ void LLVOAvatar::updateTextures(LLAgent &agent)
4523 4531
4524 mMaxPixelArea = 0.f; 4532 mMaxPixelArea = 0.f;
4525 mMinPixelArea = 99999999.f; 4533 mMinPixelArea = 99999999.f;
4534 mHasGrey = FALSE; // debug
4526 for (U32 i = 0; i < getNumTEs(); i++) 4535 for (U32 i = 0; i < getNumTEs(); i++)
4527 { 4536 {
4528 LLViewerImage *imagep = getTEImage(i); 4537 LLViewerImage *imagep = getTEImage(i);
@@ -4681,22 +4690,35 @@ void LLVOAvatar::updateTextures(LLAgent &agent)
4681void LLVOAvatar::addLocalTextureStats( LLVOAvatar::ELocTexIndex idx, LLViewerImage* imagep, 4690void LLVOAvatar::addLocalTextureStats( LLVOAvatar::ELocTexIndex idx, LLViewerImage* imagep,
4682 F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked ) 4691 F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked )
4683{ 4692{
4684 if (!covered_by_baked && 4693 if (!covered_by_baked && render_avatar) // render_avatar is always true if mIsSelf
4685 render_avatar && // always true if mIsSelf 4694 {
4686 mLocalTexture[ idx ].notNull() && mLocalTexture[idx]->getID() != IMG_DEFAULT_AVATAR) 4695 if (mLocalTexture[ idx ].notNull() && mLocalTexture[idx]->getID() != IMG_DEFAULT_AVATAR)
4687 {
4688 F32 desired_pixels;
4689 if( mIsSelf )
4690 { 4696 {
4691 desired_pixels = llmin(mPixelArea, (F32)LOCTEX_IMAGE_AREA_SELF ); 4697 F32 desired_pixels;
4692 imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR_SELF); 4698 if( mIsSelf )
4699 {
4700 desired_pixels = llmin(mPixelArea, (F32)LOCTEX_IMAGE_AREA_SELF );
4701 imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR_SELF);
4702 }
4703 else
4704 {
4705 desired_pixels = llmin(mPixelArea, (F32)LOCTEX_IMAGE_AREA_OTHER );
4706 imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR);
4707 }
4708 imagep->addTextureStats( desired_pixels, texel_area_ratio );
4709 if (imagep->getDiscardLevel() < 0)
4710 {
4711 mHasGrey = TRUE; // for statistics gathering
4712 }
4693 } 4713 }
4694 else 4714 else
4695 { 4715 {
4696 desired_pixels = llmin(mPixelArea, (F32)LOCTEX_IMAGE_AREA_OTHER ); 4716 if (mLocalTexture[idx]->getID() == IMG_DEFAULT_AVATAR)
4697 imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR); 4717 {
4718 // texture asset is missing
4719 mHasGrey = TRUE; // for statistics gathering
4720 }
4698 } 4721 }
4699 imagep->addTextureStats( desired_pixels, texel_area_ratio );
4700 } 4722 }
4701} 4723}
4702 4724
@@ -9126,10 +9148,17 @@ void LLVOAvatar::cullAvatarsByPixelArea()
9126 } 9148 }
9127 } 9149 }
9128 9150
9129 if( LLVOAvatar::areAllNearbyInstancesBaked() ) 9151 S32 grey_avatars = 0;
9152 if( LLVOAvatar::areAllNearbyInstancesBaked(grey_avatars) )
9130 { 9153 {
9131 LLVOAvatar::deleteCachedImages(); 9154 LLVOAvatar::deleteCachedImages();
9132 } 9155 }
9156 else
9157 {
9158 sUnbakedTime += gFrameTimeSeconds;
9159 if (grey_avatars > 0)
9160 sGreyTime += gFrameTimeSeconds;
9161 }
9133} 9162}
9134 9163
9135const LLUUID& LLVOAvatar::grabLocalTexture(ETextureIndex index) 9164const LLUUID& LLVOAvatar::grabLocalTexture(ETextureIndex index)