X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=r_explosion.c;h=b60bfc2d0f56cbc40da6d4b553bd2bccc0f856fe;hb=6e82b529dceb0bf5f4277fa6fd499dc4f720d2ca;hp=83cad1ee0f8a5adcba63eb584e68c84065eba3df;hpb=bf54dd6e7fb965287073b669235a7b30c7f96923;p=xonotic%2Fdarkplaces.git diff --git a/r_explosion.c b/r_explosion.c index 83cad1ee..b60bfc2d 100644 --- a/r_explosion.c +++ b/r_explosion.c @@ -55,9 +55,9 @@ static rtexture_t *explosiontexture; static rtexturepool_t *explosiontexturepool; #endif -cvar_t r_explosionclip = {CVAR_SAVE, "r_explosionclip", "1", "enables collision detection for explosion shell (so that it flattens against walls and floors)"}; +cvar_t r_explosionclip = {CVAR_CLIENT | CVAR_SAVE, "r_explosionclip", "1", "enables collision detection for explosion shell (so that it flattens against walls and floors)"}; #ifdef MAX_EXPLOSIONS -static cvar_t r_drawexplosions = {0, "r_drawexplosions", "1", "enables rendering of explosion shells (see also cl_particles_explosions_shell)"}; +static cvar_t r_drawexplosions = {CVAR_CLIENT, "r_drawexplosions", "1", "enables rendering of explosion shells (see also cl_particles_explosions_shell)"}; //extern qboolean r_loadfog; static void r_explosion_start(void) @@ -153,7 +153,7 @@ void R_Explosion_Init(void) #ifdef MAX_EXPLOSIONS Cvar_RegisterVariable(&r_drawexplosions); - R_RegisterModule("R_Explosions", r_explosion_start, r_explosion_shutdown, r_explosion_newmap); + R_RegisterModule("R_Explosions", r_explosion_start, r_explosion_shutdown, r_explosion_newmap, NULL, NULL); #endif } @@ -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, 0, 0, collision_extendmovelength.value, 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, 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, 0, 0, collision_extendmovelength.value, 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(TRANSPARENTSORT_DISTANCE, explosion[i].origin, R_DrawExplosion_TransparentCallback, NULL, i, NULL); } } while (numexplosions > 0 && explosion[i-1].alpha <= 0)