diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 60 |
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; |