summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llviewerregion.cpp26
-rwxr-xr-xindra/newview/llviewerregion.h2
2 files changed, 22 insertions, 6 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index c3cdfa2901..f9689c7473 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -847,13 +847,18 @@ void LLViewerRegion::replaceVisibleCacheEntry(LLVOCacheEntry* old_entry, LLVOCac
}
//physically delete the cache entry
-void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry)
+void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry, bool for_rendering)
{
if(!entry)
{
return;
}
+ if(for_rendering && !entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ addNewObject(entry); //force to add to rendering pipeline
+ }
+
//remove from active list and waiting list
if(entry->isState(LLVOCacheEntry::ACTIVE))
{
@@ -882,9 +887,20 @@ void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry)
parent->removeChild(entry);
}
}
- else if(entry->getNumOfChildren() > 0)//disconnect children if has any
+ else if(entry->getNumOfChildren() > 0)//remove children from cache if has any
{
- entry->removeAllChildren();
+ S32 num_child = entry->getNumOfChildren();
+
+ LLVOCacheEntry* child;
+ for(S32 i = 0; i < num_child; i++)
+ {
+ child = entry->getChild(i);
+ if(child)
+ {
+ child->setParentID(0); //disconnect from parent
+ killCacheEntry(child, for_rendering);
+ }
+ }
}
//remove from mCacheMap, real deletion
@@ -1552,13 +1568,13 @@ LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* o
if(!objectp) //object not created
{
//create a new object from cache.
- objectp = gObjectList.processObjectUpdateFromCache(entry, this);
+ objectp = addNewObject(entry);
}
//remove from cache if terse update
if(update_type == (U32)OUT_TERSE_IMPROVED)
{
- killCacheEntry(entry);
+ killCacheEntry(entry, true);
}
return objectp;
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 6c20282ecd..2085f83f32 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -385,7 +385,7 @@ private:
void killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& delete_list);
void removeFromVOCacheTree(LLVOCacheEntry* entry);
void replaceVisibleCacheEntry(LLVOCacheEntry* old_entry, LLVOCacheEntry* new_entry);
- void killCacheEntry(LLVOCacheEntry* entry); //physically delete the cache entry
+ void killCacheEntry(LLVOCacheEntry* entry, bool for_rendering = false); //physically delete the cache entry
void killInvisibleObjects(F32 max_time);
void createVisibleObjects(F32 max_time);
void updateVisibleEntries(F32 max_time); //update visible entries