summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2002-08-22 22:53:07 +0000
committerTim Angus <tim@ngus.net>2002-08-22 22:53:07 +0000
commitd974276ea91acccd09cd46f8f2b84ed8234dd4a9 (patch)
treee8fdb6f9314f2138e37bcad6a3de838d395de213
parentc8ab405f7c869fc7a786df6cc81065309b915806 (diff)
* Some more improvements to light flares
-rw-r--r--src/cgame/cg_ents.c15
-rw-r--r--src/game/g_misc.c3
2 files changed, 14 insertions, 4 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index 95d55304..8578ab08 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -669,16 +669,23 @@ static void CG_LightFlare( centity_t *cent )
maxAngle = es->origin2[ 1 ];
if( maxAngle > 0.0f )
- flare.radius *= 1.0f - ( 180.0f - RAD2DEG( acos( DotProduct( delta, forward ) ) ) ) / maxAngle;
+ {
+ float radiusMod = 1.0f - ( 180.0f - RAD2DEG( acos( DotProduct( delta, forward ) ) ) ) / maxAngle;
+
+ if( es->eFlags & EF_NODRAW )
+ flare.radius *= radiusMod;
+ else if( radiusMod < 0.0f )
+ flare.radius = 0.0f;
+ }
+
+ if( flare.radius < 0.0f )
+ flare.radius = 0.0f;
//if can't see the centre do not draw
CG_Trace( &tr, flare.origin, NULL, NULL, cg.refdef.vieworg, 0, MASK_SHOT );
if( tr.fraction < 1.0f )
return;
- if( flare.radius < 0 )
- flare.radius = 0;
-
trap_R_AddRefEntityToScene( &flare );
}
diff --git a/src/game/g_misc.c b/src/game/g_misc.c
index 5698b845..5fcc9ed6 100644
--- a/src/game/g_misc.c
+++ b/src/game/g_misc.c
@@ -455,6 +455,9 @@ void SP_misc_light_flare( gentity_t *self )
self->s.eType = ET_LIGHTFLARE;
self->s.modelindex = G_ShaderIndex( self->targetShaderName );
VectorCopy( self->pos2, self->s.origin2 );
+
+ if( self->spawnflags & 1 )
+ self->s.eFlags |= EF_NODRAW;
trap_LinkEntity( self );
}