[Scummvm-cvs-logs] SF.net SVN: scummvm: [26727] scummvm/trunk/graphics

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Tue May 1 19:29:00 CEST 2007


Revision: 26727
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26727&view=rev
Author:   peres001
Date:     2007-05-01 10:28:59 -0700 (Tue, 01 May 2007)

Log Message:
-----------
- Fixed 32/64 bits pointer mismatch.
- Changed Surface's forward from class to struct.

Modified Paths:
--------------
    scummvm/trunk/graphics/iff.cpp
    scummvm/trunk/graphics/iff.h

Modified: scummvm/trunk/graphics/iff.cpp
===================================================================
--- scummvm/trunk/graphics/iff.cpp	2007-05-01 17:17:00 UTC (rev 26726)
+++ scummvm/trunk/graphics/iff.cpp	2007-05-01 17:28:59 UTC (rev 26727)
@@ -245,8 +245,8 @@
 }
 
 uint32 PackBitsReadStream::read(void *dataPtr, uint32 dataSize) {
-	_outSize = (int32)dataSize;
 	_out = (byte*)dataPtr;
+	_outEnd = _out + dataSize;
 
 	feed();
 	unpack();
@@ -254,7 +254,7 @@
 }
 
 void PackBitsReadStream::store(byte b) {
-	if (_outSize > 0) {
+	if (_out < _outEnd) {
 		*_out++ = b;
 		_unpacked++;
 		_wStoragePos = _storage;
@@ -264,20 +264,18 @@
 	}
 
 	_rStoragePos = _storage;
-	_outSize--;
 }
 
 void PackBitsReadStream::feed() {
 	_fed = 0;
 
-	int len = MIN(_wStoragePos - _rStoragePos, _outSize);
+	int len = MIN(_wStoragePos - _rStoragePos, _outEnd - _out);
 	if (len == 0) return;
 
 	for (int i = 0; i < len; i++)
 		*_out++ = *_rStoragePos++;
 
 	_fed = len;
-	_outSize -= len;
 }
 
 void PackBitsReadStream::unpack() {
@@ -287,7 +285,7 @@
 	uint32 i, j;
 	_unpacked = 0;
 
-	while (_outSize > 0 && !_input->eos()) {
+	while (_out < _outEnd && !_input->eos()) {
 		byteRun = _input->readByte();
 		if (byteRun <= 127) {
 			i = byteRun + 1;

Modified: scummvm/trunk/graphics/iff.h
===================================================================
--- scummvm/trunk/graphics/iff.h	2007-05-01 17:17:00 UTC (rev 26726)
+++ scummvm/trunk/graphics/iff.h	2007-05-01 17:28:59 UTC (rev 26727)
@@ -27,7 +27,7 @@
 
 namespace Graphics {
 
-class Surface;
+struct Surface;
 
 
 struct BMHD {
@@ -117,8 +117,8 @@
 	byte	*_wStoragePos;
 	byte	*_rStoragePos;
 
-	int32	_outSize;
 	byte*	_out;
+	byte*	_outEnd;
 	int32	_fed;
 	int32	_unpacked;
 


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