mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-26 10:44:17 +00:00
- m_fixed.h
: Use constexpr
on inline functions where it was previously not possible to do so.
This commit is contained in:
parent
a84aa84838
commit
306c0a3ebb
1 changed files with 3 additions and 3 deletions
|
@ -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.));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue