summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2002-12-01 03:17:55 +0000
committerTim Angus <tim@ngus.net>2002-12-01 03:17:55 +0000
commit571cc865a2b4a07c7667bd8a49ffe62ac72fc193 (patch)
tree0bdb782f1aa45bbd61ddb6535d8ed919d4bcf390
parentb2fbc3d57230c38014d44fbda8a8e8f22609a994 (diff)
* New ownerdraws for the alien hud
-rw-r--r--src/cgame/cg_draw.c93
-rw-r--r--ui/menudef.h3
2 files changed, 96 insertions, 0 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 3da8583a..e95a60cf 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -727,6 +727,90 @@ static void CG_DrawPlayerClipsRing( rectDef_t *rect, vec4_t color, qhandle_t sha
trap_R_SetColor( NULL );
}
+/*
+==============
+CG_DrawPlayerBoosted
+==============
+*/
+static void CG_DrawPlayerBoosted( rectDef_t *rect, vec4_t color, qhandle_t shader )
+{
+ 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 );
+
+ CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
+ trap_R_SetColor( NULL );
+}
+
+/*
+==============
+CG_DrawPlayerPoisonBarbs
+==============
+*/
+static void CG_DrawPlayerPoisonBarbs( rectDef_t *rect, vec4_t color, qhandle_t shader )
+{
+ playerState_t *ps = &cg.snap->ps;
+ int x = rect->x;
+ int y = rect->y;
+ int width = rect->w;
+ int height = rect->h;
+ qboolean vertical;
+ int iconsize, numBarbs, i;
+
+ BG_unpackAmmoArray( ps->weapon, ps->ammo, ps->powerups, &numBarbs, NULL, NULL );
+
+ if( height > width )
+ {
+ vertical = qtrue;
+ iconsize = width;
+ }
+ else if( height <= width )
+ {
+ vertical = qfalse;
+ iconsize = height;
+ }
+
+ if( color[ 3 ] != 0.0 )
+ trap_R_SetColor( color );
+
+ for( i = 0; i < numBarbs; i ++ )
+ {
+ if( vertical )
+ y += iconsize;
+ else
+ x += iconsize;
+
+ CG_DrawPic( x, y, iconsize, iconsize, shader );
+ }
+
+ trap_R_SetColor( NULL );
+}
+
+/*
+==============
+CG_DrawPlayerWallclimbing
+==============
+*/
+static void CG_DrawPlayerWallclimbing( rectDef_t *rect, vec4_t color, qhandle_t shader )
+{
+ 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 );
+
+ CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
+ trap_R_SetColor( NULL );
+}
+
static void CG_DrawPlayerStamina( rectDef_t *rect, vec4_t color, float scale,
int align, int textStyle, int special )
{
@@ -1914,6 +1998,15 @@ 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_WALLCLIMBING:
+ CG_DrawPlayerWallclimbing( &rect, color, shader );
+ break;
+ case CG_PLAYER_BOOSTED:
+ CG_DrawPlayerBoosted( &rect, color, shader );
+ break;
+ case CG_PLAYER_POISON_BARBS:
+ CG_DrawPlayerPoisonBarbs( &rect, color, shader );
+ break;
case CG_AREA_SYSTEMCHAT:
CG_DrawAreaSystemChat( &rect, scale, color, shader );
break;
diff --git a/ui/menudef.h b/ui/menudef.h
index 775bc1ab..1ca77a9e 100644
--- a/ui/menudef.h
+++ b/ui/menudef.h
@@ -145,6 +145,9 @@
#define CG_PLAYER_CLIPS_RING 98
#define CG_PLAYER_SELECT 74
#define CG_PLAYER_SELECTTEXT 75
+#define CG_PLAYER_WALLCLIMBING 103
+#define CG_PLAYER_BOOSTED 104
+#define CG_PLAYER_POISON_BARBS 105
#define CG_SELECTEDPLAYER_HEAD 7
#define CG_SELECTEDPLAYER_NAME 8
#define CG_SELECTEDPLAYER_LOCATION 9