diff options
-rw-r--r-- | engines/scumm/boxes.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index 534426b635..736915ff08 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -542,16 +542,21 @@ bool ScummEngine::checkXYInBoxBounds(int b, int x, int y) { return true; } + // Finally, fall back to the classic algorithm to compute containment + // in a convex polygon: For each (oriented) side of the polygon + // (quadrangle in this case), compute whether p is "left" or "right" + // from it. + if (!compareSlope(box.ul, box.ur, p)) return false; if (!compareSlope(box.ur, box.lr, p)) return false; - - if (!compareSlope(box.ll, p, box.lr)) + + if (!compareSlope(box.lr, box.ll, p)) return false; - if (!compareSlope(box.ul, p, box.ll)) + if (!compareSlope(box.ll, box.ul, p)) return false; return true; |