summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2012-10-29 17:13:15 -0600
committerXiaohong Bao <bao@lindenlab.com>2012-10-29 17:13:15 -0600
commite35a220bf7dd47132174c81181d5f59fb0d54c5d (patch)
tree31ace56d92c49daded2a89ef1044a9d9c3d42009
parent09591242f90fa9b24a0be2aad02e91041ac0fcc7 (diff)
for SH-3459: interesting store object bounding information in viewer cache
-rw-r--r--indra/newview/llvocache.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index fbab5c60e3..f389867484 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -89,6 +89,8 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
BOOL success;
mDP.assignBuffer(mBuffer, 0);
+ setOctreeEntry(NULL);
+
success = check_read(apr_file, &mLocalID, sizeof(U32));
if(success)
{
@@ -108,6 +110,21 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
}
if(success)
{
+ LLVector4 pos;
+ success = check_read(apr_file, (void*)pos.mV, sizeof(LLVector4));
+
+ LLVector4a pos_;
+ pos_.load4a(pos.mV);
+ setPositionGroup(pos_);
+ }
+ if(success)
+ {
+ F32 rad;
+ success = check_read(apr_file, &rad, sizeof(F32));
+ setBinRadius(rad);
+ }
+ if(success)
+ {
success = check_read(apr_file, &size, sizeof(S32));
// Corruption in the cache entries
@@ -144,6 +161,7 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
mDupeCount = 0;
mCRCChangeCount = 0;
mBuffer = NULL;
+ mEntry = NULL;
}
}
@@ -289,6 +307,11 @@ void LLVOCacheEntry::dump() const
BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const
{
+ if(!mEntry)
+ {
+ return FALSE;
+ }
+
BOOL success;
success = check_write(apr_file, (void*)&mLocalID, sizeof(U32));
if(success)
@@ -309,6 +332,17 @@ BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const
}
if(success)
{
+ const LLVector4a pos_ = getPositionGroup() ;
+ LLVector4 pos(pos_[0], pos_[1], pos_[2], pos_[3]);
+ success = check_write(apr_file, pos.mV, sizeof(LLVector4));
+ }
+ if(success)
+ {
+ F32 rad = getBinRadius();
+ success = check_write(apr_file, (void*)&rad, sizeof(F32));
+ }
+ if(success)
+ {
S32 size = mDP.getBufferSize();
success = check_write(apr_file, (void*)&size, sizeof(S32));