- m_fixed.h: Use constexpr on inline functions where it was previously not possible to do so.

This commit is contained in:
Mitch Richters 2021-11-01 23:30:17 +11:00
parent a84aa84838
commit 306c0a3ebb

View file

@ -15,7 +15,7 @@ __forceinline constexpr int64_t DivScaleL(int64_t a, int64_t b, int shift) { ret
#include "xs_Float.h"
inline fixed_t FloatToFixed(double f)
inline constexpr fixed_t FloatToFixed(double f)
{
return xs_Fix<16>::ToFix(f);
}
@ -32,10 +32,10 @@ inline constexpr double FixedToFloat(fixed_t f)
inline constexpr int32_t FixedToInt(fixed_t f)
{
return (f + FRACUNIT/2) >> FRACBITS;
return (f + (FRACUNIT >> 1)) >> FRACBITS;
}
inline unsigned FloatToAngle(double f)
inline constexpr unsigned FloatToAngle(double f)
{
return xs_CRoundToInt((f)* (0x40000000 / 90.));
}