summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-07-13 15:49:26 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-07-13 15:49:26 -0600
commit83b693b1343b31142a6b29a45b81c72407517240 (patch)
tree583857e5b383f06d37b04408d35c5c803bca3b11 /indra/newview
parentd9ff1c28a37b2d9d2fc876e882c55cb55d167ee8 (diff)
EXT-7940: FIXED: Max # of non-impostor avatars is off by 2
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvoavatar.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 1193471ccc..4b3434269b 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3187,29 +3187,26 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
{ // muted avatars update at 16 hz
mUpdatePeriod = 16;
}
- else if (visible && mVisibilityRank <= LLVOAvatar::sMaxVisible)
+ else if (mVisibilityRank <= LLVOAvatar::sMaxVisible)
{ //first 25% of max visible avatars are not impostored
mUpdatePeriod = 1;
}
- else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 4)
+ else if (mVisibilityRank > LLVOAvatar::sMaxVisible * 4)
{ //background avatars are REALLY slow updating impostors
mUpdatePeriod = 16;
}
- else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 3)
+ else if (mVisibilityRank > LLVOAvatar::sMaxVisible * 3)
{ //back 25% of max visible avatars are slow updating impostors
mUpdatePeriod = 8;
}
- else if (visible && mImpostorPixelArea <= impostor_area)
+ else if (mImpostorPixelArea <= impostor_area)
{ // stuff in between gets an update period based on pixel area
mUpdatePeriod = llclamp((S32) sqrtf(impostor_area*4.f/mImpostorPixelArea), 2, 8);
}
- else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible)
- { // force nearby impostors in ultra crowded areas
- mUpdatePeriod = 2;
- }
else
- { // not impostored
- mUpdatePeriod = 1;
+ {
+ //nearby avatars, update the impostors more frequently.
+ mUpdatePeriod = 4;
}
visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE;
@@ -7304,7 +7301,7 @@ void LLVOAvatar::cullAvatarsByPixelArea()
std::sort(LLCharacter::sInstances.begin(), LLCharacter::sInstances.end(), CompareScreenAreaGreater());
// Update the avatars that have changed status
- U32 rank = 0;
+ U32 rank = 2; //1 is reserved for self.
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
@@ -7328,7 +7325,7 @@ void LLVOAvatar::cullAvatarsByPixelArea()
if (inst->isSelf())
{
- inst->setVisibilityRank(0);
+ inst->setVisibilityRank(1);
}
else if (inst->mDrawable.notNull() && inst->mDrawable->isVisible())
{