aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvotextbubble.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llvotextbubble.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/newview/llvotextbubble.cpp')
-rw-r--r--linden/indra/newview/llvotextbubble.cpp80
1 files changed, 61 insertions, 19 deletions
diff --git a/linden/indra/newview/llvotextbubble.cpp b/linden/indra/newview/llvotextbubble.cpp
index 96ffe6b..ee0359b 100644
--- a/linden/indra/newview/llvotextbubble.cpp
+++ b/linden/indra/newview/llvotextbubble.cpp
@@ -43,7 +43,7 @@
43#include "pipeline.h" 43#include "pipeline.h"
44 44
45LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 45LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
46: LLViewerObject(id, pcode, regionp) 46: LLAlphaObject(id, pcode, regionp)
47{ 47{
48 setScale(LLVector3(1.5f, 1.5f, 0.25f)); 48 setScale(LLVector3(1.5f, 1.5f, 0.25f));
49 mbCanSelect = FALSE; 49 mbCanSelect = FALSE;
@@ -102,8 +102,10 @@ BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
102 for (i = 0; i < getNumTEs(); i++) 102 for (i = 0; i < getNumTEs(); i++)
103 { 103 {
104 setTEColor(i, color); 104 setTEColor(i, color);
105 setTEFullbright(i, TRUE);
105 } 106 }
106 107
108 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
107 return TRUE; 109 return TRUE;
108} 110}
109 111
@@ -145,15 +147,14 @@ LLDrawable *LLVOTextBubble::createDrawable(LLPipeline *pipeline)
145 pipeline->allocDrawable(this); 147 pipeline->allocDrawable(this);
146 mDrawable->setLit(FALSE); 148 mDrawable->setLit(FALSE);
147 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME); 149 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME);
148 LLDrawPool *poolp; 150
149 for (U32 i = 0; i < getNumTEs(); i++) 151 for (U32 i = 0; i < getNumTEs(); i++)
150 { 152 {
151 LLViewerImage *imagep; 153 LLViewerImage *imagep;
152 const LLTextureEntry *texture_entry = getTE(i); 154 const LLTextureEntry *texture_entry = getTE(i);
153 imagep = gImageList.getImage(texture_entry->getID()); 155 imagep = gImageList.getImage(texture_entry->getID());
154 156
155 poolp = gPipeline.getPool(LLDrawPool::POOL_ALPHA); 157 mDrawable->addFace((LLFacePool*) NULL, imagep);
156 mDrawable->addFace(poolp, imagep);
157 } 158 }
158 159
159 return mDrawable; 160 return mDrawable;
@@ -200,24 +201,65 @@ BOOL LLVOTextBubble::updateGeometry(LLDrawable *drawable)
200 for (S32 i = 0; i < drawable->getNumFaces(); i++) 201 for (S32 i = 0; i < drawable->getNumFaces(); i++)
201 { 202 {
202 LLFace *face = drawable->getFace(i); 203 LLFace *face = drawable->getFace(i);
203
204 if (i == 0)
205 {
206 face->setSize(0);
207 continue;
208 }
209 if (i == 2)
210 {
211 face->setSize(0);
212 continue;
213 }
214
215 // Need to figure out how to readd logic to determine face dirty vs. entire object dirty.
216 face->setTEOffset(i); 204 face->setTEOffset(i);
217 face->clearState(LLFace::GLOBAL); 205 face->setTexture(LLViewerImage::sSmokeImagep);
218 face->genVolumeTriangles(*getVolume(), i, identity4, identity3); 206 face->setState(LLFace::FULLBRIGHT);
219 } 207 }
208
220 mVolumeChanged = FALSE; 209 mVolumeChanged = FALSE;
221 210
211 mDrawable->movePartition();
222 return TRUE; 212 return TRUE;
223} 213}
214
215void LLVOTextBubble::updateFaceSize(S32 idx)
216{
217 LLFace* face = mDrawable->getFace(idx);
218
219 if (idx == 0 || idx == 2)
220 {
221 face->setSize(0,0);
222 }
223 else
224 {
225 const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
226 face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size());
227 }
228}
229
230void LLVOTextBubble::getGeometry(S32 idx,
231 LLStrider<LLVector3>& verticesp,
232 LLStrider<LLVector3>& normalsp,
233 LLStrider<LLVector2>& texcoordsp,
234 LLStrider<LLColor4U>& colorsp,
235 LLStrider<U32>& indicesp)
236{
237 if (idx == 0 || idx == 2)
238 {
239 return;
240 }
241
242 const LLVolumeFace& face = getVolume()->getVolumeFace(idx);
243
244 LLVector3 pos = getPositionAgent();
245 LLColor4U color = LLColor4U(getTE(idx)->getColor());
246 U32 offset = mDrawable->getFace(idx)->getGeomIndex();
247
248 for (U32 i = 0; i < face.mVertices.size(); i++)
249 {
250 *verticesp++ = face.mVertices[i].mPosition.scaledVec(getScale()) + pos;
251 *normalsp++ = face.mVertices[i].mNormal;
252 *texcoordsp++ = face.mVertices[i].mTexCoord;
253 *colorsp++ = color;
254 }
255
256 for (U32 i = 0; i < face.mIndices.size(); i++)
257 {
258 *indicesp++ = face.mIndices[i] + offset;
259 }
260}
261
262U32 LLVOTextBubble::getPartitionType() const
263{
264 return LLPipeline::PARTITION_PARTICLE;
265}