common: fix msvc build errors

This commit is contained in:
Eric Wasylishen 2017-04-24 00:34:37 -06:00
parent 68b084a6c3
commit 0a64905df8
2 changed files with 12 additions and 11 deletions

View File

@ -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<int>(qv::floor(pos)[0]),
static_cast<int>(qv::floor(pos)[1])};
qvec2f fractionalPart(pos - qv::floor(pos));
// ensure integerPart + (1, 1) is still in bounds

View File

@ -65,16 +65,16 @@ TEST(mathlib, EdgePlanesOfNonConvexPoly) {
TEST(mathlib, SlightlyConcavePoly) {
const vector<qvec3f> 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);