From ddf4b42b4c5cee282951051f9ddcb1cab4f3bb82 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 17 Aug 2019 12:49:42 +0200 Subject: [PATCH] Fix math calculation in HUD_DrawBar, rounding float too soon (fix issue #7) --- Sources/EntitiesMP/Common/HUD.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 Sources/EntitiesMP/Common/HUD.cpp diff --git a/Sources/EntitiesMP/Common/HUD.cpp b/Sources/EntitiesMP/Common/HUD.cpp old mode 100644 new mode 100755 index e4360d67d..30d088965 --- a/Sources/EntitiesMP/Common/HUD.cpp +++ b/Sources/EntitiesMP/Common/HUD.cpp @@ -519,18 +519,18 @@ static void HUD_DrawBar( FLOAT fCenterX, FLOAT fCenterY, PIX pixSizeX, PIX pixSi // determine bar position and inner size switch( eBarOrientation) { case BO_UP: - pixSizeJ *= (PIX) fNormValue; + pixSizeJ = (PIX) (pixSizeJ*fNormValue); break; case BO_DOWN: pixUpper = pixUpper + (PIX)ceil(pixSizeJ * (1.0f-fNormValue)); - pixSizeJ *= (PIX) fNormValue; + pixSizeJ = (PIX) (pixSizeJ*fNormValue); break; case BO_LEFT: - pixSizeI *= (PIX) fNormValue; + pixSizeI = (PIX) (pixSizeI*fNormValue); break; case BO_RIGHT: pixLeft = pixLeft + (PIX)ceil(pixSizeI * (1.0f-fNormValue)); - pixSizeI *= (PIX) fNormValue; + pixSizeI = (PIX) (pixSizeI*fNormValue); break; } // done