aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--scumm/script_v72he.cpp27
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);
}