diff --git a/Display.cpp b/Display.cpp index f4a9005..11e8242 100644 --- a/Display.cpp +++ b/Display.cpp @@ -350,7 +350,7 @@ bool less (sf::CircleShape a, sf::CircleShape b) } // compute the cross product of vectors (center -> a) x (center -> b) - int det = (ax - centerx) * (by - centery) - (bx - centerx) * (ay - centery); + int det = (int)((ax - centerx) * (by - centery) - (bx - centerx) * (ay - centery)); if (det < 0) return true; if (det > 0) @@ -358,8 +358,8 @@ bool less (sf::CircleShape a, sf::CircleShape b) // points a and b are on the same line from the center // check which point is closer to the center - int d1 = (ax - centerx) * (ax - centerx) + (ay - centery) * (ay - centery); - int d2 = (bx - centerx) * (bx - centerx) + (by - centery) * (by - centery); + int d1 = (int)((ax - centerx) * (ax - centerx) + (ay - centery) * (ay - centery)); + int d2 = (int)((bx - centerx) * (bx - centerx) + (by - centery) * (by - centery)); return d1 > d2; }