summaryrefslogtreecommitdiff
path: root/indra/newview/llworld.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2012-10-15 21:34:29 -0600
committerXiaohong Bao <bao@lindenlab.com>2012-10-15 21:34:29 -0600
commitc0ba626c8009b22310b3923e8170e5db2a021253 (patch)
tree2ff3cd6737b6c8bbafbecab7ddce5e4c463b8852 /indra/newview/llworld.cpp
parent041dfccd1ea5b59c1b3c4e37e9a5495cad342c8f (diff)
For SH-3333: Design and implement a new object cache system on viewer side
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r--indra/newview/llworld.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 9e495c46b1..0a622997f7 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -133,6 +133,9 @@ void LLWorld::destroyClass()
{
mEdgeWaterObjects[i] = NULL;
}
+
+ //make all visible drawbles invisible.
+ LLDrawable::incrementVisible();
}
@@ -599,7 +602,8 @@ void LLWorld::updateVisibilities()
if (part)
{
LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
- if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (LLViewerCamera::getInstance()->AABBInFrustum(bounds[0], bounds[1]))
{
mCulledRegionList.erase(curiter);
mVisibleRegionList.push_back(regionp);
@@ -622,7 +626,8 @@ void LLWorld::updateVisibilities()
if (part)
{
LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
- if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (LLViewerCamera::getInstance()->AABBInFrustum(bounds[0], bounds[1]))
{
regionp->calculateCameraDistance();
regionp->getLand().updatePatchVisibilities(gAgent);
@@ -644,8 +649,8 @@ void LLWorld::updateVisibilities()
void LLWorld::updateRegions(F32 max_update_time)
{
LLTimer update_timer;
- BOOL did_one = FALSE;
-
+ BOOL did_one = FALSE;
+
// Perform idle time updates for the regions (and associated surfaces)
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
@@ -660,6 +665,13 @@ void LLWorld::updateRegions(F32 max_update_time)
did_one = TRUE;
}
}
+
+ mNumOfActiveCachedObjects = 0;
+ for (region_list_t::iterator iter = mRegionList.begin();
+ iter != mRegionList.end(); ++iter)
+ {
+ mNumOfActiveCachedObjects += (*iter)->getNumOfActiveCachedObjects();
+ }
}
void LLWorld::updateParticles()