diff options
author | Eugene Sandulenko | 2004-02-24 04:45:50 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-02-24 04:45:50 +0000 |
commit | 4117781522f0786329c58271233e137246a7b49a (patch) | |
tree | c76597d08d058c9e8cf9fe461a4d1a436b7977f4 | |
parent | e5392aa12c1a03f79eebd6fd65fdb8e01f7f5c49 (diff) | |
download | scummvm-rg350-4117781522f0786329c58271233e137246a7b49a.tar.gz scummvm-rg350-4117781522f0786329c58271233e137246a7b49a.tar.bz2 scummvm-rg350-4117781522f0786329c58271233e137246a7b49a.zip |
Graphics decoders for 3DO HE titles. Preliminary implementation, don't
blame me :) After testing I'll convert it to C.
svn-id: r13014
-rw-r--r-- | scumm/gfx.cpp | 166 | ||||
-rw-r--r-- | scumm/gfx.h | 2 |
2 files changed, 166 insertions, 2 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index c9c05c0e19..1311b58277 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -1485,11 +1485,16 @@ bool Gdi::decompressBitmap(byte *bgbak_ptr, const byte *src, int numLinesToProce case 7: unkDecode11(bgbak_ptr, src, numLinesToProcess); /* Ender - Zak256/Indy256 */ break; - // FIXME implement these codecs... + // 8/9 used in 3do version of puttputt joins the parade maybe others case 8: + unkDecode12(bgbak_ptr, src, numLinesToProcess); + break; + case 9: - error("decompressBitmap: Graphics codec %d not yet supported\n", code); + unkDecode13(bgbak_ptr, src, numLinesToProcess); + break; + // used in amiga version of Monkey Island case 10: decodeStripEGA(bgbak_ptr, src, numLinesToProcess); @@ -2125,6 +2130,163 @@ void Gdi::unkDecode11(byte *dst, const byte *src, int height) { } while (--x); } + +// TODO: C'ify it +void Gdi::unkDecode12(byte *dst, const byte *src, int height) { + int var_8, di, var_6; + const byte *bx; + byte si, var_4; + + var_8 = 0; + + di = height << 3; + + if (!height) + return; + + _cont1: + bx = src; + src++; + si = *bx; + + if (!(si & 1)) { + si >>= 1; + si++; + di -= si; + if (di < 0) + si += di; + + var_6 = di; + di = var_8; + + do { + bx = src; + src++; + + if (*bx != _transparentColor) + *dst = *bx; + + dst++; + di++; + if (!(di & 7)) + dst += 312; + + si--; + } while (si); + var_8 = di; + if (var_6 > 0) { + di = var_6; + goto _cont1; + } + return; + } else { + si >>= 1; + bx = src; + src++; + var_4 = *bx; + si++; + di -= si; + if (di < 0) + si += di; + var_6 = di; + di = var_8; + + do { + if (var_4 != _transparentColor) + *dst = var_4; + dst++; + di++; + if (!(di & 7)) + dst += 312; + si--; + } while (si); + var_8 = di; + if (var_6 > 0) { + di = var_6; + goto _cont1; + } + return; + } +} + + +// TODO: C'ify it +void Gdi::unkDecode13(byte *dst, const byte *src, int height) { + int var_8, di, var_6; + const byte *bx; + byte si, var_4; + + var_8 = 0; + + di = height << 3; + + if (!height) + return; + + _cont1: + bx = src; + src++; + si = *bx; + + if (!(si & 1)) { + si >>= 1; + si++; + di -= si; + if (di < 0) + si += di; + + var_6 = di; + di = var_8; + + do { + bx = src; + src++; + + *dst = *bx; + + dst++; + di++; + if (!(di & 7)) + dst += 312; + + si--; + } while (si); + var_8 = di; + if (var_6 > 0) { + di = var_6; + goto _cont1; + } + return; + } else { + si >>= 1; + bx = src; + src++; + var_4 = *bx; + si++; + di -= si; + if (di < 0) + si += di; + var_6 = di; + di = var_8; + + do { + *dst = var_4; + dst++; + di++; + if (!(di & 7)) + dst += 312; + si--; + } while (si); + var_8 = di; + if (var_6 > 0) { + di = var_6; + goto _cont1; + } + return; + } +} + + #undef NEXT_ROW #undef READ_256BIT diff --git a/scumm/gfx.h b/scumm/gfx.h index 04d7c80591..8d22eb01e9 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -248,6 +248,8 @@ protected: void unkDecode9(byte *dst, const byte *src, int height); void unkDecode10(byte *dst, const byte *src, int height); void unkDecode11(byte *dst, const byte *src, int height); + void unkDecode12(byte *dst, const byte *src, int height); + void unkDecode13(byte *dst, const byte *src, int height); void draw8ColWithMasking(byte *dst, const byte *src, int height, byte *mask); void draw8Col(byte *dst, const byte *src, int height); |