aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-07-08 17:08:44 +0000
committerMax Horn2003-07-08 17:08:44 +0000
commitd9a604a925542d34c500dd250f62def96a50c880 (patch)
tree76ec467a49fcb47269a9a0d8467f776f261f6240 /scumm
parentc1635b94bf85fed6a51d1248d7c6dacc4361f55c (diff)
downloadscummvm-rg350-d9a604a925542d34c500dd250f62def96a50c880.tar.gz
scummvm-rg350-d9a604a925542d34c500dd250f62def96a50c880.tar.bz2
scummvm-rg350-d9a604a925542d34c500dd250f62def96a50c880.zip
turns out the +4 on _baseptr is needed everywhere - now _animCmds matches between V1 and V2 MM, too, as well as the frameptr
svn-id: r8861
Diffstat (limited to 'scumm')
-rw-r--r--scumm/costume.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index 07d0cf2e20..445e89a82c 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -539,7 +539,12 @@ void LoadedCostume::loadCostume(int id) {
}
ptr += 8 + _numColors;
_frameOffsets = ptr + 2;
- _dataOffsets = ptr + ((_vm->_version == 1) ? 18 : 34); // FIXME - V1 case might be wrong
+ if (_vm->_version == 1) {
+ _dataOffsets = ptr + 18;
+ _baseptr += 4;
+ } else {
+ _dataOffsets = ptr + 34;
+ }
_animCmds = _baseptr + READ_LE_UINT16(ptr);
}
@@ -555,15 +560,25 @@ byte CostumeRenderer::drawLimb(const CostumeData &cost, int limb) {
// Determine the position the limb is at
i = cost.curpos[limb] & 0x7FFF;
+//printf("costume %d, limb %d:\n", _loaded._id, limb);
+
// Get the frame pointer for that limb
frameptr = _loaded._baseptr + READ_LE_UINT16(_loaded._frameOffsets + limb * 2);
-
+
+//printf("frameptr:\n");
+//hexdump(frameptr-0x10, 0x20);
+
// Determine the offset to the costume data for the limb at position i
code = _loaded._animCmds[i] & 0x7F;
// Code 0x7B indicates a limb for which there is nothing to draw
if (code != 0x7B) {
+//printf("code %d:\n", code);
+//hexdump(frameptr + code * 2 - 0x10, 0x20);
_srcptr = _loaded._baseptr + READ_LE_UINT16(frameptr + code * 2);
+//printf("_srcptr:\n");
+//hexdump(_srcptr, 0x20);
+
if (!(_vm->_features & GF_OLD256) || code < 0x79) {
const CostumeInfo *costumeInfo;
int xmoveCur, ymoveCur;
@@ -619,24 +634,18 @@ void Scumm::cost_decodeData(Actor *a, int frame, uint usemask) {
return;
}
-//printf("Offset table:\n");
-//hexdump(lc._dataOffsets + anim * 2 - 0x10, 0x20);
r = lc._baseptr + READ_LE_UINT16(lc._dataOffsets + anim * 2);
-//printf("actor %d, costum %d, frame %d, anim %d:\n", a->number, lc._id, frame, anim);
-//hexdump(r, 0x20);
if (r == lc._baseptr) {
return;
}
if (_version == 1) {
- r += 4;
mask = *r++ << 8;
} else {
mask = READ_LE_UINT16(r);
r += 2;
}
-//printf("mask = 0x%x, usemask = 0x%x\n", mask, usemask);
i = 0;
do {
if (mask & 0x8000) {