diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 10 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.h | 1 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 10 | ||||
-rwxr-xr-x | indra/newview/llvocache.h | 1 | ||||
-rwxr-xr-x | indra/newview/llworld.cpp | 5 |
6 files changed, 19 insertions, 12 deletions
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 7b3186d40a..bba3d26e09 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -464,15 +464,16 @@ bool LLviewerOctreeGroup::removeFromGroup(LLViewerOctreeEntry* entry) llassert(!entry->getGroup()); unbound(); + setState(OBJECT_DIRTY); + if (mOctreeNode) { - if (!mOctreeNode->remove(entry)) + if (!mOctreeNode->remove(entry)) //this could cause *this* pointer to be destroyed, so no more function calls after this. { OCT_ERRS << "Could not remove LLVOCacheEntry from LLVOCacheOctreeGroup" << llendl; return false; } - } - setState(OBJECT_DIRTY); + } return true; } @@ -580,9 +581,10 @@ void LLviewerOctreeGroup::handleInsertion(const TreeNode* node, LLViewerOctreeEn //virtual void LLviewerOctreeGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj) { - obj->setGroup(NULL); unbound(); setState(OBJECT_DIRTY); + + obj->setGroup(NULL); //this could cause *this* pointer to be destroyed. So no more function calls after this. } //virtual diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index d4de33cc38..f2e6f65bba 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -88,6 +88,7 @@ const S32 MAX_CAP_REQUEST_ATTEMPTS = 30; const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000; BOOL LLViewerRegion::sVOCacheCullingEnabled = FALSE; +S32 LLViewerRegion::sLastCameraUpdated = 0; typedef std::map<std::string, std::string> CapabilityMap; @@ -992,6 +993,7 @@ void LLViewerRegion::removeFromVOCacheTree(LLVOCacheEntry* entry) } mImpl->mVOCachePartition->removeEntry(entry->getEntry()); + entry->mLastCameraUpdated = sLastCameraUpdated; } //add the visible entries @@ -1219,7 +1221,7 @@ F32 LLViewerRegion::killInvisibleObjects(F32 max_time) iter = mImpl->mActiveSet.begin(); } - if(!(*iter)->isRecentlyVisible()) + if(!(*iter)->isRecentlyVisible() && (*iter)->mLastCameraUpdated != sLastCameraUpdated) { killObject((*iter), delete_list); } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index cc314dc43b..24d3dfae92 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -410,6 +410,7 @@ public: std::vector<LLUUID> mMapAvatarIDs; static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not. + static S32 sLastCameraUpdated; private: LLViewerRegionImpl * mImpl; LLFrameTimer mRegionTimer; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 69c32db13e..6e0243e985 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -219,18 +219,14 @@ void LLVOCacheEntry::setState(U32 state) if(getState() == ACTIVE) { - const S32 MIN_REAVTIVE_INTERVAL = 32; + const S32 MIN_REAVTIVE_INTERVAL = 128; U32 last_visible = getVisible(); setVisible(); - if(getVisible() - last_visible < MIN_REAVTIVE_INTERVAL + mMinFrameRange) + if(getVisible() - last_visible > MIN_REAVTIVE_INTERVAL + mMinFrameRange) { - mMinFrameRange = llmin(mMinFrameRange * 2, getInvisibleObjectsLiveTime() * 32); - } - else - { - mMinFrameRange = getInvisibleObjectsLiveTime(); //reset + mLastCameraUpdated = 0; //reset } } } diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 0248298eb5..816ef88dc4 100755 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -130,6 +130,7 @@ public: typedef std::set<LLVOCacheEntry*> vocache_entry_set_t; typedef std::set<LLVOCacheEntry*, CompareVOCacheEntry> vocache_entry_priority_list_t; + S32 mLastCameraUpdated; protected: U32 mLocalID; U32 mParentID; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 9659da6bf1..bfc5077c90 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -666,6 +666,11 @@ void LLWorld::updateRegions(F32 max_update_time) LLTimer update_timer; BOOL did_one = FALSE; + if(LLViewerCamera::getInstance()->isChanged()) + { + LLViewerRegion::sLastCameraUpdated = LLViewerOctreeEntryData::getCurrentFrame(); + } + // Perform idle time updates for the regions (and associated surfaces) for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) |