diff options
author | Borja Lorente | 2016-06-21 03:02:14 +0200 |
---|---|---|
committer | Borja Lorente | 2016-08-14 18:31:16 +0200 |
commit | ccc76f2119dcd3b802604294fc1f7bccad645374 (patch) | |
tree | d8c5373dd9a12cf40371a6e34913105ea91e6d1c /engines/macventure/container.h | |
parent | bbf0c62f14326818d135a75bc6f9e58ad59346a1 (diff) | |
download | scummvm-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.h | 14 |
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; } |