Ticket #8109: restorebg.diff

File restorebg.diff, 1.5 KB (added by eriktorbjorn, 21 years ago)

Patch against an October 29 CVS snapshot

  • scummvm/scumm/gfx.cpp

    diff -ur ScummVM-cvs20021029/scummvm/scumm/gfx.cpp ScummVM-cvs20021029+hack/scummvm/scumm/gfx.cpp
    old new  
    17761776void Scumm::restoreBG(int left, int top, int right, int bottom)
    17771777{
    17781778        VirtScreen *vs;
    1779         int topline, height, width, widthmod;
    1780         byte *backbuff, *bgbak, *mask;
     1779        int topline, height, width;
     1780        byte *backbuff, *bgbak;
    17811781
    17821782        if (left == right || top == bottom)
    17831783                return;
     
    18121812
    18131813        backbuff = vs->screenPtr + height;
    18141814        bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height;
    1815         mask = getResourceAddress(rtBuffer, 9) + top * gdi._numStrips + (left >> 3) + _screenStartStrip;
    1816         if (vs->number == 0) {
    1817                 // FIXME: hardcoded value
    1818                 mask += vs->topline * 216;
    1819         }
    18201815
    18211816        height = bottom - top;
    18221817        width = right - left;
    1823         widthmod = (width >> 2) + 2;
    18241818
    18251819        if (vs->alloctwobuffers && _currentRoom != 0 /*&& _vars[VAR_V5_DRAWFLAGS]&2 */ ) {
    18261820                blit(backbuff, bgbak, width, height);
    18271821                if (vs->number == 0 && charset._hasMask && height) {
     1822                        byte *mask;
     1823                        int mask_width = (width >> 3);
     1824
     1825                        if (width & 0x07)
     1826                                mask_width++;
     1827
     1828                        mask = getResourceAddress(rtBuffer, 9) + top * gdi._numStrips + (left >> 3) + _screenStartStrip;
     1829                        if (vs->number == 0)
     1830                                mask += vs->topline * gdi._numStrips;
     1831
    18281832                        do {
    1829                                 memset(mask, 0, widthmod);
     1833                                memset(mask, 0, mask_width);
    18301834                                mask += gdi._numStrips;
    18311835                        } while (--height);
    18321836                }