Ticket #1502: theater.diff

File theater.diff, 3.3 KB (added by cyxx, 20 years ago)
  • scumm/palette.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/palette.cpp,v
    retrieving revision 2.20
    diff -u -r2.20 palette.cpp
     
    147147                }
    148148        }
    149149        setDirtyColors(0, numcolor - 1);
     150        if (_version == 8) {
     151                memcpy(_currentOpPalette, _currentPalette, numcolor * 3);
     152        }
    150153}
    151154
    152155void ScummEngine::setDirtyColors(int min, int max) {
     
    532535                const byte *cptr;
    533536                const byte *palptr;
    534537                int color, idx, j;
    535 
    536                 palptr = getPalettePtr(_curPalIndex, _roomResource);
     538               
     539                if (_version == 8) {
     540                        palptr = _currentOpPalette;
     541                } else {
     542                        palptr = getPalettePtr(_curPalIndex, _roomResource);
     543                }
     544       
     545                // WORKAROUND bug #905833
     546                if (_gameId == GID_CMI && (_currentRoom == 20 || _currentRoom == 18) && startColor == 24) {
     547                        startColor = 0;
     548                }
     549               
    537550                for (j = startColor; j <= endColor; j++) {
    538551                        idx = (_heversion == 70) ? _HEV7ActorPalette[j] : j;
    539552                        cptr = palptr + idx * 3;
     
    585598 * walks from the beach towards the swamp.
    586599 */
    587600void ScummEngine::desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor) {
    588 
     601debug(0, "desaturatePalette(%d, %d)", startColor, endColor);
    589602        if (startColor <= endColor) {
    590603                const byte *cptr;
    591604                byte *cur;
    592605                int j;
    593606
    594                 cptr = getPalettePtr(_curPalIndex, _roomResource) + startColor * 3;
     607                if (_version == 8) {
     608                        cptr = _currentOpPalette;
     609                } else {
     610                        cptr = getPalettePtr(_curPalIndex, _roomResource);
     611                }
     612               
     613                cptr += startColor * 3;
    595614                cur = _currentPalette + startColor * 3;
    596615
    597616                for (j = startColor; j <= endColor; j++) {
     
    754773        _currentPalette[idx * 3 + 0] = r;
    755774        _currentPalette[idx * 3 + 1] = g;
    756775        _currentPalette[idx * 3 + 2] = b;
     776        if (_version == 8) {
     777                _currentOpPalette[idx * 3 + 0] = r;
     778                _currentOpPalette[idx * 3 + 1] = g;
     779                _currentOpPalette[idx * 3 + 2] = b;
     780        }
    757781        setDirtyColors(idx, idx);
    758782}
    759783
  • scumm/script_v8.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
    retrieving revision 2.278
    diff -u -r2.278 script_v8.cpp
     
    12401240                setScaleSlot(args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
    12411241                break;
    12421242        case 22:        // setBannerColors
    1243 //              warning("o8_kernelSetFunctions: setBannerColors(%d, %d, %d, %d)", args[1], args[2], args[3], args[4]);
     1243                warning("o8_kernelSetFunctions: setBannerColors(%d, %d, %d, %d)", args[1], args[2], args[3], args[4]);
    12441244                break;
    12451245        case 23:        // setActorChoreLimbFrame
    12461246                a = derefActor(args[1], "o8_kernelSetFunctions:setActorChoreLimbFrame");
  • scumm/scumm.h

    RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
    retrieving revision 1.521
    diff -u -r1.521 scumm.h
     
    10671067protected:
    10681068        int _shadowPaletteSize;
    10691069        byte _currentPalette[3 * 256];
     1070        byte _currentOpPalette[3 * 256]; // v8
    10701071
    10711072        int _palDirtyMin, _palDirtyMax;
    10721073