[Scummvm-cvs-logs] SF.net SVN: scummvm: [32660] scummvm/trunk/engines/cine
buddha_ at users.sourceforge.net
buddha_ at users.sourceforge.net
Wed Jun 11 00:37:56 CEST 2008
Revision: 32660
http://scummvm.svn.sourceforge.net/scummvm/?rev=32660&view=rev
Author: buddha_
Date: 2008-06-10 15:37:55 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
A little Delphine unpacker documentation addition and variable renaming.
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 22:16:10 UTC (rev 32659)
+++ scummvm/trunk/engines/cine/unpack.cpp 2008-06-10 22:37:55 UTC (rev 32660)
@@ -36,23 +36,23 @@
return value;
}
-int CineUnpacker::rcr(int CF) {
- int rCF = (_chk & 1);
- _chk >>= 1;
- if (CF) {
- _chk |= 0x80000000;
+int CineUnpacker::rcr(int inputCarry) {
+ int outputCarry = (_chunk32b & 1);
+ _chunk32b >>= 1;
+ if (inputCarry) {
+ _chunk32b |= 0x80000000;
}
- return rCF;
+ return outputCarry;
}
int CineUnpacker::nextBit() {
- int CF = rcr(0);
- if (_chk == 0) {
- _chk = readSource();
- _crc ^= _chk;
- CF = rcr(1);
+ int carry = rcr(0);
+ if (_chunk32b == 0) {
+ _chunk32b = readSource();
+ _crc ^= _chunk32b;
+ carry = rcr(1);
}
- return CF;
+ return carry;
}
uint16 CineUnpacker::getBits(byte numBits) {
@@ -85,8 +85,8 @@
_datasize = readSource();
_dst = dst + _datasize - 1;
_crc = readSource();
- _chk = readSource();
- _crc ^= _chk;
+ _chunk32b = readSource();
+ _crc ^= _chunk32b;
do {
if (!nextBit()) {
if (!nextBit()) {
Modified: scummvm/trunk/engines/cine/unpack.h
===================================================================
--- scummvm/trunk/engines/cine/unpack.h 2008-06-10 22:16:10 UTC (rev 32659)
+++ scummvm/trunk/engines/cine/unpack.h 2008-06-10 22:37:55 UTC (rev 32660)
@@ -38,7 +38,13 @@
private:
/** Reads a single big endian 32-bit integer from the source and goes backwards 4 bytes. */
uint32 readSource();
- int rcr(int CF);
+
+ /**
+ * Shifts the current internal 32-bit chunk to the right by one.
+ * Puts input carry into internal chunk's topmost (i.e. leftmost) bit.
+ * Returns the least significant bit that was shifted out.
+ */
+ int rcr(int inputCarry);
int nextBit();
uint16 getBits(byte numBits);
void unpackBytes(uint16 numBytes);
@@ -46,7 +52,7 @@
private:
int _datasize;
uint32 _crc;
- uint32 _chk;
+ uint32 _chunk32b; //!< The current internal 32-bit chunk
byte *_dst;
const byte *_src;
};
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