diff options
author | Max Horn | 2003-07-08 17:44:06 +0000 |
---|---|---|
committer | Max Horn | 2003-07-08 17:44:06 +0000 |
commit | 66ec3f9c75d5e923063506bea666f9f8825517f5 (patch) | |
tree | bc0c2093b7478dfcf36e0dc83a0d2c239f58aed2 /scumm | |
parent | 00a87fda033d07e5ca45f1180ec91809f5929060 (diff) | |
download | scummvm-rg350-66ec3f9c75d5e923063506bea666f9f8825517f5.tar.gz scummvm-rg350-66ec3f9c75d5e923063506bea666f9f8825517f5.tar.bz2 scummvm-rg350-66ec3f9c75d5e923063506bea666f9f8825517f5.zip |
rewrote c64_ignorePakCols to what I *think* it should look like, base on my understanding of the code. so far completely untested :-)
svn-id: r8864
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/costume.cpp | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/scumm/costume.cpp b/scumm/costume.cpp index c619f47d12..e8d6c74397 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -280,27 +280,24 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { return drawFlag; } -// FIXME: Call this something sensible, make sure it works void CostumeRenderer::c64_ignorePakCols(int num) { +warning("c64_ignorePakCols(%d) - this needs testing", num); #if 1 - // Fingolfin seez: this code is equivalent to codec1_ignorePakCols. - // And I wonder if that can be true, considering the different - // compressor used in procC64 vs. proc3 ? - codec1_ignorePakCols(num); + for (int x = 0; x < (num >> 3); x++) { + v1.repcolor = *_srcptr++; + if (v1.repcolor & 0x80) { + v1.replen = v1.repcolor & 0x7f; + v1.repcolor = *_srcptr++; + } else { + v1.replen = v1.repcolor; + for (int z = 0; z < v1.replen; z++) { + v1.repcolor = *_srcptr++; + } + } + } #else - int n = _height * num; - do { - v1.repcolor = *_srcptr >> 4; - v1.replen = *_srcptr++ & 0x0F; - - if (v1.replen == 0) - v1.replen = *_srcptr++; - - do { - if (!--n) return; - } while (--v1.replen); - } while (1); + codec1_ignorePakCols(num); #endif } @@ -574,6 +571,9 @@ byte CostumeRenderer::drawLimb(const CostumeData &cost, int limb) { const CostumeInfo *costumeInfo; int xmoveCur, ymoveCur; +//printf("costume %d, limb %d:\n", _loaded._id, limb); +//printf("_srcptr:\n"); +//hexdump(_srcptr, 0x20); if (_vm->_version == 1) { _width = _srcptr[0] * 8; _height = _srcptr[1]; @@ -583,10 +583,6 @@ byte CostumeRenderer::drawLimb(const CostumeData &cost, int limb) { _ymove -= _srcptr[5]; _srcptr += 6; } else { - // FIXME: those are here just in case... you never now... - assert(_srcptr[1] == 0); - assert(_srcptr[3] == 0); - costumeInfo = (const CostumeInfo *)_srcptr; _width = READ_LE_UINT16(&costumeInfo->width); _height = READ_LE_UINT16(&costumeInfo->height); @@ -596,7 +592,7 @@ byte CostumeRenderer::drawLimb(const CostumeData &cost, int limb) { _ymove -= (int16)READ_LE_UINT16(&costumeInfo->move_y); _srcptr += 12; } -//printf("costume %d, limb %d: _width %d, _height %d, xmoveCur %d, ymoveCur %d, _xmove %d, _ymove, %d\n", _loaded._id, limb, _width, _height, xmoveCur, ymoveCur, _xmove, _ymove); +//printf(" _width %d, _height %d, xmoveCur %d, ymoveCur %d, _xmove %d, _ymove, %d\n", _width, _height, xmoveCur, ymoveCur, _xmove, _ymove); return mainRoutine(xmoveCur, ymoveCur); } } |