summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lldrawable.cpp57
-rw-r--r--indra/newview/llvoavatar.cpp62
-rw-r--r--indra/newview/llvoavatar.h10
-rw-r--r--indra/newview/pipeline.cpp6
4 files changed, 65 insertions, 70 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index ae48db24bc..70ae4ee13f 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -1067,16 +1067,16 @@ F32 LLDrawable::getVisibilityRadius() const
{
return 0.f;
}
- else if (isLight())
+
+ if (isLight())
{
- const LLVOVolume *vov = getVOVolume();
- if (vov)
+ if (const LLVOVolume* vov = getVOVolume())
{
return llmax(getRadius(), vov->getLightRadius());
- } else {
- // LL_WARNS() ?
}
+ // LL_WARNS() ?
}
+
return getRadius();
}
@@ -1089,16 +1089,14 @@ bool LLDrawable::isVisible() const
{
if (LLViewerOctreeEntryData::isVisible())
{
- return true;
+ return true;
}
+ LLViewerOctreeGroup* group = mEntry->getGroup();
+ if (group && group->isVisible())
{
- LLViewerOctreeGroup* group = mEntry->getGroup();
- if (group && group->isVisible())
- {
- LLViewerOctreeEntryData::setVisible();
- return true;
- }
+ LLViewerOctreeEntryData::setVisible();
+ return true;
}
return false;
@@ -1107,27 +1105,30 @@ bool LLDrawable::isVisible() const
//virtual
bool LLDrawable::isRecentlyVisible() const
{
- //currently visible or visible in the previous frame.
- bool vis = LLViewerOctreeEntryData::isRecentlyVisible();
+ // Currently visible or visible in the previous frame.
+ if (LLViewerOctreeEntryData::isRecentlyVisible())
+ {
+ return true;
+ }
- if(!vis)
+ const U32 MIN_VIS_FRAME_RANGE = 2 ; // Two frames: the current one and the last one.
+ if (sCurVisible - getVisible() < MIN_VIS_FRAME_RANGE)
{
- const U32 MIN_VIS_FRAME_RANGE = 2 ; //two frames:the current one and the last one.
- vis = (sCurVisible - getVisible() < MIN_VIS_FRAME_RANGE);
+ return true;
}
- return vis ;
+ return false;
}
void LLDrawable::setGroup(LLViewerOctreeGroup *groupp)
- {
+{
LLSpatialGroup* cur_groupp = (LLSpatialGroup*)getGroup();
//precondition: mGroupp MUST be null or DEAD or mGroupp MUST NOT contain this
//llassert(!cur_groupp || cur_groupp->isDead() || !cur_groupp->hasElement(this));
//precondition: groupp MUST be null or groupp MUST contain this
- llassert(!groupp || (LLSpatialGroup*)groupp->hasElement(this));
+ llassert(!groupp || groupp->hasElement(this));
if (cur_groupp != groupp && getVOVolume())
{
@@ -1136,8 +1137,7 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp)
//contained by its drawable's spatial group
for (S32 i = 0; i < getNumFaces(); ++i)
{
- LLFace* facep = getFace(i);
- if (facep)
+ if (LLFace* facep = getFace(i))
{
facep->clearVertexBuffer();
}
@@ -1166,7 +1166,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
!getVOVolume() ||
isStatic())
{
- retval = gPipeline.getSpatialPartition((LLViewerObject*)mVObjp);
+ retval = gPipeline.getSpatialPartition(mVObjp);
}
else if (isRoot())
{
@@ -1274,13 +1274,12 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, bool render_by_group, U32 dat
LLSpatialBridge::~LLSpatialBridge()
{
- if(mEntry)
+ if (mEntry)
{
- LLSpatialGroup* group = getSpatialGroup();
- if (group)
- {
- group->getSpatialPartition()->remove(this, group);
- }
+ if (LLSpatialGroup* group = getSpatialGroup())
+ {
+ group->getSpatialPartition()->remove(this, group);
+ }
}
//delete octree here so listeners will still be able to access bridge specific state
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 797f2d27ce..02e4e6bef2 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4936,27 +4936,22 @@ void LLVOAvatar::updateVisibility()
{
visible = true;
}
- else
- {
- visible = false;
- }
- if(isSelf())
+ if (isSelf())
{
if (!gAgentWearables.areWearablesLoaded())
{
visible = false;
}
}
- else if( !mFirstAppearanceMessageReceived )
+ else if (!mFirstAppearanceMessageReceived)
{
visible = false;
}
if (sDebugInvisible)
{
- LLNameValue* firstname = getNVPair("FirstName");
- if (firstname)
+ if (LLNameValue* firstname = getNVPair("FirstName"))
{
LL_DEBUGS("Avatar") << avString() << " updating visibility" << LL_ENDL;
}
@@ -5045,10 +5040,11 @@ void LLVOAvatar::updateVisibility()
}
}
- if ( visible != mVisible )
+ if (visible != mVisible)
{
LL_DEBUGS("AvatarRender") << "visible was " << mVisible << " now " << visible << LL_ENDL;
}
+
mVisible = visible;
mVisibilityPreference = visible ? getPixelArea() : 0;
@@ -9796,7 +9792,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte
setCompositeUpdatesEnabled( true );
// If all of the avatars are completely baked, release the global image caches to conserve memory.
- LLVOAvatar::cullAvatarsByPixelArea();
+ cullAvatarsByPixelArea();
if (isSelf())
{
@@ -10428,12 +10424,10 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
void LLVOAvatar::setVisibilityRank(U32 rank)
{
- if (mDrawable.isNull() || mDrawable->isDead())
+ if (mDrawable.notNull() && !mDrawable->isDead())
{
- // do nothing
- return;
+ mVisibilityRank = rank;
}
- mVisibilityRank = rank;
}
// Assumes LLVOAvatar::sInstances has already been sorted.
@@ -10468,28 +10462,30 @@ void LLVOAvatar::cullAvatarsByPixelArea()
});
// Update the avatars that have changed status
+ U32 rank = 2; // Rank 1 is reserved for self.
+ for (LLCharacter* character : LLCharacter::sInstances)
{
- U32 rank = 2; //1 is reserved for self.
- for (LLCharacter* character : LLCharacter::sInstances)
- {
- LLVOAvatar* inst = (LLVOAvatar*)character;
- bool culled = !inst->isSelf() && !inst->isFullyBaked();
+ LLVOAvatar* inst = (LLVOAvatar*)character;
+ bool culled = !inst->isSelf() && !inst->isFullyBaked();
- if (inst->mCulled != culled)
- {
- inst->mCulled = culled;
- LL_DEBUGS() << "avatar " << inst->getID() << (culled ? " start culled" : " start not culled" ) << LL_ENDL;
- inst->updateMeshTextures();
- }
+ if (inst->mCulled != culled)
+ {
+ inst->mCulled = culled;
+ LL_DEBUGS() << "avatar " << inst->getID() << (culled ? " start culled" : " start not culled" ) << LL_ENDL;
+ inst->updateMeshTextures();
+ }
- if (inst->isSelf())
- {
- inst->setVisibilityRank(1);
- }
- else if (inst->mDrawable.notNull() && inst->mDrawable->isVisible())
- {
- inst->setVisibilityRank(rank++);
- }
+ if (inst->isSelf())
+ {
+ inst->setVisibilityRank(1);
+ }
+ else if (inst->mDrawable.notNull() && inst->mDrawable->isVisible())
+ {
+ inst->setVisibilityRank(rank++);
+ }
+ else
+ {
+ inst->setVisibilityRank(sMaxNonImpostors * 5);
}
}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 963eed311d..2efb232704 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -127,18 +127,18 @@ public:
/*virtual*/ void updateGL();
/*virtual*/ LLVOAvatar* asAvatar();
- virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
+ virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num,
const EObjectUpdateType update_type,
LLDataPacker *dp);
- virtual void idleUpdate(LLAgent &agent, const F64 &time);
+ virtual void idleUpdate(LLAgent &agent, const F64 &time);
/*virtual*/ bool updateLOD();
- bool updateJointLODs();
- void updateLODRiggedAttachments( void );
+ bool updateJointLODs();
+ void updateLODRiggedAttachments(void);
void setCorrectedPixelArea(F32 area);
/*virtual*/ bool isActive() const; // Whether this object needs to do an idleUpdate.
- S32Bytes totalTextureMemForUUIDS(std::set<LLUUID>& ids);
+ S32Bytes totalTextureMemForUUIDS(std::set<LLUUID>& ids);
bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const;
bool allLocalTexturesCompletelyDownloaded() const;
bool allBakedTexturesCompletelyDownloaded() const;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 9b7e0e8839..f37257feb0 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2109,9 +2109,9 @@ F32 LLPipeline::calcPixelArea(const LLVector4a& center, const LLVector4a& size,
}
//get area of circle around node
- F32 app_angle = atanf(size.getLength3().getF32()/dist);
- F32 radius = app_angle*LLDrawable::sCurPixelAngle;
- return radius*radius * F_PI;
+ F32 app_angle = atanf(size.getLength3().getF32() / dist);
+ F32 radius = app_angle * LLDrawable::sCurPixelAngle;
+ return radius * radius * F_PI;
}
void LLPipeline::grabReferences(LLCullResult& result)