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

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed Apr 5 13:12:06 CEST 2006


Revision: 21632
Author:   eriktorbjorn
Date:     2006-04-05 13:11:00 -0700 (Wed, 05 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21632&view=rev

Log Message:
-----------
Fixed bug in loadObject() where the data pointer was only advanced for the
objects that were actually loaded from the file, not the ones that were
skipped. This bug was introduced when porting cinE to the ScummVM framework,
and would cause Future Wars to crash after the copy protection screen. Quite
possibly other bugs, as well.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/object.cpp
Modified: scummvm/trunk/engines/cine/object.cpp
===================================================================
--- scummvm/trunk/engines/cine/object.cpp	2006-04-05 14:10:13 UTC (rev 21631)
+++ scummvm/trunk/engines/cine/object.cpp	2006-04-05 20:11:00 UTC (rev 21632)
@@ -76,18 +76,19 @@
 
 	assert(numEntry <= NUM_MAX_OBJECT);
 
-	
 	for (i = 0; i < numEntry; i++) {
-		if (objectTable[i].costume != -2)	// flag is keep ?
-		{
-			objectTable[i].x = READ_BE_UINT16(ptr); ptr += 2;
-			objectTable[i].y = READ_BE_UINT16(ptr); ptr += 2;
-			objectTable[i].mask = READ_BE_UINT16(ptr); ptr += 2;
-			objectTable[i].frame = READ_BE_UINT16(ptr); ptr += 2;
-			objectTable[i].costume = READ_BE_UINT16(ptr); ptr += 2;
-			memcpy(objectTable[i].name, ptr, 20); ptr += 20;
-			objectTable[i].part = READ_BE_UINT16(ptr); ptr += 2;
+		if (objectTable[i].costume != -2) {	// flag is keep ?
+			Common::MemoryReadStream readS(ptr, entrySize);
+
+			objectTable[i].x = readS.readSint16BE();
+			objectTable[i].y = readS.readSint16BE();
+			objectTable[i].mask = readS.readUint16BE();
+			objectTable[i].frame = readS.readSint16BE();
+			objectTable[i].costume = readS.readSint16BE();
+			readS.read(objectTable[i].name, 20);
+			objectTable[i].part = readS.readUint16BE();
 		}
+		ptr += entrySize;
 	}
 
 	if (!strcmp(pObjectName, "INTRO.OBJ")) {


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