aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llprimitive
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llprimitive')
-rw-r--r--linden/indra/llprimitive/llmaterialtable.h2
-rw-r--r--linden/indra/llprimitive/llprimitive.cpp100
-rw-r--r--linden/indra/llprimitive/llprimitive.h1
-rw-r--r--linden/indra/llprimitive/llprimitive_vc8.vcproj316
-rw-r--r--linden/indra/llprimitive/llvolumemessage.cpp51
5 files changed, 405 insertions, 65 deletions
diff --git a/linden/indra/llprimitive/llmaterialtable.h b/linden/indra/llprimitive/llmaterialtable.h
index 12be1e9..a472274 100644
--- a/linden/indra/llprimitive/llmaterialtable.h
+++ b/linden/indra/llprimitive/llmaterialtable.h
@@ -38,7 +38,7 @@ class LLMaterialInfo
38{ 38{
39public: 39public:
40 U8 mMCode; 40 U8 mMCode;
41 char mName[LLMATERIAL_INFO_NAME_LENGTH]; 41 char mName[LLMATERIAL_INFO_NAME_LENGTH]; /* Flawfinder: ignore */
42 LLUUID mDefaultTextureID; 42 LLUUID mDefaultTextureID;
43 LLUUID mShatterSoundID; 43 LLUUID mShatterSoundID;
44 F32 mDensity; // kg/m^3 44 F32 mDensity; // kg/m^3
diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp
index 5fb95c8..859a34f 100644
--- a/linden/indra/llprimitive/llprimitive.cpp
+++ b/linden/indra/llprimitive/llprimitive.cpp
@@ -707,13 +707,13 @@ U8 LLPrimitive::pCodeToLegacy(const LLPCode pcode)
707// Don't crash or llerrs here! This function is used for debug strings. 707// Don't crash or llerrs here! This function is used for debug strings.
708const char * LLPrimitive::pCodeToString(const LLPCode pcode) 708const char * LLPrimitive::pCodeToString(const LLPCode pcode)
709{ 709{
710 static char pcode_string[255]; 710 static char pcode_string[255]; /* Flawfinder: ignore */
711 711
712 U8 base_code = pcode & LL_PCODE_BASE_MASK; 712 U8 base_code = pcode & LL_PCODE_BASE_MASK;
713 pcode_string[0] = 0; 713 pcode_string[0] = 0;
714 if (!pcode) 714 if (!pcode)
715 { 715 {
716 sprintf(pcode_string, "null"); 716 snprintf(pcode_string, sizeof(pcode_string), "null"); /* Flawfinder: ignore */
717 } 717 }
718 else if ((base_code) == LL_PCODE_LEGACY) 718 else if ((base_code) == LL_PCODE_LEGACY)
719 { 719 {
@@ -721,66 +721,66 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
721 switch (pcode) 721 switch (pcode)
722 { 722 {
723 case LL_PCODE_LEGACY_GRASS: 723 case LL_PCODE_LEGACY_GRASS:
724 sprintf(pcode_string, "grass"); 724 snprintf(pcode_string, sizeof(pcode_string), "grass"); /* Flawfinder: ignore */
725 break; 725 break;
726 case LL_PCODE_LEGACY_PART_SYS: 726 case LL_PCODE_LEGACY_PART_SYS:
727 sprintf(pcode_string, "particle system"); 727 snprintf(pcode_string, sizeof(pcode_string), "particle system"); /* Flawfinder: ignore */
728 break; 728 break;
729 case LL_PCODE_LEGACY_AVATAR: 729 case LL_PCODE_LEGACY_AVATAR:
730 sprintf(pcode_string, "avatar"); 730 snprintf(pcode_string, sizeof(pcode_string), "avatar"); /* Flawfinder: ignore */
731 break; 731 break;
732 case LL_PCODE_LEGACY_TEXT_BUBBLE: 732 case LL_PCODE_LEGACY_TEXT_BUBBLE:
733 sprintf(pcode_string, "text bubble"); 733 snprintf(pcode_string, sizeof(pcode_string), "text bubble"); /* Flawfinder: ignore */
734 break; 734 break;
735 case LL_PCODE_LEGACY_TREE: 735 case LL_PCODE_LEGACY_TREE:
736 sprintf(pcode_string, "tree"); 736 snprintf(pcode_string, sizeof(pcode_string), "tree"); /* Flawfinder: ignore */
737 break; 737 break;
738 case LL_PCODE_TREE_NEW: 738 case LL_PCODE_TREE_NEW:
739 sprintf(pcode_string, "tree_new"); 739 snprintf(pcode_string, sizeof(pcode_string), "tree_new"); /* Flawfinder: ignore */
740 break; 740 break;
741 default: 741 default:
742 sprintf(pcode_string, "unknown legacy pcode %i",(U32)pcode); 742 snprintf(pcode_string, sizeof(pcode_string), "unknown legacy pcode %i",(U32)pcode); /* Flawfinder: ignore */
743 } 743 }
744 } 744 }
745 else 745 else
746 { 746 {
747 char shape[32]; 747 char shape[32]; /* Flawfinder: ignore */
748 char mask[32]; 748 char mask[32]; /* Flawfinder: ignore */
749 if (base_code == LL_PCODE_CUBE) 749 if (base_code == LL_PCODE_CUBE)
750 { 750 {
751 sprintf(shape, "cube"); 751 snprintf(shape, sizeof(shape), "cube"); /* Flawfinder: ignore */
752 } 752 }
753 else if (base_code == LL_PCODE_CYLINDER) 753 else if (base_code == LL_PCODE_CYLINDER)
754 { 754 {
755 sprintf(shape, "cylinder"); 755 snprintf(shape, sizeof(shape), "cylinder"); /* Flawfinder: ignore */
756 } 756 }
757 else if (base_code == LL_PCODE_CONE) 757 else if (base_code == LL_PCODE_CONE)
758 { 758 {
759 sprintf(shape, "cone"); 759 snprintf(shape, sizeof(shape), "cone"); /* Flawfinder: ignore */
760 } 760 }
761 else if (base_code == LL_PCODE_PRISM) 761 else if (base_code == LL_PCODE_PRISM)
762 { 762 {
763 sprintf(shape, "prism"); 763 snprintf(shape, sizeof(shape), "prism"); /* Flawfinder: ignore */
764 } 764 }
765 else if (base_code == LL_PCODE_PYRAMID) 765 else if (base_code == LL_PCODE_PYRAMID)
766 { 766 {
767 sprintf(shape, "pyramid"); 767 snprintf(shape, sizeof(shape), "pyramid"); /* Flawfinder: ignore */
768 } 768 }
769 else if (base_code == LL_PCODE_SPHERE) 769 else if (base_code == LL_PCODE_SPHERE)
770 { 770 {
771 sprintf(shape, "sphere"); 771 snprintf(shape, sizeof(shape), "sphere"); /* Flawfinder: ignore */
772 } 772 }
773 else if (base_code == LL_PCODE_TETRAHEDRON) 773 else if (base_code == LL_PCODE_TETRAHEDRON)
774 { 774 {
775 sprintf(shape, "tetrahedron"); 775 snprintf(shape, sizeof(shape), "tetrahedron"); /* Flawfinder: ignore */
776 } 776 }
777 else if (base_code == LL_PCODE_VOLUME) 777 else if (base_code == LL_PCODE_VOLUME)
778 { 778 {
779 sprintf(shape, "volume"); 779 snprintf(shape, sizeof(shape), "volume"); /* Flawfinder: ignore */
780 } 780 }
781 else if (base_code == LL_PCODE_APP) 781 else if (base_code == LL_PCODE_APP)
782 { 782 {
783 sprintf(shape, "app"); 783 snprintf(shape, sizeof(shape), "app"); /* Flawfinder: ignore */
784 } 784 }
785 else 785 else
786 { 786 {
@@ -790,15 +790,15 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
790 U8 mask_code = pcode & (~LL_PCODE_BASE_MASK); 790 U8 mask_code = pcode & (~LL_PCODE_BASE_MASK);
791 if (base_code == LL_PCODE_APP) 791 if (base_code == LL_PCODE_APP)
792 { 792 {
793 sprintf(mask, "%x", mask_code); 793 snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
794 } 794 }
795 else if (mask_code & LL_PCODE_HEMI_MASK) 795 else if (mask_code & LL_PCODE_HEMI_MASK)
796 { 796 {
797 sprintf(mask, "hemi"); 797 snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */
798 } 798 }
799 else if (mask != 0) 799 else if (mask != 0)
800 { 800 {
801 sprintf(mask, "%x", mask_code); 801 snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
802 } 802 }
803 else 803 else
804 { 804 {
@@ -807,11 +807,11 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
807 807
808 if (mask[0]) 808 if (mask[0])
809 { 809 {
810 sprintf(pcode_string, "%s-%s", shape, mask); 810 snprintf(pcode_string, sizeof(pcode_string), "%s-%s", shape, mask); /* Flawfinder: ignore */
811 } 811 }
812 else 812 else
813 { 813 {
814 sprintf(pcode_string, "%s", shape); 814 snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */
815 } 815 }
816 } 816 }
817 return pcode_string; 817 return pcode_string;
@@ -1197,7 +1197,7 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa
1197 { 1197 {
1198 if (!memcmp(data_ptr+(data_size *face_index), data_ptr+(data_size *i), data_size)) 1198 if (!memcmp(data_ptr+(data_size *face_index), data_ptr+(data_size *i), data_size))
1199 { 1199 {
1200 exception_faces |= (1 << i); 1200 exception_faces |= ((U64)1 << i);
1201 } 1201 }
1202 } 1202 }
1203 1203
@@ -1238,7 +1238,7 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat
1238 for (i = 1; i < face_count; i++) 1238 for (i = 1; i < face_count; i++)
1239 { 1239 {
1240 // Already unswizzled, don't need to unswizzle it again! 1240 // Already unswizzled, don't need to unswizzle it again!
1241 memcpy(data_ptr+(i*data_size),data_ptr,data_size); 1241 memcpy(data_ptr+(i*data_size),data_ptr,data_size); /* Flawfinder: ignore */
1242 } 1242 }
1243 1243
1244 while ((cur_ptr < buffer_end) && (*cur_ptr != 0)) 1244 while ((cur_ptr < buffer_end) && (*cur_ptr != 0))
@@ -1301,7 +1301,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
1301 for (face_index = 0; face_index <= last_face_index; face_index++) 1301 for (face_index = 0; face_index <= last_face_index; face_index++)
1302 { 1302 {
1303 // Directly sending image_ids is not safe! 1303 // Directly sending image_ids is not safe!
1304 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); 1304 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */
1305 1305
1306 // Cast LLColor4 to LLColor4U 1306 // Cast LLColor4 to LLColor4U
1307 coloru.setVec( getTE(face_index)->getColor() ); 1307 coloru.setVec( getTE(face_index)->getColor() );
@@ -1377,7 +1377,7 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
1377 for (face_index = 0; face_index <= last_face_index; face_index++) 1377 for (face_index = 0; face_index <= last_face_index; face_index++)
1378 { 1378 {
1379 // Directly sending image_ids is not safe! 1379 // Directly sending image_ids is not safe!
1380 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); 1380 memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */
1381 1381
1382 // Cast LLColor4 to LLColor4U 1382 // Cast LLColor4 to LLColor4U
1383 coloru.setVec( getTE(face_index)->getColor() ); 1383 coloru.setVec( getTE(face_index)->getColor() );
@@ -1588,7 +1588,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
1588 for (i = 0; i < face_count; i++) 1588 for (i = 0; i < face_count; i++)
1589 { 1589 {
1590// llinfos << "BUMP unpack (Datapacker) [" << i << "]=" << S32(bump[i]) <<llendl; 1590// llinfos << "BUMP unpack (Datapacker) [" << i << "]=" << S32(bump[i]) <<llendl;
1591 memcpy(image_ids[i].mData,&image_data[i*16],16); 1591 memcpy(image_ids[i].mData,&image_data[i*16],16); /* Flawfinder: ignore */
1592 } 1592 }
1593 1593
1594 LLColor4 color; 1594 LLColor4 color;
@@ -1628,6 +1628,24 @@ void LLPrimitive::setTextureList(LLTextureEntry *listp)
1628 1628
1629//============================================================================ 1629//============================================================================
1630 1630
1631//static
1632BOOL LLNetworkData::isValid(U16 param_type, U32 size)
1633{
1634 // ew - better mechanism needed
1635
1636 switch(param_type)
1637 {
1638 case PARAMS_FLEXIBLE:
1639 return (size == 16);
1640 case PARAMS_LIGHT:
1641 return (size == 16);
1642 }
1643
1644 return FALSE;
1645}
1646
1647//============================================================================
1648
1631LLLightParams::LLLightParams() 1649LLLightParams::LLLightParams()
1632{ 1650{
1633 mColor.setToWhite(); 1651 mColor.setToWhite();
@@ -1650,12 +1668,22 @@ BOOL LLLightParams::pack(LLDataPacker &dp) const
1650 1668
1651BOOL LLLightParams::unpack(LLDataPacker &dp) 1669BOOL LLLightParams::unpack(LLDataPacker &dp)
1652{ 1670{
1653 LLColor4U color4u; 1671 LLColor4U color;
1654 dp.unpackColor4U(color4u, "color"); 1672 dp.unpackColor4U(color, "color");
1655 mColor = LLColor4(color4u); 1673 setColor(LLColor4(color));
1656 dp.unpackF32(mRadius, "radius"); 1674
1657 dp.unpackF32(mCutoff, "cutoff"); 1675 F32 radius;
1658 dp.unpackF32(mFalloff, "falloff"); 1676 dp.unpackF32(radius, "radius");
1677 setRadius(radius);
1678
1679 F32 cutoff;
1680 dp.unpackF32(cutoff, "cutoff");
1681 setCutoff(cutoff);
1682
1683 F32 falloff;
1684 dp.unpackF32(falloff, "falloff");
1685 setFalloff(falloff);
1686
1659 return TRUE; 1687 return TRUE;
1660} 1688}
1661 1689
diff --git a/linden/indra/llprimitive/llprimitive.h b/linden/indra/llprimitive/llprimitive.h
index e51fdcf..953d284 100644
--- a/linden/indra/llprimitive/llprimitive.h
+++ b/linden/indra/llprimitive/llprimitive.h
@@ -108,6 +108,7 @@ public:
108 virtual BOOL unpack(LLDataPacker &dp) = 0; 108 virtual BOOL unpack(LLDataPacker &dp) = 0;
109 virtual bool operator==(const LLNetworkData& data) const = 0; 109 virtual bool operator==(const LLNetworkData& data) const = 0;
110 virtual void copy(const LLNetworkData& data) = 0; 110 virtual void copy(const LLNetworkData& data) = 0;
111 static BOOL isValid(U16 param_type, U32 size);
111}; 112};
112 113
113extern const F32 LIGHT_MIN_RADIUS; 114extern const F32 LIGHT_MIN_RADIUS;
diff --git a/linden/indra/llprimitive/llprimitive_vc8.vcproj b/linden/indra/llprimitive/llprimitive_vc8.vcproj
new file mode 100644
index 0000000..5fbcbb1
--- /dev/null
+++ b/linden/indra/llprimitive/llprimitive_vc8.vcproj
@@ -0,0 +1,316 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llprimitive"
6 ProjectGUID="{FCC4483C-5B84-4944-B91F-4589A219BC0B}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llxml;..\llprimitive;..\llcommon;..\llmath;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llprimitive.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llxml;..\llprimitive;..\llcommon;..\llmath;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llprimitive.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llxml;..\llprimitive;..\llcommon;..\llmath;..\llmessage;..\..\libraries\i686-win32\include;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llprimitive.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\llmaterialtable.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\llprimitive.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\lltextureanim.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\lltextureentry.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\lltreeparams.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llvolumemessage.cpp"
250 >
251 </File>
252 <File
253 RelativePath=".\llvolumexml.cpp"
254 >
255 </File>
256 </Filter>
257 <Filter
258 Name="Header Files"
259 Filter="h;hpp;hxx;hm;inl;inc;xsd"
260 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
261 >
262 <File
263 RelativePath=".\legacy_object_types.h"
264 >
265 </File>
266 <File
267 RelativePath=".\llmaterialtable.h"
268 >
269 </File>
270 <File
271 RelativePath=".\llprimitive.h"
272 >
273 </File>
274 <File
275 RelativePath=".\lltextureanim.h"
276 >
277 </File>
278 <File
279 RelativePath=".\lltextureentry.h"
280 >
281 </File>
282 <File
283 RelativePath=".\lltree_common.h"
284 >
285 </File>
286 <File
287 RelativePath=".\lltreeparams.h"
288 >
289 </File>
290 <File
291 RelativePath=".\llvolumemessage.h"
292 >
293 </File>
294 <File
295 RelativePath=".\llvolumexml.h"
296 >
297 </File>
298 <File
299 RelativePath=".\material_codes.h"
300 >
301 </File>
302 <File
303 RelativePath=".\object_flags.h"
304 >
305 </File>
306 </Filter>
307 <Filter
308 Name="Resource Files"
309 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
310 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
311 >
312 </Filter>
313 </Files>
314 <Globals>
315 </Globals>
316</VisualStudioProject>
diff --git a/linden/indra/llprimitive/llvolumemessage.cpp b/linden/indra/llprimitive/llvolumemessage.cpp
index cecd2c2..b00bbc5 100644
--- a/linden/indra/llprimitive/llvolumemessage.cpp
+++ b/linden/indra/llprimitive/llvolumemessage.cpp
@@ -448,41 +448,36 @@ bool LLVolumeMessage::unpackPathParams(LLPathParams* params, LLDataPacker &dp)
448// static 448// static
449bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params) 449bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params)
450{ 450{
451 bool ok = true; 451 U32 bad = 0;
452 452
453 // This is called immediately after an unpack. feed the raw data 453 // This is called immediately after an unpack. feed the raw data
454 // through the checked setters to constraint it to a valid set of 454 // through the checked setters to constraint it to a valid set of
455 // volume params. 455 // volume params.
456 ok &= params.setType( 456 bad |= params.setType(params.getProfileParams().getCurveType(),
457 params.getProfileParams().getCurveType(), 457 params.getPathParams().getCurveType()) ? 0 : 1;
458 params.getPathParams().getCurveType()); 458 bad |= params.setBeginAndEndS(params.getProfileParams().getBegin(),
459 ok &= params.setBeginAndEndS( 459 params.getProfileParams().getEnd()) ? 0 : 2;
460 params.getProfileParams().getBegin(), 460 bad |= params.setBeginAndEndT(params.getPathParams().getBegin(),
461 params.getProfileParams().getEnd()); 461 params.getPathParams().getEnd()) ? 0 : 4;
462 ok &= params.setBeginAndEndT( 462 bad |= params.setHollow(params.getProfileParams().getHollow()) ? 0 : 8;
463 params.getPathParams().getBegin(), 463 bad |= params.setTwistBegin(params.getPathParams().getTwistBegin()) ? 0 : 0x10;
464 params.getPathParams().getEnd()); 464 bad |= params.setTwistEnd(params.getPathParams().getTwistEnd()) ? 0 : 0x20;
465 ok &= params.setHollow(params.getProfileParams().getHollow()); 465 bad |= params.setRatio(params.getPathParams().getScaleX(),
466 ok &= params.setTwistBegin(params.getPathParams().getTwistBegin()); 466 params.getPathParams().getScaleY()) ? 0 : 0x40;
467 ok &= params.setTwistEnd(params.getPathParams().getTwistEnd()); 467 bad |= params.setShear(params.getPathParams().getShearX(),
468 ok &= params.setRatio( 468 params.getPathParams().getShearY()) ? 0 : 0x80;
469 params.getPathParams().getScaleX(), 469 bad |= params.setTaper(params.getPathParams().getTaperX(),
470 params.getPathParams().getScaleY()); 470 params.getPathParams().getTaperY()) ? 0 : 0x100;
471 ok &= params.setShear( 471 bad |= params.setRevolutions(params.getPathParams().getRevolutions()) ? 0 : 0x200;
472 params.getPathParams().getShearX(), 472 bad |= params.setRadiusOffset(params.getPathParams().getRadiusOffset()) ? 0 : 0x400;
473 params.getPathParams().getShearY()); 473 bad |= params.setSkew(params.getPathParams().getSkew()) ? 0 : 0x800;
474 ok &= params.setTaper( 474 if(bad)
475 params.getPathParams().getTaperX(),
476 params.getPathParams().getTaperY());
477 ok &= params.setRevolutions(params.getPathParams().getRevolutions());
478 ok &= params.setRadiusOffset(params.getPathParams().getRadiusOffset());
479 ok &= params.setSkew(params.getPathParams().getSkew());
480 if(!ok)
481 { 475 {
482 llwarns << "LLVolumeMessage::constrainVolumeParams() - " 476 llwarns << "LLVolumeMessage::constrainVolumeParams() - "
483 << "forced to constrain incoming volume params." << llendl; 477 << "forced to constrain incoming volume params: "
478 << llformat("0x%04x",bad) << llendl;
484 } 479 }
485 return ok; 480 return bad ? false : true;
486} 481}
487 482
488bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys) 483bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys)