summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2020-10-15 18:34:15 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2020-10-15 18:34:15 +0100
commit00ab8eb6e6f1958a41ec9d6cfbdda0dd85f1dd8a (patch)
treef5845a994d06b3993094289bd0af2d460e3aa0f0
parentdc733d2c80afecb77ae27bf4f1a9b91510c888fb (diff)
SL-14130 - WIP, notes on impostor state management
-rw-r--r--indra/newview/llvoavatar.cpp11
-rw-r--r--indra/newview/pipeline.cpp2
2 files changed, 11 insertions, 2 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f45c3c86a1..cbadf4bcda 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2763,6 +2763,9 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
BOOL visible = isVisible() || mNeedsAnimUpdate;
// update attachments positions
+ // FIXME what does sUseImpostors do
+ // here? Shouldn't behavior be based on state of this avatar,
+ // rather than some piece of global state?
if (detailed_update || !sUseImpostors)
{
LL_RECORD_BLOCK_TIME(FTM_ATTACHMENT_UPDATE);
@@ -3995,7 +3998,7 @@ void LLVOAvatar::computeUpdatePeriod()
&& isVisible()
&& (!isSelf() || visually_muted)
&& !isUIAvatar()
- && sUseImpostors
+ && sUseImpostors // FIXME
&& !mNeedsAnimUpdate
&& !sFreezeCounter)
{
@@ -10240,6 +10243,7 @@ void LLVOAvatar::updateImpostors()
for (std::vector<LLCharacter*>::iterator iter = instances_copy.begin();
iter != instances_copy.end(); ++iter)
{
+ // FIXME state spaghetti! Can we just use shouldImpostor() here?
LLVOAvatar* avatar = (LLVOAvatar*) *iter;
if (!avatar->isDead()
&& avatar->isVisible()
@@ -10257,11 +10261,14 @@ void LLVOAvatar::updateImpostors()
// virtual
BOOL LLVOAvatar::isImpostor()
{
- return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE;
+ // FIXME this doesn't seem to actually mean that the avatar is currently shown as an impostor, or should be.
+ // un-impostored avs have mUpdatePeriod 1. IMPOSTOR_PERIOD is 2.
+ return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD));
}
BOOL LLVOAvatar::shouldImpostor(const U32 rank_factor) const
{
+ // FIXME sUseImpostors question
return (!isSelf() && sUseImpostors && mVisibilityRank > (sMaxNonImpostors * rank_factor));
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 82ae99309d..05f9f7800d 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -10920,6 +10920,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
{
LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_MARK_VISIBLE);
markVisible(avatar->mDrawable, *viewer_camera);
+ // FIXME temporarily hacked during impostor generation??
LLVOAvatar::sUseImpostors = false; // @TODO ???
LLVOAvatar::attachment_map_t::iterator iter;
@@ -11160,6 +11161,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
avatar->setImpostorDim(tdim);
+ // FIXME restored here. Where is this temp hack used??
LLVOAvatar::sUseImpostors = (0 != LLVOAvatar::sMaxNonImpostors);
sUseOcclusion = occlusion;
sReflectionRender = false;