bring back the alpha setting for dlights (finally found out what it was

for) and "fix" the wayward dlights in mvds: caused by svc_muzzleflash being
written before the player updates. Should probably fix properly that in the
server too.
This commit is contained in:
Bill Currie 2004-05-03 06:21:39 +00:00
parent 57ffcae9fe
commit 9ed9832789
8 changed files with 33 additions and 19 deletions

View file

@ -44,7 +44,7 @@ typedef struct dlight_s
float die; // stop lighting after this time
float decay; // drop this each second
float minlight; // don't add when contributing less
float color[3]; // Don't use alpha --KB
float color[4];
} dlight_t;
extern dlight_t *r_dlights;

View file

@ -90,7 +90,7 @@ R_RenderDlight (dlight_t *light)
qfglBegin (GL_TRIANGLE_FAN);
qfglColor3fv (light->color);
qfglColor4fv (light->color);
VectorSubtract (r_origin, light->origin, v);
VectorNormalize (v);

View file

@ -400,10 +400,10 @@ CL_NewDlight (int key, vec3_t org, int effects)
float radius;
float time = 0.1;
dlight_t *dl;
static vec3_t normal = {0.4, 0.2, 0.05};
static vec3_t red = {0.5, 0.05, 0.05};
static vec3_t blue = {0.05, 0.05, 0.5};
static vec3_t purple = {0.5, 0.05, 0.5};
static quat_t normal = {0.4, 0.2, 0.05, 0.7};
static quat_t red = {0.5, 0.05, 0.05, 0.7};
static quat_t blue = {0.05, 0.05, 0.5, 0.7};
static quat_t purple = {0.5, 0.05, 0.5, 0.7};
if (!(effects & (EF_BLUE | EF_RED | EF_BRIGHTLIGHT | EF_DIMLIGHT)))
return;
@ -425,16 +425,16 @@ CL_NewDlight (int key, vec3_t org, int effects)
switch (effects & (EF_BLUE | EF_RED)) {
case EF_RED | EF_BLUE:
VectorCopy (purple, dl->color);
QuatCopy (purple, dl->color);
break;
case EF_RED:
VectorCopy (red, dl->color);
QuatCopy (red, dl->color);
break;
case EF_BLUE:
VectorCopy (blue, dl->color);
QuatCopy (blue, dl->color);
break;
default:
VectorCopy (normal, dl->color);
QuatCopy (normal, dl->color);
break;
}
}
@ -598,6 +598,7 @@ CL_RelinkEntities (void)
dl->color[0] = 0.2;
dl->color[1] = 0.1;
dl->color[2] = 0.05;
dl->color[3] = 0.7;
}
}
CL_NewDlight (i, ent->origin, state->effects);
@ -611,6 +612,7 @@ CL_RelinkEntities (void)
dl->radius = 200;
dl->die = cl.time + 0.1;
VectorCopy (r_firecolor->vec, dl->color);
dl->color[3] = 0.7;
}
R_RocketTrail (ent);
} else if (ent->model->flags & EF_GRENADE)

View file

@ -339,6 +339,7 @@ CL_ParseTEnt (void)
dl->color[0] = 1.0;
dl->color[1] = 0.5;
dl->color[2] = 0.25;
dl->color[3] = 0.7;
}
// sound
@ -409,6 +410,7 @@ CL_ParseTEnt (void)
dl->color[0] = vid.palette[colorStart] * (1.0 / 255.0);
dl->color[1] = vid.palette[colorStart + 1] * (1.0 / 255.0);
dl->color[2] = vid.palette[colorStart + 2] * (1.0 / 255.0);
dl->color[3] = 0.7;
break;
case TE_EXPLOSION3: // Nehahra colored light explosion
@ -423,6 +425,7 @@ CL_ParseTEnt (void)
dl->die = cl.time + 0.5;
dl->decay = 300;
VectorCopy (col, dl->color);
dl->color[3] = 0.7;
}
break;

View file

@ -38,6 +38,7 @@ struct skin_s;
extern int packet_latency[NET_TIMINGS];
extern int parsecountmod;
extern int player_parsecountmod;
extern double parsecounttime;
extern int cl_playerindex;
extern int cl_flagindex;

