- GL_Color(alpha, alpha, alpha, 1);
-
- GL_LockArrays(0, numverts);
- R_Mesh_Draw(0, numverts, numtriangles, explosiontris[0]);
- GL_LockArrays(0, 0);
+// R_Mesh_ResetTextureState();
+ R_SetupShader_Generic(explosiontexture, false, false, false);
+ for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
+ {
+ const explosion_t *e = explosion + surfacelist[surfacelistindex];
+ // FIXME: this can't properly handle r_refdef.view.colorscale > 1
+ GL_Color(e->alpha * r_refdef.view.colorscale, e->alpha * r_refdef.view.colorscale, e->alpha * r_refdef.view.colorscale, 1);
+ R_Mesh_PrepareVertices_Generic_Arrays(numverts, e->vert[0], NULL, explosiontexcoord2f[0]);
+ R_Mesh_Draw(0, numverts, 0, numtriangles, NULL, NULL, 0, explosiontris[0], NULL, 0);
+ }