mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 06:42:26 +00:00
Restore old cshift powerup behavior for quad and invuln when using polyblends. Flicker was simply unbearable otherwise.
This commit is contained in:
parent
759fa8dd5f
commit
4acdf6d3b2
2 changed files with 35 additions and 12 deletions
|
@ -99,8 +99,8 @@ float bubble_sintable[33], bubble_costable[33];
|
||||||
void
|
void
|
||||||
R_InitBubble ()
|
R_InitBubble ()
|
||||||
{
|
{
|
||||||
float a;
|
|
||||||
int i;
|
int i;
|
||||||
|
float a;
|
||||||
float *bub_sin, *bub_cos;
|
float *bub_sin, *bub_cos;
|
||||||
|
|
||||||
bub_sin = bubble_sintable;
|
bub_sin = bubble_sintable;
|
||||||
|
@ -117,7 +117,6 @@ void
|
||||||
R_RenderDlight (dlight_t *light)
|
R_RenderDlight (dlight_t *light)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
vec3_t v;
|
vec3_t v;
|
||||||
float rad;
|
float rad;
|
||||||
float *bub_sin, *bub_cos;
|
float *bub_sin, *bub_cos;
|
||||||
|
@ -125,36 +124,39 @@ R_RenderDlight (dlight_t *light)
|
||||||
bub_sin = bubble_sintable;
|
bub_sin = bubble_sintable;
|
||||||
bub_cos = bubble_costable;
|
bub_cos = bubble_costable;
|
||||||
rad = light->radius * 0.35;
|
rad = light->radius * 0.35;
|
||||||
|
|
||||||
VectorSubtract (light->origin, r_origin, v);
|
VectorSubtract (light->origin, r_origin, v);
|
||||||
|
|
||||||
if (Length (v) < rad) { // view is inside the dlight
|
if (Length (v) < rad) { // view is inside the dlight
|
||||||
AddLightBlend (light->color[0], light->color[1], light->color[2], light->radius * 0.0003);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
glBegin (GL_TRIANGLE_FAN);
|
glBegin (GL_TRIANGLE_FAN);
|
||||||
|
|
||||||
if (lighthalf)
|
if (lighthalf)
|
||||||
glColor3f (light->color[0] * 0.5, light->color[1] * 0.5,
|
glColor3f (light->color[0] * 0.5, light->color[1] * 0.5,
|
||||||
light->color[2] * 0.5);
|
light->color[2] * 0.5);
|
||||||
else
|
else
|
||||||
glColor3fv (light->color);
|
glColor3fv (light->color);
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
v[i] = light->origin[i] - vpn[i] * rad;
|
v[i] = light->origin[i] - vpn[i] * rad;
|
||||||
|
|
||||||
glVertex3fv (v);
|
glVertex3fv (v);
|
||||||
glColor3f (0, 0, 0);
|
glColor3f (0, 0, 0);
|
||||||
|
|
||||||
for (i = 16; i >= 0; i--) {
|
for (i = 16; i >= 0; i--) {
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
v[j] = light->origin[j] + (vright[j] * (*bub_cos) +
|
v[j] = light->origin[j] + (vright[j] * (*bub_cos) +
|
||||||
+vup[j] * (*bub_sin)) * rad;
|
vup[j] * (*bub_sin)) * rad;
|
||||||
bub_sin += 2;
|
bub_sin += 2;
|
||||||
bub_cos += 2;
|
bub_cos += 2;
|
||||||
glVertex3fv (v);
|
glVertex3fv (v);
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnd ();
|
glEnd ();
|
||||||
// No, we don't reset here, we reset in the function which calls this
|
|
||||||
// one.
|
// Don't glColor3ubv(lighthalf_v), as we reset in the function which
|
||||||
// Largely because this is called in a big loop.
|
// calls this one, because this is called in a big loop.
|
||||||
// glColor3ubv(lighthalf_v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -124,8 +124,29 @@ V_CalcPowerupCshift (void)
|
||||||
|| (atoi (Info_ValueForKey (cl.serverinfo, "cshifts")) & INFO_CSHIFT_POWERUP))
|
|| (atoi (Info_ValueForKey (cl.serverinfo, "cshifts")) & INFO_CSHIFT_POWERUP))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Note that quad and pent are handled as dlights now. - Despair
|
if ((gl_dlight_polyblend->int_val ||
|
||||||
if (cl.stats[STAT_ITEMS] & IT_SUIT) {
|
!(gl_dlight_lightmap->int_val && gl_dlight_polyblend->int_val)) &&
|
||||||
|
(cl.stats[STAT_ITEMS] & IT_INVULNERABILITY ||
|
||||||
|
cl.stats[STAT_ITEMS] & IT_QUAD))
|
||||||
|
{
|
||||||
|
if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY &&
|
||||||
|
cl.stats[STAT_ITEMS] & IT_QUAD) {
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||||
|
} else if (cl.stats[STAT_ITEMS] & IT_QUAD) {
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||||
|
} else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
|
||||||
|
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||||
|
}
|
||||||
|
} else if (cl.stats[STAT_ITEMS] & IT_SUIT) {
|
||||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
|
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
|
||||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
|
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
|
||||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
|
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
|
||||||
|
|
Loading…
Reference in a new issue