summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c52
-rw-r--r--src/cgame/cg_local.h3
-rw-r--r--src/cgame/cg_main.c4
-rw-r--r--src/game/g_main.c6
4 files changed, 56 insertions, 9 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 1001a30..a8331b1 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -1735,9 +1735,6 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y,
char s[ MAX_TOKEN_CHARS ];
float tx, ty;
- if( cg.intermissionStarted )
- return;
-
if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_NONE )
// return;
{
@@ -1793,9 +1790,6 @@ static void CG_DrawBuildPoolReport( rectDef_t *rect, float text_x, float text_y,
char out[ 20 ];
float tx, ty;
- if( cg.intermissionStarted )
- return;
-
Com_sprintf( out, sizeof( out ), "%s", Info_ValueForKey( CG_ConfigString( CS_BUILD_POOLS ), ( humans ? "h" : "a" ) ) );
CG_AlignText( rect, out, scale, 0.0f, 0.0f, textalign, textvalign, &tx, &ty );
@@ -1804,6 +1798,49 @@ static void CG_DrawBuildPoolReport( rectDef_t *rect, float text_x, float text_y,
/*
==================
+CG_DrawBuildPoolBars
+==================
+*/
+static void CG_DrawBuildPoolBars( rectDef_t *rect, vec4_t color )
+{
+ const char *cs;
+ float abp, hbp, f;
+ float x, y, w, h;
+
+ cs = CG_ConfigString( CS_BUILD_POOLS );
+
+ abp = atof( Info_ValueForKey( cs, "a" ) ) / atof( Info_ValueForKey( cs, "ad" ) );
+ hbp = atof( Info_ValueForKey( cs, "h" ) ) / atof( Info_ValueForKey( cs, "hd" ) );
+
+ if( fabs( abp + hbp ) < 1e-3 )
+ f = 0.5f;
+ else
+ f = ( ( abp - hbp ) / ( abp + hbp ) + 1.0f ) / 2.0f;
+
+ f = ( f < 0.0f ) ? 0.0f : ( f > 1.0f ) ? 1.0f : f;
+ f = f * 0.55f + 0.225f;
+
+ trap_R_SetColor( color );
+
+ x = rect->x;
+ y = rect->y;
+ w = rect->w * f;
+ h = rect->h;
+ CG_AdjustFrom640( &x, &y, &w, &h );
+ trap_R_DrawStretchPic( x, y, w, h, 0, 0, f, 1, cgs.media.alienBuildPoolBar );
+
+ x = rect->x + rect->w * f;
+ y = rect->y;
+ w = rect->w * ( 1.0f - f );
+ h = rect->h;
+ CG_AdjustFrom640( &x, &y, &w, &h );
+ trap_R_DrawStretchPic( x, y, w, h, f, 0, 1, 1, cgs.media.humanBuildPoolBar );
+
+ trap_R_SetColor( NULL );
+}
+
+/*
+==================
CG_DrawFPS
==================
*/
@@ -3169,6 +3206,9 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
case CG_HUMAN_BUILD_POOL:
CG_DrawBuildPoolReport( &rect, text_x, text_y, foreColor, scale, textalign, textvalign, textStyle, qtrue );
break;
+ case CG_BUILD_POOL_BARS:
+ CG_DrawBuildPoolBars( &rect, foreColor );
+ break;
case CG_ALIENS_SCORE_LABEL:
CG_DrawTeamLabel( &rect, TEAM_ALIENS, text_x, text_y, foreColor, scale, textalign, textvalign, textStyle );
break;
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index a477336..097da54 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1336,6 +1336,9 @@ typedef struct
qhandle_t headShotPS;
qhandle_t humanWoundsBleedPS;
qhandle_t alienWoundsBleedPS;
+
+ qhandle_t alienBuildPoolBar;
+ qhandle_t humanBuildPoolBar;
} cgMedia_t;
typedef struct
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index b7885ec..8f3ceb7 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -821,7 +821,9 @@ static void CG_RegisterGraphics( void )
cgs.media.healthCrossPoisoned = trap_R_RegisterShader( "ui/assets/neutral/cross_poison.tga" );
cgs.media.upgradeClassIconShader = trap_R_RegisterShader( "icons/icona_upgrade.tga" );
-
+
+ cgs.media.alienBuildPoolBar = trap_R_RegisterShader( "ui/assets/alien/build_pool_bar.tga" );
+ cgs.media.humanBuildPoolBar = trap_R_RegisterShader( "ui/assets/human/build_pool_bar.tga" );
cgs.media.disconnectPS = CG_RegisterParticleSystem( "disconnectPS" );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index f41d8d3..62df632 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -1405,9 +1405,11 @@ void G_CalculateBuildPoints( void )
level.alienBuildPoints += level.alienExtraBuildPoints;
}
- trap_SetConfigstring( CS_BUILD_POOLS, va( "a\\%d\\h\\%d",
+ trap_SetConfigstring( CS_BUILD_POOLS, va( "a\\%d\\ad\\%d\\h\\%d\\hd\\%d",
g_alienBuildPoints.integer + level.alienExtraBuildPoints,
- g_humanBuildPoints.integer + level.humanExtraBuildPoints ) );
+ g_alienBuildPoints.integer,
+ g_humanBuildPoints.integer + level.humanExtraBuildPoints,
+ g_humanBuildPoints.integer ) );
//zero bp not allowed
// if( level.humanBuildPoints < 0 )