reapply 52b6c9168974: MAINT-646 Factor std::set out of lloctree

meow-7.2.2
Dave Parks 2012-09-20 09:48:55 -04:00
parent f80d16808d
commit cf98064700
17 changed files with 167 additions and 116 deletions

View File

@ -187,20 +187,14 @@ void LLCharacter::requestStopMotion( LLMotion* motion)
//-----------------------------------------------------------------------------
// updateMotions()
//-----------------------------------------------------------------------------
static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS("Update Motions");
void LLCharacter::updateMotions(e_update_t update_type)
{
if (update_type == HIDDEN_UPDATE)
{
LLFastTimer t(FTM_UPDATE_HIDDEN_ANIMATION);
mMotionController.updateMotionsMinimal();
}
else
{
LLFastTimer t(FTM_UPDATE_ANIMATION);
// unpause if the number of outstanding pause requests has dropped to the initial one
if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1)
{
@ -208,7 +202,6 @@ void LLCharacter::updateMotions(e_update_t update_type)
}
bool force_update = (update_type == FORCE_UPDATE);
{
LLFastTimer t(FTM_UPDATE_MOTIONS);
mMotionController.updateMotions(force_update);
}
}

View File

@ -158,14 +158,11 @@ BOOL LLEditingMotion::onActivate()
return TRUE;
}
static LLFastTimer::DeclareTimer FTM_EDITING_MOTION("Editing Motion");
//-----------------------------------------------------------------------------
// LLEditingMotion::onUpdate()
//-----------------------------------------------------------------------------
BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
{
LLFastTimer t(FTM_EDITING_MOTION);
LLVector3 focus_pt;
LLVector3* pointAtPt = (LLVector3*)mCharacter->getAnimationData("PointAtPoint");

View File

@ -196,15 +196,11 @@ BOOL LLWalkAdjustMotion::onActivate()
return TRUE;
}
static LLFastTimer::DeclareTimer FTM_WALK_ADJUST_MOTION("Walk Adjust");
//-----------------------------------------------------------------------------
// LLWalkAdjustMotion::onUpdate()
//-----------------------------------------------------------------------------
BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
{
LLFastTimer t(FTM_WALK_ADJUST_MOTION);
// delta_time is guaranteed to be non zero
F32 delta_time = llclamp(time - mLastTime, TIME_EPSILON, MAX_TIME_DELTA);
mLastTime = time;

View File

@ -539,14 +539,11 @@ void LLMotionController::updateIdleActiveMotions()
}
}
static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS_BY_TYPE("Update Motions By Type");
//-----------------------------------------------------------------------------
// updateMotionsByType()
//-----------------------------------------------------------------------------
void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
{
LLFastTimer t(FTM_UPDATE_MOTIONS_BY_TYPE);
BOOL update_result = TRUE;
U8 last_joint_signature[LL_CHARACTER_MAX_JOINTS];
@ -798,9 +795,6 @@ void LLMotionController::updateLoadingMotions()
// call updateMotion() or updateMotionsMinimal() every frame
//-----------------------------------------------------------------------------
static LLFastTimer::DeclareTimer FTM_UPDATE_MOTION_PURGE_EXCESS("Purge Excess Motions");
static LLFastTimer::DeclareTimer FTM_UPDATE_LOADING_MOTIONS("Update Loading Motions");
//-----------------------------------------------------------------------------
// updateMotion()
//-----------------------------------------------------------------------------
@ -814,12 +808,9 @@ void LLMotionController::updateMotions(bool force_update)
mPrevTimerElapsed = cur_time;
mLastTime = mAnimTime;
{
LLFastTimer t(FTM_UPDATE_MOTION_PURGE_EXCESS);
// Always cap the number of loaded motions
purgeExcessMotions();
}
// Always cap the number of loaded motions
purgeExcessMotions();
// Update timing info for this time step.
if (!mPaused)
{
@ -840,11 +831,8 @@ void LLMotionController::updateMotions(bool force_update)
mLastInterp = interp;
}
{
LLFastTimer t(FTM_UPDATE_LOADING_MOTIONS);
updateLoadingMotions();
}
updateLoadingMotions();
return;
}
@ -862,11 +850,8 @@ void LLMotionController::updateMotions(bool force_update)
}
}
{
LLFastTimer t(FTM_UPDATE_LOADING_MOTIONS);
updateLoadingMotions();
}
updateLoadingMotions();
resetJointSignatures();
if (mPaused && !force_update)

