diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/cgame/cg_scanner.c | 21 |
2 files changed, 15 insertions, 8 deletions
@@ -123,7 +123,7 @@ RPMARCH=i386 VENDOR=unknown endif #alpha test -BASE_CFLAGS=-pipe +BASE_CFLAGS=-pipe -Wall DEBUG_CFLAGS=$(BASE_CFLAGS) -g -pg DEPEND_CFLAGS= -MM diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c index 16e79a51..c0686865 100644 --- a/src/cgame/cg_scanner.c +++ b/src/cgame/cg_scanner.c @@ -15,7 +15,7 @@ static entityPos_t entityPositions; -#define HUMAN_SCANNER_UPDATE_PERIOD 300 +#define HUMAN_SCANNER_UPDATE_PERIOD 700 /* ============= @@ -112,6 +112,12 @@ static void CG_DrawBlips( rectDef_t *rect, vec3_t origin, vec4_t colour ) vec3_t drawOrigin; vec3_t up = { 0, 0, 1 }; float alphaMod = 1.0f; + float timeFractionSinceRefresh = 1.0f - + ( (float)( cg.time - entityPositions.lastUpdateTime ) / + (float)HUMAN_SCANNER_UPDATE_PERIOD ); + vec4_t localColour; + + Vector4Copy( colour, localColour ); RotatePointAroundVector( drawOrigin, up, origin, -entityPositions.vangles[ 1 ] - 90 ); drawOrigin[ 0 ] /= ( 2 * HELMET_RANGE / rect->w ); @@ -121,14 +127,15 @@ static void CG_DrawBlips( rectDef_t *rect, vec3_t origin, vec4_t colour ) alphaMod = FAR_ALPHA + ( ( drawOrigin[ 1 ] + ( rect->h / 2.0f ) ) / rect->h ) * ( NEAR_ALPHA - FAR_ALPHA ); - colour[ 3 ] *= alphaMod; + localColour[ 3 ] *= alphaMod; + localColour[ 3 ] *= ( 0.5f + ( timeFractionSinceRefresh * 0.5f ) ); - if( colour[ 3 ] > 1.0f ) - colour[ 3 ] = 1.0f; - else if( colour[ 3 ] < 0.0f ) - colour[ 3 ] = 0.0f; + if( localColour[ 3 ] > 1.0f ) + localColour[ 3 ] = 1.0f; + else if( localColour[ 3 ] < 0.0f ) + localColour[ 3 ] = 0.0f; - trap_R_SetColor( colour ); + trap_R_SetColor( localColour ); if( drawOrigin[ 2 ] > 0 ) CG_DrawPic( rect->x + ( rect->w / 2 ) - ( STALKWIDTH / 2 ) - drawOrigin[ 0 ], |