...
 
Commits (6)
......@@ -58,7 +58,7 @@ struct LLDrivenEntry
//-----------------------------------------------------------------------------
class LLDriverParamInfo : public LLViewerVisualParamInfo
class LLDriverParamInfo final : public LLViewerVisualParamInfo
{
friend class LLDriverParam;
public:
......@@ -78,7 +78,7 @@ class LLDriverParamInfo : public LLViewerVisualParamInfo
//-----------------------------------------------------------------------------
LL_ALIGN_PREFIX(16)
class LLDriverParam : public LLViewerVisualParam
class LLDriverParam final : public LLViewerVisualParam
{
private:
// Hide the default constructor. Force construction with LLAvatarAppearance.
......@@ -116,7 +116,8 @@ class LLDriverParam : public LLViewerVisualParam
/*virtual*/ void stopAnimating();
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
/*virtual*/ void resetDrivenParams();
/*virtual*/ bool isDriverParam() { return true; }
// LLViewerVisualParam Virtual functions
/*virtual*/ F32 getTotalDistortion();
/*virtual*/ const LLVector4a& getAvgDistortion();
......
......@@ -553,7 +553,7 @@ void LLWearable::revertValues()
S32 id = iter->first;
F32 value = iter->second;
LLVisualParam *param = getVisualParam(id);
if(param && !dynamic_cast<LLDriverParam*>(param) )
if(param && !param->isDriverParam() )
{
setVisualParamWeight(id, value);
}
......@@ -565,7 +565,7 @@ void LLWearable::revertValues()
S32 id = iter->first;
F32 value = iter->second;
LLVisualParam *param = getVisualParam(id);
if(param && dynamic_cast<LLDriverParam*>(param) )
if(param && param->isDriverParam())
{
setVisualParamWeight(id, value);
}
......
......@@ -198,11 +198,10 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type)
{
if( param )
{
LLDriverParam *driver_param = dynamic_cast<LLDriverParam*>(param);
if(driver_param)
if(param->isDriverParam())
{
// parameter is a driver parameter, have it update its cross-driven params
driver_param->updateCrossDrivenParams(type);
static_cast<LLDriverParam*>(param)->updateCrossDrivenParams(type);
}
}
}
......
......@@ -290,8 +290,8 @@ void LLCharacter::removeAnimationData(const std::string& name)
BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight)
{
S32 index = which_param->getID();
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
if (index_iter != mVisualParamIndexMap.end())
auto index_iter = mVisualParamIndexHashmap.find(index);
if (index_iter != mVisualParamIndexHashmap.end())
{
index_iter->second->setWeight(weight);
return TRUE;
......@@ -322,8 +322,8 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight)
//-----------------------------------------------------------------------------
BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight)
{
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
if (index_iter != mVisualParamIndexMap.end())
auto index_iter = mVisualParamIndexHashmap.find(index);
if (index_iter != mVisualParamIndexHashmap.end())
{
index_iter->second->setWeight(weight);
return TRUE;
......@@ -338,8 +338,8 @@ BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight)
F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param)
{
S32 index = which_param->getID();
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
if (index_iter != mVisualParamIndexMap.end())
auto index_iter = mVisualParamIndexHashmap.find(index);
if (index_iter != mVisualParamIndexHashmap.end())
{
return index_iter->second->getWeight();
}
......@@ -372,8 +372,8 @@ F32 LLCharacter::getVisualParamWeight(const char* param_name)
//-----------------------------------------------------------------------------
F32 LLCharacter::getVisualParamWeight(S32 index)
{
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
if (index_iter != mVisualParamIndexMap.end())
auto index_iter = mVisualParamIndexHashmap.find(index);
if (index_iter != mVisualParamIndexHashmap.end())
{
return index_iter->second->getWeight();
}
......@@ -389,10 +389,9 @@ F32 LLCharacter::getVisualParamWeight(S32 index)
//-----------------------------------------------------------------------------
void LLCharacter::clearVisualParamWeights()
{
for (LLVisualParam *param = getFirstVisualParam();
param;
param = getNextVisualParam())
for (const auto& param_pair : mVisualParamIndexHashmap)
{
LLVisualParam* param = param_pair.second;
if (param->isTweakable())
{
param->setWeight( param->getDefaultWeight());
......@@ -423,9 +422,9 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name)
void LLCharacter::addSharedVisualParam(LLVisualParam *param)
{
S32 index = param->getID();
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
LLVisualParam* current_param = 0;
if (index_iter != mVisualParamIndexMap.end())
auto index_iter = mVisualParamIndexHashmap.find(index);
LLVisualParam* current_param = nullptr;
if (index_iter != mVisualParamIndexHashmap.end())
current_param = index_iter->second;
if( current_param )
{
......@@ -450,8 +449,7 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
{
S32 index = param->getID();
// Add Index map
std::pair<visual_param_index_map_t::iterator, bool> idxres;
idxres = mVisualParamIndexMap.insert(visual_param_index_map_t::value_type(index, param));
auto idxres = mVisualParamIndexMap.emplace(index, param);
if (!idxres.second)
{
LL_WARNS() << "Visual parameter " << param->getName() << " already exists with same ID as " <<
......@@ -460,6 +458,16 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
index_iter->second = param;
}
// Add Index map
auto idxreshash = mVisualParamIndexHashmap.emplace(index, param);
if (!idxreshash.second)
{
LL_WARNS() << "Visual parameter " << param->getName() << " already exists with same ID as " <<
param->getName() << LL_ENDL;
auto index_iter = idxreshash.first;
index_iter->second = param;
}
if (param->getInfo())
{
// Add name map
......@@ -467,7 +475,7 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
LLStringUtil::toLower(tname);
char *tableptr = sVisualParamNames.addString(tname);
std::pair<visual_param_name_map_t::iterator, bool> nameres;
nameres = mVisualParamNameMap.insert(visual_param_name_map_t::value_type(tableptr, param));
nameres = mVisualParamNameMap.emplace(tableptr, param);
if (!nameres.second)
{
// Already exists, copy param
......@@ -483,10 +491,9 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
//-----------------------------------------------------------------------------
void LLCharacter::updateVisualParams()
{
for (LLVisualParam *param = getFirstVisualParam();
param;
param = getNextVisualParam())
for (const auto& param_pair : mVisualParamIndexHashmap)
{
LLVisualParam* param = param_pair.second;
if (param->isAnimating())
{
continue;
......
......@@ -234,12 +234,12 @@ class LLCharacter
LLVisualParam* getVisualParam(S32 id) const
{
visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.find(id);
return (iter == mVisualParamIndexMap.end()) ? 0 : iter->second;
visual_param_index_hashmap_t::const_iterator iter = mVisualParamIndexHashmap.find(id);
return (iter == mVisualParamIndexHashmap.end()) ? 0 : iter->second;
}
S32 getVisualParamID(LLVisualParam *id)
{
for (const auto& param_pair : mVisualParamIndexMap)
for (const auto& param_pair : mVisualParamIndexHashmap)
{
if (param_pair.second == id)
return param_pair.first;
......@@ -280,10 +280,12 @@ class LLCharacter
private:
// visual parameter stuff
typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;
typedef std::map<char *, LLVisualParam *> visual_param_name_map_t;
typedef absl::flat_hash_map<S32, LLVisualParam*> visual_param_index_hashmap_t;
typedef absl::flat_hash_map<char *, LLVisualParam *> visual_param_name_map_t;
visual_param_index_map_t::iterator mCurIterator;
visual_param_index_map_t mVisualParamIndexMap;
visual_param_index_hashmap_t mVisualParamIndexHashmap;
visual_param_name_map_t mVisualParamNameMap;
static LLStringTable sVisualParamNames;
......
......@@ -128,6 +128,8 @@ class LLVisualParam
virtual BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
virtual void resetDrivenParams();
virtual bool isDriverParam() { return false; }
// Interface methods
S32 getID() const { return mID; }
void setID(S32 id) { llassert(!mInfo); mID = id; }
......
......@@ -2399,94 +2399,6 @@ LLGLUserClipPlane::~LLGLUserClipPlane()
disable();
}
LLGLNamePool::LLGLNamePool()
{
}
LLGLNamePool::~LLGLNamePool()
{
}
void LLGLNamePool::upkeep()
{
std::sort(mNameList.begin(), mNameList.end(), CompareUsed());
}
void LLGLNamePool::cleanup()
{
for (name_list_t::iterator iter = mNameList.begin(); iter != mNameList.end(); ++iter)
{
releaseName(iter->name);
}
mNameList.clear();
}
GLuint LLGLNamePool::allocate()
{
#if LL_GL_NAME_POOLING
for (name_list_t::iterator iter = mNameList.begin(); iter != mNameList.end(); ++iter)
{
if (!iter->used)
{
iter->used = TRUE;
return iter->name;
}
}
NameEntry entry;
entry.name = allocateName();
entry.used = TRUE;
mNameList.push_back(entry);
return entry.name;
#else
return allocateName();
#endif
}
void LLGLNamePool::release(GLuint name)
{
#if LL_GL_NAME_POOLING
for (name_list_t::iterator iter = mNameList.begin(); iter != mNameList.end(); ++iter)
{
if (iter->name == name)
{
if (iter->used)
{
iter->used = FALSE;
return;
}
else
{
LL_ERRS() << "Attempted to release a pooled name that is not in use!" << LL_ENDL;
}
}
}
LL_ERRS() << "Attempted to release a non pooled name!" << LL_ENDL;
#else
releaseName(name);
#endif
}
//static
void LLGLNamePool::upkeepPools()
{
for (auto& pool : instance_snapshot())
{
pool.upkeep();
}
}
//static
void LLGLNamePool::cleanupPools()
{
for (auto& pool : instance_snapshot())
{
pool.cleanup();
}
}
LLGLDepthTest::LLGLDepthTest(GLboolean depth_enabled, GLboolean write_enabled, GLenum depth_func)
: mPrevDepthEnabled(sDepthEnabled), mPrevDepthFunc(sDepthFunc), mPrevWriteEnabled(sWriteEnabled)
{
......
......@@ -377,51 +377,6 @@ class LLGLSquashToFarClip
~LLGLSquashToFarClip();
};
/*
Generic pooling scheme for things which use GL names (used for occlusion queries and vertex buffer objects).
Prevents thrashing of GL name caches by avoiding calls to glGenFoo and glDeleteFoo.
*/
class LLGLNamePool : public LLInstanceTracker<LLGLNamePool>
{
public:
typedef LLInstanceTracker<LLGLNamePool> tracker_t;
struct NameEntry
{
GLuint name;
BOOL used;
};
struct CompareUsed
{
bool operator()(const NameEntry& lhs, const NameEntry& rhs)
{
return lhs.used < rhs.used; //FALSE entries first
}
};
typedef std::vector<NameEntry> name_list_t;
name_list_t mNameList;
LLGLNamePool();
virtual ~LLGLNamePool();
void upkeep();
void cleanup();
GLuint allocate();
void release(GLuint name);
static void upkeepPools();
static void cleanupPools();
protected:
typedef std::vector<LLGLNamePool*> pool_list_t;
virtual GLuint allocateName() = 0;
virtual void releaseName(GLuint name) = 0;
};
/*
Interface for objects that need periodic GL updates applied to them.
Used to synchronize GL updates with GL thread.
......
......@@ -660,8 +660,8 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
0.0f,
1.0f);
LLDriverParam *driver_param = dynamic_cast<LLDriverParam *>(mParamDriver);
llassert_always(driver_param);
LLDriverParam *driver_param = static_cast<LLDriverParam *>(mParamDriver);
llassert_always(mParamDriver->isDriverParam());
if (driver_param)
{
// If this is one of our "hidden" driver params, then make sure it's
......@@ -697,7 +697,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor);
const F32 pixel_area = sqrtf(mCharacter->getPixelArea());
const BOOL is_self = (dynamic_cast<LLVOAvatarSelf *>(mCharacter) != NULL);
const BOOL is_self = static_cast<LLVOAvatar*>(mCharacter)->isSelf();
if ((pixel_area > area_for_this_setting) || is_self)
{
const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local_clamped);
......
......@@ -833,7 +833,7 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
// changes local camera and broadcasts change
/* virtual */ void LLViewerCamera::setView(F32 vertical_fov_rads)
{
F32 old_fov = LLViewerCamera::getInstance()->getView();
F32 old_fov = getView();
// cap the FoV
vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView());
......
......@@ -663,9 +663,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_HUD_PARTICLES);
}
//upkeep gl name pools
LLGLNamePool::upkeepPools();
stop_glerror();
display_update_camera();
stop_glerror();
......
......@@ -787,16 +787,12 @@ void LLViewerOctreeGroup::checkStates()
//occulsion culling functions and classes
//-------------------------------------------------------------------------------------------
std::set<U32> LLOcclusionCullingGroup::sPendingQueries;
class LLOcclusionQueryPool : public LLGLNamePool
class LLOcclusionQueryPool
{
public:
LLOcclusionQueryPool()
{
}
protected:
LLOcclusionQueryPool() = default;
virtual GLuint allocateName()
GLuint allocateName()
{
GLuint ret = 0;
......@@ -805,7 +801,7 @@ class LLOcclusionQueryPool : public LLGLNamePool
return ret;
}
virtual void releaseName(GLuint name)
void releaseName(GLuint name)
{
#if LL_TRACK_PENDING_OCCLUSION_QUERIES
LLOcclusionCullingGroup::sPendingQueries.erase(name);
......@@ -817,12 +813,12 @@ class LLOcclusionQueryPool : public LLGLNamePool
static LLOcclusionQueryPool sQueryPool;
U32 LLOcclusionCullingGroup::getNewOcclusionQueryObjectName()
{
return sQueryPool.allocate();
return sQueryPool.allocateName();
}
void LLOcclusionCullingGroup::releaseOcclusionQueryObjectName(GLuint name)
{
sQueryPool.release(name);
sQueryPool.releaseName(name);
}
//=====================================
......
......@@ -321,12 +321,12 @@ void LLViewerTexLayerSet::setUpdatesEnabled( BOOL b )
LLVOAvatarSelf* LLViewerTexLayerSet::getAvatar()
{
return dynamic_cast<LLVOAvatarSelf*> (mAvatarAppearance);
return mAvatarAppearance->isSelf() ? static_cast<LLVOAvatarSelf*>(mAvatarAppearance) : nullptr;
}
const LLVOAvatarSelf* LLViewerTexLayerSet::getAvatar() const
{
return dynamic_cast<const LLVOAvatarSelf*> (mAvatarAppearance);
return mAvatarAppearance->isSelf() ? static_cast<const LLVOAvatarSelf*>(mAvatarAppearance) : nullptr;
}
LLViewerTexLayerSetBuffer* LLViewerTexLayerSet::getViewerComposite()
......
......@@ -1986,7 +1986,7 @@ void LLVOAvatar::resetVisualParams()
++iter)
{
LLPolySkeletalDistortionInfo *info = (LLPolySkeletalDistortionInfo*)*iter;
LLPolySkeletalDistortion *param = dynamic_cast<LLPolySkeletalDistortion*>(getVisualParam(info->getID()));
LLPolySkeletalDistortion *param = static_cast<LLPolySkeletalDistortion*>(getVisualParam(info->getID()));
*param = LLPolySkeletalDistortion(this);
llassert(param);
if (!param->setInfo(info))
......@@ -2002,7 +2002,7 @@ void LLVOAvatar::resetVisualParams()
++iter)
{
LLDriverParamInfo *info = *iter;
LLDriverParam *param = dynamic_cast<LLDriverParam*>(getVisualParam(info->getID()));
LLDriverParam *param = static_cast<LLDriverParam*>(getVisualParam(info->getID()));
LLDriverParam::entry_list_t driven_list = param->getDrivenList();
*param = LLDriverParam(this);
llassert(param);
......
......@@ -258,10 +258,8 @@ void LLWorld::removeRegion(const LLHost &host)
if (regionp == gAgent.getRegion())
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* reg : mRegionList)
{
LLViewerRegion* reg = *iter;
LL_WARNS() << "RegionDump: " << reg->getName()
<< " " << reg->getHost()
<< " " << reg->getOriginGlobal()
......@@ -305,10 +303,8 @@ void LLWorld::removeRegion(const LLHost &host)
LLViewerRegion* LLWorld::getRegion(const LLHost &host)
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
if (regionp->getHost() == host)
{
return regionp;
......@@ -324,10 +320,8 @@ LLViewerRegion* LLWorld::getRegionFromPosAgent(const LLVector3 &pos)
LLViewerRegion* LLWorld::getRegionFromPosGlobal(const LLVector3d &pos)
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
if (regionp->pointInRegionGlobal(pos))
{
return regionp;
......@@ -402,16 +396,14 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe
final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], 0.0,
(F64)(region_width - F_ALMOST_ZERO));
final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0,
(F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO));
(F64)(getRegionMaxHeight() - F_ALMOST_ZERO));
return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos));
}
LLViewerRegion* LLWorld::getRegionFromHandle(const U64 &handle)
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
if (regionp->getHandle() == handle)
{
return regionp;
......@@ -422,10 +414,8 @@ LLViewerRegion* LLWorld::getRegionFromHandle(const U64 &handle)
LLViewerRegion* LLWorld::getRegionFromID(const LLUUID& region_id)
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
if (regionp->getRegionID() == region_id)
{
return regionp;
......@@ -437,10 +427,8 @@ LLViewerRegion* LLWorld::getRegionFromID(const LLUUID& region_id)
void LLWorld::updateAgentOffset(const LLVector3d &offset_global)
{
#if 0
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
regionp->setAgentOffset(offset_global);
}
#endif
......@@ -449,10 +437,8 @@ void LLWorld::updateAgentOffset(const LLVector3d &offset_global)
BOOL LLWorld::positionRegionValidGlobal(const LLVector3d &pos_global)
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
if (regionp->pointInRegionGlobal(pos_global))
{
return TRUE;
......@@ -704,10 +690,8 @@ void LLWorld::updateRegions(F32 max_update_time)
//sort regions by its mLastUpdate
//smaller mLastUpdate first to make sure every region has chance to get updated.
LLViewerRegion::region_priority_list_t region_list;
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
if(regionp != self_regionp)
{
region_list.insert(regionp);
......@@ -716,8 +700,7 @@ void LLWorld::updateRegions(F32 max_update_time)
}
// Perform idle time updates for the regions (and associated surfaces)
for (LLViewerRegion::region_priority_list_t::iterator iter = region_list.begin();
iter != region_list.end(); ++iter)
for (LLViewerRegion* regionp : region_list)
{
if(max_time > 0.f)
{
......@@ -726,12 +709,12 @@ void LLWorld::updateRegions(F32 max_update_time)
if(max_time > 0.f)
{
(*iter)->idleUpdate(max_time);
regionp->idleUpdate(max_time);
}
else
{
//perform some necessary but very light updates.
(*iter)->lightIdleUpdate();
regionp->lightIdleUpdate();
}
}
......@@ -773,10 +756,8 @@ void LLWorld::updateNetStats()
F64Bits bits;
U32 packets = 0;
for (region_list_t::iterator iter = mActiveRegionList.begin();
iter != mActiveRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mActiveRegionList)
{
LLViewerRegion* regionp = *iter;
regionp->updateNetStats();
bits += regionp->mBitsReceived;
packets += llfloor( regionp->mPacketsReceived );
......@@ -817,10 +798,8 @@ void LLWorld::printPacketsLost()
LL_INFOS() << "----------" << LL_ENDL;
LLCircuitData *cdp = NULL;
for (region_list_t::iterator iter = mActiveRegionList.begin();
iter != mActiveRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mActiveRegionList)
{
LLViewerRegion* regionp = *iter;
cdp = gMessageSystem->mCircuitInfo.findCircuit(regionp->getHost());
if (cdp)
{
......@@ -865,11 +844,11 @@ void LLWorld::setLandFarClip(const F32 far_clip)
// a (possibly) new water height. Update it in our local copy.
void LLWorld::waterHeightRegionInfo(std::string const& sim_name, F32 water_height)
{
for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
if ((*iter)->getName() == sim_name)
if (regionp->getName() == sim_name)
{
(*iter)->setWaterHeight(water_height);
regionp->setWaterHeight(water_height);
break;
}
}
......@@ -888,10 +867,8 @@ void LLWorld::precullWaterObjects(LLCamera& camera, LLCullResult* cull, bool inc
return;
}
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
LLVOWater* waterp = regionp->getLand().getWaterObj();
if (waterp && waterp->mDrawable)
{
......@@ -958,10 +935,8 @@ void LLWorld::updateWaterObjects()
max_x = (S32)region_x + range;
max_y = (S32)region_y + range;
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
LLVOWater* waterp = regionp->getLand().getWaterObj();
if (waterp)
{
......@@ -1070,9 +1045,8 @@ void LLWorld::updateWaterObjects()
void LLWorld::shiftRegions(const LLVector3& offset)
{
for (region_list_t::const_iterator i = getRegionList().begin(); i != getRegionList().end(); ++i)
for (LLViewerRegion* region : getRegionList())
{
LLViewerRegion* region = *i;
region->updateRenderMatrix();
}
......@@ -1096,10 +1070,8 @@ U64MicrosecondsImplicit LLWorld::getSpaceTimeUSec() const
void LLWorld::requestCacheMisses()
{
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
regionp->requestCacheMisses();
}
}
......@@ -1107,10 +1079,8 @@ void LLWorld::requestCacheMisses()
void LLWorld::getInfo(LLSD& info)
{
LLSD region_info;
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
for (LLViewerRegion* regionp : mRegionList)
{
regionp->getInfo(region_info);
info["World"].append(region_info);
}
......@@ -1119,10 +1089,8 @@ void LLWorld::getInfo(LLSD& info)
void LLWorld::disconnectRegions()
{
LLMessageSystem* msg = gMessageSystem;
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
for (LLViewerRegion* regionp : mRegionList)
{
LLViewerRegion* regionp = *iter;
if (regionp == gAgent.getRegion())
{
// Skip the main agent
......@@ -1352,7 +1320,7 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
}
}
// region avatars added for situations where radius is greater than RenderFarClip
for (LLViewerRegion* regionp : LLWorld::getInstance()->getRegionList())
for (LLViewerRegion* regionp : getRegionList())
{
const LLVector3d& origin_global = regionp->getOriginGlobal();
S32 count = regionp->mMapAvatars.size();
......@@ -1404,7 +1372,7 @@ void LLWorld::getAvatars(pos_map_t* umap, const LLVector3d& relative_to, F32 rad
}
}
// region avatars added for situations where radius is greater than RenderFarClip
for (LLViewerRegion* regionp : LLWorld::getInstance()->getRegionList())
for (LLViewerRegion* regionp : getRegionList())
{
const LLVector3d& origin_global = regionp->getOriginGlobal();
S32 count = regionp->mMapAvatars.size();
......@@ -1451,7 +1419,7 @@ void LLWorld::getAvatars(region_gpos_map_t* umap, const LLVector3d& relative_to,
}
}
// region avatars added for situations where radius is greater than RenderFarClip
for (LLViewerRegion* regionp : LLWorld::getInstance()->getRegionList())
for (LLViewerRegion* regionp : getRegionList())
{
const LLVector3d& origin_global = regionp->getOriginGlobal();
size_t count = regionp->mMapAvatars.size();
......@@ -1482,7 +1450,7 @@ bool LLWorld::getAvatar(const LLUUID& idAvatar, LLVector3d& posAvatar) const
}
}
for (const LLViewerRegion* pRegion : LLWorld::getInstance()->getRegionList())
for (const LLViewerRegion* pRegion : getRegionList())
{
for (S32 idxAgent = 0, cntAgent = pRegion->mMapAvatarIDs.size(); idxAgent < cntAgent; ++idxAgent)
{
......
......@@ -7397,11 +7397,6 @@ void LLPipeline::doResetVertexBuffers(bool forced)
SUBSYSTEM_CLEANUP(LLVertexBuffer);
//delete all name pool caches
LLGLNamePool::cleanupPools();
if (LLVertexBuffer::sGLCount > 0)
{
LL_WARNS() << "VBO wipe failed -- " << LLVertexBuffer::sGLCount << " buffers remaining." << LL_ENDL;
......