PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llhudeffect.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 133 lines | 84 code | 22 blank | 27 comment | 0 complexity | 6c41b09c4ddb9623ddcfa688a9a9d850 MD5 | raw file
  1/** 
  2 * @file llhudeffect.cpp
  3 * @brief LLHUDEffect class implementation
  4 *
  5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#include "llviewerprecompiledheaders.h"
 28
 29#include "llhudeffect.h"
 30
 31#include "message.h"
 32#include "llgl.h"
 33#include "llagent.h"
 34#include "llrendersphere.h"
 35
 36#include "llviewerobjectlist.h"
 37#include "lldrawable.h"
 38
 39LLHUDEffect::LLHUDEffect(const U8 type)
 40:	LLHUDObject(type),
 41	mID(),
 42	mDuration(1.f),
 43	mColor()
 44{
 45	mNeedsSendToSim = FALSE;
 46	mOriginatedHere = FALSE;
 47	mDead = FALSE;
 48}
 49
 50LLHUDEffect::~LLHUDEffect()
 51{
 52}
 53
 54
 55void LLHUDEffect::packData(LLMessageSystem *mesgsys)
 56{
 57	mesgsys->addUUIDFast(_PREHASH_ID, mID);
 58	mesgsys->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
 59	mesgsys->addU8Fast(_PREHASH_Type, mType);
 60	mesgsys->addF32Fast(_PREHASH_Duration, mDuration);
 61	mesgsys->addBinaryData(_PREHASH_Color, mColor.mV, 4);
 62}
 63
 64void LLHUDEffect::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
 65{
 66	mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, mID, blocknum);
 67	mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, mType, blocknum);
 68	mesgsys->getF32Fast(_PREHASH_Effect, _PREHASH_Duration, mDuration, blocknum);
 69	mesgsys->getBinaryDataFast(_PREHASH_Effect,_PREHASH_Color, mColor.mV, 4, blocknum);
 70}
 71
 72void LLHUDEffect::render()
 73{
 74	llerrs << "Never call this!" << llendl;
 75}
 76
 77void LLHUDEffect::setID(const LLUUID &id)
 78{
 79	mID = id;
 80}
 81
 82const LLUUID &LLHUDEffect::getID() const
 83{
 84	return mID;
 85}
 86
 87void LLHUDEffect::setColor(const LLColor4U &color)
 88{
 89	mColor = color;
 90}
 91
 92void LLHUDEffect::setDuration(const F32 duration)
 93{
 94	mDuration = duration;
 95}
 96
 97void LLHUDEffect::setNeedsSendToSim(const BOOL send_to_sim)
 98{
 99	mNeedsSendToSim = send_to_sim;
100}
101
102BOOL LLHUDEffect::getNeedsSendToSim() const
103{
104	return mNeedsSendToSim;
105}
106
107
108void LLHUDEffect::setOriginatedHere(const BOOL orig_here)
109{
110	mOriginatedHere = orig_here;
111}
112
113BOOL LLHUDEffect::getOriginatedHere() const
114{
115	return mOriginatedHere;
116}
117
118//static
119void LLHUDEffect::getIDType(LLMessageSystem *mesgsys, S32 blocknum, LLUUID &id, U8 &type)
120{
121	mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, id, blocknum);
122	mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, type, blocknum);
123}
124
125BOOL LLHUDEffect::isDead() const
126{
127	return mDead;
128}
129
130void LLHUDEffect::update()
131{
132	// do nothing
133}