Attempts to fix the quad/pent glows not appearing on bots (normal style). More changes than strictly necessary to clean up combined gl_flashblend and r_dynamic usage.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2877 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2008-01-24 01:24:10 +00:00
parent ed953da8ed
commit 2801b70dd2
3 changed files with 21 additions and 16 deletions

View file

@ -1597,8 +1597,8 @@ void CL_LinkPacketEntities (void)
VectorCopy(le->origin, ent->origin)
//bots or powerup glows. Bots always glow, powerups can be disabled
if (state->modelindex != cl_playerindex && r_powerupglow.value)
//bots or powerup glows. items always glow, powerups can be disabled
if (state->modelindex != cl_playerindex || r_powerupglow.value)
{
flicker = r_lightflicker.value?(rand()&31):0;
// spawn light flashes, even ones coming from invisible objects
@ -1900,8 +1900,8 @@ void CL_LinkPacketEntities (void)
ent->origin[i] = cl.lerpents[s1->number].origin[i] +
f * (s1->origin[i] - cl.lerpents[s1->number].origin[i]);
//bots or powerup glows. Bots always glow, powerups can be disabled
if (s1->modelindex != cl_playerindex && r_powerupglow.value)
//bots or powerup glows. items 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
@ -2709,6 +2709,7 @@ void CL_LinkPlayers (void)
frame_t *fromf;
int oldphysent;
vec3_t angles;
float *org;
playertime = realtime - cls.latency + 0.02;
if (playertime > realtime)
@ -2724,18 +2725,20 @@ void CL_LinkPlayers (void)
continue; // not present this frame
// spawn light flashes, even ones coming from invisible objects
if ((!r_flashblend.value || j != cl.playernum[0]) && r_powerupglow.value)
if (r_powerupglow.value && !(r_powerupglow.value == 2 && j == cl.playernum[0]))
{
org = (j == cl.playernum[0]) ? cl.simorg[0] : state->origin;
if ((state->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED))
CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 3)->noppl = (j != cl.playernum[0]);
CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 3)->noppl = (j != cl.playernum[0]);
else if (state->effects & EF_BLUE)
CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 1)->noppl = (j != cl.playernum[0]);
CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 1)->noppl = (j != cl.playernum[0]);
else if (state->effects & EF_RED)
CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 2)->noppl = (j != cl.playernum[0]);
CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 2)->noppl = (j != cl.playernum[0]);
else if (state->effects & EF_BRIGHTLIGHT)
CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2] + 16, 400 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]);
CL_NewDlight (j+1, org[0], org[1], org[2] + 16, 400 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]);
else if (state->effects & EF_DIMLIGHT)
CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]);
CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]);
}
if (state->modelindex < 1)

View file

@ -3244,7 +3244,7 @@ void CL_MuzzleFlash (int destsplit)
if (s1->number == i)
{
dl = CL_AllocDlight (i);
dl = CL_AllocDlight (-i);
VectorCopy (s1->origin, dl->origin);
break;
}
@ -3253,13 +3253,9 @@ void CL_MuzzleFlash (int destsplit)
{ //that ent number doesn't exist, go for a player with that number
if ((unsigned)(i) <= MAX_CLIENTS && i > 0)
{
// don't draw our own muzzle flash in gl if flashblending
if (i-1 == cl.playernum[destsplit] && r_flashblend.value && qrenderer == QR_OPENGL)
return;
pl = &cl.frames[parsecountmod].playerstate[i-1];
dl = CL_AllocDlight (i);
dl = CL_AllocDlight (-i);
VectorCopy (pl->origin, dl->origin); //set it's origin
AngleVectors (pl->viewangles, fv, rv, uv); //shift it up a little

View file

@ -190,6 +190,12 @@ void GLR_RenderDlights (void)
if (!l->radius || l->noflash)
continue;
//dlights emitting from the local player are not visible as flashblends
if (l->key == cl.playernum[r_refdef.currentplayernum]+1)
continue; //was a glow
if (l->key == -(cl.playernum[r_refdef.currentplayernum]+1))
continue; //was a muzzleflash
if (r_flashblend.value == 2)
{
if (TraceLineN(r_refdef.vieworg, l->origin, waste1, waste2))