cvar_t cl_decals_fadetime = {CVAR_SAVE, "cl_decals_fadetime", "1", "how long decals take to fade away"};
cvar_t cl_decals_newsystem = {CVAR_SAVE, "cl_decals_newsystem", "0", "enables new advanced decal system"};
cvar_t cl_decals_newsystem_intensitymultiplier = {CVAR_SAVE, "cl_decals_newsystem_intensitymultiplier", "2", "boosts intensity of decals (because the distance fade can make them hard to see otherwise)"};
+cvar_t cl_decals_newsystem_immediatebloodstain = {CVAR_SAVE, "cl_decals_newsystem_immediatebloodstain", "2", "0: no on-spawn blood stains; 1: on-spawn blood stains for pt_blood; 2: always use on-spawn blood stains"};
cvar_t cl_decals_models = {CVAR_SAVE, "cl_decals_models", "0", "enables decals on animated models (if newsystem is also 1)"};
cvar_t cl_decals_bias = {CVAR_SAVE, "cl_decals_bias", "0.125", "distance to bias decals from surface to prevent depth fighting"};
cvar_t cl_decals_max = {CVAR_SAVE, "cl_decals_max", "4096", "maximum number of decals allowed to exist in the world at once"};
Cvar_RegisterVariable (&cl_decals_fadetime);
Cvar_RegisterVariable (&cl_decals_newsystem);
Cvar_RegisterVariable (&cl_decals_newsystem_intensitymultiplier);
+ Cvar_RegisterVariable (&cl_decals_newsystem_immediatebloodstain);
Cvar_RegisterVariable (&cl_decals_models);
Cvar_RegisterVariable (&cl_decals_bias);
Cvar_RegisterVariable (&cl_decals_max);
{
// bloodhack checks if this effect's color matches regular or lightning blood and if so spawns a blood effect instead
if (count == 1024)
- CL_ParticleExplosion(center);
+ CL_ParticleEffect(EFFECT_TE_EXPLOSION, 1, originmins, originmaxs, velocitymins, velocitymaxs, NULL, 0);
else if (cl_particles_blood_bloodhack.integer && !cl_particles_quake.integer && (palettecolor == 73 || palettecolor == 225))
CL_ParticleEffect(EFFECT_TE_BLOOD, count / 2.0f, originmins, originmaxs, velocitymins, velocitymaxs, NULL, 0);
else
else
{
static double bloodaccumulator = 0;
- qboolean immediatebloodstain = true;
+ qboolean immediatebloodstain = (cl_decals_newsystem_immediatebloodstain.integer >= 1);
//CL_NewParticle(center, pt_alphastatic, 0x4f0000,0x7f0000, tex_particle, 2.5, 0, 256, 256, 0, 0, lhrandom(originmins[0], originmaxs[0]), lhrandom(originmins[1], originmaxs[1]), lhrandom(originmins[2], originmaxs[2]), 0, 0, 0, 1, 4, 0, 0, true, 0, 1, PBLEND_ALPHA, PARTICLE_BILLBOARD, NULL);
bloodaccumulator += count * 0.333 * cl_particles_quality.value;
for (;bloodaccumulator > 0;bloodaccumulator--)
{
info->particleaccumulator += info->countabsolute + pcount * info->countmultiplier * cl_particles_quality.value;
trailstep = 0;
- immediatebloodstain = info->particletype == pt_blood || staintex;
+ immediatebloodstain =
+ ((cl_decals_newsystem_immediatebloodstain.integer >= 1) && (info->particletype == pt_blood))
+ ||
+ ((cl_decals_newsystem_immediatebloodstain.integer >= 2) && staintex);
}
info->particleaccumulator = bound(0, info->particleaccumulator, 16384);
for (;info->particleaccumulator >= 1;info->particleaccumulator--)
{
for (i = 0;i < 512 * cl_particles_quality.value;i++)
{
- int k;
+ int k = 0;
vec3_t v, v2;
- for (k = 0;k < 16;k++)
+ do
{
VectorRandom(v2);
VectorMA(org, 128, v2, v);
trace = CL_TraceLine(org, v, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID, true, false, NULL, false);
- if (trace.fraction >= 0.1)
- break;
}
+ while (k < 16 && trace.fraction < 0.1f);
VectorSubtract(trace.endpos, org, v2);
VectorScale(v2, 2.0f, v2);
CL_NewParticle(org, pt_spark, 0x903010, 0xFFD030, tex_particle, 1.0f, 0, lhrandom(0, 255), 512, 0, 0, org[0], org[1], org[2], v2[0], v2[1], v2[2], 0, 0, 0, 0, true, 0, 1, PBLEND_ADD, PARTICLE_SPARK, -1, -1, -1, 1, 1, 0, 0, NULL);
{
int i, j, k, m;
size_t datasize = PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4;
- unsigned char *data = Mem_Alloc(tempmempool, datasize);
+ unsigned char *data = (unsigned char *)Mem_Alloc(tempmempool, datasize);
// blood particles
for (i = 0;i < 8;i++)
}
#ifndef DUMPPARTICLEFONT
- particletexture[tex_beam].texture = loadtextureimage(particletexturepool, "particles/nexbeam.tga", false, TEXF_ALPHA | TEXF_FORCELINEAR, true, r_texture_convertsRGB_particles.integer);
+ particletexture[tex_beam].texture = loadtextureimage(particletexturepool, "particles/nexbeam.tga", false, TEXF_ALPHA | TEXF_FORCELINEAR, true, r_texture_convertsRGB_particles.integer != 0);
if (!particletexture[tex_beam].texture)
#endif
{
if (COM_ParseToken_Simple(&bufptr, true, false) && strcmp(com_token, "\n"))
{
+ strlcpy(texturename, com_token, sizeof(texturename));
s1 = atof(com_token);
if (COM_ParseToken_Simple(&bufptr, true, false) && strcmp(com_token, "\n"))
{
+ texturename[0] = 0;
t1 = atof(com_token);
if (COM_ParseToken_Simple(&bufptr, true, false) && strcmp(com_token, "\n"))
{
}
}
else
- {
s1 = 0;
- strlcpy(texturename, com_token, sizeof(texturename));
- }
}
if (!texturename[0])
{
Cvar_RegisterVariable(&r_drawparticles_drawdistance);
Cvar_RegisterVariable(&r_drawdecals);
Cvar_RegisterVariable(&r_drawdecals_drawdistance);
- R_RegisterModule("R_Particles", r_part_start, r_part_shutdown, r_part_newmap);
+ R_RegisterModule("R_Particles", r_part_start, r_part_shutdown, r_part_newmap, NULL, NULL);
}
void R_DrawDecal_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)