From 169bc3880df8951f6ce8bbcb335ce6da8ad892e3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 18 Oct 2006 15:55:10 +0000 Subject: cleanup svn-id: r24373 --- engines/scumm/boxes.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'engines') 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; -- cgit v1.2.3