Ticket #8061: painting.diff

File painting.diff, 2.4 KB (added by eriktorbjorn, 22 years ago)

Patch against a September 21 CVS snapshot

  • scummvm/scumm/gfx.cpp

    diff -ur ScummVM-cvs20020921/scummvm/scumm/gfx.cpp ScummVM-cvs20020921+hack/scummvm/scumm/gfx.cpp
    old new  
    26612661        ap[2] = bp[2];
    26622662        bp[2] = t;
    26632663
    2664         setDirtyColors(a, b);
     2664        setDirtyColors(a, a);
     2665        setDirtyColors(b, b);
     2666}
     2667
     2668void Scumm::copyPalColor(int dst, int src)
     2669{
     2670        byte *dp, *sp;
     2671
     2672        if ((uint) dst >= 256 || (uint) src >= 256)
     2673                error("copyPalColor: invalid values, %d, %d", dst, src);
     2674
     2675        dp = &_currentPalette[dst * 3];
     2676        sp = &_currentPalette[src * 3];
     2677
     2678        dp[0] = sp[0];
     2679        dp[1] = sp[1];
     2680        dp[2] = sp[2];
     2681
     2682        setDirtyColors(dst, dst);
    26652683}
    26662684
    26672685void Gdi::resetBackground(int top, int bottom, int strip)
  • scummvm/scumm/script_v2.cpp

    diff -ur ScummVM-cvs20020921/scummvm/scumm/script_v2.cpp ScummVM-cvs20020921+hack/scummvm/scumm/script_v2.cpp
    old new  
    29082908                        break;
    29092909
    29102910                case 123:
    2911                         swapPalColors(args[1], args[2]);
     2911                        copyPalColor(args[2], args[1]);
    29122912                        break;
    29132913
    29142914                case 124:                                                                       /* samnmax */
     
    29322932
    29332933        switch (args[0]) {
    29342934        case 113:
    2935                 // Do something to [1] x [2] (x/y)
    2936                 warning("o6_kernelFunction: stub113(%d,%d)", args[1], args[2]);
    2937                 push(0);
     2935                // This is used for the Sam & Max paint-by-numbers mini-game
     2936                // to find out what color to change. I think that what we have
     2937                // the virtual mouse coordinates, because that's what used
     2938                // everywhere else in the script.
     2939
     2940                if (args[1] != -1 && args[2] != -1) {
     2941                        VirtScreen *vs = &virtscr[0];
     2942                        push(vs->screenPtr[args[1] + args[2] * vs->width]);
     2943                } else
     2944                        push(0);
    29382945                break;
    29392946        case 115:
    29402947                push(getSpecialBox(args[1], args[2]));
  • scummvm/scumm/scumm.h

    diff -ur ScummVM-cvs20020921/scummvm/scumm/scumm.h ScummVM-cvs20020921+hack/scummvm/scumm/scumm.h
    old new  
    797797        void setDirtyColors(int min, int max);
    798798        byte *findPalInPals(byte *pal, int index);
    799799        void swapPalColors(int a, int b);
     800        void copyPalColor(int dst, int src);
    800801        void cyclePalette();
    801802        void stopCycle(int i);
    802803        void palManipulateInit(int start, int end, int string_id, int time);