summaryrefslogtreecommitdiff
path: root/indra/newview/llworld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r--indra/newview/llworld.cpp63
1 files changed, 28 insertions, 35 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 2eadea20ef..40bfa8ec83 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -805,10 +805,10 @@ void LLWorld::updateNetStats()
add(LLStatViewer::PACKETS_OUT, packets_out);
add(LLStatViewer::PACKETS_LOST, packets_lost);
- F32 total_packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN);
- if (total_packets_in > 0)
+ F32 total_packets_in = (F32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN);
+ if (total_packets_in > 0.f)
{
- F32 total_packets_lost = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST);
+ F32 total_packets_lost = (F32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST);
sample(LLStatViewer::PACKETS_LOST_PERCENT, LLUnits::Ratio::fromValue((F32)total_packets_lost/(F32)total_packets_in));
}
@@ -961,7 +961,6 @@ void LLWorld::updateWaterObjects()
if (!getRegionFromHandle(region_handle))
{ // No region at that area, so make water
LLVOWater* waterp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, gAgent.getRegion());
- waterp->setUseTexture(false);
waterp->setPositionGlobal(LLVector3d(x + rwidth/2,
y + rwidth/2,
256.f + water_height));
@@ -1015,7 +1014,6 @@ void LLWorld::updateWaterObjects()
mEdgeWaterObjects[dir] = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_VOID_WATER,
gAgent.getRegion());
waterp = mEdgeWaterObjects[dir];
- waterp->setUseTexture(false);
waterp->setIsEdgePatch(true);
gPipeline.createObject(waterp);
}
@@ -1266,7 +1264,7 @@ void send_agent_pause()
void send_agent_resume()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
// Note: used to check for LLWorld initialization before it became a singleton.
// Rather than just remove this check I'm changing it to assure that the message
// system has been initialized. -MG
@@ -1322,35 +1320,32 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
}
// get the list of avatars from the character list first, so distances are correct
// when agent is above 1020m and other avatars are nearby
- for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
- iter != LLCharacter::sInstances.end(); ++iter)
+ for (LLCharacter* character : LLCharacter::sInstances)
{
- LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;
-
- if (!pVOAvatar->isDead() && !pVOAvatar->mIsDummy && !pVOAvatar->isOrphaned())
+ LLVOAvatar* avatar = (LLVOAvatar*)character;
+ if (!avatar->isDead() && !avatar->mIsDummy && !avatar->isOrphaned())
{
- LLVector3d pos_global = pVOAvatar->getPositionGlobal();
- LLUUID uuid = pVOAvatar->getID();
+ LLVector3d pos_global = avatar->getPositionGlobal();
+ LLUUID uuid = avatar->getID();
if (!uuid.isNull()
&& dist_vec_squared(pos_global, relative_to) <= radius_squared)
{
- if(positions != NULL)
+ if (positions != NULL)
{
positions->push_back(pos_global);
}
- if(avatar_ids !=NULL)
+ if (avatar_ids != NULL)
{
avatar_ids->push_back(uuid);
}
}
}
}
+
// region avatars added for situations where radius is greater than RenderFarClip
- for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
- iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
+ for (const LLViewerRegion* regionp : LLWorld::getInstance()->getRegionList())
{
- LLViewerRegion* regionp = *iter;
const LLVector3d& origin_global = regionp->getOriginGlobal();
auto count = regionp->mMapAvatars.size();
for (size_t i = 0; i < count; i++)
@@ -1373,33 +1368,31 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
}
}
-F32 LLWorld::getNearbyAvatarsAndMaxGPUTime(std::vector<LLCharacter*> &valid_nearby_avs)
+F32 LLWorld::getNearbyAvatarsAndMaxGPUTime(std::vector<LLVOAvatar*> &valid_nearby_avs)
{
static LLCachedControl<F32> render_far_clip(gSavedSettings, "RenderFarClip", 64);
+
F32 nearby_max_complexity = 0;
F32 radius = render_far_clip * render_far_clip;
- std::vector<LLCharacter*>::iterator char_iter = LLCharacter::sInstances.begin();
- while (char_iter != LLCharacter::sInstances.end())
+
+ for (LLCharacter* character : LLCharacter::sInstances)
{
- LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*char_iter);
- if (avatar && !avatar->isDead() && !avatar->isControlAvatar())
+ LLVOAvatar* avatar = (LLVOAvatar*)character;
+ if (!avatar->isDead() && !avatar->isControlAvatar())
{
- if ((dist_vec_squared(avatar->getPositionGlobal(), gAgent.getPositionGlobal()) > radius) &&
- (dist_vec_squared(avatar->getPositionGlobal(), gAgentCamera.getCameraPositionGlobal()) > radius))
+ if ((dist_vec_squared(avatar->getPositionGlobal(), gAgent.getPositionGlobal()) <= radius) ||
+ (dist_vec_squared(avatar->getPositionGlobal(), gAgentCamera.getCameraPositionGlobal()) <= radius))
{
- char_iter++;
- continue;
- }
-
- if (!avatar->isTooSlow())
- {
- gPipeline.profileAvatar(avatar);
+ if (!avatar->isTooSlow())
+ {
+ gPipeline.profileAvatar(avatar);
+ }
+ nearby_max_complexity = llmax(nearby_max_complexity, avatar->getGPURenderTime());
+ valid_nearby_avs.push_back(avatar);
}
- nearby_max_complexity = llmax(nearby_max_complexity, avatar->getGPURenderTime());
- valid_nearby_avs.push_back(*char_iter);
}
- char_iter++;
}
+
return nearby_max_complexity;
}