From 788bcb26b5e963f71865975026cda1dc1c5e710d Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Thu, 19 Jun 2003 10:45:21 +0000 Subject: added initial form of v1 costume codec (NOT WORKING, i think) svn-id: r8551 --- scumm/costume.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++--- scumm/costume.h | 1 + scumm/gfx.h | 3 ++- 3 files changed, 45 insertions(+), 4 deletions(-) (limited to 'scumm') diff --git a/scumm/costume.cpp b/scumm/costume.cpp index 43e7d71956..deedcd027e 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -197,7 +197,10 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { skip = -v1.x; if (skip > 0) { v1.skip_width -= skip; - codec1_ignorePakCols(skip); + if (_vm->_version != 1) + codec1_ignorePakCols(skip); + else + warning ("TODO: ignore columns for v1 gfx costume codec"); v1.x = 0; } else { skip = x_right - _vm->_screenWidth; @@ -212,7 +215,10 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { skip = x_right - _vm->_screenWidth; if (skip > 0) { v1.skip_width -= skip; - codec1_ignorePakCols(skip); + if (_vm->_version != 1) + codec1_ignorePakCols(skip); + else + warning ("TODO: ignore columns for v1 gfx costume codec"); v1.x = _vm->_screenWidth - 1; } else { skip = -1 - x_left; @@ -252,7 +258,9 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { CHECK_HEAP - if (_vm->_features & GF_AMIGA && (_vm->_gameId == GID_INDY4 || _vm->_gameId == GID_MONKEY2)) + if (_vm->_version == 1) + procC64(); + else if (_vm->_features & GF_AMIGA && (_vm->_gameId == GID_INDY4 || _vm->_gameId == GID_MONKEY2)) proc3_ami(); else proc3(); @@ -261,6 +269,37 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { return drawFlag; } +void CostumeRenderer::procC64() { + const byte *src; + byte *dst; + byte color; + byte len; + + int y = 0; + src = _srcptr; + dst = v1.destptr; + + for (int x = 0; x < (_width >> 3); x++) { + color = *src++; + if (color & 0x80) { + len &= 0x7f; + color = *src++; + for (int z = 0; z < len; z++) { + dst[0] = dst[1] = _vm->gdi._C64Colors[(color >> 6) & 3]; + dst[2] = dst[3] = _vm->gdi._C64Colors[(color >> 4) & 3]; + dst[4] = dst[5] = _vm->gdi._C64Colors[(color >> 2) & 3]; + dst[6] = dst[7] = _vm->gdi._C64Colors[(color >> 0) & 3]; + dst += _outwidth; + y++; + if (y >= (_height >> 3)) { + y = 0; + dst = v1.destptr + (x << 3); + } + } + } + } +} + void CostumeRenderer::proc3() { const byte *mask, *src; byte *dst; diff --git a/scumm/costume.h b/scumm/costume.h index c423cbfd1f..e2cce8ab72 100644 --- a/scumm/costume.h +++ b/scumm/costume.h @@ -62,6 +62,7 @@ protected: byte drawLimb(const CostumeData &cost, int limb); void proc3(); + void procC64(); void proc3_ami(); byte mainRoutine(int xmoveCur, int ymoveCur); }; diff --git a/scumm/gfx.h b/scumm/gfx.h index c388134ebf..b6c8cba163 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -113,6 +113,7 @@ public: int _imgBufOffs[8]; int32 _numStrips; ScummVM::Rect _mask; + byte _C64Colors[4]; protected: byte _palette_mod; @@ -122,7 +123,7 @@ protected: bool _zbufferDisabled; - byte _C64Colors[4], _C64CharMap[2048], _C64ObjectMap[2048], _C64PicMap[4096], _C64ColorMap[4096]; + byte _C64CharMap[2048], _C64ObjectMap[2048], _C64PicMap[4096], _C64ColorMap[4096]; byte _C64MaskMap[4096], _C64MaskChar[4096]; bool _C64ObjectMode; -- cgit v1.2.3