- int i, index, *indexlist = &explosiontris[0][0], alpha = bound(0, e->alpha * 255.0f, 255);
- float s = cl.time * 1, t = cl.time * 0.75;
- s -= (int) s;
- t -= (int) t;
- /*
- glColor4f(1,1,1,e->alpha);
- glDisable(GL_TEXTURE_2D);
-// glBindTexture(GL_TEXTURE_2D, explosiontexture);
- if (gl_vertexarrays.value)
- {
- qglVertexPointer(3, GL_FLOAT, 0, (float *) &e->vert[0][0]);
-// qglTexCoordPointer(2, GL_FLOAT, 0, (float *) &explosiontexcoords[0][0]);
- glEnableClientState(GL_VERTEX_ARRAY);
-// glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- qglDrawElements(GL_TRIANGLES, EXPLOSIONTRIS, GL_UNSIGNED_INT, indexlist);
-// glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_VERTEX_ARRAY);
- }
- else
- {
- glBegin(GL_TRIANGLES);
- for (i = 0;i < EXPLOSIONTRIS * 3;i++)
- {
- index = *indexlist++;
-// glTexCoord2fv(explosiontexcoords[index]);
- glVertex3fv(e->vert[index]);
- }
- glEnd();
- }
- glEnable(GL_TEXTURE_2D);
- */
- for (i = 0;i < EXPLOSIONTRIS;i++)
- {
- transpolybegin(explosiontexture, 0, explosiontexturefog, TPOLYTYPE_ALPHA);
- index = *indexlist++;transpolyvert(e->vert[index][0], e->vert[index][1], e->vert[index][2], explosiontexcoords[index][0] + s, explosiontexcoords[index][1] + t, 255, 255, 255, alpha);
- index = *indexlist++;transpolyvert(e->vert[index][0], e->vert[index][1], e->vert[index][2], explosiontexcoords[index][0] + s, explosiontexcoords[index][1] + t, 255, 255, 255, alpha);
- index = *indexlist++;transpolyvert(e->vert[index][0], e->vert[index][1], e->vert[index][2], explosiontexcoords[index][0] + s, explosiontexcoords[index][1] + t, 255, 255, 255, alpha);
- transpolyend();
- }
+ int numtriangles, numverts;
+ float alpha;
+ rmeshstate_t m;
+ const explosion_t *e;
+ e = (explosion_t *)calldata1;
+
+ GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
+ GL_DepthMask(false);
+ GL_DepthTest(true);
+ R_Mesh_Matrix(&r_identitymatrix);
+
+ numtriangles = EXPLOSIONTRIS;
+ numverts = EXPLOSIONVERTS;
+ alpha = e->alpha;
+
+ memset(&m, 0, sizeof(m));
+ m.tex[0] = R_GetTexture(explosiontexture);
+ m.pointer_texcoord[0] = explosiontexcoord2f[0];
+ m.pointer_vertex = e->vert[0];
+ R_Mesh_State(&m);
+
+ GL_Color(alpha, alpha, alpha, 1);
+
+ GL_LockArrays(0, numverts);
+ R_Mesh_Draw(0, numverts, numtriangles, explosiontris[0]);
+ GL_LockArrays(0, 0);