Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVAR: gl_part_bloodtrails #934

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions help_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -5178,6 +5178,12 @@
"group-id": "36",
"type": "boolean"
},
"gl_part_bloodtrails": {
"default": "1",
"desc": "Determines particles used for blood trails (gibs).",
"group-id": "36",
"type": "boolean"
},
"gl_part_bubble": {
"default": "1",
"desc": "Advanced particles for bubbles (drowning effect).",
Expand Down
1 change: 1 addition & 0 deletions src/gl_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ extern cvar_t gl_fb_models;
extern cvar_t gl_playermip;

extern cvar_t gl_part_explosions;
extern cvar_t gl_part_bloodtrails;
extern cvar_t gl_part_trails;
extern cvar_t gl_part_spikes;
extern cvar_t gl_part_gunshots;
Expand Down
47 changes: 37 additions & 10 deletions src/r_part.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const int default_size = 32;

extern cvar_t gl_part_blood;
extern cvar_t gl_part_gunshots;
extern cvar_t gl_part_bloodtrails;
extern cvar_t gl_part_trails;
extern cvar_t gl_part_spikes;
extern cvar_t gl_part_explosions;
Expand Down Expand Up @@ -812,21 +813,47 @@ void R_RunParticleEffect(vec3_t org, vec3_t dir, int color, int count)
// Used for temporary entities and untrackable effects
void R_ParticleTrail(vec3_t start, vec3_t end, trail_type_t type)
{
if (qmb_initialized && gl_part_trails.integer) {
QMB_ParticleTrail(start, end, type);
}
else {
Classic_ParticleTrail(start, end, NULL, type);
switch(type){
case BLOOD_TRAIL:
case BIG_BLOOD_TRAIL:
if (qmb_initialized && gl_part_bloodtrails.integer) {
QMB_ParticleTrail(start, end, type);
}
else {
Classic_ParticleTrail(start, end, NULL, type);
}
break;
default:
if (qmb_initialized && gl_part_trails.integer) {
QMB_ParticleTrail(start, end, type);
}
else {
Classic_ParticleTrail(start, end, NULL, type);
}
break;
}
}

void R_EntityParticleTrail(centity_t* cent, trail_type_t type)
{
if (qmb_initialized && gl_part_trails.integer) {
QMB_EntityParticleTrail(cent, type);
}
else {
Classic_ParticleTrail(cent->trails[0].stop, cent->lerp_origin, &cent->trails[0].stop, type);
switch(type){
case BLOOD_TRAIL:
case BIG_BLOOD_TRAIL:
if (qmb_initialized && gl_part_bloodtrails.integer) {
QMB_EntityParticleTrail(cent, type);
}
else {
Classic_ParticleTrail(cent->trails[0].stop, cent->lerp_origin, &cent->trails[0].stop, type);
}
break;
default:
if (qmb_initialized && gl_part_trails.integer) {
QMB_EntityParticleTrail(cent, type);
}
else {
Classic_ParticleTrail(cent->trails[0].stop, cent->lerp_origin, &cent->trails[0].stop, type);
}
break;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/r_rmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ cvar_t gl_oldlitscaling = {"gl_oldlitscaling", "0"};
cvar_t gl_colorlights = {"gl_colorlights", "1"};
cvar_t gl_squareparticles = {"gl_squareparticles", "0", 0, OnSquareParticleChange};
cvar_t gl_part_explosions = {"gl_part_explosions", "0"}; // 1
cvar_t gl_part_bloodtrails = {"gl_part_bloodtrails", "1"}; // 1 was the default behaviour before this became a cvar
cvar_t gl_part_trails = {"gl_part_trails", "0"}; // 1
cvar_t gl_part_tracer1_color = {"gl_part_tracer1_color", "0 124 0", CVAR_COLOR};
cvar_t gl_part_tracer2_color = {"gl_part_tracer2_color", "255 77 0", CVAR_COLOR};
Expand Down Expand Up @@ -619,6 +620,7 @@ void R_Init(void)

Cvar_SetCurrentGroup(CVAR_GROUP_PARTICLES);
Cvar_Register(&gl_part_explosions);
Cvar_Register(&gl_part_bloodtrails);
Cvar_Register(&gl_part_trails);
Cvar_Register(&gl_part_tracer1_color);
Cvar_Register(&gl_part_tracer1_size);
Expand Down
Loading