From b05fa7f20414d6a7571a9ba52f542e527f598c62 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 11 Dec 2012 02:56:48 +0200 Subject: TINSEL: Add resource handling of the BE resources in DW1 Mac This is the second attempt. All the BE resources of DW1 Mac are handled correctly now. Added READ_16, READ_32, FROM_16, FROM_32 and TO_32 to handle all of the different cases where endianess is already handled. Note that the game scripts are LE, so these haven't been changed --- engines/tinsel/tinsel.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/tinsel/tinsel.cpp') diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 83812caf96..721e76dbac 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -718,15 +718,15 @@ void LoadBasicChunks() { // CHUNK_TOTAL_ACTORS seems to be missing in the released version, hard coding a value // TODO: Would be nice to just change 511 to MAX_SAVED_ALIVES cptr = FindChunk(MASTER_SCNHANDLE, CHUNK_TOTAL_ACTORS); - RegisterActors((cptr != NULL) ? READ_LE_UINT32(cptr) : 511); + RegisterActors((cptr != NULL) ? READ_32(cptr) : 511); // CHUNK_TOTAL_GLOBALS seems to be missing in some versions. // So if it is missing, set a reasonably high value for the number of globals. cptr = FindChunk(MASTER_SCNHANDLE, CHUNK_TOTAL_GLOBALS); - RegisterGlobals((cptr != NULL) ? READ_LE_UINT32(cptr) : 512); + RegisterGlobals((cptr != NULL) ? READ_32(cptr) : 512); cptr = FindChunk(INV_OBJ_SCNHANDLE, CHUNK_TOTAL_OBJECTS); - numObjects = (cptr != NULL) ? READ_LE_UINT32(cptr) : 0; + numObjects = (cptr != NULL) ? READ_32(cptr) : 0; cptr = FindChunk(INV_OBJ_SCNHANDLE, CHUNK_OBJECTS); @@ -734,10 +734,10 @@ void LoadBasicChunks() { //convert to native endianness INV_OBJECT *io = (INV_OBJECT *)cptr; for (int i = 0; i < numObjects; i++, io++) { - io->id = FROM_LE_32(io->id); - io->hIconFilm = FROM_LE_32(io->hIconFilm); - io->hScript = FROM_LE_32(io->hScript); - io->attribute = FROM_LE_32(io->attribute); + io->id = FROM_32(io->id); + io->hIconFilm = FROM_32(io->hIconFilm); + io->hScript = FROM_32(io->hScript); + io->attribute = FROM_32(io->attribute); } #endif @@ -759,7 +759,7 @@ void LoadBasicChunks() { // CdPlay() stuff cptr = FindChunk(MASTER_SCNHANDLE, CHUNK_CDPLAY_HANDLE); assert(cptr); - uint32 playHandle = READ_LE_UINT32(cptr); + uint32 playHandle = READ_32(cptr); assert(playHandle < 512); SetCdPlayHandle(playHandle); } -- cgit v1.2.3