]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_explosion.c
added r_transparent_sortsurfacesbynearest cvar (default 1), this
[xonotic/darkplaces.git] / r_explosion.c
index 3519fd940044dd983f9fb935f377e3f30bb9c976..b8f8152f89316fd3f2b64708d519130e857a3b96 100644 (file)
@@ -189,7 +189,7 @@ void R_NewExplosion(const vec3_t org)
                                // clip start origin
                                if (e->clipping)
                                {
-                                       trace = CL_TraceLine(e->origin, e->vert[j], MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID, true, false, NULL, false);
+                                       trace = CL_TraceLine(e->origin, e->vert[j], MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID, true, false, NULL, false, false);
                                        VectorCopy(trace.endpos, e->vert[i]);
                                }
                        }
@@ -212,8 +212,8 @@ static void R_DrawExplosion_TransparentCallback(const entity_render_t *ent, cons
        GL_CullFace(r_refdef.view.cullface_back);
        R_EntityMatrix(&identitymatrix);
 
-       R_Mesh_ResetTextureState();
-       R_SetupShader_Generic(explosiontexture, NULL, GL_MODULATE, 1);
+//     R_Mesh_ResetTextureState();
+       R_SetupShader_Generic(explosiontexture, NULL, GL_MODULATE, 1, false, false, false);
        for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
        {
                const explosion_t *e = explosion + surfacelist[surfacelistindex];
@@ -245,7 +245,7 @@ static void R_MoveExplosion(explosion_t *e)
                        VectorMA(e->vert[i], frametime, e->vertvel[i], end);
                        if (e->clipping)
                        {
-                               trace = CL_TraceLine(e->vert[i], end, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID, true, false, NULL, false);
+                               trace = CL_TraceLine(e->vert[i], end, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID, true, false, NULL, false, false);
                                if (trace.fraction < 1)
                                {
                                        // clip velocity against the wall
@@ -275,7 +275,7 @@ void R_DrawExplosions(void)
                {
                        R_MoveExplosion(&explosion[i]);
                        if (explosion[i].alpha)
-                               R_MeshQueue_AddTransparent(explosion[i].origin, R_DrawExplosion_TransparentCallback, NULL, i, NULL);
+                               R_MeshQueue_AddTransparent(MESHQUEUE_SORT_DISTANCE, explosion[i].origin, R_DrawExplosion_TransparentCallback, NULL, i, NULL);
                }
        }
        while (numexplosions > 0 && explosion[i-1].alpha <= 0)