aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-04-05 20:11:00 +0000
committerTorbjörn Andersson2006-04-05 20:11:00 +0000
commit738aecd57ee47182dc72519148519efb80e9db2e (patch)
tree2aa265c2464ceba530733bfe8dbb8de130a9c535 /engines/cine
parentc409c600964913cfdfb95128d49cfbecac4cc06b (diff)
downloadscummvm-rg350-738aecd57ee47182dc72519148519efb80e9db2e.tar.gz
scummvm-rg350-738aecd57ee47182dc72519148519efb80e9db2e.tar.bz2
scummvm-rg350-738aecd57ee47182dc72519148519efb80e9db2e.zip
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. svn-id: r21632
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/object.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index 0c42646897..2f960d9736 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -76,18 +76,19 @@ void loadObject(char *pObjectName) {
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")) {