llhudeffect.cpp

Go to the documentation of this file.
00001 
00032 #include "llviewerprecompiledheaders.h"
00033 
00034 #include "llhudeffect.h"
00035 
00036 #include "message.h"
00037 #include "llgl.h"
00038 #include "llagent.h"
00039 #include "llsphere.h"
00040 #include "llimagegl.h"
00041 
00042 #include "llviewerobjectlist.h"
00043 #include "lldrawable.h"
00044 
00045 LLHUDEffect::LLHUDEffect(const U8 type)
00046 :       LLHUDObject(type),
00047         mID(),
00048         mDuration(1.f),
00049         mColor()
00050 {
00051         mNeedsSendToSim = FALSE;
00052         mOriginatedHere = FALSE;
00053         mDead = FALSE;
00054 }
00055 
00056 LLHUDEffect::~LLHUDEffect()
00057 {
00058 }
00059 
00060 
00061 void LLHUDEffect::packData(LLMessageSystem *mesgsys)
00062 {
00063         mesgsys->addUUIDFast(_PREHASH_ID, mID);
00064         mesgsys->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
00065         mesgsys->addU8Fast(_PREHASH_Type, mType);
00066         mesgsys->addF32Fast(_PREHASH_Duration, mDuration);
00067         mesgsys->addBinaryData(_PREHASH_Color, mColor.mV, 4);
00068 }
00069 
00070 void LLHUDEffect::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
00071 {
00072         mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, mID, blocknum);
00073         mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, mType, blocknum);
00074         mesgsys->getF32Fast(_PREHASH_Effect, _PREHASH_Duration, mDuration, blocknum);
00075         mesgsys->getBinaryDataFast(_PREHASH_Effect,_PREHASH_Color, mColor.mV, 4, blocknum);
00076 }
00077 
00078 void LLHUDEffect::render()
00079 {
00080         llerrs << "Never call this!" << llendl;
00081 }
00082 
00083 void LLHUDEffect::setID(const LLUUID &id)
00084 {
00085         mID = id;
00086 }
00087 
00088 const LLUUID &LLHUDEffect::getID() const
00089 {
00090         return mID;
00091 }
00092 
00093 void LLHUDEffect::setColor(const LLColor4U &color)
00094 {
00095         mColor = color;
00096 }
00097 
00098 void LLHUDEffect::setDuration(const F32 duration)
00099 {
00100         mDuration = duration;
00101 }
00102 
00103 void LLHUDEffect::setNeedsSendToSim(const BOOL send_to_sim)
00104 {
00105         mNeedsSendToSim = send_to_sim;
00106 }
00107 
00108 BOOL LLHUDEffect::getNeedsSendToSim() const
00109 {
00110         return mNeedsSendToSim;
00111 }
00112 
00113 
00114 void LLHUDEffect::setOriginatedHere(const BOOL orig_here)
00115 {
00116         mOriginatedHere = orig_here;
00117 }
00118 
00119 BOOL LLHUDEffect::getOriginatedHere() const
00120 {
00121         return mOriginatedHere;
00122 }
00123 
00124 //static
00125 void LLHUDEffect::getIDType(LLMessageSystem *mesgsys, S32 blocknum, LLUUID &id, U8 &type)
00126 {
00127         mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, id, blocknum);
00128         mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, type, blocknum);
00129 }
00130 
00131 BOOL LLHUDEffect::isDead() const
00132 {
00133         return mDead;
00134 }
00135 
00136 void LLHUDEffect::update()
00137 {
00138         // do nothing
00139 }

Generated on Thu Jul 1 06:08:42 2010 for Second Life Viewer by  doxygen 1.4.7