Ticket #8019: cursor2.diff

File cursor2.diff, 2.8 KB (added by eriktorbjorn, 22 years ago)

Updated patch against a September 17 CVS snapshot

  • scummvm/scumm/gfx.cpp

    diff -ur ScummVM-cvs20020917/scummvm/scumm/gfx.cpp ScummVM-cvs20020917+hack/scummvm/scumm/gfx.cpp
    old new  
    257257
    258258void Scumm::setCursor(int cursor)
    259259{
    260         warning("setCursor(%d)", cursor);
     260        if (cursor >= 0 && cursor <= 3)
     261                gdi._currentCursor = cursor;
     262        else
     263                warning("setCursor(%d)", cursor);
    261264}
    262265
    263266void Scumm::setCameraAt(int pos_x, int pos_y)
     
    29782981        15, 15, 7, 8
    29792982};
    29802983
     2984static const uint16 default_cursor_images[4][16] = {
     2985        /* cross-hair */
     2986        { 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000, 0x7e3f,
     2987          0x0000, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000 },
     2988        /* hourglass */
     2989        { 0x0000, 0x7ffe, 0x6006, 0x300c, 0x1818, 0x0c30, 0x0660, 0x03c0,
     2990          0x0660, 0x0c30, 0x1998, 0x33cc, 0x67e6, 0x7ffe, 0x0000, 0x0000 },
     2991        /* arrow */
     2992        { 0x0000, 0x4000, 0x6000, 0x7000, 0x7800, 0x7c00, 0x7e00, 0x7f00,
     2993          0x7f80, 0x78c0, 0x7c00, 0x4600, 0x0600, 0x0300, 0x0300, 0x0180 },
     2994        /* hand */
     2995        { 0x1e00, 0x1200, 0x1200, 0x1200, 0x1200, 0x13ff, 0x1249, 0x1249,
     2996          0xf249, 0x9001, 0x9001, 0x9001, 0x8001, 0x8001, 0x8001, 0xffff },
     2997};
     2998
     2999static const byte default_cursor_hotspots[8] = {
     3000        8, 7,   8, 7,   1, 1,   5, 0
     3001};
     3002
    29813003void Scumm::decompressDefaultCursor(int idx)
    29823004{
    2983         int i;
     3005        int i, j;
    29843006        byte color;
    29853007
    29863008        memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
    2987         _cursorWidth = 16;
    2988         _cursorHeight = 16;
    2989         _cursorHotspotX = 8;
    2990         _cursorHotspotY = 8;
    29913009
    29923010        color = default_cursor_colors[idx];
    29933011
    2994         for (i = 0; i < 16; i++) {
    2995                 if ((i < 7) || (i > 9)) {
    2996                         _grabbedCursor[16 * 8 + i] = color;
    2997                         _grabbedCursor[16 * i + 8] = color;
     3012        // FIXME: None of the stock cursors are right for Loom. Why is that?
     3013
     3014        if (_gameId == GID_LOOM256) {
     3015                int w;
     3016
     3017                _cursorWidth = 8;
     3018                _cursorHeight = 8;
     3019                _cursorHotspotX = 0;
     3020                _cursorHotspotY = 0;
     3021
     3022                for (i = 0, w = 0; i < 8; i++) {
     3023                        w += (i >= 6) ? -2 : 1;
     3024                        for (j = 0; j < w; j++)
     3025                                _grabbedCursor[i * 8 + j] = color;
     3026                }
     3027        } else {
     3028                _cursorWidth = 16;
     3029                _cursorHeight = 16;
     3030                _cursorHotspotX = default_cursor_hotspots[2 * gdi._currentCursor];
     3031                _cursorHotspotY = default_cursor_hotspots[2 * gdi._currentCursor + 1];
     3032
     3033                for (i = 0; i < 16; i++) {
     3034                        for (j = 0; j < 16; j++) {
     3035                                if (default_cursor_images[gdi._currentCursor][i] & (1 << j))
     3036                                        _grabbedCursor[16 * i + 15 - j] = color;
     3037                        }
    29983038                }
    29993039        }
    30003040
  • scummvm/scumm/scummvm.cpp

    diff -ur ScummVM-cvs20020917/scummvm/scumm/scummvm.cpp ScummVM-cvs20020917+hack/scummvm/scumm/scummvm.cpp
    old new  
    263263        _talkDelay = 0;
    264264        _keepText = false;
    265265
     266        gdi._currentCursor = 0;
    266267        _cursorState = 0;
    267268        _userPut = 0;
    268269