Ticket #7992: noir2.diff

File noir2.diff, 2.3 KB (added by eriktorbjorn, 22 years ago)

film noir mode cleanup patch

  • scummvm/script_v2.cpp

    diff -ur ScummVM-cvs20020726/scummvm/script_v2.cpp ScummVM-cvs20020726+hack/scummvm/script_v2.cpp
    old new  
    18891889                break;
    18901890
    18911891        case 213:                                                                               /* set palette */
     1892                // One case where this is used is to turn off Sam & Max film
     1893                // noir mode. Unfortunately it only restores color to the
     1894                // palette, it doesn't take palette manipulation (darkening,
     1895                // etc.) into account. So, for instance, if you turn on film
     1896                // noir mode in Sam & Max's office, turn off the light and turn
     1897                // off film noir mode, the room will no longer look dark.
     1898                //
     1899                // This bug is present in the original interpreter, so it may
     1900                // not be worth the trouble fixing it.
    18921901                setPalette(pop());
    18931902                break;
    18941903
     
    28382847
    28392848                case 114:
    28402849                        // Sam & Max film noir mode
    2841                         if (_gameId == GID_SAMNMAX)
    2842                                 desaturatePalette();
    2843                         else
     2850                        if (_gameId == GID_SAMNMAX) {
     2851                                // At this point ScummVM will already have set
     2852                                // variable 0x8000 to indicate that the game is
     2853                                // in film noir mode. All we have to do here is
     2854                                // to mark the palette as "dirty", and the next
     2855                                // call to updatePalette() will take care of
     2856                                // the rest.
     2857                                //
     2858                                // Actually, for extra bug-compatibility we
     2859                                // should call desaturatePalette() here only,
     2860                                // instead of in updatePalette(). To see the
     2861                                // difference in behaviour, try turning on film
     2862                                // noir mode in Sam & Max's office. The
     2863                                // background will be grayscale, but Sam and
     2864                                // Max themselves will be in color.
     2865                                setDirtyColors(0, 255);
     2866                        } else
    28442867                                warning("stub o6_miscOps_114()");
    28452868                        break;
    28462869
  • scummvm/scummvm.cpp

    diff -ur ScummVM-cvs20020726/scummvm/scummvm.cpp ScummVM-cvs20020726+hack/scummvm/scummvm.cpp
    old new  
    13761376        int i;
    13771377        byte *data = _currentPalette + first * 3;
    13781378
     1379        byte palette_colors[1024],*p = palette_colors;
     1380
    13791381        // Sam & Max film noir mode
    13801382        if (_gameId == GID_SAMNMAX && readVar(0x8000))
    13811383                desaturatePalette();
    1382        
    1383         byte palette_colors[1024],*p = palette_colors;
    13841384       
    13851385        for (i = 0; i != num; i++, data += 3, p+=4) {
    13861386                p[0] = data[0];