diff options
Diffstat (limited to 'linden/indra/newview/llhudeffect.cpp')
-rw-r--r-- | linden/indra/newview/llhudeffect.cpp | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/linden/indra/newview/llhudeffect.cpp b/linden/indra/newview/llhudeffect.cpp new file mode 100644 index 0000000..6343dc3 --- /dev/null +++ b/linden/indra/newview/llhudeffect.cpp | |||
@@ -0,0 +1,134 @@ | |||
1 | /** | ||
2 | * @file llhudeffect.cpp | ||
3 | * @brief LLHUDEffect class implementation | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #include "llviewerprecompiledheaders.h" | ||
29 | |||
30 | #include "llhudeffect.h" | ||
31 | |||
32 | #include "message.h" | ||
33 | #include "llgl.h" | ||
34 | #include "llagent.h" | ||
35 | #include "llsphere.h" | ||
36 | #include "llimagegl.h" | ||
37 | |||
38 | #include "llviewerobjectlist.h" | ||
39 | #include "lldrawable.h" | ||
40 | |||
41 | LLHUDEffect::LLHUDEffect(const U8 type) | ||
42 | : LLHUDObject(type), | ||
43 | mID(), | ||
44 | mDuration(1.f), | ||
45 | mColor() | ||
46 | { | ||
47 | mNeedsSendToSim = FALSE; | ||
48 | mOriginatedHere = FALSE; | ||
49 | mDead = FALSE; | ||
50 | } | ||
51 | |||
52 | LLHUDEffect::~LLHUDEffect() | ||
53 | { | ||
54 | } | ||
55 | |||
56 | |||
57 | void LLHUDEffect::packData(LLMessageSystem *mesgsys) | ||
58 | { | ||
59 | mesgsys->addUUIDFast(_PREHASH_ID, mID); | ||
60 | mesgsys->addU8Fast(_PREHASH_Type, mType); | ||
61 | mesgsys->addF32Fast(_PREHASH_Duration, mDuration); | ||
62 | mesgsys->addBinaryData(_PREHASH_Color, mColor.mV, 4); | ||
63 | } | ||
64 | |||
65 | void LLHUDEffect::unpackData(LLMessageSystem *mesgsys, S32 blocknum) | ||
66 | { | ||
67 | mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, mID, blocknum); | ||
68 | mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, mType, blocknum); | ||
69 | mesgsys->getF32Fast(_PREHASH_Effect, _PREHASH_Duration, mDuration, blocknum); | ||
70 | mesgsys->getBinaryDataFast(_PREHASH_Effect,_PREHASH_Color, mColor.mV, 4, blocknum); | ||
71 | } | ||
72 | |||
73 | void LLHUDEffect::render() | ||
74 | { | ||
75 | llerrs << "Never call this!" << llendl; | ||
76 | } | ||
77 | |||
78 | void LLHUDEffect::setID(const LLUUID &id) | ||
79 | { | ||
80 | mID = id; | ||
81 | } | ||
82 | |||
83 | const LLUUID &LLHUDEffect::getID() const | ||
84 | { | ||
85 | return mID; | ||
86 | } | ||
87 | |||
88 | void LLHUDEffect::setColor(const LLColor4U &color) | ||
89 | { | ||
90 | mColor = color; | ||
91 | } | ||
92 | |||
93 | void LLHUDEffect::setDuration(const F32 duration) | ||
94 | { | ||
95 | mDuration = duration; | ||
96 | } | ||
97 | |||
98 | void LLHUDEffect::setNeedsSendToSim(const BOOL send_to_sim) | ||
99 | { | ||
100 | mNeedsSendToSim = send_to_sim; | ||
101 | } | ||
102 | |||
103 | BOOL LLHUDEffect::getNeedsSendToSim() const | ||
104 | { | ||
105 | return mNeedsSendToSim; | ||
106 | } | ||
107 | |||
108 | |||
109 | void LLHUDEffect::setOriginatedHere(const BOOL orig_here) | ||
110 | { | ||
111 | mOriginatedHere = orig_here; | ||
112 | } | ||
113 | |||
114 | BOOL LLHUDEffect::getOriginatedHere() const | ||
115 | { | ||
116 | return mOriginatedHere; | ||
117 | } | ||
118 | |||
119 | //static | ||
120 | void LLHUDEffect::getIDType(LLMessageSystem *mesgsys, S32 blocknum, LLUUID &id, U8 &type) | ||
121 | { | ||
122 | mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_ID, id, blocknum); | ||
123 | mesgsys->getU8Fast(_PREHASH_Effect, _PREHASH_Type, type, blocknum); | ||
124 | } | ||
125 | |||
126 | BOOL LLHUDEffect::isDead() const | ||
127 | { | ||
128 | return mDead; | ||
129 | } | ||
130 | |||
131 | void LLHUDEffect::update() | ||
132 | { | ||
133 | // do nothing | ||
134 | } | ||