From b2afb8800bb033a04bb3ecdf0363068d56648ef1 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:54 -0500 Subject: Second Life viewer sources 1.15.0.2 --- linden/indra/llprimitive/legacy_object_types.h | 1 + linden/indra/llprimitive/llmaterialtable.cpp | 1 + linden/indra/llprimitive/llmaterialtable.h | 1 + linden/indra/llprimitive/llprimitive.cpp | 71 +++++++++---------- linden/indra/llprimitive/llprimitive.h | 1 + linden/indra/llprimitive/lltextureanim.cpp | 1 + linden/indra/llprimitive/lltextureanim.h | 1 + linden/indra/llprimitive/lltextureentry.cpp | 1 + linden/indra/llprimitive/lltextureentry.h | 1 + linden/indra/llprimitive/lltree_common.h | 1 + linden/indra/llprimitive/lltreeparams.cpp | 1 + linden/indra/llprimitive/lltreeparams.h | 1 + linden/indra/llprimitive/llvolumemessage.cpp | 97 ++++++++++++++------------ linden/indra/llprimitive/llvolumemessage.h | 1 + linden/indra/llprimitive/llvolumexml.cpp | 1 + linden/indra/llprimitive/llvolumexml.h | 1 + linden/indra/llprimitive/material_codes.h | 1 + linden/indra/llprimitive/object_flags.h | 1 + 18 files changed, 103 insertions(+), 81 deletions(-) (limited to 'linden/indra/llprimitive') diff --git a/linden/indra/llprimitive/legacy_object_types.h b/linden/indra/llprimitive/legacy_object_types.h index 19af9e6..9cdc632 100644 --- a/linden/indra/llprimitive/legacy_object_types.h +++ b/linden/indra/llprimitive/legacy_object_types.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/llmaterialtable.cpp b/linden/indra/llprimitive/llmaterialtable.cpp index 201d0c9..d7ac57a 100644 --- a/linden/indra/llprimitive/llmaterialtable.cpp +++ b/linden/indra/llprimitive/llmaterialtable.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/llmaterialtable.h b/linden/indra/llprimitive/llmaterialtable.h index a472274..d9596e1 100644 --- a/linden/indra/llprimitive/llmaterialtable.h +++ b/linden/indra/llprimitive/llmaterialtable.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp index 859a34f..e2cf7e3 100644 --- a/linden/indra/llprimitive/llprimitive.cpp +++ b/linden/indra/llprimitive/llprimitive.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -733,7 +734,7 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode) snprintf(pcode_string, sizeof(pcode_string), "text bubble"); /* Flawfinder: ignore */ break; case LL_PCODE_LEGACY_TREE: - snprintf(pcode_string, sizeof(pcode_string), "tree"); /* Flawfinder: ignore */ + snprintf(pcode_string, sizeof(pcode_string), "tree"); /* Flawfinder: ignore */ break; case LL_PCODE_TREE_NEW: snprintf(pcode_string, sizeof(pcode_string), "tree_new"); /* Flawfinder: ignore */ @@ -764,23 +765,23 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode) } else if (base_code == LL_PCODE_PYRAMID) { - snprintf(shape, sizeof(shape), "pyramid"); /* Flawfinder: ignore */ + snprintf(shape, sizeof(shape), "pyramid"); /* Flawfinder: ignore */ } else if (base_code == LL_PCODE_SPHERE) { - snprintf(shape, sizeof(shape), "sphere"); /* Flawfinder: ignore */ + snprintf(shape, sizeof(shape), "sphere"); /* Flawfinder: ignore */ } else if (base_code == LL_PCODE_TETRAHEDRON) { - snprintf(shape, sizeof(shape), "tetrahedron"); /* Flawfinder: ignore */ + snprintf(shape, sizeof(shape), "tetrahedron"); /* Flawfinder: ignore */ } else if (base_code == LL_PCODE_VOLUME) { - snprintf(shape, sizeof(shape), "volume"); /* Flawfinder: ignore */ + snprintf(shape, sizeof(shape), "volume"); /* Flawfinder: ignore */ } else if (base_code == LL_PCODE_APP) { - snprintf(shape, sizeof(shape), "app"); /* Flawfinder: ignore */ + snprintf(shape, sizeof(shape), "app"); /* Flawfinder: ignore */ } else { @@ -790,15 +791,15 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode) U8 mask_code = pcode & (~LL_PCODE_BASE_MASK); if (base_code == LL_PCODE_APP) { - snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */ + snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */ } else if (mask_code & LL_PCODE_HEMI_MASK) { - snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */ + snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */ } else if (mask != 0) { - snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */ + snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */ } else { @@ -807,11 +808,11 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode) if (mask[0]) { - snprintf(pcode_string, sizeof(pcode_string), "%s-%s", shape, mask); /* Flawfinder: ignore */ + snprintf(pcode_string, sizeof(pcode_string), "%s-%s", shape, mask); /* Flawfinder: ignore */ } else { - snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */ + snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */ } } return pcode_string; @@ -1279,8 +1280,8 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; - S16 scale_s[MAX_TES]; - S16 scale_t[MAX_TES]; + F32 scale_s[MAX_TES]; + F32 scale_t[MAX_TES]; S16 offset_s[MAX_TES]; S16 offset_t[MAX_TES]; S16 image_rot[MAX_TES]; @@ -1315,8 +1316,8 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const colors[4*face_index + 3] = 255 - coloru.mV[3]; const LLTextureEntry* te = getTE(face_index); - scale_s[face_index] = (S16) llround(((llclamp(te->mScaleS,-LL_MAX_SCALE_S, LL_MAX_SCALE_S)-1.0f)/(LL_MAX_SCALE_S+1.f) * (F32)0x7FFF)); - scale_t[face_index] = (S16) llround(((llclamp(te->mScaleT,-LL_MAX_SCALE_T, LL_MAX_SCALE_T)-1.0f)/(LL_MAX_SCALE_T+1.f) * (F32)0x7FFF)); + scale_s[face_index] = (F32) te->mScaleS; + scale_t[face_index] = (F32) te->mScaleT; offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * (F32)0x7FFF)); @@ -1329,9 +1330,9 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const *cur_ptr++ = 0; cur_ptr += packTEField(cur_ptr, (U8 *)colors, 4 ,last_face_index, MVT_U8); *cur_ptr++ = 0; - cur_ptr += packTEField(cur_ptr, (U8 *)scale_s, 2 ,last_face_index, MVT_S16Array); + cur_ptr += packTEField(cur_ptr, (U8 *)scale_s, 4 ,last_face_index, MVT_F32); *cur_ptr++ = 0; - cur_ptr += packTEField(cur_ptr, (U8 *)scale_t, 2 ,last_face_index, MVT_S16Array); + cur_ptr += packTEField(cur_ptr, (U8 *)scale_t, 4 ,last_face_index, MVT_F32); *cur_ptr++ = 0; cur_ptr += packTEField(cur_ptr, (U8 *)offset_s, 2 ,last_face_index, MVT_S16Array); *cur_ptr++ = 0; @@ -1355,8 +1356,8 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; - S16 scale_s[MAX_TES]; - S16 scale_t[MAX_TES]; + F32 scale_s[MAX_TES]; + F32 scale_t[MAX_TES]; S16 offset_s[MAX_TES]; S16 offset_t[MAX_TES]; S16 image_rot[MAX_TES]; @@ -1391,8 +1392,8 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const colors[4*face_index + 3] = 255 - coloru.mV[3]; const LLTextureEntry* te = getTE(face_index); - scale_s[face_index] = (S16) llround(((llclamp(te->mScaleS,-LL_MAX_SCALE_S, LL_MAX_SCALE_S)-1.0f)/(LL_MAX_SCALE_S+1.f) * (F32)0x7FFF)); - scale_t[face_index] = (S16) llround(((llclamp(te->mScaleT,-LL_MAX_SCALE_T, LL_MAX_SCALE_T)-1.0f)/(LL_MAX_SCALE_T+1.f) * (F32)0x7FFF)); + scale_s[face_index] = (F32) te->mScaleS; + scale_t[face_index] = (F32) te->mScaleT; offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * (F32)0x7FFF)); @@ -1406,9 +1407,9 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const *cur_ptr++ = 0; cur_ptr += packTEField(cur_ptr, (U8 *)colors, 4 ,last_face_index, MVT_U8); *cur_ptr++ = 0; - cur_ptr += packTEField(cur_ptr, (U8 *)scale_s, 2 ,last_face_index, MVT_S16Array); + cur_ptr += packTEField(cur_ptr, (U8 *)scale_s, 4 ,last_face_index, MVT_F32); *cur_ptr++ = 0; - cur_ptr += packTEField(cur_ptr, (U8 *)scale_t, 2 ,last_face_index, MVT_S16Array); + cur_ptr += packTEField(cur_ptr, (U8 *)scale_t, 4 ,last_face_index, MVT_F32); *cur_ptr++ = 0; cur_ptr += packTEField(cur_ptr, (U8 *)offset_s, 2 ,last_face_index, MVT_S16Array); *cur_ptr++ = 0; @@ -1440,8 +1441,8 @@ S32 LLPrimitive::unpackTEMessage(LLMessageSystem *mesgsys, char *block_name, con U8 image_data[MAX_TES*16]; U8 colors[MAX_TES*4]; - S16 scale_s[MAX_TES]; - S16 scale_t[MAX_TES]; + F32 scale_s[MAX_TES]; + F32 scale_t[MAX_TES]; S16 offset_s[MAX_TES]; S16 offset_t[MAX_TES]; S16 image_rot[MAX_TES]; @@ -1484,9 +1485,9 @@ S32 LLPrimitive::unpackTEMessage(LLMessageSystem *mesgsys, char *block_name, con cur_ptr++; cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)colors, 4, face_count, MVT_U8); cur_ptr++; - cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_s, 2, face_count, MVT_S16Array); + cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_s, 4, face_count, MVT_F32); cur_ptr++; - cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_t, 2, face_count, MVT_S16Array); + cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_t, 4, face_count, MVT_F32); cur_ptr++; cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)offset_s, 2, face_count, MVT_S16Array); cur_ptr++; @@ -1503,9 +1504,7 @@ S32 LLPrimitive::unpackTEMessage(LLMessageSystem *mesgsys, char *block_name, con for (U32 i = 0; i < face_count; i++) { retval |= setTETexture(i, ((LLUUID*)image_data)[i]); - retval |= setTEScale(i, - floor((1.0f + ((((F32)scale_s[i] / (F32)0x7FFF)) * (LL_MAX_SCALE_S+1.f))) * 100.f + 0.5f) / 100.f, - floor((1.0f + ((((F32)scale_t[i] / (F32)0x7FFF)) * (LL_MAX_SCALE_T+1.f))) * 100.f + 0.5f) / 100.f); + retval |= setTEScale(i, scale_s[i], scale_t[i]); retval |= setTEOffset(i, (F32)offset_s[i] / (F32)0x7FFF, (F32) offset_t[i] / (F32) 0x7FFF); retval |= setTERotation(i, ((F32)image_rot[i]/ (F32)0x7FFF) * F_TWO_PI); retval |= setTEBumpShinyFullbright(i, bump[i]); @@ -1537,8 +1536,8 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) U8 image_data[MAX_TES*16]; U8 colors[MAX_TES*4]; - S16 scale_s[MAX_TES]; - S16 scale_t[MAX_TES]; + F32 scale_s[MAX_TES]; + F32 scale_t[MAX_TES]; S16 offset_s[MAX_TES]; S16 offset_t[MAX_TES]; S16 image_rot[MAX_TES]; @@ -1571,9 +1570,9 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) cur_ptr++; cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)colors, 4, face_count, MVT_U8); cur_ptr++; - cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_s, 2, face_count, MVT_S16Array); + cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_s, 4, face_count, MVT_F32); cur_ptr++; - cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_t, 2, face_count, MVT_S16Array); + cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_t, 4, face_count, MVT_F32); cur_ptr++; cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)offset_s, 2, face_count, MVT_S16Array); cur_ptr++; @@ -1596,9 +1595,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) for (i = 0; i < face_count; i++) { retval |= setTETexture(i, image_ids[i]); - retval |= setTEScale(i, - floor((1.0f + ((((F32)scale_s[i] / (F32)0x7FFF)) * (LL_MAX_SCALE_S+1.f))) * 100.f + 0.5f) / 100.f, - floor((1.0f + ((((F32)scale_t[i] / (F32)0x7FFF)) * (LL_MAX_SCALE_T+1.f))) * 100.f + 0.5f) / 100.f); + retval |= setTEScale(i, scale_s[i], scale_t[i]); retval |= setTEOffset(i, (F32)offset_s[i] / (F32)0x7FFF, (F32) offset_t[i] / (F32) 0x7FFF); retval |= setTERotation(i, ((F32)image_rot[i]/ (F32)0x7FFF) * F_TWO_PI); retval |= setTEBumpShinyFullbright(i, bump[i]); diff --git a/linden/indra/llprimitive/llprimitive.h b/linden/indra/llprimitive/llprimitive.h index 953d284..89e6623 100644 --- a/linden/indra/llprimitive/llprimitive.h +++ b/linden/indra/llprimitive/llprimitive.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/lltextureanim.cpp b/linden/indra/llprimitive/lltextureanim.cpp index b496463..e373a29 100644 --- a/linden/indra/llprimitive/lltextureanim.cpp +++ b/linden/indra/llprimitive/lltextureanim.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/lltextureanim.h b/linden/indra/llprimitive/lltextureanim.h index b47d492..502cf54 100644 --- a/linden/indra/llprimitive/lltextureanim.h +++ b/linden/indra/llprimitive/lltextureanim.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/lltextureentry.cpp b/linden/indra/llprimitive/lltextureentry.cpp index 5099eef..81bfd6f 100644 --- a/linden/indra/llprimitive/lltextureentry.cpp +++ b/linden/indra/llprimitive/lltextureentry.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/lltextureentry.h b/linden/indra/llprimitive/lltextureentry.h index b06f9a1..861b585 100644 --- a/linden/indra/llprimitive/lltextureentry.h +++ b/linden/indra/llprimitive/lltextureentry.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/lltree_common.h b/linden/indra/llprimitive/lltree_common.h index 0904f9d..f9594e2 100644 --- a/linden/indra/llprimitive/lltree_common.h +++ b/linden/indra/llprimitive/lltree_common.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/lltreeparams.cpp b/linden/indra/llprimitive/lltreeparams.cpp index ce52cae..fde21f0 100644 --- a/linden/indra/llprimitive/lltreeparams.cpp +++ b/linden/indra/llprimitive/lltreeparams.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/lltreeparams.h b/linden/indra/llprimitive/lltreeparams.h index 7822d31..29bbc9a 100644 --- a/linden/indra/llprimitive/lltreeparams.h +++ b/linden/indra/llprimitive/lltreeparams.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/llvolumemessage.cpp b/linden/indra/llprimitive/llvolumemessage.cpp index b00bbc5..650e0cd 100644 --- a/linden/indra/llprimitive/llvolumemessage.cpp +++ b/linden/indra/llprimitive/llvolumemessage.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -42,23 +43,25 @@ bool LLVolumeMessage::packProfileParams( LLMessageSystem *mesgsys) { // Default to cylinder - static LLProfileParams defaultparams(LL_PCODE_PROFILE_CIRCLE, U8(0), U8(0), U8(0)); + static LLProfileParams defaultparams(LL_PCODE_PROFILE_CIRCLE, U16(0), U16(0), U16(0)); if (!params) params = &defaultparams; U8 tempU8; + U16 tempU16; + tempU8 = params->getCurveType(); mesgsys->addU8Fast(_PREHASH_ProfileCurve, tempU8); - tempU8 = (U8) llround( params->getBegin() / CUT_QUANTA); - mesgsys->addU8Fast(_PREHASH_ProfileBegin, tempU8); + tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA); + mesgsys->addU16Fast(_PREHASH_ProfileBegin, tempU16); - tempU8 = 200 - (U8) llround(params->getEnd() / CUT_QUANTA); - mesgsys->addU8Fast(_PREHASH_ProfileEnd, tempU8); + tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + mesgsys->addU16Fast(_PREHASH_ProfileEnd, tempU16); - tempU8 = (S8) llround(params->getHollow() / SHEAR_QUANTA); - mesgsys->addU8Fast(_PREHASH_ProfileHollow, tempU8); + tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA); + mesgsys->addU16Fast(_PREHASH_ProfileHollow, tempU16); return true; } @@ -68,23 +71,25 @@ bool LLVolumeMessage::packProfileParams( LLDataPacker &dp) { // Default to cylinder - static LLProfileParams defaultparams(LL_PCODE_PROFILE_CIRCLE, U8(0), U8(0), U8(0)); + static LLProfileParams defaultparams(LL_PCODE_PROFILE_CIRCLE, U16(0), U16(0), U16(0)); if (!params) params = &defaultparams; U8 tempU8; + U16 tempU16; + tempU8 = params->getCurveType(); dp.packU8(tempU8, "Curve"); - tempU8 = (U8) llround( params->getBegin() / CUT_QUANTA); - dp.packU8(tempU8, "Begin"); + tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA); + dp.packU16(tempU16, "Begin"); - tempU8 = 200 - (U8) llround(params->getEnd() / CUT_QUANTA); - dp.packU8(tempU8, "End"); + tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + dp.packU16(tempU16, "End"); - tempU8 = (S8) llround(params->getHollow() / SHEAR_QUANTA); - dp.packU8(tempU8, "Hollow"); + tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA); + dp.packU16(tempU16, "Hollow"); return true; } @@ -96,13 +101,14 @@ bool LLVolumeMessage::unpackProfileParams( { bool ok = true; U8 temp_u8; + U16 temp_u16; F32 temp_f32; mesgsys->getU8Fast(block_name, _PREHASH_ProfileCurve, temp_u8, block_num); params->setCurveType(temp_u8); - mesgsys->getU8Fast(block_name, _PREHASH_ProfileBegin, temp_u8, block_num); - temp_f32 = temp_u8 * CUT_QUANTA; + mesgsys->getU16Fast(block_name, _PREHASH_ProfileBegin, temp_u16, block_num); + temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { llwarns << "Profile begin out of range: " << temp_f32 @@ -112,8 +118,8 @@ bool LLVolumeMessage::unpackProfileParams( } params->setBegin(temp_f32); - mesgsys->getU8Fast(block_name, _PREHASH_ProfileEnd, temp_u8, block_num); - temp_f32 = temp_u8 * CUT_QUANTA; + mesgsys->getU16Fast(block_name, _PREHASH_ProfileEnd, temp_u16, block_num); + temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { llwarns << "Profile end out of range: " << 1.f - temp_f32 @@ -123,8 +129,8 @@ bool LLVolumeMessage::unpackProfileParams( } params->setEnd(1.f - temp_f32); - mesgsys->getU8Fast(block_name, _PREHASH_ProfileHollow, temp_u8, block_num); - temp_f32 = temp_u8 * SCALE_QUANTA; + mesgsys->getU16Fast(block_name, _PREHASH_ProfileHollow, temp_u16, block_num); + temp_f32 = temp_u16 * HOLLOW_QUANTA; if (temp_f32 > 1.f) { llwarns << "Profile hollow out of range: " << temp_f32 @@ -151,13 +157,14 @@ bool LLVolumeMessage::unpackProfileParams( { bool ok = true; U8 temp_u8; + U16 temp_u16; F32 temp_f32; dp.unpackU8(temp_u8, "Curve"); params->setCurveType(temp_u8); - dp.unpackU8(temp_u8, "Begin"); - temp_f32 = temp_u8 * CUT_QUANTA; + dp.unpackU16(temp_u16, "Begin"); + temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { llwarns << "Profile begin out of range: " << temp_f32 << llendl; @@ -167,8 +174,8 @@ bool LLVolumeMessage::unpackProfileParams( } params->setBegin(temp_f32); - dp.unpackU8(temp_u8, "End"); - temp_f32 = temp_u8 * CUT_QUANTA; + dp.unpackU16(temp_u16, "End"); + temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { llwarns << "Profile end out of range: " << 1.f - temp_f32 << llendl; @@ -178,8 +185,8 @@ bool LLVolumeMessage::unpackProfileParams( } params->setEnd(1.f - temp_f32); - dp.unpackU8(temp_u8, "Hollow"); - temp_f32 = temp_u8 * SCALE_QUANTA; + dp.unpackU16(temp_u16, "Hollow"); + temp_f32 = temp_u16 * HOLLOW_QUANTA; if (temp_f32 > 1.f) { llwarns << "Profile hollow out of range: " << temp_f32 << llendl; @@ -212,11 +219,11 @@ bool LLVolumeMessage::packPathParams( U8 curve = params->getCurveType(); mesgsys->addU8Fast(_PREHASH_PathCurve, curve); - U8 begin = (U8) llround(params->getBegin() / SCALE_QUANTA); - mesgsys->addU8Fast(_PREHASH_PathBegin, begin); + U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA); + mesgsys->addU16Fast(_PREHASH_PathBegin, begin); - U8 end = 100 - (U8) llround(params->getEnd() / SCALE_QUANTA); - mesgsys->addU8Fast(_PREHASH_PathEnd, end); + U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + mesgsys->addU16Fast(_PREHASH_PathEnd, end); // Avoid truncation problem with direct F32->U8 cast. // (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50. @@ -269,11 +276,11 @@ bool LLVolumeMessage::packPathParams( U8 curve = params->getCurveType(); dp.packU8(curve, "Curve"); - U8 begin = (U8) llround(params->getBegin() / SCALE_QUANTA); - dp.packU8(begin, "Begin"); + U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA); + dp.packU16(begin, "Begin"); - U8 end = 100 - (U8) llround(params->getEnd() / SCALE_QUANTA); - dp.packU8(end, "End"); + U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + dp.packU16(end, "End"); // Avoid truncation problem with direct F32->U8 cast. // (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50. @@ -324,13 +331,13 @@ bool LLVolumeMessage::unpackPathParams( mesgsys->getU8Fast(block_name, _PREHASH_PathCurve, curve, block_num); params->setCurveType(curve); - U8 begin; - mesgsys->getU8Fast(block_name, _PREHASH_PathBegin, begin, block_num); - params->setBegin((F32)(begin * SCALE_QUANTA)); + U16 begin; + mesgsys->getU16Fast(block_name, _PREHASH_PathBegin, begin, block_num); + params->setBegin((F32)(begin * CUT_QUANTA)); - U8 end; - mesgsys->getU8Fast(block_name, _PREHASH_PathEnd, end, block_num); - params->setEnd((F32)((100 - end) * SCALE_QUANTA)); + U16 end; + mesgsys->getU16Fast(block_name, _PREHASH_PathEnd, end, block_num); + params->setEnd((F32)((50000 - end) * CUT_QUANTA)); U8 pack_scale_x, pack_scale_y; mesgsys->getU8Fast(block_name, _PREHASH_PathScaleX, pack_scale_x, block_num); @@ -390,14 +397,16 @@ bool LLVolumeMessage::unpackPathParams(LLPathParams* params, LLDataPacker &dp) { U8 value; S8 svalue; + U16 temp_u16; + dp.unpackU8(value, "Curve"); params->setCurveType( value ); - dp.unpackU8(value, "Begin"); - params->setBegin((F32)(value * SCALE_QUANTA)); + dp.unpackU16(temp_u16, "Begin"); + params->setBegin((F32)(temp_u16 * CUT_QUANTA)); - dp.unpackU8(value, "End"); - params->setEnd((F32)((100 - value) * SCALE_QUANTA)); + dp.unpackU16(temp_u16, "End"); + params->setEnd((F32)((50000 - temp_u16) * CUT_QUANTA)); dp.unpackU8(value, "ScaleX"); F32 x = (F32) (200 - value) * SCALE_QUANTA; diff --git a/linden/indra/llprimitive/llvolumemessage.h b/linden/indra/llprimitive/llvolumemessage.h index ad062a9..e626a04 100644 --- a/linden/indra/llprimitive/llvolumemessage.h +++ b/linden/indra/llprimitive/llvolumemessage.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/llvolumexml.cpp b/linden/indra/llprimitive/llvolumexml.cpp index 101eace..370f152 100644 --- a/linden/indra/llprimitive/llvolumexml.cpp +++ b/linden/indra/llprimitive/llvolumexml.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/llvolumexml.h b/linden/indra/llprimitive/llvolumexml.h index c6ae480..0a3d1c5 100644 --- a/linden/indra/llprimitive/llvolumexml.h +++ b/linden/indra/llprimitive/llvolumexml.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/material_codes.h b/linden/indra/llprimitive/material_codes.h index fe55344..01a5573 100644 --- a/linden/indra/llprimitive/material_codes.h +++ b/linden/indra/llprimitive/material_codes.h @@ -4,6 +4,7 @@ * * Copyright (c) 2000-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement diff --git a/linden/indra/llprimitive/object_flags.h b/linden/indra/llprimitive/object_flags.h index 7c8a66c..e7bf023 100644 --- a/linden/indra/llprimitive/object_flags.h +++ b/linden/indra/llprimitive/object_flags.h @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement -- cgit v1.1