From b0f0bf8dc2b0c1604b664307b34bf210a31ce4e9 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Tue, 21 Sep 2004 11:22:39 +0000 Subject: Add multi-block support for HE games. svn-id: r15217 --- TODO | 1 - scumm/script_v72he.cpp | 27 ++++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 2d8bdd8a38..630f852d19 100644 --- a/TODO +++ b/TODO @@ -244,7 +244,6 @@ SCUMM - Add support for song sync. in HE80+ games. - Add support for additional sound resources - Add support for sprites (Used by HE90+ games) - - Add support for multi-blocks, often used when loading wizImages - Add support for additional drawWizImage flags - Add support for WizPolygon rendering (cyx) - Add support for aux animation code used by cut scenes (cyx) diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 9875ad717f..6dbc833ff5 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -625,8 +625,33 @@ int ScummEngine_v72he::findObject(int x, int y, int *args) { } const byte *ScummEngine_v72he::findWrappedBlock(uint32 tag, const byte *ptr, int state, bool errorFlag) { + printf("findWrappedBlock: tag %x\n", tag); if (READ_UINT32(ptr) == MKID('MULT')) { - error("findWrappedBlock: multi blocks aren't implemented"); + const byte *offs, *wrap; + uint32 size; + + wrap = findResource(MKID('WRAP'), ptr); + if (wrap == NULL) + return NULL; + + offs = findResourceData(MKID('OFFS'), wrap); + if (offs == NULL) + return NULL; + + size = getResourceDataSize(offs) / 4; + if ((uint32)state >= (uint32)size) + return NULL; + + offs += READ_LE_UINT32(offs + state * sizeof(uint32)); + offs = findResourceData(tag, offs - 8); +; if (offs) + return offs; + + offs = findResourceData(MKID('DEFA'), ptr); + if (offs == NULL) + return NULL; + + return findResourceData(tag, offs - 8); } else { return findResourceData(tag, ptr); } -- cgit v1.2.3