Ticket #8087: bompmasking.diff

File bompmasking.diff, 3.1 KB (added by eriktorbjorn, 22 years ago)

Patch against an October 10 CVS snapshot

  • scummvm/scumm/gfx.cpp

    diff -ur ScummVM-cvs20021010/scummvm/scumm/gfx.cpp ScummVM-cvs20021010+hack/scummvm/scumm/gfx.cpp
    old new  
    18381838                lp = (left >> 3) + _screenStartStrip;
    18391839                if (lp < 0)
    18401840                        lp = 0;
    1841                 if (rp >= _realHeight)
    1842                         rp = _realHeight;
     1841                if (rp >= 200)
     1842                        rp = 200;
    18431843                if (lp <= rp) {
    18441844                        num = rp - lp + 1;
    18451845                        sp = &gfxUsageBits[lp];
     
    31943194        int src_x, src_y, dst_x, dst_y;
    31953195        uint scaled_width, scaled_height;
    31963196        int h = bd->srcheight;
     3197        byte *mask = NULL;
    31973198        uint i;
    31983199
    31993200        if (h == 0 || bd->srcwidth == 0)
     
    32173218                }
    32183219        }
    32193220
     3221        // We take charset masking into consideration, because otherwise the
     3222        // inventory window in The Dig may overwrite text.
     3223
     3224        mask = getResourceAddress(rtBuffer, 9) + _screenStartStrip;
     3225       
    32203226        // Select which rows and columns from the original to show in the
    32213227        // scaled version of the image. This is a pretty stupid way of scaling
    32223228        // images, but it will have to do for now.
     
    32673273                                color = *src++;
    32683274                                for (i = 0; i < num; i++) {
    32693275                                        if (bd->scale_x == 255 || scale_cols[src_x]) {
    3270                                                 if (dst_x >= 0 && dst_x < bd->outwidth)
    3271                                                         *d = blend(_currentPalette, color, *d);
     3276                                                if (dst_x >= 0 && dst_x < bd->outwidth) {
     3277                                                        if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7]))
     3278                                                       
     3279                                                                *d = blend(_currentPalette, color, *d);
     3280                                                }
    32723281                                                d++;
    32733282                                                dst_x++;
    32743283                                        }
     
    32783287                                for (i = 0; i < num; i++) {
    32793288                                        if (bd->scale_x == 255 || scale_cols[src_x]) {
    32803289                                                if (dst_x >= 0 && dst_x < bd->outwidth)
    3281                                                         *d = blend(_currentPalette, src[i], *d);
     3290                                                        if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7]))
     3291                                                                *d = blend(_currentPalette, src[i], *d);
    32823292                                                d++;
    32833293                                                dst_x++;
    32843294                                        }
  • scummvm/scumm/object.cpp

    diff -ur ScummVM-cvs20021010/scummvm/scumm/object.cpp ScummVM-cvs20021010+hack/scummvm/scumm/object.cpp
    old new  
    12681268
    12691269void Scumm::removeBlastObject(BlastObject *eo)
    12701270{
    1271         restoreBG(eo->posX, eo->posY, eo->posX + eo->width, eo->posY + eo->height);
     1271        VirtScreen *vs = &virtscr[0];
     1272
     1273        int top, bottom, left, right;
     1274        int left_strip, right_strip;
     1275        int i;
     1276
     1277        top = eo->posY;
     1278        bottom = eo->posY + eo->height;
     1279        left = eo->posX;
     1280        right = eo->posX + eo->width;
     1281
     1282        if (bottom < 0 || right < 0 || top > vs->height || left > vs->width)
     1283                return;
     1284
     1285        if (top < 0)
     1286                top = 0;
     1287        if (bottom > vs->height)
     1288                bottom = vs->height;
     1289        if (left < 0)
     1290                left = 0;
     1291        if (right > vs->width)
     1292                right = vs->width;
     1293
     1294        left_strip = left >> 3;
     1295        right_strip = (right >> 3) + 1;
     1296
     1297        if (left_strip < 0)
     1298                left_strip = 0;
     1299        if (right_strip >= 200)
     1300                right_strip = 200;
     1301
     1302        for (i = left_strip; i <= right_strip; i++)
     1303                gdi.resetBackground(top, bottom, i);
     1304
     1305        updateDirtyRect(0, left, right, top, bottom, 0x40000000);
    12721306}
    12731307
    12741308int Scumm::findFlObjectSlot()