mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
Fix math calculation in HUD_DrawBar, rounding float too soon (fix issue #7)
This commit is contained in:
parent
fd2175173a
commit
ddf4b42b4c
8
Sources/EntitiesMP/Common/HUD.cpp
Normal file → Executable file
8
Sources/EntitiesMP/Common/HUD.cpp
Normal file → Executable file
|
@ -519,18 +519,18 @@ static void HUD_DrawBar( FLOAT fCenterX, FLOAT fCenterY, PIX pixSizeX, PIX pixSi
|
||||||
// determine bar position and inner size
|
// determine bar position and inner size
|
||||||
switch( eBarOrientation) {
|
switch( eBarOrientation) {
|
||||||
case BO_UP:
|
case BO_UP:
|
||||||
pixSizeJ *= (PIX) fNormValue;
|
pixSizeJ = (PIX) (pixSizeJ*fNormValue);
|
||||||
break;
|
break;
|
||||||
case BO_DOWN:
|
case BO_DOWN:
|
||||||
pixUpper = pixUpper + (PIX)ceil(pixSizeJ * (1.0f-fNormValue));
|
pixUpper = pixUpper + (PIX)ceil(pixSizeJ * (1.0f-fNormValue));
|
||||||
pixSizeJ *= (PIX) fNormValue;
|
pixSizeJ = (PIX) (pixSizeJ*fNormValue);
|
||||||
break;
|
break;
|
||||||
case BO_LEFT:
|
case BO_LEFT:
|
||||||
pixSizeI *= (PIX) fNormValue;
|
pixSizeI = (PIX) (pixSizeI*fNormValue);
|
||||||
break;
|
break;
|
||||||
case BO_RIGHT:
|
case BO_RIGHT:
|
||||||
pixLeft = pixLeft + (PIX)ceil(pixSizeI * (1.0f-fNormValue));
|
pixLeft = pixLeft + (PIX)ceil(pixSizeI * (1.0f-fNormValue));
|
||||||
pixSizeI *= (PIX) fNormValue;
|
pixSizeI = (PIX) (pixSizeI*fNormValue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// done
|
// done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user