View file

@ -97,10 +97,10 @@ CL_NewDlight (int key, vec3_t org, int effects, byte glow_size,
{
float radius;
dlight_t *dl;
static vec3_t normal = {0.4, 0.2, 0.05};
static vec3_t red = {0.5, 0.05, 0.05};
static vec3_t blue = {0.05, 0.05, 0.5};
static vec3_t purple = {0.5, 0.05, 0.5};
static quat_t normal = {0.4, 0.2, 0.05, 0.7};
static quat_t red = {0.5, 0.05, 0.05, 0.7};
static quat_t blue = {0.05, 0.05, 0.5, 0.7};
static quat_t purple = {0.5, 0.05, 0.5, 0.7};
effects &= EF_BLUE | EF_RED | EF_BRIGHTLIGHT | EF_DIMLIGHT;
if (!effects) {
@ -126,16 +126,16 @@ CL_NewDlight (int key, vec3_t org, int effects, byte glow_size,
dl->die = cl.time + 0.1;
switch (effects & (EF_RED | EF_BLUE)) {
case EF_RED | EF_BLUE:
VectorCopy (purple, dl->color);
QuatCopy (purple, dl->color);
break;
case EF_RED:
VectorCopy (red, dl->color);
QuatCopy (red, dl->color);
break;
case EF_BLUE:
VectorCopy (blue, dl->color);
QuatCopy (blue, dl->color);
break;
default:
VectorCopy (normal, dl->color);
QuatCopy (normal, dl->color);
break;
}
}
@ -537,6 +537,7 @@ CL_LinkPacketEntities (void)
dl->radius = 200.0;
dl->die = cl.time + 0.1;
VectorCopy (r_firecolor->vec, dl->color);
dl->color[3] = 0.7;
}
R_RocketTrail (*ent);
} else if (model->flags & EF_GRENADE)
@ -663,6 +664,7 @@ CL_ParsePlayerinfo (void)
Host_Error ("CL_ParsePlayerinfo: bad num");
info = &cl.players[num];
player_parsecountmod = parsecountmod;
state = &cl.frames[parsecountmod].playerstate[num];
state->number = num;
@ -1160,6 +1162,7 @@ CL_EmitEntities (void)
dl->color[0] = 0;
dl->color[1] = 1;
dl->color[2] = 0;
dl->color[3] = 0.7;
}
VectorCopy (nearloc->loc, trueloc);
R_WizSpikeEffect (trueloc);

View file

@ -159,6 +159,7 @@ const char *svc_strings[] = {
int oldparsecountmod;
int parsecountmod;
int player_parsecountmod;
double parsecounttime;
int viewentity;
@ -1156,7 +1157,7 @@ CL_MuzzleFlash (void)
if ((unsigned int) (i - 1) >= MAX_CLIENTS)
return;
pl = &cl.frames[parsecountmod].playerstate[i - 1];
pl = &cl.frames[player_parsecountmod].playerstate[i - 1];
dl = R_AllocDlight (i);
if (!dl)
@ -1174,6 +1175,7 @@ CL_MuzzleFlash (void)
dl->color[0] = 0.2;
dl->color[1] = 0.1;
dl->color[2] = 0.05;
dl->color[3] = 0.7;
}
#define SHOWNET(x) \

View file

@ -350,6 +350,7 @@ CL_ParseTEnt (void)
dl->color[0] = 0.86;
dl->color[1] = 0.31;
dl->color[2] = 0.24;
dl->color[3] = 0.7;
}
// sound
@ -419,6 +420,7 @@ CL_ParseTEnt (void)
dl->color[0] = vid.palette[colorStart] * (1.0 / 255.0);
dl->color[1] = vid.palette[colorStart + 1] * (1.0 / 255.0);
dl->color[2] = vid.palette[colorStart + 2] * (1.0 / 255.0);
dl->color[3] = 0.7;
break;
case TE_GUNSHOT: // bullet hitting wall
@ -446,6 +448,7 @@ CL_ParseTEnt (void)
dl->color[0] = 0.25;
dl->color[1] = 0.40;
dl->color[2] = 0.65;
dl->color[3] = 1;
}
R_LightningBloodEffect (pos);