View File

@ -79,9 +79,9 @@ public:
typedef LLOctreeTraveler<T> oct_traveler;
typedef LLTreeTraveler<T> tree_traveler;
typedef typename std::set<LLPointer<T> > element_list;
typedef typename element_list::iterator element_iter;
typedef typename element_list::const_iterator const_element_iter;
typedef LLPointer<T>* element_list;
typedef LLPointer<T>* element_iter;
typedef const LLPointer<T>* const_element_iter;
typedef typename std::vector<LLTreeListener<T>*>::iterator tree_listener_iter;
typedef typename std::vector<LLOctreeNode<T>* > child_list;
typedef LLTreeNode<T> BaseType;
@ -105,6 +105,9 @@ public:
: mParent((oct_node*)parent),
mOctant(octant)
{
mData = NULL;
mDataEnd = NULL;
mCenter = center;
mSize = size;
@ -123,6 +126,16 @@ public:
{
BaseType::destroyListeners();
for (U32 i = 0; i < mElementCount; ++i)
{
mData[i]->setBinIndex(-1);
mData[i] = NULL;
}
free(mData);
mData = NULL;
mDataEnd = NULL;
for (U32 i = 0; i < getChildCount(); i++)
{
delete getChild(i);
@ -222,9 +235,14 @@ public:
virtual bool isLeaf() const { return mChild.empty(); }
U32 getElementCount() const { return mElementCount; }
bool isEmpty() const { return mElementCount == 0; }
element_list& getData() { return mData; }
const element_list& getData() const { return mData; }
element_iter getDataBegin() { return mData; }
element_iter getDataEnd() { return mDataEnd; }
const_element_iter getDataBegin() const { return mData; }
const_element_iter getDataEnd() const { return mDataEnd; }
U32 getChildCount() const { return mChildCount; }
oct_node* getChild(U32 index) { return mChild[index]; }
const oct_node* getChild(U32 index) const { return mChild[index]; }
@ -289,7 +307,7 @@ public:
virtual bool insert(T* data)
{
if (data == NULL)
if (data == NULL || data->getBinIndex() != -1)
{
OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE BRANCH !!!" << llendl;
return false;
@ -302,13 +320,16 @@ public:
if ((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius()) ||
(data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity)))
{ //it belongs here
//if this is a redundant insertion, error out (should never happen)
llassert(mData.find(data) == mData.end());
mElementCount++;
mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount);
mData.insert(data);
//avoid unref on uninitialized memory
memset(mData+mElementCount-1, 0, sizeof(LLPointer<T>));
mData[mElementCount-1] = data;
mDataEnd = mData + mElementCount;
data->setBinIndex(mElementCount-1);
BaseType::insert(data);
mElementCount = mData.size();
return true;
}
else
@ -342,10 +363,16 @@ public:
if( lt == 0x7 )
{
mData.insert(data);
BaseType::insert(data);
mElementCount++;
mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount);
mElementCount = mData.size();
//avoid unref on uninitialized memory
memset(mData+mElementCount-1, 0, sizeof(LLPointer<T>));
mData[mElementCount-1] = data;
mDataEnd = mData + mElementCount;
data->setBinIndex(mElementCount-1);
BaseType::insert(data);
return true;
}
@ -394,23 +421,59 @@ public:
return false;
}
void _remove(T* data, S32 i)
{ //precondition -- mElementCount > 0, idx is in range [0, mElementCount)
mElementCount--;
data->setBinIndex(-1);
if (mElementCount > 0)
{
if (mElementCount != i)
{
mData[i] = mData[mElementCount]; //might unref data, do not access data after this point
mData[i]->setBinIndex(i);
}
mData[mElementCount] = NULL; //needed for unref
mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount);
mDataEnd = mData+mElementCount;
}
else
{
mData[0] = NULL; //needed for unref
free(mData);
mData = NULL;
mDataEnd = NULL;
}
notifyRemoval(data);
checkAlive();
}
bool remove(T* data)
{
if (mData.find(data) != mData.end())
{ //we have data
mData.erase(data);
mElementCount = mData.size();
notifyRemoval(data);
checkAlive();
return true;
S32 i = data->getBinIndex();
if (i >= 0 && i < mElementCount)
{
if (mData[i] == data)
{ //found it
_remove(data, i);
llassert(data->getBinIndex() == -1);
return true;
}
}
else if (isInside(data))
if (isInside(data))
{
oct_node* dest = getNodeAt(data);
if (dest != this)
{
return dest->remove(data);
bool ret = dest->remove(data);
llassert(data->getBinIndex() == -1);
return ret;
}
}
@ -429,19 +492,20 @@ public:
//node is now root
llwarns << "!!! OCTREE REMOVING FACE BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << llendl;
node->removeByAddress(data);
llassert(data->getBinIndex() == -1);
return true;
}
void removeByAddress(T* data)
{
if (mData.find(data) != mData.end())
for (U32 i = 0; i < mElementCount; ++i)
{
mData.erase(data);
mElementCount = mData.size();
notifyRemoval(data);
llwarns << "FOUND!" << llendl;
checkAlive();
return;
if (mData[i] == data)
{ //we have data
_remove(data, i);
llwarns << "FOUND!" << llendl;
return;
}
}
for (U32 i = 0; i < getChildCount(); i++)
@ -606,6 +670,7 @@ protected:
U32 mChildCount;
element_list mData;
element_iter mDataEnd;
U32 mElementCount;
};

View File

@ -317,16 +317,16 @@ public:
LLVector4a& min = node->mExtents[0];
LLVector4a& max = node->mExtents[1];
if (!branch->getData().empty())
if (!branch->isEmpty())
{ //node has data, find AABB that binds data set
const LLVolumeTriangle* tri = *(branch->getData().begin());
const LLVolumeTriangle* tri = *(branch->getDataBegin());
//initialize min/max to first available vertex
min = *(tri->mV[0]);
max = *(tri->mV[0]);
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter =
branch->getData().begin(); iter != branch->getData().end(); ++iter)
branch->getDataBegin(); iter != branch->getDataEnd(); ++iter)
{ //for each triangle in node
//stretch by triangles in node

View File

@ -131,7 +131,7 @@ void LLOctreeTriangleRayIntersect::traverse(const LLOctreeNode<LLVolumeTriangle>
void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle>* node)
{
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter =
node->getData().begin(); iter != node->getData().end(); ++iter)
node->getDataBegin(); iter != node->getDataEnd(); ++iter)
{
const LLVolumeTriangle* tri = *iter;
@ -236,8 +236,8 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode<LLVolumeTriangle>* branch)
}
//children fit, check data
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin();
iter != branch->getData().end(); ++iter)
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getDataBegin();
iter != branch->getDataEnd(); ++iter)
{
const LLVolumeTriangle* tri = *iter;

View File

@ -49,7 +49,7 @@ public:
LLVolumeTriangle()
{
mBinIndex = -1;
}
LLVolumeTriangle(const LLVolumeTriangle& rhs)
@ -74,9 +74,16 @@ public:
U16 mIndex[3];
F32 mRadius;
mutable S32 mBinIndex;
virtual const LLVector4a& getPositionGroup() const;
virtual const F32& getBinRadius() const;
S32 getBinIndex() const { return mBinIndex; }
void setBinIndex(S32 idx) const { mBinIndex = idx; }
};
class LLVolumeOctreeListener : public LLOctreeListener<LLVolumeTriangle>

