diff options
Diffstat (limited to 'graphics/scaler')
-rw-r--r-- | graphics/scaler/2xsai.cpp | 26 | ||||
-rw-r--r-- | graphics/scaler/aspect.cpp | 1 | ||||
-rw-r--r-- | graphics/scaler/downscaler.cpp | 18 | ||||
-rw-r--r-- | graphics/scaler/hq2x.cpp | 1 | ||||
-rw-r--r-- | graphics/scaler/hq3x.cpp | 1 | ||||
-rw-r--r-- | graphics/scaler/intern.h | 18 |
6 files changed, 42 insertions, 23 deletions
diff --git a/graphics/scaler/2xsai.cpp b/graphics/scaler/2xsai.cpp index 165734ba10..936ed19124 100644 --- a/graphics/scaler/2xsai.cpp +++ b/graphics/scaler/2xsai.cpp @@ -153,7 +153,13 @@ void Super2xSaITemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uin } } -MAKE_WRAPPER(Super2xSaI) +void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + extern int gBitFormat; + if (gBitFormat == 565) + Super2xSaITemplate<Graphics::ColorMasks<565> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); + else + Super2xSaITemplate<Graphics::ColorMasks<555> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); +} template<typename ColorMask> void SuperEagleTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { @@ -258,7 +264,14 @@ void SuperEagleTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uin } } -MAKE_WRAPPER(SuperEagle) + +void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + extern int gBitFormat; + if (gBitFormat == 565) + SuperEagleTemplate<Graphics::ColorMasks<565> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); + else + SuperEagleTemplate<Graphics::ColorMasks<555> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); +} template<typename ColorMask> void _2xSaITemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { @@ -394,4 +407,11 @@ void _2xSaITemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 } } -MAKE_WRAPPER(_2xSaI) + +void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + extern int gBitFormat; + if (gBitFormat == 565) + _2xSaITemplate<Graphics::ColorMasks<565> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); + else + _2xSaITemplate<Graphics::ColorMasks<555> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); +} diff --git a/graphics/scaler/aspect.cpp b/graphics/scaler/aspect.cpp index 3707f39b60..58974c30fa 100644 --- a/graphics/scaler/aspect.cpp +++ b/graphics/scaler/aspect.cpp @@ -176,6 +176,7 @@ int stretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, i } int stretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY) { + extern int gBitFormat; if (gBitFormat == 565) return stretch200To240<Graphics::ColorMasks<565> >(buf, pitch, width, height, srcX, srcY, origSrcY); else // gBitFormat == 555 diff --git a/graphics/scaler/downscaler.cpp b/graphics/scaler/downscaler.cpp index 6f94f1f34b..7b2e7c70c4 100644 --- a/graphics/scaler/downscaler.cpp +++ b/graphics/scaler/downscaler.cpp @@ -63,7 +63,14 @@ void DownscaleAllByHalfTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dst dstPtr += dstPitch; } } -MAKE_WRAPPER(DownscaleAllByHalf) + +void DownscaleAllByHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + extern int gBitFormat; + if (gBitFormat == 565) + DownscaleAllByHalfTemplate<Graphics::ColorMasks<565> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); + else + DownscaleAllByHalfTemplate<Graphics::ColorMasks<555> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); +} #endif @@ -93,4 +100,11 @@ void DownscaleHorizByHalfTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *d dstPtr += dstPitch; } } -MAKE_WRAPPER(DownscaleHorizByHalf) + +void DownscaleHorizByHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + extern int gBitFormat; + if (gBitFormat == 565) + DownscaleHorizByHalfTemplate<Graphics::ColorMasks<565> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); + else + DownscaleHorizByHalfTemplate<Graphics::ColorMasks<555> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); +} diff --git a/graphics/scaler/hq2x.cpp b/graphics/scaler/hq2x.cpp index 3d9112e5c6..c302ebe8e4 100644 --- a/graphics/scaler/hq2x.cpp +++ b/graphics/scaler/hq2x.cpp @@ -96,6 +96,7 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, #define PIXEL11_90 *(q+1+nextlineDst) = interpolate16_2_3_3<ColorMask >(w5, w6, w8); #define PIXEL11_100 *(q+1+nextlineDst) = interpolate16_14_1_1<ColorMask >(w5, w6, w8); +extern "C" uint32 *RGBtoYUV; #define YUV(x) RGBtoYUV[w ## x] diff --git a/graphics/scaler/hq3x.cpp b/graphics/scaler/hq3x.cpp index 727f06ff0b..83b00ee4b3 100644 --- a/graphics/scaler/hq3x.cpp +++ b/graphics/scaler/hq3x.cpp @@ -99,6 +99,7 @@ void HQ3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, #define PIXEL22_5 *(q+2+nextlineDst2) = interpolate16_1_1<ColorMask >(w6, w8); #define PIXEL22_C *(q+2+nextlineDst2) = w5; +extern "C" uint32 *RGBtoYUV; #define YUV(x) RGBtoYUV[w ## x] diff --git a/graphics/scaler/intern.h b/graphics/scaler/intern.h index 706f0a11d0..4addd6d3bd 100644 --- a/graphics/scaler/intern.h +++ b/graphics/scaler/intern.h @@ -211,22 +211,4 @@ static inline bool diffYUV(int yuv1, int yuv2) { */ } -/** - * 16bit RGB to YUV conversion table. This table is setup by InitLUT(). - * Used by the hq scaler family. - */ -extern "C" uint32 *RGBtoYUV; - -/** Auxiliary macro to simplify creating those template function wrappers. */ -#define MAKE_WRAPPER(FUNC) \ - void FUNC(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { \ - if (gBitFormat == 565) \ - FUNC ## Template<Graphics::ColorMasks<565> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); \ - else \ - FUNC ## Template<Graphics::ColorMasks<555> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); \ - } - -/** Specifies the currently active 16bit pixel format, 555 or 565. */ -extern int gBitFormat; - #endif |