summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-01-05 21:26:33 +0000
committerTim Angus <tim@ngus.net>2003-01-05 21:26:33 +0000
commit12988d8127bf6e0341926bd224460626dc9dbebb (patch)
tree7bf14743d860e1604c352839bebf4ccacb991337 /src
parent9505a7b801c0d56fac83a480c5defbfe0c3b5f66 (diff)
* Various bits for the alien hud
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c54
1 files changed, 37 insertions, 17 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 156bfd43..675e791d 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -533,7 +533,7 @@ void CG_SetPrintString( int type, const char *p )
}
}
-static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color )
+static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color, qboolean padding )
{
int value;
playerState_t *ps;
@@ -544,12 +544,17 @@ static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color )
if( value > -1 )
{
trap_R_SetColor( color );
- CG_DrawFieldPadded( rect->x, rect->y, 4, rect->w / 4, rect->h, value );
+
+ if( padding )
+ CG_DrawFieldPadded( rect->x, rect->y, 4, rect->w / 4, rect->h, value );
+ else
+ CG_DrawField( rect->x, rect->y, 1, rect->w, rect->h, value );
+
trap_R_SetColor( NULL );
}
}
-static void CG_DrawPlayerBankValue( rectDef_t *rect, vec4_t color )
+static void CG_DrawPlayerBankValue( rectDef_t *rect, vec4_t color, qboolean padding )
{
int value;
playerState_t *ps;
@@ -560,7 +565,12 @@ static void CG_DrawPlayerBankValue( rectDef_t *rect, vec4_t color )
if( value > -1 )
{
trap_R_SetColor( color );
- CG_DrawFieldPadded( rect->x, rect->y, 4, rect->w / 4, rect->h, value );
+
+ if( padding )
+ CG_DrawFieldPadded( rect->x, rect->y, 4, rect->w / 4, rect->h, value );
+ else
+ CG_DrawField( rect->x, rect->y, 1, rect->w, rect->h, value );
+
trap_R_SetColor( NULL );
}
}
@@ -569,6 +579,10 @@ static void CG_DrawPlayerBankValue( rectDef_t *rect, vec4_t color )
#define HH_MAX_ALPHA 0.8f
#define HH_ALPHA_DIFF (HH_MAX_ALPHA-HH_MIN_ALPHA)
+#define AH_MIN_ALPHA 0.2f
+#define AH_MAX_ALPHA 0.8f
+#define AH_ALPHA_DIFF (AH_MAX_ALPHA-AH_MIN_ALPHA)
+
/*
==============
CG_DrawPlayerStamina1
@@ -747,13 +761,13 @@ static void CG_DrawPlayerBoosted( rectDef_t *rect, vec4_t color, qhandle_t shade
{
playerState_t *ps = &cg.snap->ps;
qboolean boosted = ps->stats[ STAT_STATE ] & SS_BOOSTED;
-
- if( !boosted )
- return;
-
- if( color[ 3 ] != 0.0 )
- trap_R_SetColor( color );
+ if( boosted )
+ color[ 3 ] = AH_MAX_ALPHA;
+ else
+ color[ 3 ] = AH_MIN_ALPHA;
+
+ trap_R_SetColor( color );
CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
trap_R_SetColor( NULL );
}
@@ -812,12 +826,12 @@ static void CG_DrawPlayerWallclimbing( rectDef_t *rect, vec4_t color, qhandle_t
playerState_t *ps = &cg.snap->ps;
qboolean ww = ps->stats[ STAT_STATE ] & SS_WALLCLIMBING;
- if( !ww )
- return;
-
- if( color[ 3 ] != 0.0 )
- trap_R_SetColor( color );
+ if( ww )
+ color[ 3 ] = AH_MAX_ALPHA;
+ else
+ color[ 3 ] = AH_MIN_ALPHA;
+ trap_R_SetColor( color );
CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
trap_R_SetColor( NULL );
}
@@ -1968,10 +1982,16 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
switch( ownerDraw )
{
case CG_PLAYER_CREDITS_VALUE:
- CG_DrawPlayerCreditsValue( &rect, color );
+ CG_DrawPlayerCreditsValue( &rect, color, qtrue );
break;
case CG_PLAYER_BANK_VALUE:
- CG_DrawPlayerBankValue( &rect, color );
+ CG_DrawPlayerBankValue( &rect, color, qtrue );
+ break;
+ case CG_PLAYER_CREDITS_VALUE_NOPAD:
+ CG_DrawPlayerCreditsValue( &rect, color, qfalse );
+ break;
+ case CG_PLAYER_BANK_VALUE_NOPAD:
+ CG_DrawPlayerBankValue( &rect, color, qfalse );
break;
case CG_PLAYER_STAMINA:
CG_DrawPlayerStamina( &rect, color, scale, align, textStyle, special );