View File

@ -108,6 +108,8 @@ void LLDrawable::init()
mGeneration = -1;
mBinRadius = 1.f;
mBinIndex = -1;
mSpatialBridge = NULL;
}
@ -1087,6 +1089,8 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat
mDrawable = root;
root->setSpatialBridge(this);
mBinIndex = -1;
mRenderType = mDrawable->mRenderType;
mDrawableType = mDrawable->mRenderType;

View File

@ -120,6 +120,9 @@ public:
F32 getIntensity() const { return llmin(mXform.getScale().mV[0], 4.f); }
S32 getLOD() const { return mVObjp ? mVObjp->getLOD() : 1; }
F32 getBinRadius() const { return mBinRadius; }
S32 getBinIndex() const { return mBinIndex; }
void setBinIndex(S32 index) const { mBinIndex = index; }
void getMinMax(LLVector3& min,LLVector3& max) const { mXform.getMinMax(min,max); }
LLXformMatrix* getXform() { return &mXform; }
@ -326,6 +329,7 @@ private:
mutable U32 mVisible;
F32 mRadius;
F32 mBinRadius;
mutable S32 mBinIndex;
S32 mGeneration;
LLVector3 mCurrentScale;

View File

@ -163,15 +163,10 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
mGeomCount = 0;
mGeomIndex = 0;
mIndicesCount = 0;
if (drawablep->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
drawablep->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES)
{ //indicate to LLParticlePartition that this particle is uninitialized
mIndicesIndex = 0xFFFFFFFF;
}
else
{
mIndicesIndex = 0;
}
//special value to indicate uninitialized position
mIndicesIndex = 0xFFFFFFFF;
mIndexInTex = 0;
mTexture = NULL;
mTEOffset = -1;

