- 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);
-
- R_Mesh_Draw(numverts, numtriangles, explosiontris[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);
+ }