summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-03-06 00:37:09 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-03-06 00:37:09 +0000
commit14360b815ed486c90c57b8025f8c93376ca6b6c6 (patch)
tree30707bf0bf390ebf6357325aa31e34ad8553f2ac /indra/llprimitive
parentb06b9cd30464188f68a1125db9ecc588fdf5ca71 (diff)
merge -r 58641:58711 maintenance -> release
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llprimitive.cpp40
-rw-r--r--indra/llprimitive/llprimitive.h1
2 files changed, 35 insertions, 6 deletions
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 105f7c8c9e..1b96ac16d4 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -1609,6 +1609,24 @@ void LLPrimitive::setTextureList(LLTextureEntry *listp)
//============================================================================
+//static
+BOOL LLNetworkData::isValid(U16 param_type, U32 size)
+{
+ // ew - better mechanism needed
+
+ switch(param_type)
+ {
+ case PARAMS_FLEXIBLE:
+ return (size == 16);
+ case PARAMS_LIGHT:
+ return (size == 16);
+ }
+
+ return FALSE;
+}
+
+//============================================================================
+
LLLightParams::LLLightParams()
{
mColor.setToWhite();
@@ -1631,12 +1649,22 @@ BOOL LLLightParams::pack(LLDataPacker &dp) const
BOOL LLLightParams::unpack(LLDataPacker &dp)
{
- LLColor4U color4u;
- dp.unpackColor4U(color4u, "color");
- mColor = LLColor4(color4u);
- dp.unpackF32(mRadius, "radius");
- dp.unpackF32(mCutoff, "cutoff");
- dp.unpackF32(mFalloff, "falloff");
+ LLColor4U color;
+ dp.unpackColor4U(color, "color");
+ setColor(LLColor4(color));
+
+ F32 radius;
+ dp.unpackF32(radius, "radius");
+ setRadius(radius);
+
+ F32 cutoff;
+ dp.unpackF32(cutoff, "cutoff");
+ setCutoff(cutoff);
+
+ F32 falloff;
+ dp.unpackF32(falloff, "falloff");
+ setFalloff(falloff);
+
return TRUE;
}
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index 3ad96bf6e1..90871fd319 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -89,6 +89,7 @@ public:
virtual BOOL unpack(LLDataPacker &dp) = 0;
virtual bool operator==(const LLNetworkData& data) const = 0;
virtual void copy(const LLNetworkData& data) = 0;
+ static BOOL isValid(U16 param_type, U32 size);
};
extern const F32 LIGHT_MIN_RADIUS;