aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-09-25 11:33:50 +0000
committerTravis Howell2004-09-25 11:33:50 +0000
commit3d8fa00317aba7d38f1ca5b080eebf0b888a1daf (patch)
tree7ddfa6b9e2733aae807dad4c67714a9d1f705ef6 /scumm
parent2bc1e81a71455d1dc29eb28f613554cc9733a95a (diff)
downloadscummvm-rg350-3d8fa00317aba7d38f1ca5b080eebf0b888a1daf.tar.gz
scummvm-rg350-3d8fa00317aba7d38f1ca5b080eebf0b888a1daf.tar.bz2
scummvm-rg350-3d8fa00317aba7d38f1ca5b080eebf0b888a1daf.zip
Cleanup to reduce code duplication.
svn-id: r15266
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp58
-rw-r--r--scumm/gfx.h3
2 files changed, 6 insertions, 55 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 5118939340..67c0daa611 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -2070,13 +2070,13 @@ bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLine
// FIXME: Ugly workaround for bug #901462
if (_vm->_version == 8 && code == 10)
useOrDecompress = true;
- drawStripComplex(dst, dstPitch, src, numLinesToProcess);
+ drawStripComplex(dst, dstPitch, src, numLinesToProcess, false);
break;
case 8:
case 12:
useOrDecompress = true;
- drawStripComplex_trans(dst, dstPitch, src, numLinesToProcess);
+ drawStripComplex(dst, dstPitch, src, numLinesToProcess, true);
break;
case 13:
@@ -2268,7 +2268,7 @@ void Gdi::drawStrip3DO(byte *dst, int dstPitch, const byte *src, int height, con
} \
} while (0)
-void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height) const {
+void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const {
byte color = *src++;
uint bits = *src++;
byte cl = 8;
@@ -2279,55 +2279,7 @@ void Gdi::drawStripComplex(byte *dst, int dstPitch, const byte *src, int height)
int x = 8;
do {
FILL_BITS;
- *dst++ = _roomPalette[color];
-
- againPos:
- if (!READ_BIT) {
- } else if (!READ_BIT) {
- FILL_BITS;
- color = bits & _decomp_mask;
- bits >>= _decomp_shr;
- cl -= _decomp_shr;
- } else {
- incm = (bits & 7) - 4;
- cl -= 3;
- bits >>= 3;
- if (incm) {
- color += incm;
- } else {
- FILL_BITS;
- reps = bits & 0xFF;
- do {
- if (!--x) {
- x = 8;
- dst += dstPitch - 8;
- if (!--height)
- return;
- }
- *dst++ = _roomPalette[color];
- } while (--reps);
- bits >>= 8;
- bits |= (*src++) << (cl - 8);
- goto againPos;
- }
- }
- } while (--x);
- dst += dstPitch - 8;
- } while (--height);
-}
-
-void Gdi::drawStripComplex_trans(byte *dst, int dstPitch, const byte *src, int height) const {
- byte color = *src++;
- uint bits = *src++;
- byte cl = 8;
- byte bit;
- byte incm, reps;
-
- do {
- int x = 8;
- do {
- FILL_BITS;
- if (color != _transparentColor)
+ if (!transpCheck || color != _transparentColor)
*dst = _roomPalette[color];
dst++;
@@ -2354,7 +2306,7 @@ void Gdi::drawStripComplex_trans(byte *dst, int dstPitch, const byte *src, int h
if (!--height)
return;
}
- if (color != _transparentColor)
+ if (!transpCheck || color != _transparentColor)
*dst = _roomPalette[color];
dst++;
} while (--reps);
diff --git a/scumm/gfx.h b/scumm/gfx.h
index da02d90711..4865da3c0d 100644
--- a/scumm/gfx.h
+++ b/scumm/gfx.h
@@ -237,8 +237,7 @@ protected:
void drawStripC64Object(byte *dst, int dstPitch, int stripnr, int width, int height);
void drawStripC64Background(byte *dst, int dstPitch, int stripnr, int height);
- void drawStripComplex(byte *dst, int dstPitch, const byte *src, int height) const;
- void drawStripComplex_trans(byte *dst, int dstPitch, const byte *src, int height) const;
+ void drawStripComplex(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
void drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height) const;
void drawStripBasicH_trans(byte *dst, int dstPitch, const byte *src, int height) const;
void drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height) const;