mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
ASYLUM: return true if the test point is on the border of the polygon
This commit is contained in:
parent
7214a190b0
commit
733f109acc
@ -41,11 +41,11 @@ bool Polygon::contains(const Common::Point &point) {
|
||||
Common::Point *vtx0 = &points[count() - 1];
|
||||
Common::Point *vtx1 = &points[0];
|
||||
|
||||
yflag0 = (vtx0->y >= point.y);
|
||||
yflag0 = (vtx0->y > point.y);
|
||||
for (uint32 pt = 0; pt < count(); pt++, vtx1++) {
|
||||
yflag1 = (vtx1->y >= point.y);
|
||||
yflag1 = (vtx1->y > point.y);
|
||||
if (yflag0 != yflag1) {
|
||||
if (((vtx1->y - point.y) * (vtx0->x - vtx1->x) >= (vtx1->x - point.x) * (vtx0->y - vtx1->y)) == yflag1) {
|
||||
if (((vtx1->y - point.y) * (vtx0->x - vtx1->x) > (vtx1->x - point.x) * (vtx0->y - vtx1->y)) == yflag1) {
|
||||
inside_flag = !inside_flag;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user