diff options
author | Kari Salminen | 2008-06-10 21:44:59 +0000 |
---|---|---|
committer | Kari Salminen | 2008-06-10 21:44:59 +0000 |
commit | 009e26f813ca1eeb8f8c973b0d3f3e1ce66f26fd (patch) | |
tree | b330604b9d30ff2cb2891668719889b11fbc9191 /engines | |
parent | 8b560107121542fa90e9ce928a9e4a1ca2899c1a (diff) | |
download | scummvm-rg350-009e26f813ca1eeb8f8c973b0d3f3e1ce66f26fd.tar.gz scummvm-rg350-009e26f813ca1eeb8f8c973b0d3f3e1ce66f26fd.tar.bz2 scummvm-rg350-009e26f813ca1eeb8f8c973b0d3f3e1ce66f26fd.zip |
Changed unpackHelper1(numBits, addCount) to unpackBytes(numBytes).
svn-id: r32655
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/unpack.cpp | 13 | ||||
-rw-r--r-- | engines/cine/unpack.h | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/engines/cine/unpack.cpp b/engines/cine/unpack.cpp index 01cbe5476c..7afeeb1509 100644 --- a/engines/cine/unpack.cpp +++ b/engines/cine/unpack.cpp @@ -64,10 +64,9 @@ uint16 CineUnpacker::getBits(byte numBits) { return c; } -void CineUnpacker::unpackHelper1(byte numBits, byte addCount) { - uint16 count = getBits(numBits) + addCount + 1; - _datasize -= count; - while (count--) { +void CineUnpacker::unpackBytes(uint16 numBytes) { + _datasize -= numBytes; + while (numBytes--) { *_dst = (byte)getBits(8); --_dst; } @@ -91,7 +90,8 @@ bool CineUnpacker::unpack(byte *dst, const byte *src, int srcLen) { do { if (!nextBit()) { if (!nextBit()) { - unpackHelper1(3, 0); + uint16 numBytes = getBits(3) + 1; + unpackBytes(numBytes); } else { uint16 numBytes = 2; uint16 offset = getBits(8); @@ -100,7 +100,8 @@ bool CineUnpacker::unpack(byte *dst, const byte *src, int srcLen) { } else { uint16 c = getBits(2); if (c == 3) { - unpackHelper1(8, 8); + uint16 numBytes = getBits(8) + 9; + unpackBytes(numBytes); } else if (c < 2) { // c == 0 || c == 1 uint16 numBytes = c + 3; uint16 offset = getBits(c + 9); diff --git a/engines/cine/unpack.h b/engines/cine/unpack.h index 39a7aca8e5..c401c8679b 100644 --- a/engines/cine/unpack.h +++ b/engines/cine/unpack.h @@ -41,7 +41,7 @@ private: int rcr(int CF); int nextBit(); uint16 getBits(byte numBits); - void unpackHelper1(byte numBits, byte addCount); + void unpackBytes(uint16 numBytes); void copyRelocatedBytes(uint16 offset, uint16 numBytes); private: int _datasize; |