summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-03-11 21:23:15 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-03-11 21:23:15 -0600
commit27bb36b1e796add58f319555bf761e417f7957ef (patch)
treea99f6d5ff87e7838197adfbb88f59531d2ecf1ee /indra
parent79dc4a1190a2954a7f1338596aa2d63ea3a96fff (diff)
for SH-3979: interesting: can not edit objects with new object cache code
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerobject.cpp20
-rw-r--r--indra/newview/llviewerobject.h1
-rw-r--r--indra/newview/llviewerobjectlist.cpp7
-rw-r--r--indra/newview/llviewerregion.cpp18
-rw-r--r--indra/newview/llviewerregion.h4
-rw-r--r--indra/newview/llvocache.cpp3
-rw-r--r--indra/newview/llvocache.h4
7 files changed, 43 insertions, 14 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index bf7590c640..dca159f982 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -1838,11 +1838,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
{
U32 flags;
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, block_num);
- // keep local flags and overwrite remote-controlled flags
- mFlags = (mFlags & FLAGS_LOCAL) | flags;
-
- // ...new objects that should come in selected need to be added to the selected list
- mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
+ loadFlags(flags);
}
}
break;
@@ -2343,7 +2339,21 @@ BOOL LLViewerObject::isActive() const
return TRUE;
}
+//load flags from cache or from message
+void LLViewerObject::loadFlags(U32 flags)
+{
+ if(flags == (U32)(-1))
+ {
+ return; //invalid
+ }
+
+ // keep local flags and overwrite remote-controlled flags
+ mFlags = (mFlags & FLAGS_LOCAL) | flags;
+ // ...new objects that should come in selected need to be added to the selected list
+ mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
+ return;
+}
void LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index eda9692e19..a1f63faf5b 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -511,6 +511,7 @@ public:
virtual void updateRegion(LLViewerRegion *regionp);
void updateFlags(BOOL physics_changed = FALSE);
+ void loadFlags(U32 flags); //load flags from cache or from message
BOOL setFlags(U32 flag, BOOL state);
BOOL setFlagsWithoutUpdate(U32 flag, BOOL state);
void setPhysicsShapeType(U8 type);
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 6202a7b6cc..873b6e1d03 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -365,7 +365,8 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry*
}
processUpdateCore(objectp, NULL, 0, OUT_FULL_CACHED, cached_dpp, justCreated, true);
-
+ objectp->loadFlags(entry->getUpdateFlags()); //just in case, reload update flags from cache.
+
recorder.log(0.2f);
LLVOAvatar::cullAvatarsByPixelArea();
@@ -470,7 +471,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
}
else //send to object cache
{
- regionp->cacheFullUpdate(compressed_dp);
+ regionp->cacheFullUpdate(compressed_dp, flags);
continue;
}
}
@@ -623,7 +624,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if(!(flags & FLAGS_TEMPORARY_ON_REZ))
{
bCached = true;
- LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp);
+ LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp, flags);
recorder.cacheFullUpdate(local_id, update_type, result, objectp, msg_size);
}
}
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 704b3b644f..c74e7158b6 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1795,7 +1795,7 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry)
return ;
}
-LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerBinaryBuffer &dp)
+LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerBinaryBuffer &dp, U32 flags)
{
eCacheUpdateResult result;
U32 crc;
@@ -1849,14 +1849,16 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerB
decodeBoundingInfo(entry);
}
-
+ entry->setUpdateFlags(flags);
+
return result;
}
-LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp)
+LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp, U32 flags)
{
- eCacheUpdateResult result = cacheFullUpdate(dp);
+ eCacheUpdateResult result = cacheFullUpdate(dp, flags);
+#if 0
LLVOCacheEntry* entry = mImpl->mCacheMap[objectp->getLocalID()];
if(!entry)
{
@@ -1871,6 +1873,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec
{
addActiveCacheEntry(entry);
}
+#endif
return result;
}
@@ -1926,7 +1929,14 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss
// Record a hit
entry->recordHit();
cache_miss_type = CACHE_MISS_TYPE_NONE;
+ entry->setUpdateFlags(flags);
+ if(entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ ((LLDrawable*)entry->getEntry()->getDrawable())->getVObj()->loadFlags(flags);
+ return true;
+ }
+
if(entry->getGroup() || !entry->isState(LLVOCacheEntry::INACTIVE))
{
return true;
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 4fc74ee7c3..a903f61cbc 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -317,8 +317,8 @@ public:
} eCacheUpdateResult;
// handle a full update message
- eCacheUpdateResult cacheFullUpdate(LLDataPackerBinaryBuffer &dp);
- eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp);
+ eCacheUpdateResult cacheFullUpdate(LLDataPackerBinaryBuffer &dp, U32 flags);
+ eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp, U32 flags);
LLVOCacheEntry* getCacheEntryForOctree(U32 local_id);
LLVOCacheEntry* getCacheEntry(U32 local_id);
bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type);
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index ac97f1b6ce..5f112675dc 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -53,6 +53,7 @@ LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &
: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
mLocalID(local_id),
mCRC(crc),
+ mUpdateFlags(-1),
mHitCount(0),
mDupeCount(0),
mCRCChangeCount(0),
@@ -72,6 +73,7 @@ LLVOCacheEntry::LLVOCacheEntry()
: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
mLocalID(0),
mCRC(0),
+ mUpdateFlags(-1),
mHitCount(0),
mDupeCount(0),
mCRCChangeCount(0),
@@ -89,6 +91,7 @@ LLVOCacheEntry::LLVOCacheEntry()
LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
mBuffer(NULL),
+ mUpdateFlags(-1),
mState(INACTIVE),
mRepeatedVisCounter(0),
mVisFrameRange(64),
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index ca25583922..64eb876919 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -119,6 +119,9 @@ public:
void setTouched(BOOL touched = TRUE) {mTouched = touched;}
BOOL isTouched() const {return mTouched;}
+ void setUpdateFlags(U32 flags) {mUpdateFlags = flags;}
+ U32 getUpdateFlags() const {return mUpdateFlags;}
+
public:
typedef std::map<U32, LLPointer<LLVOCacheEntry> > vocache_entry_map_t;
typedef std::set<LLVOCacheEntry*> vocache_entry_set_t;
@@ -128,6 +131,7 @@ protected:
U32 mLocalID;
U32 mParentID;
U32 mCRC;
+ U32 mUpdateFlags; //receive from sim
S32 mHitCount;
S32 mDupeCount;
S32 mCRCChangeCount;