Ticket #8280: scalers.diff

File scalers.diff, 6.4 KB (added by SF/jamieson630, 21 years ago)

Scalers patch, rev. 1

  • scummvm/common/scaler.cpp

    RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
    retrieving revision 1.49
    diff -u -r1.49 scaler.cpp
     
    233233}
    234234
    235235template<int bitFormat>
    236 void TV2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
     236void doTV2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
    237237                                        int width, int height) {
    238238        const uint32 nextlineSrc = srcPitch / sizeof(uint16);
    239239        const uint16 *p = (const uint16 *)srcPtr;
  • scummvm/common/scaler/2xsai.cpp

    RCS file: /cvsroot/scummvm/scummvm/common/scaler/2xsai.cpp,v
    retrieving revision 1.2
    diff -u -r1.2 2xsai.cpp
     
    6262#define Q_INTERPOLATE   Q_INTERPOLATE<bitFormat>
    6363
    6464template<int bitFormat>
    65 void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
     65void doSuper2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
    6666        const uint16 *bP;
    6767        uint16 *dP;
    6868        const uint32 nextlineSrc = srcPitch >> 1;
     
    171171MAKE_WRAPPER(Super2xSaI)
    172172
    173173template<int bitFormat>
    174 void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
     174void doSuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
    175175        const uint16 *bP;
    176176        uint16 *dP;
    177177        const uint32 nextlineSrc = srcPitch >> 1;
     
    282282MAKE_WRAPPER(SuperEagle)
    283283
    284284template<int bitFormat>
    285 void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
     285void do_2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
    286286        const uint16 *bP;
    287287        uint16 *dP;
    288288        const uint32 nextlineSrc = srcPitch >> 1;
  • scummvm/common/scaler/hq2x.cpp

    RCS file: /cvsroot/scummvm/scummvm/common/scaler/hq2x.cpp,v
    retrieving revision 1.4
    diff -u -r1.4 hq2x.cpp
     
    8282 * Adapted for ScummVM to 16 bit output and optimized by Max Horn.
    8383 */
    8484template<int bitFormat>
    85 void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
     85void doHQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
    8686        int  w[10];
    8787 
    8888        const uint32 nextlineSrc = srcPitch / sizeof(uint16);
  • scummvm/common/scaler/hq3x.cpp

    RCS file: /cvsroot/scummvm/scummvm/common/scaler/hq3x.cpp,v
    retrieving revision 1.3
    diff -u -r1.3 hq3x.cpp
     
    8585 * Adapted for ScummVM to 16 bit output and optimized by Max Horn.
    8686 */
    8787template<int bitFormat>
    88 void HQ3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
     88void doHQ3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
    8989        int   w[10];
    9090 
    9191        const uint32 nextlineSrc = srcPitch / sizeof(uint16);
  • scummvm/common/scaler/intern.h

    RCS file: /cvsroot/scummvm/scummvm/common/scaler/intern.h,v
    retrieving revision 1.3
    diff -u -r1.3 intern.h
     
    3030#include "common/util.h"
    3131
    3232
    33 template<int bitFormat>
    34 struct ColorMasks {
     33namespace ColorMasks_565 {
     34        const int highBits = 0xF7DEF7DE;
     35        const int lowBits = 0x08210821;
     36        const int qhighBits = 0xE79CE79C;
     37        const int qlowBits = 0x18631863;
     38        const int redblueMask = 0xF81F;
     39        const int greenMask = 0x07E0;
    3540};
    3641
    37 struct ColorMasks<565> {
    38         static const int highBits = 0xF7DEF7DE;
    39         static const int lowBits = 0x08210821;
    40         static const int qhighBits = 0xE79CE79C;
    41         static const int qlowBits = 0x18631863;
    42         static const int redblueMask = 0xF81F;
    43         static const int greenMask = 0x07E0;
     42namespace ColorMasks_555 {
     43        const int highBits = 0x04210421;
     44        const int lowBits = 0x04210421;
     45        const int qhighBits = 0x739C739C;
     46        const int qlowBits = 0x0C630C63;
     47        const int redblueMask = 0x7C1F;
     48        const int greenMask = 0x03E0;
    4449};
    4550
    46 struct ColorMasks<555> {
    47         static const int highBits = 0x04210421;
    48         static const int lowBits = 0x04210421;
    49         static const int qhighBits = 0x739C739C;
    50         static const int qlowBits = 0x0C630C63;
    51         static const int redblueMask = 0x7C1F;
    52         static const int greenMask = 0x03E0;
    53 };
     51#define ColorMasks(bitFormat,member) (((bitFormat) == 555) ? ColorMasks_555::member : ColorMasks_565::member)
    5452
    55 #define highBits        ColorMasks<bitFormat>::highBits
    56 #define lowBits         ColorMasks<bitFormat>::lowBits
    57 #define qhighBits       ColorMasks<bitFormat>::qhighBits
    58 #define qlowBits        ColorMasks<bitFormat>::qlowBits
    59 #define redblueMask     ColorMasks<bitFormat>::redblueMask
    60 #define greenMask       ColorMasks<bitFormat>::greenMask
     53#define highBits        ColorMasks(bitFormat,highBits)
     54#define lowBits         ColorMasks(bitFormat,lowBits)
     55#define qhighBits       ColorMasks(bitFormat,qhighBits)
     56#define qlowBits        ColorMasks(bitFormat,qlowBits)
     57#define redblueMask     ColorMasks(bitFormat,redblueMask)
     58#define greenMask       ColorMasks(bitFormat,greenMask)
    6159
    6260
    6361extern int gBitFormat;
     
    129127#define MAKE_WRAPPER(FUNC) \
    130128        void FUNC(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { \
    131129                if (gBitFormat == 565) \
    132                         FUNC<565>(srcPtr, srcPitch, dstPtr, dstPitch, width, height); \
     130                        do ## FUNC<565>(srcPtr, srcPitch, dstPtr, dstPitch, width, height); \
    133131                else \
    134                         FUNC<555>(srcPtr, srcPitch, dstPtr, dstPitch, width, height); \
     132                        do ## FUNC<555>(srcPtr, srcPitch, dstPtr, dstPitch, width, height); \
    135133        }
    136134
    137135#endif