summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobjectlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobjectlist.cpp')
-rw-r--r--indra/newview/llviewerobjectlist.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 4a06685994..383d4a7955 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1438,12 +1438,24 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
if (active)
{
//llinfos << "Adding " << objectp->mID << " " << objectp->getPCodeString() << " to active list." << llendl;
- llassert(objectp->getListIndex() == -1);
-
- mActiveObjects.push_back(objectp);
- objectp->setListIndex(mActiveObjects.size()-1);
+ S32 idx = objectp->getListIndex();
+ if (idx <= -1)
+ {
+ mActiveObjects.push_back(objectp);
+ objectp->setListIndex(mActiveObjects.size()-1);
+ objectp->setOnActiveList(TRUE);
+ }
+ else
+ {
+ llassert(idx < mActiveObjects.size());
+ llassert(mActiveObjects[idx] == objectp);
- objectp->setOnActiveList(TRUE);
+ if (idx >= mActiveObjects.size() ||
+ mActiveObjects[idx] != objectp)
+ {
+ llwarns << "Invalid object list index detected!" << llendl;
+ }
+ }
}
else
{
@@ -1522,6 +1534,10 @@ void LLViewerObjectList::onPhysicsFlagsFetchFailure(const LLUUID& object_id)
mPendingPhysicsFlags.erase(object_id);
}
+static LLFastTimer::DeclareTimer FTM_SHIFT_OBJECTS("Shift Objects");
+static LLFastTimer::DeclareTimer FTM_PIPELINE_SHIFT("Pipeline Shift");
+static LLFastTimer::DeclareTimer FTM_REGION_SHIFT("Region Shift");
+
void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
{
// This is called when we shift our origin when we cross region boundaries...
@@ -1533,6 +1549,8 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
return;
}
+ LLFastTimer t(FTM_SHIFT_OBJECTS);
+
LLViewerObject *objectp;
for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
@@ -1549,8 +1567,15 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
}
}
- gPipeline.shiftObjects(offset);
- LLWorld::getInstance()->shiftRegions(offset);
+ {
+ LLFastTimer t(FTM_PIPELINE_SHIFT);
+ gPipeline.shiftObjects(offset);
+ }
+
+ {
+ LLFastTimer t(FTM_REGION_SHIFT);
+ LLWorld::getInstance()->shiftRegions(offset);
+ }
}
void LLViewerObjectList::repartitionObjects()