Ticket #8236: restorebg.diff

File restorebg.diff, 859 bytes (added by eriktorbjorn, 21 years ago)

Patch against a May 27 CVS snapshot

  • scummvm/scumm/gfx.cpp

    diff -ur ScummVM+orig/scummvm/scumm/gfx.cpp ScummVM+hack/scummvm/scumm/gfx.cpp
    old new  
    844844                blit(backbuff, bgbak, width, height);
    845845                if (vs->number == 0 && _charset->_hasMask && height) {
    846846                        byte *mask;
    847                         int mask_width = (width >> 3);
     847                        // Note: At first sight it may look as if this could
     848                        // be optimized to (rect.right - rect.left) >> 3 and
     849                        // thus to width >> 3, but that's not the case since
     850                        // we are dealing with integer math here.
     851                        int mask_width = (rect.right >> 3) - (rect.left >> 3);
    848852
    849                         if (width & 0x07)
     853                        if (rect.right & 0x07)
    850854                                mask_width++;
    851855
    852856                        mask = getResourceAddress(rtBuffer, 9) + rect.top * gdi._numStrips + (rect.left >> 3) + _screenStartStrip;