mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-01 21:04:31 +00:00
Use float directly
This commit is contained in:
parent
f5889ba067
commit
5b94502c7f
1 changed files with 9 additions and 9 deletions
|
|
@ -92,17 +92,17 @@ namespace
|
||||||
return 2.0 * intPart == d;
|
return 2.0 * intPart == d;
|
||||||
}
|
}
|
||||||
|
|
||||||
float round_ieee_754(double d)
|
float round_ieee_754(float f)
|
||||||
{
|
{
|
||||||
double i = std::floor(d);
|
float i = std::floor(f);
|
||||||
d -= i;
|
f -= i;
|
||||||
if (d < 0.5)
|
if (f < 0.5)
|
||||||
return float(static_cast<int>(i));
|
return i;
|
||||||
if (d > 0.5)
|
if (f > 0.5)
|
||||||
return static_cast<int>(i) + 1.f;
|
return i + 1.f;
|
||||||
if (isEven(i))
|
if (isEven(i))
|
||||||
return float(static_cast<int>(i));
|
return i;
|
||||||
return static_cast<int>(i) + 1.f;
|
return i + 1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void autoCalculateAttributes(const ESM::NPC* npc, MWMechanics::CreatureStats& creatureStats)
|
void autoCalculateAttributes(const ESM::NPC* npc, MWMechanics::CreatureStats& creatureStats)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue