diff options
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 12 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.h | 3 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 20 |
3 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 6e9f649d23..2ed7d59ec0 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -377,7 +377,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mPacketsReceived(0.f), mDead(FALSE), mLastVisitedEntry(NULL), - mInvisibilityCheckHistory(-1) + mInvisibilityCheckHistory(-1), + mPaused(FALSE) { mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); @@ -1185,6 +1186,7 @@ void LLViewerRegion::clearCachedVisibleObjects() //reset all occluders mImpl->mVOCachePartition->resetOccluders(); + mPaused = TRUE; //clean visible entries for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mVisibleEntries.begin(); iter != mImpl->mVisibleEntries.end();) @@ -1257,9 +1259,13 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) { return did_update; } - + if(mPaused) + { + mPaused = FALSE; //unpause. + } + //reset all occluders - mImpl->mVOCachePartition->resetOccluders(); + mImpl->mVOCachePartition->resetOccluders(); max_update_time -= update_timer.getElapsedTimeF32(); diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 79a992a4c1..cc7ee5c6ee 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -373,6 +373,8 @@ public: void removeFromCreatedList(U32 local_id); void addToCreatedList(U32 local_id); + BOOL isPaused() const {return mPaused;} + private: void addToVOCacheTree(LLVOCacheEntry* entry); LLViewerObject* addNewObject(LLVOCacheEntry* entry); @@ -482,6 +484,7 @@ private: BOOL mCapabilitiesReceived; BOOL mReleaseNotesRequested; BOOL mDead; //if true, this region is in the process of deleting. + BOOL mPaused; //pause processing the objects in the region typedef std::map<U32, std::vector<U32> > orphan_list_t; orphan_list_t mOrphanMap; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 71d5a92df3..b8a6141e2c 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -481,9 +481,13 @@ void LLVOCacheEntry::updateParentBoundingInfo(const LLVOCacheEntry* child) //------------------------------------------------------------------- LLVOCacheGroup::~LLVOCacheGroup() { - if(mOcclusionState[0] & ACTIVE_OCCLUSION) + for(S32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) { - ((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this); + if(mOcclusionState[i] & ACTIVE_OCCLUSION) + { + ((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this); + break; + } } } @@ -726,6 +730,10 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) { return 0; } + if(mRegionp->isPaused()) + { + return 0; + } ((LLviewerOctreeGroup*)mOctree->getListener(0))->rebound(); @@ -791,7 +799,7 @@ void LLVOCachePartition::addOccluders(LLviewerOctreeGroup* gp) if(!group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION)) { - group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION, LLOcclusionCullingGroup::STATE_MODE_ALL_CAMERAS); + group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION); mOccludedGroups.insert(group); } } @@ -808,7 +816,11 @@ void LLVOCachePartition::processOccluders(LLCamera* camera) for(std::set<LLVOCacheGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter) { LLVOCacheGroup* group = *iter; - group->doOcclusion(camera, &shift); + if(group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION)) + { + group->doOcclusion(camera, &shift); + group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION); + } } } |