Skip to content

Commit

Permalink
fp config fix constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Jul 11, 2024
1 parent a6a8308 commit a80df5e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/engine/shared/fixed_point_number.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef ENGINE_SHARED_FIXED_POINT_NUMBER_H
#define ENGINE_SHARED_FIXED_POINT_NUMBER_H

#include <base/math.h>

#include <cstdint>
#include <cmath>

class CFixedPointNumber
{
Expand All @@ -21,12 +22,12 @@ class CFixedPointNumber

inline constexpr CFixedPointNumber::CFixedPointNumber(float Value)
{
m_Value = std::round(Value * 1000);
m_Value = round_to_int(Value * 1000);
}

inline constexpr CFixedPointNumber &CFixedPointNumber::operator=(float Value)
{
m_Value = std::round(Value * 1000);
m_Value = round_to_int(Value * 1000);
return *this;
}

Expand Down

0 comments on commit a80df5e

Please sign in to comment.