aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorGregory Montoir2004-10-09 16:41:35 +0000
committerGregory Montoir2004-10-09 16:41:35 +0000
commitdd0d454da94d5afb2c2437b44310404fe9581772 (patch)
tree5141905d3578a9d445b1457a8392cc753b276c24 /scumm
parent550b64dab661e234b8689b86170516d0e2ae181d (diff)
downloadscummvm-rg350-dd0d454da94d5afb2c2437b44310404fe9581772.tar.gz
scummvm-rg350-dd0d454da94d5afb2c2437b44310404fe9581772.tar.bz2
scummvm-rg350-dd0d454da94d5afb2c2437b44310404fe9581772.zip
ScummEngine_v90he::processWizImage() cases 3 & 4
svn-id: r15490
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v90he.cpp48
1 files changed, 47 insertions, 1 deletions
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index 3789535117..1abbddeacd 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -563,9 +563,55 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
case 1:
displayWizComplexImage(params);
break;
- case 2:
case 3:
+ if (params->processFlags & 0x800) {
+ File f;
+ if (!f.open((const char *)params->filename, File::kFileReadMode)) {
+ warning("Unable to open for read '%s'", params->filename);
+ } else {
+ uint32 id = f.readUint32BE();
+ if (id != MKID('AWIZ') && id != MKID('MULT')) {
+ VAR(0x20) = -1;
+ } else {
+ uint32 size = f.readUint32BE();
+ f.seek(0, SEEK_SET);
+ byte *p = createResource(rtImage, params->img.resNum, size);
+ if (f.read(p, size) != size) {
+ nukeResource(rtImage, params->img.resNum);
+ warning("i/o error when reading '%s'", params->filename);
+ VAR(0x20) = -2;
+ } else {
+ VAR(0x20) = 0;
+ }
+ }
+ f.close();
+ }
+ }
+ break;
case 4:
+ if (params->processFlags & 0x800) {
+ if (params->unk_14C != 0) {
+ VAR(0x77) = -1;
+ } else {
+ File f;
+ if (!f.open((const char *)params->filename, File::kFileWriteMode)) {
+ warning("Unable to open for write '%s'", params->filename);
+ VAR(0x77) = -3;
+ } else {
+ byte *p = getResourceAddress(rtImage, params->img.resNum);
+ uint32 size = READ_BE_UINT32(p + 4);
+ if (f.write(p, size) != size) {
+ warning("i/o error when writing '%s'", params->filename);
+ VAR(0x77) = -2;
+ } else {
+ VAR(0x77) = 0;
+ }
+ f.close();
+ }
+ }
+ }
+ break;
+ case 2:
case 6:
// HE 99+
case 7: