flickering rocket/lava lights are dead and cvars now support vectors (archiving

broken atm).
This commit is contained in:
Bill Currie 2001-01-08 07:07:48 +00:00
parent e7a6ad981d
commit b66c22d0e5
7 changed files with 19 additions and 34 deletions

View file

@ -39,6 +39,7 @@ void CL_ParseProjectiles (void);
void CL_ParsePacketEntities (qboolean delta);
void CL_SetSolidEntities (void);
void CL_ParsePlayerinfo (void);
void CL_Ents_Init (void);
extern struct cvar_s *cl_deadbodyfilter;
extern struct cvar_s *cl_gibfilter;

View file

@ -40,6 +40,7 @@ typedef struct cvar_s
char *description; // for "help" command
float value;
int int_val;
vec3_t vec;
struct cvar_s *next;
} cvar_t;

View file

@ -49,6 +49,8 @@ extern cvar_t *cl_solid_players;
extern cvar_t *gl_flashblend;
cvar_t *r_firecolor;
static struct predicted_player {
int flags;
qboolean active;
@ -611,6 +613,7 @@ CL_LinkPacketEntities (void)
dl = CL_AllocDlight (-s1->number);
VectorCopy ((*ent)->origin, dl->origin);
dl->radius = 200;
VectorCopy (r_firecolor->vec, dl->color);
dl->die = cl.time + 0.1;
R_RocketTrail (0, (*ent));
} else if (model->flags & EF_GRENADE)
@ -1192,3 +1195,10 @@ CL_EmitEntities (void)
CL_LinkProjectiles ();
CL_UpdateTEnts ();
}
void
CL_Ents_Init (void)
{
r_firecolor = Cvar_Get ("r_firecolor", "0.9 0.4 0", CVAR_ARCHIVE,
"color of rocket and lava ball fires");
}

View file

@ -441,6 +441,7 @@ CL_ClearState (void)
if (host_hunklevel) // FIXME: check this...
Hunk_FreeToLowMark (host_hunklevel);
CL_Ents_Init ();
CL_ClearEnts ();
CL_ClearTEnts ();

View file

@ -207,6 +207,7 @@ Cvar_Set (cvar_t *var, char *value)
var->string = strdup (value);
var->value = atof (var->string);
var->int_val = atoi (var->string);
sscanf (var->string, "%f %f %f", &var->vec[0], &var->vec[1], &var->vec[2]);
Cvar_Info (var);
}
@ -228,6 +229,7 @@ Cvar_SetROM (cvar_t *var, char *value)
var->string = strdup (value);
var->value = atof (var->string);
var->int_val = atoi (var->string);
sscanf (var->string, "%f %f %f", &var->vec[0], &var->vec[1], &var->vec[2]);
Cvar_Info (var);
}
@ -525,6 +527,8 @@ Cvar_Get (char *name, char *string, int cvarflags, char *description)
v->description = description;
v->value = atof (v->string);
v->int_val = atoi (v->string);
sscanf (v->string, "%f %f %f",
&v->vec[0], &v->vec[1], &v->vec[2]);
Hash_Add (cvar_hash, v);
} else {
// Cvar does exist, so we update the flags and return.

View file

@ -47,6 +47,7 @@
static fire_t r_fires[MAX_FIRES];
extern cvar_t *gl_fires;
extern cvar_t *r_firecolor;
/*
R_AddFire
@ -54,14 +55,12 @@ extern cvar_t *gl_fires;
Nifty ball of fire GL effect. Kinda a meshing of the dlight and
particle engine code.
*/
float r_firecolor[3] = { 0.9, 0.4, 0 };
void
R_AddFire (vec3_t start, vec3_t end, entity_t *ent)
{
float len;
fire_t *f;
dlight_t *dl;
vec3_t vec;
int key;
@ -79,13 +78,7 @@ R_AddFire (vec3_t start, vec3_t end, entity_t *ent)
f->size = 20;
f->die = cl.time + 0.5;
f->decay = -1;
f->color = r_firecolor;
dl = CL_AllocDlight (-key);
VectorCopy (end, dl->origin);
dl->radius = 200;
dl->die = cl.time + 0.5;
dl->color = r_firecolor;
f->color = r_firecolor->vec;
}
}
@ -213,25 +206,3 @@ R_UpdateFires (void)
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask (GL_TRUE);
}
void
R_FireColor_f (void)
{
int i;
if (Cmd_Argc () == 1) {
Con_Printf ("r_firecolor %g %g %g\n",
r_firecolor[0], r_firecolor[1], r_firecolor[2]);
return;
}
if (Cmd_Argc () == 5 || Cmd_Argc () == 6) {
Con_Printf
("Warning: obsolete 4th and 5th parameters to r_firecolor ignored\n");
} else if (Cmd_Argc () != 4) {
Con_Printf ("Usage r_firecolor R G B\n");
return;
}
for (i = 0; i < 4; i++) {
r_firecolor[i] = atof (Cmd_Argv (i + 1));
}
}

View file

@ -49,7 +49,6 @@
qboolean VID_Is8bit (void);
void R_InitBubble (void);
void R_FireColor_f (void);
cvar_t *gl_fires;
cvar_t *r_netgraph_alpha;
@ -194,8 +193,6 @@ R_Init (void)
Cmd_AddCommand ("pointfile", R_ReadPointFile_f);
Cmd_AddCommand ("loadsky", R_LoadSky_f);
Cmd_AddCommand ("r_firecolor", R_FireColor_f);
R_InitBubble ();
R_InitParticles ();