[Scummvm-cvs-logs] SF.net SVN: scummvm: [32655] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Tue Jun 10 23:44:59 CEST 2008


Revision: 32655
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32655&view=rev
Author:   buddha_
Date:     2008-06-10 14:44:59 -0700 (Tue, 10 Jun 2008)

Log Message:
-----------
Changed unpackHelper1(numBits, addCount) to unpackBytes(numBytes).

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 21:40:53 UTC (rev 32654)
+++ scummvm/trunk/engines/cine/unpack.cpp	2008-06-10 21:44:59 UTC (rev 32655)
@@ -64,10 +64,9 @@
 	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 @@
 	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 @@
 		} 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);

Modified: scummvm/trunk/engines/cine/unpack.h
===================================================================
--- scummvm/trunk/engines/cine/unpack.h	2008-06-10 21:40:53 UTC (rev 32654)
+++ scummvm/trunk/engines/cine/unpack.h	2008-06-10 21:44:59 UTC (rev 32655)
@@ -41,7 +41,7 @@
 	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;


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