From bd6fc418d171378de5de2b7450e22f70b4899b5c Mon Sep 17 00:00:00 2001 From: enneract Date: Fri, 12 Dec 2014 21:02:36 +0100 Subject: Improve BP bars' formula. --- src/cgame/cg_draw.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index e1ee2b7..8e0b88f 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -1809,11 +1809,7 @@ static void CG_DrawBuildPoolBars( rectDef_t *rect, vec4_t color ) abp = (float)cgs.alienBuildPool / (float)cgs.alienBuildPoolMax; hbp = (float)cgs.humanBuildPool / (float)cgs.humanBuildPoolMax; - if( fabs( abp + hbp ) < 1e-3 ) - f = 0.5f; - else - f = ( ( abp - hbp ) / ( abp + hbp ) + 1.0f ) / 2.0f; - + f = ( abp - hbp + 1.0f ) / 2.0f; f = ( f < 0.0f ) ? 0.0f : ( f > 1.0f ) ? 1.0f : f; f = f * 0.55f + 0.225f; -- cgit