Skip to content

Commit

Permalink
cgame: add cg_visualEffects cvar to turn the visibility of global vis…
Browse files Browse the repository at this point in the history
…ual effects like debris, airstrike plane, ...
  • Loading branch information
Aranud committed Mar 15, 2019
1 parent e5d15ac commit 52219af
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cgame/cg_ents.c
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ void CG_MovePlane(centity_t *cent)
refEntity_t ent;

// allow the airstrike plane to be completely removed
if (!cg_drawAirstrikePlane.integer)
if (!cg_visualEffects.integer)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -2554,7 +2554,7 @@ extern vmCvar_t cg_quickchat;

extern vmCvar_t cg_drawspeed;

extern vmCvar_t cg_drawAirstrikePlane; ///< turn invisible (0) / visible (1) airstrike plane
extern vmCvar_t cg_visualEffects; ///< turn invisible (0) / visible (1) visual effect (i.e airstrike plane, debris ...)

// local clock flags
#define LOCALTIME_ON 0x01
Expand Down
4 changes: 2 additions & 2 deletions src/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ vmCvar_t cg_quickchat;

vmCvar_t cg_drawspeed;

vmCvar_t cg_drawAirstrikePlane;
vmCvar_t cg_visualEffects;

typedef struct
{
Expand Down Expand Up @@ -590,7 +590,7 @@ cvarTable_t cvarTable[] =

{ &cg_drawspeed, "cg_drawspeed", "0", CVAR_ARCHIVE, 0 },

{ &cg_drawAirstrikePlane, "cg_drawAirstrikePlane", "1", CVAR_ARCHIVE, 0 } // Draw Airstrike Plane
{ &cg_visualEffects, "cg_visualEffects", "1", CVAR_ARCHIVE, 0 } // Draw visual effects (i.e : airstrike plane, debris ...)
};

const unsigned int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]);
Expand Down
5 changes: 5 additions & 0 deletions src/cgame/cg_weapons.c
Original file line number Diff line number Diff line change
Expand Up @@ -4926,6 +4926,11 @@ void CG_AddDebris(vec3_t origin, vec3_t dir, int speed, int duration, int count,
return;
}

if (!cg_visualEffects.integer)
{
return;
}

for (i = 0; i < count; i++)
{
le = CG_AllocLocalEntity();
Expand Down

0 comments on commit 52219af

Please sign in to comment.