Ticket #8156: tv2x-20030109.2.diff

File tv2x-20030109.2.diff, 4.5 KB (added by SF/khalek, 18 years ago)

updated version with /s and no CRs

  • backends/sdl/sdl-common.cpp

    diff -ur scummvm-20030109/backends/sdl/sdl-common.cpp scummvm-20030109_tv2x/backends/sdl/sdl-common.cpp
    old new  
    485485                                        quit();
    486486                                        break;
    487487                                }
    488                                 // Ctr-Alt-1 till Ctrl-Alt-7 will change the GFX mode
     488                                // Ctr-Alt-1 till Ctrl-Alt-8 will change the GFX mode
    489489                                if (b == (KBD_CTRL|KBD_ALT) &&
    490                                     (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) {
     490                                    (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='8')) {
    491491                                        Property prop;
    492492                                        prop.gfx_mode = ev.key.keysym.sym - '1';
    493493                                        property(PROP_SET_GFX_MODE, &prop);
  • backends/sdl/sdl.cpp

    Only in scummvm-20030109_tv2x/backends/sdl: sdl-common.cpp.orig
    diff -ur scummvm-20030109/backends/sdl/sdl.cpp scummvm-20030109_tv2x/backends/sdl/sdl.cpp
    old new  
    9999                _scaleFactor = 2;
    100100                _scaler_proc = AdvMame2x;
    101101                break;
     102  case GFX_TV2X:
     103    _scaleFactor = 2;
     104    _scaler_proc = TV2x;
     105    break;
    102106
    103107        case GFX_DOUBLESIZE:
    104108                _scaleFactor = 2;
     
    339343#endif
    340344                return 1;
    341345        } else if (param == PROP_SET_GFX_MODE) {
    342                 if (value->gfx_mode >= 7)
     346                if (value->gfx_mode >= 8)
    343347                        return 0;
    344348
    345349                _mode = value->gfx_mode;
  • common/gameDetector.cpp

    diff -ur scummvm-20030109/common/gameDetector.cpp scummvm-20030109_tv2x/common/gameDetector.cpp
    old new  
    4747        "\t-p<path>   - look for game in <path>\n"
    4848        "\t-x[<num>]  - load this savegame (default: 0 - autosave)\n"
    4949        "\t-f         - fullscreen mode\n"
    50         "\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x)\n"
     50        "\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x)\n"
    5151        "\t-e<mode>   - set music engine (see README for details)\n"
    5252        "\t-a         - specify game is amiga version\n"
    5353        "\n"
     
    178178        {"super2xsai", "Super2xSAI", GFX_SUPER2XSAI},
    179179        {"supereagle", "SuperEagle", GFX_SUPEREAGLE},
    180180        {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
     181  {"tv2x", "TV2x", GFX_TV2X},
    181182        {0, 0}
    182183};
    183184
  • common/scaler.cpp

    diff -ur scummvm-20030109/common/scaler.cpp scummvm-20030109_tv2x/common/scaler.cpp
    old new  
    810810                dstPtr += dstPitch3;
    811811        }
    812812}
     813
     814void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
     815            int width, int height)
     816{
     817        unsigned int nextlineSrc = srcPitch / sizeof(short);
     818        short *p = (short *)srcPtr;
     819
     820        unsigned int nextlineDst = dstPitch / sizeof(short);
     821        short *q = (short *)dstPtr;
     822
     823        while(height--) {
     824                for (int i = 0, j = 0; i < width; ++i, j += 2) {
     825                        unsigned short p1 = *(p + i);
     826                        unsigned short p2 = *(p + i + nextlineSrc);
     827                        unsigned short pi = (unsigned short)((INTERPOLATE(p1, p2) & colorMask) >> 1);
     828
     829                        *(q + j) = p1;
     830                        *(q + j + 1) = p1;
     831                        *(q + j + nextlineDst) = pi;
     832                        *(q + j + nextlineDst + 1) = pi;
     833                }
     834                p += nextlineSrc;
     835                q += nextlineDst << 1;
     836        }
     837}
  • common/scaler.h

    diff -ur scummvm-20030109/common/scaler.h scummvm-20030109_tv2x/common/scaler.h
    old new  
    3636                                                                uint8 *dstPtr, uint32 dstPitch, int width, int height);
    3737extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
    3838                                                                uint8 *dstPtr, uint32 dstPitch, int width, int height);
     39extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
     40                                                                uint8 *dstPtr, uint32 dstPitch, int width, int height);
    3941
    4042#endif
  • common/system.h

    diff -ur scummvm-20030109/common/system.h scummvm-20030109_tv2x/common/system.h
    old new  
    215215        GFX_2XSAI = 3,
    216216        GFX_SUPER2XSAI = 4,
    217217        GFX_SUPEREAGLE = 5,
    218         GFX_ADVMAME2X = 6
     218        GFX_ADVMAME2X = 6,
     219  GFX_TV2X = 7
    219220};
    220221
    221222
  • gui/options.cpp

    diff -ur scummvm-20030109/gui/options.cpp scummvm-20030109_tv2x/gui/options.cpp
    old new  
    6969        gfxPopUp->appendEntry("Super2xSAI");
    7070        gfxPopUp->appendEntry("SuperEagle");
    7171        gfxPopUp->appendEntry("AdvMAME2x");
     72        gfxPopUp->appendEntry("TV2x");
    7273        gfxPopUp->setSelected(0);
    7374
    7475        // The MIDI mode popup & a label