diff options
author | Tim Angus <tim@ngus.net> | 2001-08-19 22:45:21 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-08-19 22:45:21 +0000 |
commit | d9d6d4365c934dc89a81e73e2564a2029cdd5fef (patch) | |
tree | e5ba1860768e8dd757b30bd3628f91bc3512950a /src/cgame/cg_draw.c | |
parent | 50bd6599085e04dbe215fcb347811877fecc39a5 (diff) |
Buildable points now configurable via worldspawn
Diffstat (limited to 'src/cgame/cg_draw.c')
-rw-r--r-- | src/cgame/cg_draw.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 0617580b..0774476a 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -541,12 +541,12 @@ static void CG_DrawStatusBar( void ) { #define PWR_Y 20 if( ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) { - int total = cgs.hBuildPointsTotal; - int allocated = total - cgs.hBuildPoints; - int powered = total - cgs.hBuildPointsPowered; + float total = cgs.hBuildPointsTotal; + float allocated = total - cgs.hBuildPoints; + float powered = total - cgs.hBuildPointsPowered; - int awidth = (int)( (float)allocated / ( total / PWR_WIDTH ) ); - int pwidth = (int)( (float)powered / ( total / PWR_WIDTH ) ); + int awidth = (int)( ( allocated / total ) * PWR_WIDTH ); + int pwidth = (int)( ( powered / total ) * PWR_WIDTH ); vec4_t bcolor = { 0.5, 0.5, 0.5, 0.5 }; char *s; @@ -579,10 +579,10 @@ static void CG_DrawStatusBar( void ) { #define HV_Y 20 if( ps->stats[ STAT_PTEAM ] == PTE_DROIDS ) { - int total = cgs.dBuildPointsTotal; - int allocated = total - cgs.dBuildPoints; + float total = cgs.dBuildPointsTotal; + float allocated = total - cgs.dBuildPoints; - int awidth = (int)( (float)allocated / ( total / HV_WIDTH ) ); + int awidth = (int)( ( allocated / total ) * HV_WIDTH ); vec4_t bcolor = { 0.5, 0.5, 0.5, 0.5 }; trap_R_SetColor( bcolor ); // white |