CAuiEnergyBarT01: Prevent truncation within DownloadBarCoordFunc

Without float literals, the calculation is performed in double precision
and then truncated down to float implicitly.
This commit is contained in:
Lioncash 2019-09-19 22:31:43 -04:00
parent 9c2fd54546
commit 3f06dd0a64
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ CAuiEnergyBarT01::CAuiEnergyBarT01(const CGuiWidgetParms& parms, CSimplePool* sp
} }
std::pair<zeus::CVector3f, zeus::CVector3f> CAuiEnergyBarT01::DownloadBarCoordFunc(float t) { std::pair<zeus::CVector3f, zeus::CVector3f> CAuiEnergyBarT01::DownloadBarCoordFunc(float t) {
float x = 12.5 * t - 6.25; const float x = 12.5f * t - 6.25f;
return {zeus::CVector3f{x, 0.f, -0.2f}, zeus::CVector3f{x, 0.f, 0.2f}}; return {zeus::CVector3f{x, 0.f, -0.2f}, zeus::CVector3f{x, 0.f, 0.2f}};
} }