diff options
author | Paul Gilbert | 2009-03-23 08:49:05 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-03-23 08:49:05 +0000 |
commit | f405dff025b0a5e12b1b05d210f2bca9723f4a61 (patch) | |
tree | c9ab23f46d5a8bec9c71fedf50bed58007de2deb /engines | |
parent | a6f49a636bf0e8cef76bc416d80ed10020a1924a (diff) | |
download | scummvm-rg350-f405dff025b0a5e12b1b05d210f2bca9723f4a61.tar.gz scummvm-rg350-f405dff025b0a5e12b1b05d210f2bca9723f4a61.tar.bz2 scummvm-rg350-f405dff025b0a5e12b1b05d210f2bca9723f4a61.zip |
Bugfixes for incorrect Poly class usage in the CheckNPathIntegrity DEBUG method
svn-id: r39627
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tinsel/polygons.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index e097174fe2..5631d5551a 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -1406,7 +1406,6 @@ void CheckNPathIntegrity() { uint8 *pps; // Compiled polygon data const POLYGON *rp; // Run-time polygon structure HPOLYGON hp; - const Poly *cp; // Compiled polygon structure int i, j; // Loop counters int n; // Last node in current path @@ -1416,16 +1415,16 @@ void CheckNPathIntegrity() { rp = Polys[i]; if (rp && rp->polyType == PATH && rp->subtype == NODE) { //...if it's a node path // Get compiled polygon structure - cp = (const Poly *)pps + rp->pIndex; // This polygon + const Poly cp(pps, rp->pIndex); // This polygon - n = cp->getNodecount() - 1; // Last node + n = cp.getNodecount() - 1; // Last node assert(n >= 1); // Node paths must have at least 2 nodes hp = PolygonIndex(rp); for (j = 0; j <= n; j++) { - if (!IsInPolygon(cp->getNodeX(j), cp->getNodeY(j), hp)) { + if (!IsInPolygon(cp.getNodeX(j), cp.getNodeY(j), hp)) { sprintf(TextBufferAddr(), "Node (%d, %d) is not in its own path (starting (%d, %d))", - cp->getNodeX(j), cp->getNodeY(j), rp->cx[0], rp->cy[0]); + cp.getNodeX(j), cp.getNodeY(j), rp->cx[0], rp->cy[0]); error(TextBufferAddr()); } } @@ -1435,14 +1434,14 @@ void CheckNPathIntegrity() { if (rp->adjpaths[j] == NULL) break; - if (IsInPolygon(cp->getNodeX(0), cp->getNodeY(0), PolygonIndex(rp->adjpaths[j]))) { + if (IsInPolygon(cp.getNodeX(0), cp.getNodeY(0), PolygonIndex(rp->adjpaths[j]))) { sprintf(TextBufferAddr(), "Node (%d, %d) is in another path (starting (%d, %d))", - cp->getNodeX(0), cp->getNodeY(0), rp->adjpaths[j]->cx[0], rp->adjpaths[j]->cy[0]); + cp.getNodeX(0), cp.getNodeY(0), rp->adjpaths[j]->cx[0], rp->adjpaths[j]->cy[0]); error(TextBufferAddr()); } - if (IsInPolygon(cp->getNodeX(n), cp->getNodeY(n), PolygonIndex(rp->adjpaths[j]))) { + if (IsInPolygon(cp.getNodeX(n), cp.getNodeY(n), PolygonIndex(rp->adjpaths[j]))) { sprintf(TextBufferAddr(), "Node (%d, %d) is in another path (starting (%d, %d))", - cp->getNodeX(n), cp->getNodeY(n), rp->adjpaths[j]->cx[0], rp->adjpaths[j]->cy[0]); + cp.getNodeX(n), cp.getNodeY(n), rp->adjpaths[j]->cx[0], rp->adjpaths[j]->cy[0]); error(TextBufferAddr()); } } |