aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-04-12 13:44:06 +0000
committerTravis Howell2005-04-12 13:44:06 +0000
commit003b3a3f487500e17788590ea1c5e75b55221765 (patch)
treefd1d33c148fc4463f9aaec3d7cd6bc62b6eef0f8
parent4efa8da52a1f64796562629c286be09ea10fd624 (diff)
downloadscummvm-rg350-003b3a3f487500e17788590ea1c5e75b55221765.tar.gz
scummvm-rg350-003b3a3f487500e17788590ea1c5e75b55221765.tar.bz2
scummvm-rg350-003b3a3f487500e17788590ea1c5e75b55221765.zip
Add missing segment
svn-id: r17568
-rw-r--r--scumm/wiz_he.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp
index 5e6b8a3403..e08436b11b 100644
--- a/scumm/wiz_he.cpp
+++ b/scumm/wiz_he.cpp
@@ -172,6 +172,43 @@ bool Wiz::polygonContains(const WizPolygon &pol, int x, int y) {
diry = curdir;
}
+ // HE80+
+ int a, b;
+ pi = pol.numVerts - 1;
+ if (r == 0) {
+ for (int i = 0; i < pol.numVerts; i++) {
+ if (pol.vert[i].y == y && pol.vert[i].y == pol.vert[pi].y) {
+
+ a = pol.vert[i].x;
+ b = pol.vert[pi].x;
+
+ if (pol.vert[i].x >= pol.vert[pi].x)
+ a = pol.vert[pi].x;
+
+ if (pol.vert[i].x > pol.vert[pi].x)
+ b = pol.vert[i].x;
+
+ if (x >= a && x <= b)
+ return 1;
+
+ } else if (pol.vert[i].x == x && pol.vert[i].x == pol.vert[pi].x) {
+
+ a = pol.vert[i].y;
+ b = pol.vert[i].y;
+
+ if (pol.vert[i].y >= pol.vert[pi].y)
+ a = pol.vert[pi].y;
+
+ if (pol.vert[i].y <= pol.vert[pi].y)
+ b = pol.vert[pi].y;
+
+ if (y >= a && y <= b)
+ return 1;
+ }
+ pi = i;
+ }
+ }
+
return r;
}