summaryrefslogtreecommitdiff
path: root/src/cgame/cg_draw.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2002-08-08 21:40:19 +0000
committerTim Angus <tim@ngus.net>2002-08-08 21:40:19 +0000
commitb209c6138bfa97f8d427611f19a5e128d1a134e0 (patch)
tree86941a427e060b2b9b12b5386418f044c9ea223f /src/cgame/cg_draw.c
parentf58a14bc26cd5356f7ddd97f6481ddf8fc079223 (diff)
* Display of buildable health and power status
Diffstat (limited to 'src/cgame/cg_draw.c')
-rw-r--r--src/cgame/cg_draw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 1aca9df4..25a62b85 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -535,8 +535,7 @@ static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color,
float scale, int align, int textStyle, float progress )
{
int rimWidth = (int)( rect->h / 20.0f );
- float doneWidth = ( rect->w - 2 * rimWidth ) * progress;
- float leftWidth = ( rect->w - 2 * rimWidth ) - doneWidth;
+ float doneWidth, leftWidth;
float tx, ty, tw, th;
char textBuffer[ 8 ];
@@ -545,6 +544,9 @@ static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color,
else if( progress > 1.0f )
progress = 1.0f;
+ doneWidth = ( rect->w - 2 * rimWidth ) * progress;
+ leftWidth = ( rect->w - 2 * rimWidth ) - doneWidth;
+
trap_R_SetColor( color );
//draw rim and bar