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 cl_solid_players;
extern cvar_t gl_part_inferno; extern cvar_t gl_part_inferno;
extern cvar_t cl_item_bobbing; 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; extern int cl_playerindex;
static struct predicted_player { static struct predicted_player {
@ -46,6 +51,8 @@ static struct predicted_player {
float newlerprate; float newlerprate;
extern int cl_rocketindex, cl_grenadeindex;
//============================================================ //============================================================
/* /*
@ -1242,6 +1249,7 @@ void CL_LinkPacketEntities (void)
//, spnum; //, spnum;
dlight_t *dl; dlight_t *dl;
vec3_t angles; vec3_t angles;
int flicker;
pack = &cl.frames[cl.validsequence&UPDATE_MASK].packet_entities; pack = &cl.frames[cl.validsequence&UPDATE_MASK].packet_entities;
@ -1251,17 +1259,22 @@ void CL_LinkPacketEntities (void)
{ {
s1 = &pack->entities[pnum]; s1 = &pack->entities[pnum];
// spawn light flashes, even ones coming from invisible objects //bots or powerup glows. Bots always glow, powerups can be disabled
if ((s1->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED)) if (s1->modelindex == cl_playerindex || r_powerupglow.value);
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand()&31), 0, 3); {
else if (s1->effects & EF_BLUE) flicker = r_lightflicker.value?(rand()&31):0;
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand()&31), 0, 1); // spawn light flashes, even ones coming from invisible objects
else if (s1->effects & EF_RED) 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, 2); CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + flicker, 0, 3);
else if (s1->effects & EF_BRIGHTLIGHT) else if (s1->effects & EF_BLUE)
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], 200 + flicker, 0, 1);
else if (s1->effects & EF_DIMLIGHT) else if (s1->effects & EF_RED)
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, 2);
else if (s1->effects & EF_BRIGHTLIGHT)
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 + flicker, 0, 0);
}
// if set to invisible, skip // if set to invisible, skip
if (s1->modelindex<1) if (s1->modelindex<1)
@ -1284,7 +1297,11 @@ void CL_LinkPacketEntities (void)
ent->visframe = 0; ent->visframe = 0;
ent->keynum = s1->number; 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; ent->flags = 0;
@ -1426,40 +1443,43 @@ void CL_LinkPacketEntities (void)
if (model->particletrail>=0) if (model->particletrail>=0)
R_RocketTrail (old_origin, ent->origin, model->particletrail, &cl.lerpents[s1->number].trailstate); R_RocketTrail (old_origin, ent->origin, model->particletrail, &cl.lerpents[s1->number].trailstate);
//dlights are not customisable. //dlights are not so customisable.
if (model->flags & EF_ROCKET) if (r_rocketlight.value)
{ {
if (strncmp(model->name, "models/sflesh", 13)) if (model->flags & EF_ROCKET)
{ //hmm. hexen spider gibs... {
dl = CL_AllocDlight (s1->number); if (strncmp(model->name, "models/sflesh", 13))
VectorCopy (ent->origin, dl->origin); { //hmm. hexen spider gibs...
dl->radius = 200; dl = CL_AllocDlight (s1->number);
dl->die = (float)cl.time; VectorCopy (ent->origin, dl->origin);
dl->color[0] = 0.20; dl->radius = 200;
dl->color[1] = 0.1; dl->die = (float)cl.time;
dl->color[2] = 0.05; dl->color[0] = 0.20;
dl->color[1] = 0.1;
dl->color[2] = 0.05;
}
}
else if (model->flags & EF_FIREBALL)
{
dl = CL_AllocDlight (i);
VectorCopy (ent->origin, dl->origin);
dl->radius = 120 - (rand() % 20);
dl->die = (float)cl.time;
}
else if (model->flags & EF_ACIDBALL)
{
dl = CL_AllocDlight (i);
VectorCopy (ent->origin, dl->origin);
dl->radius = 120 - (rand() % 20);
dl->die = (float)cl.time;
}
else if (model->flags & EF_SPIT)
{
dl = CL_AllocDlight (i);
VectorCopy (ent->origin, dl->origin);
dl->radius = -120 - (rand() % 20);
dl->die = (float)cl.time;
} }
}
else if (model->flags & EF_FIREBALL)
{
dl = CL_AllocDlight (i);
VectorCopy (ent->origin, dl->origin);
dl->radius = 120 - (rand() % 20);
dl->die = (float)cl.time;
}
else if (model->flags & EF_ACIDBALL)
{
dl = CL_AllocDlight (i);
VectorCopy (ent->origin, dl->origin);
dl->radius = 120 - (rand() % 20);
dl->die = (float)cl.time;
}
else if (model->flags & EF_SPIT)
{
dl = CL_AllocDlight (i);
VectorCopy (ent->origin, dl->origin);
dl->radius = -120 - (rand() % 20);
dl->die = (float)cl.time;
} }
} }
} }
@ -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); 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_nofake = {"cl_nofake", "2"};
cvar_t cl_chatsound = {"cl_chatsound", "1"}; 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_muzzleflash = {"cl_muzzleflash", "1"};
cvar_t cl_item_bobbing = {"cl_model_bobbing", "0"}; cvar_t cl_item_bobbing = {"cl_model_bobbing", "0"};
@ -2035,7 +2040,8 @@ CL_Download_f
*/ */
void CL_Download_f (void) void CL_Download_f (void)
{ {
char *p, *q, *url; // char *p, *q;
char *url;
url = Cmd_Argv(1); url = Cmd_Argv(1);
@ -2268,6 +2274,11 @@ void CL_Init (void)
Cvar_Register (&cl_staticsounds, "Item effects"); 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 // info mirrors
// //