Ticket #8173: cmi-boxtest.diff

File cmi-boxtest.diff, 1.2 KB (added by eriktorbjorn, 21 years ago)

Patch against a February 10 CVS snapshot

  • scummvm/scumm/boxes.cpp

    diff -ur ScummVM-cvs20030210/scummvm/scumm/boxes.cpp ScummVM-cvs20030210+hack/scummvm/scumm/boxes.cpp
    old new  
    308308                box->ll.y = (int32)FROM_LE_32(bp->v8.lly);
    309309                box->lr.x = (int32)FROM_LE_32(bp->v8.lrx);
    310310                box->lr.y = (int32)FROM_LE_32(bp->v8.lry);
     311
     312                // FIXME: Some walkboxes in CMI appear to have been flipped,
     313                // in the sense that for instance the lower boundary is above
     314                // the upper one. Can that really be the case, or is there
     315                // some more sinister problem afoot?
     316                //
     317                // Is this fix sufficient, or will we need something more
     318                // elaborate?
     319
     320                if (box->ul.y > box->ll.y && box->ur.y > box->lr.y) {
     321                        SWAP(box->ul.x, box->ll.x);
     322                        SWAP(box->ul.y, box->ll.y);
     323                        SWAP(box->ur.x, box->lr.x);
     324                        SWAP(box->ur.y, box->lr.y);
     325                }
     326
     327                if (box->ul.x > box->ur.x && box->ll.x > box->lr.x) {
     328                        SWAP(box->ul.x, box->ur.x);
     329                        SWAP(box->ul.y, box->ur.y);
     330                        SWAP(box->ll.x, box->lr.x);
     331                        SWAP(box->ll.y, box->lr.y);
     332                }
    311333        } else {
    312334                box->ul.x = (int16)FROM_LE_16(bp->old.ulx);
    313335                box->ul.y = (int16)FROM_LE_16(bp->old.uly);