summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-06-13 23:58:32 +0000
committerTim Angus <tim@ngus.net>2003-06-13 23:58:32 +0000
commit7cca20bab858badbef5f3d519c418b7d118eb53e (patch)
tree5f7a80e969cd0bc7da19a4ffcfb05ec6980a414b /src/cgame
parent7630d01bc896bf5fa2403810867e6bc0f19c9d5a (diff)
* Code support for the "new" huds
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index fecbfd70..3d82440b 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -754,6 +754,31 @@ static void CG_DrawPlayerClipsRing( rectDef_t *rect, vec4_t color, qhandle_t sha
/*
==============
+CG_DrawPlayerBuildTimerRing
+==============
+*/
+static void CG_DrawPlayerBuildTimerRing( rectDef_t *rect, vec4_t color, qhandle_t shader )
+{
+ playerState_t *ps = &cg.snap->ps;
+ centity_t *cent;
+ float buildTime = ps->stats[ STAT_MISC ];
+ float progress;
+ float maxDelay;
+
+ cent = &cg_entities[ cg.snap->ps.clientNum ];
+
+ maxDelay = (float)BG_FindBuildDelayForWeapon( cent->currentState.weapon );
+ progress = ( maxDelay - buildTime ) / maxDelay;
+
+ color[ 3 ] = AH_MIN_ALPHA + ( progress * AH_ALPHA_DIFF );
+
+ trap_R_SetColor( color );
+ CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
+ trap_R_SetColor( NULL );
+}
+
+/*
+==============
CG_DrawPlayerBoosted
==============
*/
@@ -774,6 +799,35 @@ static void CG_DrawPlayerBoosted( rectDef_t *rect, vec4_t color, qhandle_t shade
/*
==============
+CG_DrawPlayerBoosterBolt
+==============
+*/
+static void CG_DrawPlayerBoosterBolt( rectDef_t *rect, vec4_t color, qhandle_t shader )
+{
+ playerState_t *ps = &cg.snap->ps;
+ qboolean boosted = ps->stats[ STAT_STATE ] & SS_BOOSTED;
+ vec4_t localColor;
+
+ Vector4Copy( color, localColor );
+
+ if( boosted )
+ {
+ if( ps->stats[ STAT_BOOSTTIME ] > BOOST_TIME - 3000 )
+ {
+ qboolean flash = ( ps->stats[ STAT_BOOSTTIME ] / 500 ) % 2;
+
+ if( flash )
+ localColor[ 3 ] = 1.0f;
+ }
+ }
+
+ trap_R_SetColor( localColor );
+ CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
+ trap_R_SetColor( NULL );
+}
+
+/*
+==============
CG_DrawPlayerPoisonBarbs
==============
*/
@@ -2129,12 +2183,18 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
case CG_PLAYER_CLIPS_RING:
CG_DrawPlayerClipsRing( &rect, color, shader );
break;
+ case CG_PLAYER_BUILD_TIMER_RING:
+ CG_DrawPlayerBuildTimerRing( &rect, color, shader );
+ break;
case CG_PLAYER_WALLCLIMBING:
CG_DrawPlayerWallclimbing( &rect, color, shader );
break;
case CG_PLAYER_BOOSTED:
CG_DrawPlayerBoosted( &rect, color, shader );
break;
+ case CG_PLAYER_BOOST_BOLT:
+ CG_DrawPlayerBoosterBolt( &rect, color, shader );
+ break;
case CG_PLAYER_POISON_BARBS:
CG_DrawPlayerPoisonBarbs( &rect, color, shader );
break;