From de7a4e326e9517bd188bd7a508f64bcdef2c8cf4 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 19 Jan 2004 02:43:55 +0000 Subject: [PATCH] nq blood particle hack from Grievre --- nq/include/client.h | 3 +++ nq/source/cl_main.c | 7 +++++++ nq/source/cl_tent.c | 11 ++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/nq/include/client.h b/nq/include/client.h index b939c3160..700c0a456 100644 --- a/nq/include/client.h +++ b/nq/include/client.h @@ -258,6 +258,9 @@ extern struct cvar_s *cl_autofire; extern struct cvar_s *cl_shownet; extern struct cvar_s *cl_nolerp; +extern struct cvar_s *cl_particle_hack; +extern struct cvar_s *cl_particle_blood; + extern struct cvar_s *hud_sbar; extern struct cvar_s *cl_pitchdriftspeed; diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 0f4f1328f..d162a512c 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -63,6 +63,9 @@ cvar_t *cl_writecfg; cvar_t *cl_shownet; cvar_t *cl_nolerp; +cvar_t *cl_particle_hack; +cvar_t *cl_particle_blood; + cvar_t *cl_cshift_bonus; cvar_t *cl_cshift_contents; cvar_t *cl_cshift_damage; @@ -125,6 +128,10 @@ CL_InitCvars (void) "show network packets. 0=off, 1=basic, 2=verbose"); cl_nolerp = Cvar_Get ("cl_nolerp", "0", CVAR_NONE, NULL, "linear motion interpolation"); + cl_particle_blood = Cvar_Get ("cl_particle_blood", "3", CVAR_ARCHIVE, NULL, "Amount of blood"); + cl_particle_hack = Cvar_Get ("cl_particle_hack", "1", CVAR_ARCHIVE, NULL, "Make netquake " + "blood/explosions look better (some mods may look " + "weird with this on)"); lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, NULL, "Snap view " "to center when moving and no mlook/klook"); m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, NULL, diff --git a/nq/source/cl_tent.c b/nq/source/cl_tent.c index 791250693..93f1172b6 100644 --- a/nq/source/cl_tent.c +++ b/nq/source/cl_tent.c @@ -46,6 +46,7 @@ static __attribute__ ((unused)) const char rcsid[] = #include "QF/msg.h" #include "QF/sound.h" #include "QF/sys.h" +#include "QF/cvar.h" #include "client.h" #include "compat.h" @@ -551,8 +552,12 @@ CL_ParseParticleEffect (void) count = MSG_ReadByte (net_message); color = MSG_ReadByte (net_message); - if (count == 255) - R_ParticleExplosion (org); - else + if (count == 255) { // have to keep this because it's id :/ + R_ParticleExplosion(org); + } else if (color == 73 && cl_particle_hack->int_val) { + if (cl_particle_blood->value) + R_BloodPuffEffect (org, count * cl_particle_blood->value); + } else { R_RunParticleEffect (org, dir, color, count); + } }