- int i, index, *indexlist = &explosiontris[0][0], alpha = bound(0, e->alpha * 128.0f, 128), texnum, fogtexnum;
- float s, t;
-// s = cl.time * 1;
-// t = cl.time * 0.75;
-// s -= (int) s;
-// t -= (int) t;
- s = 0;
- t = 0;
- /*
- glColor4f(1,1,1,e->alpha);
- glDisable(GL_TEXTURE_2D);
-// glBindTexture(GL_TEXTURE_2D, explosiontexture);
- glVertexPointer(3, GL_FLOAT, sizeof(float[3]), (float *) &e->vert[0][0]);
-// glTexCoordPointer(2, GL_FLOAT, sizeof(float[2]), (float *) &explosiontexcoords[0][0]);
- glEnableClientState(GL_VERTEX_ARRAY);
-// glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glDrawElements(GL_TRIANGLES, EXPLOSIONTRIS, GL_UNSIGNED_INT, indexlist);
-// glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_VERTEX_ARRAY);
- glEnable(GL_TEXTURE_2D);
- */
- texnum = R_GetTexture(explosiontexture);
- fogtexnum = R_GetTexture(explosiontexturefog);
- for (i = 0;i < EXPLOSIONTRIS;i++)
- {
- transpolybegin(texnum, 0, fogtexnum, 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 = 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;
+ GL_Color(alpha, alpha, alpha, 1);
+ GL_VertexPointer(e->vert[0]);
+
+ memset(&m, 0, sizeof(m));
+ m.tex[0] = R_GetTexture(explosiontexture);
+ m.pointer_texcoord[0] = explosiontexcoord2f[0];
+ R_Mesh_State_Texture(&m);
+
+ R_Mesh_Draw(numverts, numtriangles, explosiontris[0]);