diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llviewerobjectlist.cpp | 12 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 21 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.h | 4 |
3 files changed, 22 insertions, 15 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 173473dded..5212ab3651 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -458,7 +458,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, LLTimer update_timer; BOOL justCreated = FALSE; S32 msg_size = 0; - bool remove_from_cache = false; //remove from object cache if it is a full-update or terse update + bool update_cache = false; //update object cache if it is a full-update or terse update if (compressed) { @@ -486,9 +486,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, continue; } } - else + else //OUT_TERSE_IMPROVED { - remove_from_cache = true; + update_cache = true; compressed_dp.unpackU32(local_id, "LocalID"); getUUIDFromLocal(fullid, local_id, @@ -518,7 +518,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } else // OUT_FULL only? { - remove_from_cache = true; + update_cache = true; mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FullID, fullid, i); mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i); msg_size += sizeof(LLUUID); @@ -527,9 +527,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } objectp = findObject(fullid); - if(remove_from_cache) + if(update_cache) { - objectp = regionp->forceToRemoveFromCache(local_id, objectp); + objectp = regionp->updateCacheEntry(local_id, objectp, update_type); } // This looks like it will break if the local_id of the object doesn't change diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 939c6dbed1..57938f8490 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1535,9 +1535,15 @@ LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry) return obj; } -//remove from object cache if the object receives a full-update or terse update -LLViewerObject* LLViewerRegion::forceToRemoveFromCache(U32 local_id, LLViewerObject* objectp) +//update object cache if the object receives a full-update or terse update +//update_type == EObjectUpdateType::OUT_TERSE_IMPROVED or EObjectUpdateType::OUT_FULL +LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type) { + if(objectp && update_type != (U32)OUT_TERSE_IMPROVED) + { + return objectp; //no need to access cache + } + LLVOCacheEntry* entry = getCacheEntry(local_id); if (!entry) { @@ -1545,14 +1551,15 @@ LLViewerObject* LLViewerRegion::forceToRemoveFromCache(U32 local_id, LLViewerObj } if(!objectp) //object not created { - entry->setTouched(FALSE); //mark this entry invalid - - //create a new object before delete it from cache. + //create a new object from cache. objectp = gObjectList.processObjectUpdateFromCache(entry, this); } - //remove from cache. - killCacheEntry(entry); + //remove from cache if terse update + if(update_type == (U32)OUT_TERSE_IMPROVED) + { + killCacheEntry(entry); + } return objectp; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index a789cc6715..6c20282ecd 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -335,8 +335,8 @@ public: bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type); void requestCacheMisses(); void addCacheMissFull(const U32 local_id); - //remove from object cache if the object receives a full-update or terse update - LLViewerObject* forceToRemoveFromCache(U32 local_id, LLViewerObject* objectp); + //update object cache if the object receives a full-update or terse update + LLViewerObject* updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type); void findOrphans(U32 parent_id); void clearCachedVisibleObjects(); void dumpCache(); |