1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-03 12:45:38 +00:00

Truncate instead of rounding to deal with negative values

This commit is contained in:
Evil Eye 2021-11-23 17:00:53 +01:00
parent 6f5e0e7697
commit f18b8adfea

View file

@ -11,7 +11,7 @@ namespace
// Round value to prevent precision issues
void truncate(float& value)
{
value = std::roundf(value * 1024.f) / 1024.f;
value = static_cast<int>(value * 1024.f) / 1024.f;
}
}