Some new cvars added for controlling ent effects (fuhquake compatability)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@801 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-17 17:40:37 +00:00
parent ef62abd8f9
commit cb0e9f7351
2 changed files with 77 additions and 46 deletions

View file

@ -27,6 +27,11 @@ extern cvar_t cl_predict_players2;
extern cvar_t cl_solid_players;
extern cvar_t gl_part_inferno;
extern cvar_t cl_item_bobbing;
extern cvar_t r_rocketlight;
extern cvar_t r_lightflicker;
extern cvar_t cl_r2g;
extern cvar_t r_powerupglow;
extern int cl_playerindex;
static struct predicted_player {
@ -46,6 +51,8 @@ static struct predicted_player {
float newlerprate;
extern int cl_rocketindex, cl_grenadeindex;
//============================================================
/*
@ -1242,6 +1249,7 @@ void CL_LinkPacketEntities (void)
//, spnum;
dlight_t *dl;
vec3_t angles;
int flicker;
pack = &cl.frames[cl.validsequence&UPDATE_MASK].packet_entities;
@ -1251,17 +1259,22 @@ void CL_LinkPacketEntities (void)
{
s1 = &pack->entities[pnum];
//bots or powerup glows. Bots always glow, powerups can be disabled
if (s1->modelindex == cl_playerindex || r_powerupglow.value);
{
flicker = r_lightflicker.value?(rand()&31):0;
// spawn light flashes, even ones coming from invisible objects
if ((s1->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED))
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand()&31), 0, 3);
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + flicker, 0, 3);
else if (s1->effects & EF_BLUE)
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand()&31), 0, 1);
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + flicker, 0, 1);
else if (s1->effects & EF_RED)
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand()&31), 0, 2);
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + flicker, 0, 2);
else if (s1->effects & EF_BRIGHTLIGHT)
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2] + 16, 400 + (rand()&31), 0, 0);
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2] + 16, 400 + flicker, 0, 0);
else if (s1->effects & EF_DIMLIGHT)
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand()&31), 0, 0);
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + flicker, 0, 0);
}
// if set to invisible, skip
if (s1->modelindex<1)
@ -1284,7 +1297,11 @@ void CL_LinkPacketEntities (void)
ent->visframe = 0;
ent->keynum = s1->number;
ent->model = model;//Mod_ForName("progs/tris.md2", true);//model;
if (cl_r2g.value && s1->modelindex == cl_rocketindex && cl_rocketindex)
ent->model = cl.model_precache[cl_grenadeindex];
else
ent->model = model;
ent->flags = 0;
@ -1426,7 +1443,9 @@ void CL_LinkPacketEntities (void)
if (model->particletrail>=0)
R_RocketTrail (old_origin, ent->origin, model->particletrail, &cl.lerpents[s1->number].trailstate);
//dlights are not customisable.
//dlights are not so customisable.
if (r_rocketlight.value)
{
if (model->flags & EF_ROCKET)
{
if (strncmp(model->name, "models/sflesh", 13))
@ -1463,6 +1482,7 @@ void CL_LinkPacketEntities (void)
}
}
}
}
/*
@ -1573,7 +1593,7 @@ void CL_LinkProjectiles (void)
//========================================
extern int cl_spikeindex, cl_playerindex, cl_flagindex;
extern int cl_spikeindex, cl_playerindex, cl_flagindex, cl_rocketindex, cl_grenadeindex;
entity_t *CL_NewTempEntity (void);

View file

@ -107,6 +107,11 @@ cvar_t msg = {"msg", "1", NULL, CVAR_ARCHIVE | CVAR_USERINFO};
cvar_t cl_nofake = {"cl_nofake", "2"};
cvar_t cl_chatsound = {"cl_chatsound", "1"};
cvar_t r_rocketlight = {"r_rocketlight", "1"};
cvar_t r_lightflicker = {"r_lightflicker", "1"};
cvar_t cl_r2g = {"cl_r2g", "0"};
cvar_t r_powerupglow = {"r_powerupglow", "1"};
cvar_t cl_muzzleflash = {"cl_muzzleflash", "1"};
cvar_t cl_item_bobbing = {"cl_model_bobbing", "0"};
@ -2035,7 +2040,8 @@ CL_Download_f
*/
void CL_Download_f (void)
{
char *p, *q, *url;
// char *p, *q;
char *url;
url = Cmd_Argv(1);
@ -2268,6 +2274,11 @@ void CL_Init (void)
Cvar_Register (&cl_staticsounds, "Item effects");
Cvar_Register (&r_rocketlight, "Item effects");
Cvar_Register (&r_lightflicker, "Item effects");
Cvar_Register (&cl_r2g, "Item effects");
Cvar_Register (&r_powerupglow, "Item effects");
//
// info mirrors
//