diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-09-05 21:55:56 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-09-05 21:55:56 +0300 |
commit | cd895d6e583f42349ca3bc330d82c66740ce08ab (patch) | |
tree | 4367d6ee2d3d3e9df896ad25501d80446aef32ba /indra/llprimitive/llprimitive.cpp | |
parent | 23acff80c083c442edddbe3fbb1754d640496704 (diff) | |
parent | 05f1e3e7138c4eca27d4047bd9727a4fba0c9dc0 (diff) |
Merged in lindenlab/viewer-bear
Diffstat (limited to 'indra/llprimitive/llprimitive.cpp')
-rw-r--r-- | indra/llprimitive/llprimitive.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 040f9fb6c2..bc5dd62f45 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1040,14 +1040,26 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa } //assign exception faces to cur_ptr - if (exception_faces >= (0x1 << 7)) + if (exception_faces >= ((U64)0x1 << 7)) { - if (exception_faces >= (0x1 << 14)) + if (exception_faces >= ((U64)0x1 << 14)) { - if (exception_faces >= (0x1 << 21)) + if (exception_faces >= ((U64)0x1 << 21)) { - if (exception_faces >= (0x1 << 28)) + if (exception_faces >= ((U64)0x1 << 28)) { + if (exception_faces >= ((U64)0x1 << 35)) + { + if (exception_faces >= ((U64)0x1 << 42)) + { + if (exception_faces >= ((U64)0x1 << 49)) + { + *cur_ptr++ = (U8)(((exception_faces >> 49) & 0x7F) | 0x80); + } + *cur_ptr++ = (U8)(((exception_faces >> 42) & 0x7F) | 0x80); + } + *cur_ptr++ = (U8)(((exception_faces >> 35) & 0x7F) | 0x80); + } *cur_ptr++ = (U8)(((exception_faces >> 28) & 0x7F) | 0x80); } *cur_ptr++ = (U8)(((exception_faces >> 21) & 0x7F) | 0x80); @@ -1056,6 +1068,7 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa } *cur_ptr++ = (U8)(((exception_faces >> 7) & 0x7F) | 0x80); } + *cur_ptr++ = (U8)(exception_faces & 0x7F); @@ -1115,7 +1128,7 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat // Includes information about image ID, color, scale S,T, offset S,T and rotation BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const { - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; @@ -1200,7 +1213,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const { - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; @@ -1313,6 +1326,8 @@ S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, tec.packed_buffer, 0, block_num, LLTEContents::MAX_TE_BUFFER); } + + tec.face_count = llmin((U32)getNumTEs(),(U32)LLTEContents::MAX_TES); U8 *cur_ptr = tec.packed_buffer; @@ -1385,6 +1400,8 @@ S32 LLPrimitive::applyParsedTEMessage(LLTEContents& tec) retval |= setTEColor(i, color); + + } return retval; @@ -1403,7 +1420,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) { // use a negative block_num to indicate a single-block read (a non-variable block) S32 retval = 0; - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; // Avoid construction of 32 UUIDs per call static LLUUID image_ids[MAX_TES]; |