Ticket #8137: insult-arrows.diff

File insult-arrows.diff, 3.0 KB (added by eriktorbjorn, 22 years ago)

Patch against a November 23 CVS snapshot

  • scummvm/scumm/scumm.h

    diff -ur ScummVM-cvs20021123/scummvm/scumm/scumm.h ScummVM-cvs20021123+hack/scummvm/scumm/scumm.h
    old new  
    194194        bool _blitAlso;
    195195       
    196196        int _strLeft, _strRight, _strTop, _strBottom;
     197        int _strLeftPixel, _strRightPixel;
    197198        byte _curId;
    198199
    199200        int _xpos2, _ypos2;
  • scummvm/scumm/string.cpp

    diff -ur ScummVM-cvs20021123/scummvm/scumm/string.cpp ScummVM-cvs20021123+hack/scummvm/scumm/string.cpp
    old new  
    588588        charset._unk12 = 1;
    589589        charset._disableOffsX = 1;
    590590
     591        // In MonkeyVGA, the scroll arrows during insult sword-fighting are
     592        // drawn - correctly, as far as I can tell - so that their background
     593        // overlaps the insults/comebacks. This causes problems whenever the
     594        // arrows are redrawn, because ScummVM simply erases the whole area
     595        // it thinks the verb occupies.
     596        //
     597        // To fix this, keep track of the left- and rightmost pixels of the
     598        // string that are actually drawn. I originally intended to do the
     599        // same for top and bottom, but for whatever reason I could never get
     600        // it to work right. Besides, I've never seen any case where it would
     601        // be necessary anyway.
     602
     603        charset._strLeftPixel = _realWidth;
     604        charset._strRightPixel = -1;
     605
    591606        if (!(_features & GF_OLD256)) {
    592607                charsetptr = getResourceAddress(rtCharset, charset._curId);
    593608                assert(charsetptr);
     
    703718                if (charset._strBottom > gdi._mask_bottom)
    704719                        gdi._mask_bottom = charset._strBottom;
    705720        }
     721
     722        // If the string has no pixels (which at the very least happens in
     723        // Indy3), then fall back on _strLeft and _strRight.
     724
     725        if (charset._strLeftPixel == _realWidth)
     726                charset._strLeftPixel = charset._strLeft;
     727        if (charset._strRightPixel == -1)
     728                charset._strRightPixel = charset._strRight;
    706729}
    707730
    708731byte *Scumm::addMessageToStack(byte *msg)
     
    10891112                                        mask[maskpos] |= maskmask;
    10901113                                }
    10911114                                *dst = _colorMap[color];
     1115                                if (_left + x < _strLeftPixel)
     1116                                        _strLeftPixel = _left + x;
     1117                                if (_left + x > _strRightPixel)
     1118                                        _strRightPixel = _left + x;
    10921119                        }
    10931120                        dst++;
    10941121                        bits <<= _bpp;
  • scummvm/scumm/verbs.cpp

    diff -ur ScummVM-cvs20021123/scummvm/scumm/verbs.cpp ScummVM-cvs20021123+hack/scummvm/scumm/verbs.cpp
    old new  
    160160                drawString(4);
    161161                charset._center = tmp;
    162162
    163                 vs->right = charset._strRight;
     163                vs->right = charset._strRightPixel;
    164164                vs->bottom = charset._strBottom;
    165                 vs->oldleft = charset._strLeft;
    166                 vs->oldright = charset._strRight;
     165                vs->oldleft = charset._strLeftPixel;
     166                vs->oldright = charset._strRightPixel;
    167167                vs->oldtop = charset._strTop;
    168168                vs->oldbottom = charset._strBottom;
    169169                charset._strLeft = charset._strRight;