summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llprimitive.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-01 18:03:43 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-01 18:03:43 +0100
commite562a200b69c39f60540019ef0ec7423ace04bef (patch)
treed7f501eeb7f104243c7a094b62f0b7728056f8f8 /indra/llprimitive/llprimitive.cpp
parentab79bf7aaeaa0cbd7b2571601971cce97f9b4acd (diff)
parentbb4836f53d98d987a1702f970d4b853eaa529907 (diff)
merge from viewer-trunk
Diffstat (limited to 'indra/llprimitive/llprimitive.cpp')
-rw-r--r--indra/llprimitive/llprimitive.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index b75d1b0f67..732f5a698b 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -744,7 +744,11 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
setNumTEs(mVolumep->getNumFaces());
return TRUE;
}
-
+
+#if 0
+ // #if 0'd out by davep
+ // this is a lot of cruft to set texture entry values that just stay the same for LOD switch
+ // or immediately get overridden by an object update message, also crashes occasionally
U32 old_face_mask = mVolumep->mFaceMask;
S32 face_bit = 0;
@@ -942,6 +946,13 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
setTE(te_num, *(old_tes.getTexture(face_mapping[face_bit])));
}
}
+#else
+ // build the new object
+ sVolumeManager->unrefVolume(mVolumep);
+ mVolumep = volumep;
+
+ setNumTEs(mVolumep->getNumFaces());
+#endif
return TRUE;
}
@@ -1084,7 +1095,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
U8 packed_buffer[MAX_TE_BUFFER];
U8 *cur_ptr = packed_buffer;
- S32 last_face_index = getNumTEs() - 1;
+ S32 last_face_index = llmin((U32) getNumTEs(), MAX_TES) - 1;
if (last_face_index > -1)
{
@@ -1365,7 +1376,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
return retval;
}
- face_count = getNumTEs();
+ face_count = llmin((U32) getNumTEs(), MAX_TES);
U32 i;
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_data, 16, face_count, MVT_LLUUID);