diff --git a/include/common/mathlib.hh b/include/common/mathlib.hh index 672c07a5..20c46204 100644 --- a/include/common/mathlib.hh +++ b/include/common/mathlib.hh @@ -345,7 +345,8 @@ bilinearWeightsAndCoords(qvec2f pos, const qvec2i &size) Q_assert(pos[0] >= 0.f && pos[0] <= (size[0] - 1)); Q_assert(pos[1] >= 0.f && pos[1] <= (size[1] - 1)); - qvec2i integerPart{qv::floor(pos)[0], qv::floor(pos)[1]}; + qvec2i integerPart{static_cast(qv::floor(pos)[0]), + static_cast(qv::floor(pos)[1])}; qvec2f fractionalPart(pos - qv::floor(pos)); // ensure integerPart + (1, 1) is still in bounds diff --git a/light/test_light.cc b/light/test_light.cc index fda60843..81445dce 100644 --- a/light/test_light.cc +++ b/light/test_light.cc @@ -65,16 +65,16 @@ TEST(mathlib, EdgePlanesOfNonConvexPoly) { TEST(mathlib, SlightlyConcavePoly) { const vector poly { - {225.846161, -1744, 1774}, - {248, -1744, 1798}, - {248, -1763.82605, 1799.65222}, - {248, -1764, 1799.66663}, - {248, -1892, 1810.33337}, - {248, -1893.21741, 1810.43481}, - {248, -1921.59998, 1812.80005}, - {248, -1924, 1813}, - {80, -1924, 1631}, - {80, -1744, 1616} + qvec3f(225.846161, -1744, 1774), + qvec3f(248, -1744, 1798), + qvec3f(248, -1763.82605, 1799.65222), + qvec3f(248, -1764, 1799.66663), + qvec3f(248, -1892, 1810.33337), + qvec3f(248, -1893.21741, 1810.43481), + qvec3f(248, -1921.59998, 1812.80005), + qvec3f(248, -1924, 1813), + qvec3f(80, -1924, 1631), + qvec3f(80, -1744, 1616) }; const auto edges = GLM_MakeInwardFacingEdgePlanes(poly);