Ticket #8103: loom-regression.diff

File loom-regression.diff, 2.8 KB (added by eriktorbjorn, 22 years ago)

Patch against an October 22 CVS snapshot

  • scummvm/scumm/actor.cpp

    diff -ur ScummVM-cvs20021022/scummvm/scumm/actor.cpp ScummVM-cvs20021022+hack/scummvm/scumm/actor.cpp
    old new  
    896896
    897897                cr._outheight = _vm->virtscr->height;
    898898
    899                 // If walkbox is 0, that could mean two things:
     899                // FIXME - Hack to fix two glitches in the scene where Bobbin
     900                // heals Rusty: Bobbin's feet get masked when Rusty shows him
     901                // what happens to The Forge, and Rusty gets masked after
     902                // Bobbin heals him.
    900903                //
    901                 // Either the actor is or has been moved around with
    902                 // ignoreBoxes != 0. In this case, use the mask for the
    903                 // walkbox the actor is currently inside or, if it's not in
    904                 // any walkbox, don't mask at all.
     904                // When an actor is moved around without regards to walkboxes,
     905                // its walkbox is set to 0. Unfortunately that's a valid
     906                // walkbox in older games, and its mask may be completely
     907                // wrong for this purpose.
    905908                //
    906                 // This fixes two graphics glitches in Loom. Bobbin's feet
    907                 // are not obscured after Rusty's ghost has shown him what's
    908                 // happened to The Forge, and Rusty himself isn't partially
    909                 // obscured after Bobbin heals him.
     909                // So instead use the mask of the box where the actor happens
     910                // to be at the moment or, if it's not in any box, don't mask
     911                // at all.
    910912                //
    911                 // Or it could mean that the actor really is in walkbox 0.
     913                // Checking if ignoreBoxes != 0 isn't enough to fix all the
     914                // glitches, so I have to check for walkbox 0. However, that
     915                // gives too many false positives -- it breaks masking in a
     916                // few other rooms, e.g. when Stoke leaves the room where he
     917                // locks up "Rusty".
     918                //
     919                // Until someone can find the proper fix, only apply it to the
     920                // one room where it's actually needed.
    912921
    913                 if (_vm->_gameId == GID_LOOM256 && walkbox == 0) {
    914                         int i;
     922                if (_vm->_gameId == GID_LOOM256 && _vm->_currentRoom == 34 && walkbox == 0) {
     923                        int num_boxes, i;
    915924
    916925                        cr._zbuf = 0;
     926                        num_boxes = _vm->getNumBoxes();
     927
     928                        // For this particular room it won't matter in which
     929                        // direction we loop. In other rooms, looping in the
     930                        // other direction may pick the wrong box.
    917931
    918                         for (i = _vm->getNumBoxes() - 1; i >= 0; i--) {
     932                        for (i = 0; i < num_boxes; i++) {
    919933                                if (_vm->checkXYInBoxBounds(i, x, y)) {
    920934                                        cr._zbuf = _vm->getMaskFromBox(i);
    921935                                        break;
     
    11411155                abr.dist = 0;
    11421156                walkbox = 0;
    11431157        } else {
    1144                 // FIXME: this prevents part of bug #605970 (Loom) from occuring. Not sure
    1145                 // if there is a better way to achieve this.
     1158                // FIXME: this prevents part of bug #605970 (Loom) from
     1159                // occuring, and also fixes a walk bug with Rusty's ghost.
     1160                // Not sure if there is a better way to achieve this.
    11461161                if (walkbox == 0)
    11471162                        adjustActorPos();
    11481163