diff options
author | Travis Howell | 2005-04-12 13:18:40 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-12 13:18:40 +0000 |
commit | 4efa8da52a1f64796562629c286be09ea10fd624 (patch) | |
tree | 3df80cbc066126c403b1f04dc45efa754a5a5e0f /scumm/wiz_he.cpp | |
parent | 185aa763513f2e7e3c206ade8fb0c51c24c49b55 (diff) | |
download | scummvm-rg350-4efa8da52a1f64796562629c286be09ea10fd624.tar.gz scummvm-rg350-4efa8da52a1f64796562629c286be09ea10fd624.tar.bz2 scummvm-rg350-4efa8da52a1f64796562629c286be09ea10fd624.zip |
Not all polygons should be cleared in startScene().
A few minor corrections.
svn-id: r17567
Diffstat (limited to 'scumm/wiz_he.cpp')
-rw-r--r-- | scumm/wiz_he.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 13e7835b88..5e6b8a3403 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -41,7 +41,10 @@ void Wiz::imageNumClear() { } void Wiz::polygonClear() { - memset(&_polygons, 0, sizeof(_polygons)); + for (int i = 0; i < ARRAYSIZE(_polygons); i++) { + if (_polygons[i].flag == 1) + memset(&_polygons[i], 0, sizeof(WizPolygon)); + } } void Wiz::polygonLoad(const uint8 *polData) { @@ -157,10 +160,10 @@ bool Wiz::polygonContains(const WizPolygon &pol, int x, int y) { bool r = false; for (int i = 0; i < pol.numVerts; i++) { - curdir = (y <= pol.vert[i].y); + curdir = (y < pol.vert[i].y); if (curdir != diry) { - if (((pol.vert[pi].y - pol.vert[i].y) * (pol.vert[i].x - x) <= + if (((pol.vert[pi].y - pol.vert[i].y) * (pol.vert[i].x - x) < (pol.vert[pi].x - pol.vert[i].x) * (pol.vert[i].y - y)) == diry) r = !r; } |