From 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:50 -0500 Subject: Second Life viewer sources 1.14.0.0 --- linden/indra/newview/llvotextbubble.cpp | 80 +++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 19 deletions(-) (limited to 'linden/indra/newview/llvotextbubble.cpp') 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 @@ #include "pipeline.h" LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) -: LLViewerObject(id, pcode, regionp) +: LLAlphaObject(id, pcode, regionp) { setScale(LLVector3(1.5f, 1.5f, 0.25f)); mbCanSelect = FALSE; @@ -102,8 +102,10 @@ BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) for (i = 0; i < getNumTEs(); i++) { setTEColor(i, color); + setTEFullbright(i, TRUE); } + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); return TRUE; } @@ -145,15 +147,14 @@ LLDrawable *LLVOTextBubble::createDrawable(LLPipeline *pipeline) pipeline->allocDrawable(this); mDrawable->setLit(FALSE); mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME); - LLDrawPool *poolp; + for (U32 i = 0; i < getNumTEs(); i++) { LLViewerImage *imagep; const LLTextureEntry *texture_entry = getTE(i); imagep = gImageList.getImage(texture_entry->getID()); - poolp = gPipeline.getPool(LLDrawPool::POOL_ALPHA); - mDrawable->addFace(poolp, imagep); + mDrawable->addFace((LLFacePool*) NULL, imagep); } return mDrawable; @@ -200,24 +201,65 @@ BOOL LLVOTextBubble::updateGeometry(LLDrawable *drawable) for (S32 i = 0; i < drawable->getNumFaces(); i++) { LLFace *face = drawable->getFace(i); - - if (i == 0) - { - face->setSize(0); - continue; - } - if (i == 2) - { - face->setSize(0); - continue; - } - - // Need to figure out how to readd logic to determine face dirty vs. entire object dirty. face->setTEOffset(i); - face->clearState(LLFace::GLOBAL); - face->genVolumeTriangles(*getVolume(), i, identity4, identity3); + face->setTexture(LLViewerImage::sSmokeImagep); + face->setState(LLFace::FULLBRIGHT); } + mVolumeChanged = FALSE; + mDrawable->movePartition(); return TRUE; } + +void LLVOTextBubble::updateFaceSize(S32 idx) +{ + LLFace* face = mDrawable->getFace(idx); + + if (idx == 0 || idx == 2) + { + face->setSize(0,0); + } + else + { + const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx); + face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size()); + } +} + +void LLVOTextBubble::getGeometry(S32 idx, + LLStrider& verticesp, + LLStrider& normalsp, + LLStrider& texcoordsp, + LLStrider& colorsp, + LLStrider& indicesp) +{ + if (idx == 0 || idx == 2) + { + return; + } + + const LLVolumeFace& face = getVolume()->getVolumeFace(idx); + + LLVector3 pos = getPositionAgent(); + LLColor4U color = LLColor4U(getTE(idx)->getColor()); + U32 offset = mDrawable->getFace(idx)->getGeomIndex(); + + for (U32 i = 0; i < face.mVertices.size(); i++) + { + *verticesp++ = face.mVertices[i].mPosition.scaledVec(getScale()) + pos; + *normalsp++ = face.mVertices[i].mNormal; + *texcoordsp++ = face.mVertices[i].mTexCoord; + *colorsp++ = color; + } + + for (U32 i = 0; i < face.mIndices.size(); i++) + { + *indicesp++ = face.mIndices[i] + offset; + } +} + +U32 LLVOTextBubble::getPartitionType() const +{ + return LLPipeline::PARTITION_PARTICLE; +} -- cgit v1.1