- R_Mesh_Matrix(&r_identitymatrix);
- R_Mesh_State(&m);
-
- numtriangles = EXPLOSIONTRIS;
- numverts = EXPLOSIONVERTS;
- R_Mesh_ResizeCheck(numverts);
-
- for (i = 0, v = varray_vertex;i < numverts;i++, v += 4)
- {
- v[0] = e->vert[i][0];
- v[1] = e->vert[i][1];
- v[2] = e->vert[i][2];
- }
- memcpy(varray_texcoord[0], explosiontexcoords, numverts * sizeof(float[4]));
- alpha = e->alpha;
- VectorSubtract(r_origin, e->origin, centerdir);
- VectorNormalizeFast(centerdir);
- if (fogenabled)
- {
- for (i = 0, c = varray_color;i < EXPLOSIONVERTS;i++, c += 4)
- {
- VectorSubtract(e->vert[i], e->origin, diff);
- VectorNormalizeFast(diff);
- dist = (DotProduct(diff, centerdir) * 6.0f - 4.0f) * alpha;
- if (dist > 0)
- {
- // use inverse fog alpha
- VectorSubtract(e->vert[i], r_origin, diff);
- ifog = 1 - exp(fogdensity/DotProduct(diff,diff));
- dist = dist * ifog;
- if (dist < 0)
- dist = 0;
- else
- dist *= r_colorscale;
- }
- else
- dist = 0;
- c[0] = c[1] = c[2] = dist;
- c[3] = 1;
- }
- }
- else
+ m.pointer_texcoord[0] = explosiontexcoord2f[0];
+ R_Mesh_TextureState(&m);
+ for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)