aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/container.h
diff options
context:
space:
mode:
authorBorja Lorente2016-06-21 03:02:14 +0200
committerBorja Lorente2016-08-14 18:31:16 +0200
commitccc76f2119dcd3b802604294fc1f7bccad645374 (patch)
treed8c5373dd9a12cf40371a6e34913105ea91e6d1c /engines/macventure/container.h
parentbbf0c62f14326818d135a75bc6f9e58ad59346a1 (diff)
downloadscummvm-rg350-ccc76f2119dcd3b802604294fc1f7bccad645374.tar.gz
scummvm-rg350-ccc76f2119dcd3b802604294fc1f7bccad645374.tar.bz2
scummvm-rg350-ccc76f2119dcd3b802604294fc1f7bccad645374.zip
MACVENTURE: Add PPIC0, 1 and 2 decoding
Diffstat (limited to 'engines/macventure/container.h')
-rw-r--r--engines/macventure/container.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/macventure/container.h b/engines/macventure/container.h
index bd88f663b8..4dc5172fd7 100644
--- a/engines/macventure/container.h
+++ b/engines/macventure/container.h
@@ -117,7 +117,7 @@ public:
uint32 bitSize = _lens[x];
bits += bitSize & 0xF;
if (bits & 0x10) {
- bits &= 0xf;
+ bits &= 0xF;
_res->seek(2, SEEK_CUR);
}
bitSize >>= 4;
@@ -129,7 +129,11 @@ public:
else length >>= (32 - bitSize) - bits;
length &= (1 << bitSize) - 1;
length |= 1 << bitSize;
- bits += bitSize;
+ bits += bitSize;
+ if (bits & 0x10) {
+ bits &= 0xF;
+ _res->seek(2, SEEK_CUR);
+ }
}
group.lengths[j] = length;
@@ -173,16 +177,14 @@ public:
return _res;
} else {
uint32 groupID = (id >> 6);
- uint32 objectIndex = id & 0x3f; // Index within the group
-
- _res->seek(4 + (groupID * 6), SEEK_SET);
+ uint32 objectIndex = id & 0x3f; // Index within the group
uint32 offset = 0;
for (uint i = 0; i < objectIndex; i++) {
offset += _groups[groupID].lengths[i];
}
- _res->seek(offset, SEEK_CUR);
+ _res->seek(_groups[groupID].offset + offset + sizeof(_header), SEEK_SET);
return _res;
}