Browse Source

Address C4244 warnings in MSVC

Making Displacement and Point operator*(float) use explicit casts because rounding is desirable.
pull/2274/head
ephphatha 5 years ago committed by Anders Jenbo
parent
commit
6008ea91c1
  1. 4
      Source/engine/displacement.hpp
  2. 4
      Source/engine/point.hpp

4
Source/engine/displacement.hpp

@ -44,8 +44,8 @@ struct Displacement {
constexpr Displacement &operator*=(const float factor)
{
deltaX *= factor;
deltaY *= factor;
deltaX = static_cast<int>(deltaX * factor);
deltaY = static_cast<int>(deltaY * factor);
return *this;
}

4
Source/engine/point.hpp

@ -44,8 +44,8 @@ struct Point {
constexpr Point &operator*=(const float factor)
{
x *= factor;
y *= factor;
x = static_cast<int>(x * factor);
y = static_cast<int>(y * factor);
return *this;
}

Loading…
Cancel
Save