diff options
author | Johannes Schickel | 2012-07-14 04:53:37 +0200 |
---|---|---|
committer | Johannes Schickel | 2012-08-28 02:27:47 +0200 |
commit | a0f46e9396861b9eb4ab8adebcbc4739e44b9716 (patch) | |
tree | a2373ea71f1f296aa799537e0d02c15180a4b970 /graphics | |
parent | ea1bcaad3380132356adb567826e74e587c389cd (diff) | |
download | scummvm-rg350-a0f46e9396861b9eb4ab8adebcbc4739e44b9716.tar.gz scummvm-rg350-a0f46e9396861b9eb4ab8adebcbc4739e44b9716.tar.bz2 scummvm-rg350-a0f46e9396861b9eb4ab8adebcbc4739e44b9716.zip |
GRAPHICS: Remove 3Bpp destination support in crossBlit.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/conversion.cpp | 31 | ||||
-rw-r--r-- | graphics/conversion.h | 1 |
2 files changed, 2 insertions, 30 deletions
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp index 7b6bda30a4..84f9bcbb9c 100644 --- a/graphics/conversion.cpp +++ b/graphics/conversion.cpp @@ -56,6 +56,7 @@ bool crossBlit(byte *dst, const byte *src, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt) { // Error out if conversion is impossible if ((srcFmt.bytesPerPixel == 1) || (dstFmt.bytesPerPixel == 1) + || (dstFmt.bytesPerPixel == 3) || (!srcFmt.bytesPerPixel) || (!dstFmt.bytesPerPixel) || (srcFmt.bytesPerPixel > dstFmt.bytesPerPixel)) return false; @@ -84,36 +85,6 @@ bool crossBlit(byte *dst, const byte *src, // TODO: optimized cases for dstDelta of 0 if (dstFmt.bytesPerPixel == 2) { crossBlitLogic<uint16, uint16>(dst, src, w, h, srcFmt, dstFmt, srcDelta, dstDelta); - } else if (dstFmt.bytesPerPixel == 3) { - uint32 color; - uint8 r, g, b, a; - uint8 *col = (uint8 *) &color; -#ifdef SCUMM_BIG_ENDIAN - col++; -#endif - if (srcFmt.bytesPerPixel == 2) { - for (uint y = 0; y < h; ++y) { - for (uint x = 0; x < w; ++x, src += 2, dst += 3) { - color = *(const uint16 *)src; - srcFmt.colorToARGB(color, a, r, g, b); - color = dstFmt.ARGBToColor(a, r, g, b); - memcpy(dst, col, 3); - } - src += srcDelta; - dst += dstDelta; - } - } else { - for (uint y = 0; y < h; ++y) { - for (uint x = 0; x < w; ++x, src += 3, dst += 3) { - memcpy(col, src, 3); - srcFmt.colorToARGB(color, a, r, g, b); - color = dstFmt.ARGBToColor(a, r, g, b); - memcpy(dst, col, 3); - } - src += srcDelta; - dst += dstDelta; - } - } } else if (dstFmt.bytesPerPixel == 4) { if (srcFmt.bytesPerPixel == 2) { crossBlitLogic<uint16, uint32>(dst, src, w, h, srcFmt, dstFmt, srcDelta, dstDelta); diff --git a/graphics/conversion.h b/graphics/conversion.h index c25f413fab..8fcb6ba12d 100644 --- a/graphics/conversion.h +++ b/graphics/conversion.h @@ -59,6 +59,7 @@ inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) { * @return true if conversion completes successfully, * false if there is an error. * + * @note Blitting to a 3Bpp destination is not supported * @note This implementation currently arbitrarily requires that the * destination's format have at least as high a bytedepth as * the source's. |