View File

@ -542,7 +542,7 @@ void LLSpatialGroup::validate()
validateDrawMap();
for (element_iter i = getData().begin(); i != getData().end(); ++i)
for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
sg_assert(drawable->getSpatialGroup() == this);
@ -759,7 +759,7 @@ BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& ma
{
const OctreeNode* node = mOctreeNode;
if (node->getData().empty())
if (node->isEmpty())
{ //don't do anything if there are no objects
if (empty && mOctreeNode->getParent())
{ //only root is allowed to be empty
@ -776,14 +776,14 @@ BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& ma
clearState(OBJECT_DIRTY);
//initialize bounding box to first element
OctreeNode::const_element_iter i = node->getData().begin();
OctreeNode::const_element_iter i = node->getDataBegin();
LLDrawable* drawablep = *i;
const LLVector4a* minMax = drawablep->getSpatialExtents();
newMin = minMax[0];
newMax = minMax[1];
for (++i; i != node->getData().end(); ++i)
for (++i; i != node->getDataEnd(); ++i)
{
drawablep = *i;
minMax = drawablep->getSpatialExtents();
@ -1247,7 +1247,7 @@ void LLSpatialGroup::updateDistance(LLCamera &camera)
llerrs << "Spatial group dirty on distance update." << llendl;
}
#endif
if (!getData().empty())
if (!isEmpty())
{
mRadius = mSpatialPartition->mRenderByGroup ? mObjectBounds[1].getLength3().getF32() :
(F32) mOctreeNode->getSize().getLength3().getF32();
@ -1398,7 +1398,7 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
setState(DEAD);
for (element_iter i = getData().begin(); i != getData().end(); ++i)
for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
if (drawable->getSpatialGroup() == this)
@ -1485,7 +1485,7 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion)
}
for (LLSpatialGroup::element_iter i = getData().begin(); i != getData().end(); ++i)
for (LLSpatialGroup::element_iter i = getDataBegin(); i != getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
for (S32 j = 0; j < drawable->getNumFaces(); j++)
@ -2117,7 +2117,7 @@ public:
virtual void processGroup(LLSpatialGroup* group)
{
llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->getData().empty())
llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->isEmpty())
if (mRes < 2)
{
@ -2184,7 +2184,7 @@ public:
{
LLSpatialGroup::OctreeNode* branch = group->mOctreeNode;
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
@ -2308,7 +2308,7 @@ public:
LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
group->destroyGL();
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
if (drawable->getVObj().notNull() && !group->mSpatialPartition->mRenderByGroup)
@ -2618,7 +2618,7 @@ void renderOctree(LLSpatialGroup* group)
gGL.flush();
glLineWidth(1.f);
gGL.flush();
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
if (!group->mSpatialPartition->isBridge())
@ -2664,7 +2664,7 @@ void renderOctree(LLSpatialGroup* group)
}
else
{
if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->getData().empty()
if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->isEmpty()
&& group->mSpatialPartition->mRenderByGroup)
{
col.setVec(0.8f, 0.4f, 0.1f, 0.1f);
@ -2732,7 +2732,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() &&
!group->getData().empty();
!group->isEmpty();
if (render_objects)
{
@ -3463,7 +3463,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
void renderPhysicsShapes(LLSpatialGroup* group)
{
for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
LLVOVolume* volume = drawable->getVOVolume();
@ -3812,7 +3812,7 @@ public:
LLVector3 center, size;
if (branch->getData().empty())
if (branch->isEmpty())
{
gGL.diffuseColor3f(1.f,0.2f,0.f);
center.set(branch->getCenter().getF32ptr());
@ -3848,8 +3848,8 @@ public:
}
gGL.begin(LLRender::TRIANGLES);
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin();
iter != branch->getData().end();
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getDataBegin();
iter != branch->getDataEnd();
++iter)
{
const LLVolumeTriangle* tri = *iter;
@ -4086,7 +4086,7 @@ public:
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
{
if (!group->getData().empty())
if (!group->isEmpty())
{
gGL.diffuseColor3f(0,0,1);
drawBoxOutline(group->mObjectBounds[0],
@ -4094,7 +4094,7 @@ public:
}
}
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
@ -4283,7 +4283,7 @@ public:
return;
}
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
@ -4507,7 +4507,7 @@ public:
virtual void visit(const LLSpatialGroup::OctreeNode* branch)
{
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
check(*i);
}

View File

@ -345,8 +345,13 @@ public:
void dirtyGeom() { setState(GEOM_DIRTY); }
void dirtyMesh() { setState(MESH_DIRTY); }
//octree wrappers to make code more readable
element_list& getData() { return mOctreeNode->getData(); }
element_iter getDataBegin() { return mOctreeNode->getDataBegin(); }
element_iter getDataEnd() { return mOctreeNode->getDataEnd(); }
U32 getElementCount() const { return mOctreeNode->getElementCount(); }
bool isEmpty() const { return mOctreeNode->isEmpty(); }
void drawObjectBox(LLColor4 col);

View File

@ -622,7 +622,7 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count
mFaceList.clear();
LLViewerCamera* camera = LLViewerCamera::getInstance();
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawablep = *i;

View File

@ -554,7 +554,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
mFaceList.clear();
LLViewerCamera* camera = LLViewerCamera::getInstance();
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawablep = *i;

View File

@ -4251,7 +4251,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
LLFastTimer t(FTM_REBUILD_VOLUME_FACE_LIST);
//get all the faces into a list
for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
LLDrawable* drawablep = *drawable_iter;
@ -4657,7 +4657,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
if (!LLPipeline::sDelayVBUpdate)
{
//drawables have been rebuilt, clear rebuild status
for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
LLDrawable* drawablep = *drawable_iter;
drawablep->clearState(LLDrawable::REBUILD_ALL);
@ -4697,7 +4697,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
std::set<LLVertexBuffer*> mapped_buffers;
for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
LLDrawable* drawablep = *drawable_iter;
@ -4759,7 +4759,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
if(num_mapped_veretx_buffer != LLVertexBuffer::sMappedCount)
{
llwarns << "Not all mapped vertex buffers are unmapped!" << llendl ;
for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
LLDrawable* drawablep = *drawable_iter;
for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
@ -5227,7 +5227,7 @@ void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_coun
//for each drawable
for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
LLDrawable* drawablep = *drawable_iter;

View File

@ -1371,7 +1371,7 @@ public:
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
if (!group->isState(LLSpatialGroup::GEOM_DIRTY) && !group->getData().empty())
if (!group->isState(LLSpatialGroup::GEOM_DIRTY) && !group->isEmpty())
{
for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
{
@ -1976,7 +1976,7 @@ void LLPipeline::clearReferences()
void check_references(LLSpatialGroup* group, LLDrawable* drawable)
{
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
if (drawable == *i)
{
@ -1998,7 +1998,7 @@ void check_references(LLDrawable* drawable, LLFace* face)
void check_references(LLSpatialGroup* group, LLFace* face)
{
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawable = *i;
check_references(drawable, face);
@ -2374,7 +2374,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera)
{
if (group->getData().empty())
if (group->isEmpty())
{
return;
}
@ -3004,7 +3004,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
else
{
group->setVisible();
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
markVisible(*i, camera);
}
@ -3092,7 +3092,7 @@ void LLPipeline::stateSort(LLSpatialGroup* group, LLCamera& camera)
LLMemType mt(LLMemType::MTYPE_PIPELINE_STATE_SORT);
if (group->changeLOD())
{
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
LLDrawable* drawablep = *i;
stateSort(drawablep, camera);
@ -3215,7 +3215,7 @@ void forAllDrawables(LLCullResult::sg_iterator begin,
{
for (LLCullResult::sg_iterator i = begin; i != end; ++i)
{
for (LLSpatialGroup::element_iter j = (*i)->getData().begin(); j != (*i)->getData().end(); ++j)
for (LLSpatialGroup::element_iter j = (*i)->getDataBegin(); j != (*i)->getDataEnd(); ++j)
{
func(*j);
}