From a2367d26f9d7f8523c313a7b82d0b719de1e6e15 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 20 Nov 2010 03:14:03 +0000 Subject: TINSEL: Preliminary functionality for reading BE data files svn-id: r54392 --- engines/tinsel/scn.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/tinsel/scn.cpp') diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp index 0c89819ca0..326fd9e750 100644 --- a/engines/tinsel/scn.cpp +++ b/engines/tinsel/scn.cpp @@ -46,6 +46,8 @@ byte *FindChunk(SCNHANDLE handle, uint32 chunk) { byte *bptr = LockMem(handle); uint32 *lptr = (uint32 *)bptr; uint32 add; + bool bigEndian = (_vm->getFeatures() & GF_BIG_ENDIAN) != 0; + assert(!bigEndian); // Big endian data not yet supported // Initial adjustmnet for Tinsel 1 chunk types if ((TinselVersion != TINSEL_V2) && (chunk >= CHUNK_SCENE) && @@ -60,14 +62,17 @@ byte *FindChunk(SCNHANDLE handle, uint32 chunk) { chunk -= 0x2L; while (1) { - if (READ_LE_UINT32(lptr) == chunk) + if (READ_32(lptr) == chunk) return (byte *)(lptr + 2); ++lptr; - add = READ_LE_UINT32(lptr); + add = READ_32(lptr); + if (!add) + // End of file reached return NULL; + // Move to next chunk lptr = (uint32 *)(bptr + add); } } -- cgit v1.2.3