aboutsummaryrefslogtreecommitdiff
path: root/graphics/conversion.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2012-07-14 04:53:37 +0200
committerJohannes Schickel2012-08-28 02:27:47 +0200
commita0f46e9396861b9eb4ab8adebcbc4739e44b9716 (patch)
treea2373ea71f1f296aa799537e0d02c15180a4b970 /graphics/conversion.cpp
parentea1bcaad3380132356adb567826e74e587c389cd (diff)
downloadscummvm-rg350-a0f46e9396861b9eb4ab8adebcbc4739e44b9716.tar.gz
scummvm-rg350-a0f46e9396861b9eb4ab8adebcbc4739e44b9716.tar.bz2
scummvm-rg350-a0f46e9396861b9eb4ab8adebcbc4739e44b9716.zip
GRAPHICS: Remove 3Bpp destination support in crossBlit.
Diffstat (limited to 'graphics/conversion.cpp')
-rw-r--r--graphics/conversion.cpp31
1 files changed, 1 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);