[Scummvm-cvs-logs] SF.net SVN: scummvm: [32649] scummvm/trunk/engines/cine
buddha_ at users.sourceforge.net
buddha_ at users.sourceforge.net
Tue Jun 10 22:57:22 CEST 2008
Revision: 32649
http://scummvm.svn.sourceforge.net/scummvm/?rev=32649&view=rev
Author: buddha_
Date: 2008-06-10 13:57:22 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
Properly renamed some of the functions in the Delphine unpacker after understanding what they really do.
Modified Paths:
--------------
scummvm/trunk/engines/cine/unpack.cpp
scummvm/trunk/engines/cine/unpack.h
Modified: scummvm/trunk/engines/cine/unpack.cpp
===================================================================
--- scummvm/trunk/engines/cine/unpack.cpp 2008-06-10 20:19:44 UTC (rev 32648)
+++ scummvm/trunk/engines/cine/unpack.cpp 2008-06-10 20:57:22 UTC (rev 32649)
@@ -45,7 +45,7 @@
return rCF;
}
-int CineUnpacker::nextChunk() {
+int CineUnpacker::nextBit() {
int CF = rcr(0);
if (_chk == 0) {
_chk = readSource();
@@ -55,28 +55,26 @@
return CF;
}
-uint16 CineUnpacker::getCode(byte numChunks) {
+uint16 CineUnpacker::getBits(byte numBits) {
uint16 c = 0;
- while (numChunks--) {
+ while (numBits--) {
c <<= 1;
- if (nextChunk()) {
- c |= 1;
- }
+ c |= nextBit();
}
return c;
}
-void CineUnpacker::unpackHelper1(byte numChunks, byte addCount) {
- uint16 count = getCode(numChunks) + addCount + 1;
+void CineUnpacker::unpackHelper1(byte numBits, byte addCount) {
+ uint16 count = getBits(numBits) + addCount + 1;
_datasize -= count;
while (count--) {
- *_dst = (byte)getCode(8);
+ *_dst = (byte)getBits(8);
--_dst;
}
}
-void CineUnpacker::unpackHelper2(byte numChunks) {
- uint16 i = getCode(numChunks);
+void CineUnpacker::unpackHelper2(byte numBits) {
+ uint16 i = getBits(numBits);
uint16 count = _size + 1;
_datasize -= count;
while (count--) {
@@ -94,22 +92,22 @@
_chk = readSource();
_crc ^= _chk;
do {
- if (!nextChunk()) {
+ if (!nextBit()) {
_size = 1;
- if (!nextChunk()) {
+ if (!nextBit()) {
unpackHelper1(3, 0);
} else {
unpackHelper2(8);
}
} else {
- uint16 c = getCode(2);
+ uint16 c = getBits(2);
if (c == 3) {
unpackHelper1(8, 8);
} else if (c < 2) {
_size = c + 2;
unpackHelper2(c + 9);
} else {
- _size = getCode(8);
+ _size = getBits(8);
unpackHelper2(12);
}
}
Modified: scummvm/trunk/engines/cine/unpack.h
===================================================================
--- scummvm/trunk/engines/cine/unpack.h 2008-06-10 20:19:44 UTC (rev 32648)
+++ scummvm/trunk/engines/cine/unpack.h 2008-06-10 20:57:22 UTC (rev 32649)
@@ -39,10 +39,10 @@
/** Reads a single big endian 32-bit integer from the source and goes backwards 4 bytes. */
uint32 readSource();
int rcr(int CF);
- int nextChunk();
- uint16 getCode(byte numChunks);
- void unpackHelper1(byte numChunks, byte addCount);
- void unpackHelper2(byte numChunks);
+ int nextBit();
+ uint16 getBits(byte numBits);
+ void unpackHelper1(byte numBits, byte addCount);
+ void unpackHelper2(byte numBits);
private:
int _size, _datasize;
uint32 _crc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list