cvar_t r_draweffects = {0, "r_draweffects", "1"};
cvar_t cl_explosions = {CVAR_SAVE, "cl_explosions", "1"};
+cvar_t cl_explosions_alpha_start = {CVAR_SAVE, "cl_explosions_alpha_start", "1.5"};
+cvar_t cl_explosions_alpha_end = {CVAR_SAVE, "cl_explosions_alpha_end", "0.01"};
+cvar_t cl_explosions_size_start = {CVAR_SAVE, "cl_explosions_size_start", "1"};
+cvar_t cl_explosions_size_end = {CVAR_SAVE, "cl_explosions_size_end", "1"};
+cvar_t cl_explosions_lifetime = {CVAR_SAVE, "cl_explosions_lifetime", "1"};
+
cvar_t cl_stainmaps = {CVAR_SAVE, "cl_stainmaps", "1"};
cvar_t cl_beams_polygons = {CVAR_SAVE, "cl_beams_polygons", "1"};
Cvar_RegisterVariable(&r_draweffects);
Cvar_RegisterVariable(&cl_explosions);
+ Cvar_RegisterVariable(&cl_explosions_alpha_start);
+ Cvar_RegisterVariable(&cl_explosions_alpha_end);
+ Cvar_RegisterVariable(&cl_explosions_size_start);
+ Cvar_RegisterVariable(&cl_explosions_size_end);
+ Cvar_RegisterVariable(&cl_explosions_lifetime);
Cvar_RegisterVariable(&cl_stainmaps);
Cvar_RegisterVariable(&cl_beams_polygons);
Cvar_RegisterVariable(&cl_beams_relative);
extern cvar_t r_draweffects;
extern cvar_t cl_explosions;
+extern cvar_t cl_explosions_alpha_start;
+extern cvar_t cl_explosions_alpha_end;
+extern cvar_t cl_explosions_size_start;
+extern cvar_t cl_explosions_size_end;
+extern cvar_t cl_explosions_lifetime;
extern cvar_t cl_stainmaps;
// these are updated by CL_ClearState
#define EXPLOSIONVERTS ((EXPLOSIONGRID+1)*(EXPLOSIONGRID+1))
#define EXPLOSIONTRIS (EXPLOSIONGRID*EXPLOSIONGRID*2)
#define EXPLOSIONSTARTVELOCITY (256.0f)
-#define EXPLOSIONFADESTART (1.5f)
#define EXPLOSIONFADERATE (3.0f)
float explosiontexcoord2f[EXPLOSIONVERTS][2];
fractalnoisequick(noise, EXPLOSIONGRID, 4); // adjust noise grid size according to explosion
for (i = 0;i < MAX_EXPLOSIONS;i++)
{
- if (explosion[i].alpha <= 0.01f)
+ if (explosion[i].alpha <= cl_explosions_alpha_end.value)
{
explosion[i].starttime = cl.time;
explosion[i].time = explosion[i].starttime - 0.1;
- explosion[i].alpha = EXPLOSIONFADESTART;
+ explosion[i].alpha = cl_explosions_alpha_start.value;
VectorCopy(org, explosion[i].origin);
for (j = 0;j < EXPLOSIONVERTS;j++)
{
frametime = cl.time - e->time;
e->time = cl.time;
- e->alpha = EXPLOSIONFADESTART - (cl.time - e->starttime) * EXPLOSIONFADERATE;
- if (e->alpha <= 0.01f)
+ e->alpha = cl_explosions_alpha_start.value - (cl.time - e->starttime) * EXPLOSIONFADERATE;
+ if (e->alpha <= cl_explosions_alpha_end.value)
{
e->alpha = -1;
return;
frametime = cl.time - cl.oldtime;
for (i = 0;i < MAX_EXPLOSIONS;i++)
- if (explosion[i].alpha > 0.01f)
+ if (explosion[i].alpha > cl_explosions_alpha_end.value)
R_MoveExplosion(&explosion[i]);
}
if (!r_drawexplosions.integer)
return;
for (i = 0;i < MAX_EXPLOSIONS;i++)
- if (explosion[i].alpha > 0.01f)
+ if (explosion[i].alpha > cl_explosions_alpha_end.value)
R_MeshQueue_AddTransparent(explosion[i].origin, R_DrawExplosionCallback, &explosion[i], 0);
}