aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llsprite.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/llsprite.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/llsprite.cpp')
-rw-r--r--linden/indra/newview/llsprite.cpp42
1 files changed, 26 insertions, 16 deletions
diff --git a/linden/indra/newview/llsprite.cpp b/linden/indra/newview/llsprite.cpp
index 601810c..fb56f4d 100644
--- a/linden/indra/newview/llsprite.cpp
+++ b/linden/indra/newview/llsprite.cpp
@@ -94,14 +94,7 @@ void LLSprite::updateFace(LLFace &face)
94 // First, figure out how many vertices/indices we need. 94 // First, figure out how many vertices/indices we need.
95 U32 num_vertices, num_indices; 95 U32 num_vertices, num_indices;
96 U32 vertex_count = 0; 96 U32 vertex_count = 0;
97 97
98
99 LLStrider<LLVector3> verticesp;
100 LLStrider<LLVector3> normalsp;
101 LLStrider<LLVector2> tex_coordsp;
102 U32 *indicesp;
103 S32 index_offset;
104
105 // Get the total number of vertices and indices 98 // Get the total number of vertices and indices
106 if (mFollow) 99 if (mFollow)
107 { 100 {
@@ -114,14 +107,7 @@ void LLSprite::updateFace(LLFace &face)
114 num_indices = 12; 107 num_indices = 12;
115 } 108 }
116 109
117 // Setup face
118 face.setPrimType(LLTriangles);
119 face.setSize(num_vertices, num_indices); 110 face.setSize(num_vertices, num_indices);
120 index_offset = face.getGeometry(verticesp,normalsp,tex_coordsp, indicesp);
121 if (-1 == index_offset)
122 {
123 return;
124 }
125 111
126 if (mFollow) 112 if (mFollow)
127 { 113 {
@@ -206,7 +192,30 @@ void LLSprite::updateFace(LLFace &face)
206 } 192 }
207 193
208 face.setFaceColor(mColor); 194 face.setFaceColor(mColor);
209 195
196 LLStrider<LLVector3> verticesp;
197 LLStrider<LLVector3> normalsp;
198 LLStrider<LLVector2> tex_coordsp;
199 LLStrider<U32> indicesp;
200 S32 index_offset;
201
202 // Setup face
203 if (face.mVertexBuffer.isNull())
204 {
205 face.mVertexBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX |
206 LLVertexBuffer::MAP_TEXCOORD,
207 GL_STREAM_DRAW_ARB);
208 face.mVertexBuffer->allocateBuffer(4, 12, TRUE);
209 face.setGeomIndex(0);
210 face.setIndicesIndex(0);
211 }
212
213 index_offset = face.getGeometry(verticesp,normalsp,tex_coordsp, indicesp);
214 if (-1 == index_offset)
215 {
216 return;
217 }
218
210 *tex_coordsp = LLVector2(0.f, 0.f); 219 *tex_coordsp = LLVector2(0.f, 0.f);
211 *verticesp = mC; 220 *verticesp = mC;
212 tex_coordsp++; 221 tex_coordsp++;
@@ -251,6 +260,7 @@ void LLSprite::updateFace(LLFace &face)
251 *indicesp++ = 3 + index_offset; 260 *indicesp++ = 3 + index_offset;
252 } 261 }
253 262
263 //face.mVertexBuffer->setBuffer(0);
254 face.mCenterAgent = mPosition; 264 face.mCenterAgent = mPosition;
255} 265}
256 266