summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llprimitive.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive/llprimitive.h')
-rwxr-xr-x[-rw-r--r--]indra/llprimitive/llprimitive.h77
1 files changed, 61 insertions, 16 deletions
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index f535fb1672..1bf83e36b4 100644..100755
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -42,6 +42,7 @@ class LLMessageSystem;
class LLVolumeParams;
class LLColor4;
class LLColor3;
+class LLMaterialID;
class LLTextureEntry;
class LLDataPacker;
class LLVolumeMgr;
@@ -103,6 +104,8 @@ public:
PARAMS_LIGHT = 0x20,
PARAMS_SCULPT = 0x30,
PARAMS_LIGHT_IMAGE = 0x40,
+ PARAMS_RESERVED = 0x50, // Used on server-side
+ PARAMS_MESH = 0x60,
};
public:
@@ -287,6 +290,35 @@ public:
};
+// This code is not naming-standards compliant. Leaving it like this for
+// now to make the connection to code in
+// BOOL packTEMessage(LLDataPacker &dp) const;
+// more obvious. This should be refactored to remove the duplication, at which
+// point we can fix the names as well.
+// - Vir
+struct LLTEContents
+{
+ static const U32 MAX_TES = 32;
+
+ U8 image_data[MAX_TES*16];
+ U8 colors[MAX_TES*4];
+ 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];
+ U8 bump[MAX_TES];
+ U8 media_flags[MAX_TES];
+ U8 glow[MAX_TES];
+ LLMaterialID material_ids[MAX_TES];
+
+ static const U32 MAX_TE_BUFFER = 4096;
+ U8 packed_buffer[MAX_TE_BUFFER];
+
+ U32 size;
+ U32 face_count;
+};
+
class LLPrimitive : public LLXform
{
public:
@@ -323,12 +355,13 @@ public:
const LLVolume *getVolumeConst() const { return mVolumep; } // HACK for Windoze confusion about ostream operator in LLVolume
LLVolume *getVolume() const { return mVolumep; }
virtual BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false);
-
+
// Modify texture entry properties
inline BOOL validTE(const U8 te_num) const;
LLTextureEntry* getTE(const U8 te_num) const;
virtual void setNumTEs(const U8 num_tes);
+ virtual void setAllTESelected(bool sel);
virtual void setAllTETextures(const LLUUID &tex_id);
virtual void setTE(const U8 index, const LLTextureEntry& te);
virtual S32 setTEColor(const U8 te, const LLColor4 &color);
@@ -351,16 +384,22 @@ public:
virtual S32 setTEFullbright(const U8 te, const U8 fullbright);
virtual S32 setTEMediaFlags(const U8 te, const U8 flags);
virtual S32 setTEGlow(const U8 te, const F32 glow);
+ virtual S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
+ virtual S32 setTEMaterialParams(const U8 index, const LLMaterialPtr pMaterialParams);
virtual BOOL setMaterial(const U8 material); // returns TRUE if material changed
+ virtual void setTESelected(const U8 te, bool sel);
+
+ LLMaterialPtr getTEMaterialParams(const U8 index);
void copyTEs(const LLPrimitive *primitive);
S32 packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_face_index, EMsgVariableType type) const;
S32 unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 data_size, U8 face_count, EMsgVariableType type);
BOOL packTEMessage(LLMessageSystem *mesgsys) const;
BOOL packTEMessage(LLDataPacker &dp) const;
- S32 unpackTEMessage(LLMessageSystem *mesgsys, char *block_name);
- S32 unpackTEMessage(LLMessageSystem *mesgsys, char *block_name, const S32 block_num); // Variable num of blocks
+ S32 unpackTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num); // Variable num of blocks
BOOL unpackTEMessage(LLDataPacker &dp);
+ S32 parseTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num, LLTEContents& tec);
+ S32 applyParsedTEMessage(LLTEContents& tec);
#ifdef CHECK_FOR_FINITE
inline void setPosition(const LLVector3& pos);
@@ -419,7 +458,8 @@ public:
inline BOOL isAvatar() const;
inline BOOL isSittingAvatar() const;
inline BOOL isSittingAvatarOnGround() const;
-
+ inline bool hasBumpmap() const { return mNumBumpmapTEs > 0;}
+
void setFlags(U32 flags) { mMiscFlags = flags; }
void addFlags(U32 flags) { mMiscFlags |= flags; }
void removeFlags(U32 flags) { mMiscFlags &= ~flags; }
@@ -433,6 +473,9 @@ public:
inline static BOOL isPrimitive(const LLPCode pcode);
inline static BOOL isApp(const LLPCode pcode);
+private:
+ void updateNumBumpmap(const U8 index, const U8 bump);
+
protected:
LLPCode mPrimitiveCode; // Primitive code
LLVector3 mVelocity; // how fast are we moving?
@@ -442,8 +485,10 @@ protected:
LLPrimTextureList mTextureList; // list of texture GUIDs, scales, offsets
U8 mMaterial; // Material code
U8 mNumTEs; // # of faces on the primitve
+ U8 mNumBumpmapTEs; // number of bumpmap TEs.
U32 mMiscFlags; // home for misc bools
+public:
static LLVolumeMgr* sVolumeManager;
};
@@ -497,7 +542,7 @@ void LLPrimitive::setPosition(const F32 x, const F32 y, const F32 z)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setPosition(x,y,z) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setPosition(x,y,z) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -510,7 +555,7 @@ void LLPrimitive::setPosition(const LLVector3& pos)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setPosition(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setPosition(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -522,7 +567,7 @@ void LLPrimitive::setAngularVelocity(const LLVector3& avel)
}
else
{
- llerror("Non Finite in LLPrimitive::setAngularVelocity", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setAngularVelocity" << LL_ENDL;
}
}
@@ -534,7 +579,7 @@ void LLPrimitive::setAngularVelocity(const F32 x, const F32 y, const F32 z)
}
else
{
- llerror("Non Finite in LLPrimitive::setAngularVelocity", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setAngularVelocity" << LL_ENDL;
}
}
@@ -546,7 +591,7 @@ void LLPrimitive::setVelocity(const LLVector3& vel)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setVelocity(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocity(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -558,7 +603,7 @@ void LLPrimitive::setVelocity(const F32 x, const F32 y, const F32 z)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setVelocity(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocity(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -570,7 +615,7 @@ void LLPrimitive::setVelocityX(const F32 x)
}
else
{
- llerror("Non Finite in LLPrimitive::setVelocityX", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocityX" << LL_ENDL;
}
}
@@ -582,7 +627,7 @@ void LLPrimitive::setVelocityY(const F32 y)
}
else
{
- llerror("Non Finite in LLPrimitive::setVelocityY", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocityY" << LL_ENDL;
}
}
@@ -594,7 +639,7 @@ void LLPrimitive::setVelocityZ(const F32 z)
}
else
{
- llerror("Non Finite in LLPrimitive::setVelocityZ", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocityZ" << LL_ENDL;
}
}
@@ -606,7 +651,7 @@ void LLPrimitive::addVelocity(const LLVector3& vel)
}
else
{
- llerror("Non Finite in LLPrimitive::addVelocity", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::addVelocity" << LL_ENDL;
}
}
@@ -618,7 +663,7 @@ void LLPrimitive::setAcceleration(const LLVector3& accel)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setAcceleration(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setAcceleration(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -630,7 +675,7 @@ void LLPrimitive::setAcceleration(const F32 x, const F32 y, const F32 z)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setAcceleration(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setAcceleration(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
#endif // CHECK_FOR_FINITE