From ccc76f2119dcd3b802604294fc1f7bccad645374 Mon Sep 17 00:00:00 2001 From: Borja Lorente Date: Tue, 21 Jun 2016 03:02:14 +0200 Subject: MACVENTURE: Add PPIC0, 1 and 2 decoding --- engines/macventure/container.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'engines/macventure/container.h') 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; } -- cgit v1.2.3