summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-09-25 16:41:13 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-09-25 16:41:13 -0600
commit4aa41f80bae421109900321af1d090ba5c8e6fdb (patch)
treec366e14e442a72a87397415003dcb28bda524de3 /indra
parentab8f64a96754edaa68dd1ff97b9519eff4496aa6 (diff)
parent456ff3949a28542ecd89ec23b0287b55a166529f (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llviewerregion.cpp55
-rwxr-xr-xindra/newview/llviewerregion.h2
-rwxr-xr-xindra/newview/llworld.cpp10
-rwxr-xr-xindra/newview/llworld.h1
-rwxr-xr-xindra/newview/pipeline.cpp1
5 files changed, 68 insertions, 1 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 985f5a0a1f..24f419b4b1 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1178,6 +1178,61 @@ F32 LLViewerRegion::createVisibleObjects(F32 max_time)
return max_time - update_timer.getElapsedTimeF32();
}
+void LLViewerRegion::clearCachedVisibleObjects()
+{
+ mImpl->mWaitingList.clear();
+ mImpl->mVisibleGroups.clear();
+
+ //clean visible entries
+ for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mVisibleEntries.begin(); iter != mImpl->mVisibleEntries.end();)
+ {
+ LLVOCacheEntry* entry = *iter;
+ LLVOCacheEntry* parent = getCacheEntry(entry->getParentID());
+
+ if(!entry->getParentID() || parent) //no child or parent is cache-able
+ {
+ if(parent) //has a cache-able parent
+ {
+ parent->addChild(entry);
+ }
+
+ LLVOCacheEntry::vocache_entry_set_t::iterator next_iter = iter;
+ ++next_iter;
+ mImpl->mVisibleEntries.erase(iter);
+ iter = next_iter;
+ }
+ else //parent is not cache-able, leave it.
+ {
+ ++iter;
+ }
+ }
+
+ //remove all visible entries.
+ mLastVisitedEntry = NULL;
+ std::vector<LLDrawable*> delete_list;
+ for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mActiveSet.begin();
+ iter != mImpl->mActiveSet.end(); ++iter)
+ {
+ LLDrawable* drawablep = (LLDrawable*)(*iter)->getEntry()->getDrawable();
+
+ if(drawablep && !drawablep->getParent())
+ {
+ delete_list.push_back(drawablep);
+ }
+ }
+
+ if(!delete_list.empty())
+ {
+ for(S32 i = 0; i < delete_list.size(); i++)
+ {
+ gObjectList.killObject(delete_list[i]->getVObj());
+ }
+ delete_list.clear();
+ }
+
+ return;
+}
+
BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
{
LLTimer update_timer;
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index b2df8d5325..8a375610d9 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -336,7 +336,7 @@ public:
//remove from object cache if the object receives a full-update or terse update
LLViewerObject* forceToRemoveFromCache(U32 local_id, LLViewerObject* objectp);
void findOrphans(U32 parent_id);
-
+ void clearCachedVisibleObjects();
void dumpCache();
void unpackRegionHandshake();
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 9009626a03..d600abeb0a 100755
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -684,6 +684,16 @@ void LLWorld::updateRegions(F32 max_update_time)
}
}
+void LLWorld::clearAllVisibleObjects()
+{
+ for (region_list_t::iterator iter = mRegionList.begin();
+ iter != mRegionList.end(); ++iter)
+ {
+ //clear all cached visible objects.
+ (*iter)->clearCachedVisibleObjects();
+ }
+}
+
void LLWorld::updateParticles()
{
LLViewerPartSim::getInstance()->updateSimulation();
diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h
index 287e41d323..b2d8418064 100755
--- a/indra/newview/llworld.h
+++ b/indra/newview/llworld.h
@@ -147,6 +147,7 @@ public:
void getInfo(LLSD& info);
U32 getNumOfActiveCachedObjects() const {return mNumOfActiveCachedObjects;}
+ void clearAllVisibleObjects();
public:
typedef std::list<LLViewerRegion*> region_list_t;
const region_list_t& getRegionList() const { return mActiveRegionList; }
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 38bef1f4f5..9d8aa849ba 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7371,6 +7371,7 @@ void LLPipeline::doResetVertexBuffers()
{
LLSpatialPartition::sTeleportRequested = FALSE;
+ LLWorld::getInstance()->clearAllVisibleObjects();
clearRebuildGroups();
clearRebuildDrawables();
}