diff options
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 4 | ||||
-rw-r--r-- | scumm/wiz_he.cpp | 67 | ||||
-rw-r--r-- | scumm/wiz_he.h | 8 |
5 files changed, 74 insertions, 7 deletions
@@ -262,7 +262,6 @@ SCUMM - Add support for SBNG sound resources for songs (Used in ff2-demo/freddi2/pajama) - Add support for wizImage compression types 2/3 (For freddicove) - Add support for processWizImage mode 6 (For lost/smaller) - - Add support for processWizImage mode 8 (For freddicove/bb2demo/footdemo) - Add support for processWizImage mode 9 (For freddicove/bb2demo/footdemo) - Add support for additional drawWizImage flags (cyx) - Add shadows support for akos codecs in HE90+ games, uses XMAP resources. diff --git a/scumm/intern.h b/scumm/intern.h index 79475ca3ce..12ec701ce2 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -878,6 +878,7 @@ protected: void drawWizComplexPolygon(int resnum, int state, int po_x, int po_y, int arg14, int angle, int zoom, const Common::Rect *r); void displayWizComplexImage(const WizParameters *params); + void createWizEmptyImage(const WizParameters *params); void processWizImage(const WizParameters *params); int getWizImageStates(int resnum); int isWizPixelNonTransparent(int restype, int resnum, int state, int x, int y, int flags); diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 358f772f45..2266aa8432 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -480,11 +480,11 @@ void ScummEngine_v90he::o90_wizImageOps() { switch (subOp) { case -14: // HE99+ - _wizParams.processFlags |= 0x2000; + _wizParams.processFlags |= kWPFUseDefImgWidth; pop(); break; case -13: // HE99+ - _wizParams.processFlags |= 0x4000; + _wizParams.processFlags |= kWPFUseDefImgHeight; pop(); break; case 0: diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 6aa71527eb..b5e722c709 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -1247,6 +1247,69 @@ void ScummEngine_v90he::displayWizComplexImage(const WizParameters *params) { } } +void ScummEngine_v90he::createWizEmptyImage(const WizParameters *params) { + int img_w = 640; + if (params->processFlags & kWPFUseDefImgWidth) { + img_w = params->resDefImgW; + } + int img_h = 480; + if (params->processFlags & kWPFUseDefImgHeight) { + img_h = params->resDefImgH; + } + int img_x = 0; + int img_y = 0; + if (params->processFlags & 1) { + img_x = params->img.x1; + img_y = params->img.y1; + } + const uint16 flags = 0xB; + int res_size = 0x1C; + if (flags & 1) { + res_size += 0x308; + } + if (flags & 2) { + res_size += 0x10; + } + if (flags & 8) { + res_size += 0x10C; + } + res_size += 8 + img_w * img_h; + uint8 *res_data = createResource(rtImage, params->img.resNum, res_size); + if (!res_data) { + VAR(119) = -1; + } else { + VAR(119) = 0; + WRITE_BE_UINT32(res_data, 'AWIZ'); res_data += 4; + WRITE_BE_UINT32(res_data, res_size); res_data += 4; + WRITE_BE_UINT32(res_data, 'WIZH'); res_data += 4; + WRITE_BE_UINT32(res_data, 0x14); res_data += 4; + WRITE_BE_UINT32(res_data, 0); res_data += 4; + WRITE_BE_UINT32(res_data, img_w); res_data += 4; + WRITE_BE_UINT32(res_data, img_h); res_data += 4; + if (flags & 1) { + WRITE_BE_UINT32(res_data, 'RGBS'); res_data += 4; + WRITE_BE_UINT32(res_data, 0x308); res_data += 4; + memcpy(res_data, _currentPalette, 0x300); res_data += 0x300; + } + if (flags & 2) { + WRITE_BE_UINT32(res_data, 'SPOT'); res_data += 4; + WRITE_BE_UINT32(res_data, 0x10); res_data += 4; + WRITE_BE_UINT32(res_data, img_x); res_data += 4; + WRITE_BE_UINT32(res_data, img_y); res_data += 4; + } + if (flags & 8) { + WRITE_BE_UINT32(res_data, 'RMAP'); res_data += 4; + WRITE_BE_UINT32(res_data, 0x10C); res_data += 4; + WRITE_BE_UINT32(res_data, 0); res_data += 4; + for (int i = 0; i < 0x100; ++i) { + *res_data++ = i; + } + } + WRITE_BE_UINT32(res_data, 'WIZD'); res_data += 4; + WRITE_BE_UINT32(res_data, img_w * img_h); res_data += 4; + } +} + void ScummEngine_v90he::processWizImage(const WizParameters *params) { debug(1, "processWizImage: processMode %d", params->processMode); switch (params->processMode) { @@ -1304,10 +1367,12 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) { } } break; + case 8: + createWizEmptyImage(params); + break; case 6: // HE 99+ case 7: - case 8: case 9: case 10: case 11: diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h index 33181200f7..dd18ae903a 100644 --- a/scumm/wiz_he.h +++ b/scumm/wiz_he.h @@ -64,8 +64,8 @@ struct WizParameters { int unk_15C; int unk_160; int unk_164; - int unk_16C; - int unk_170; + int resDefImgW; + int resDefImgH; int unk_174; int unk_178; uint8 remapColor[256]; @@ -91,7 +91,9 @@ enum WizProcessFlags { kWPFNewFlags = 0x20, kWPFClipBox = 0x200, kWPFNewState = 0x400, - kWPFUseFile = 0x800 + kWPFUseFile = 0x800, + kWPFUseDefImgWidth = 0x2000, + kWPFUseDefImgHeight = 0x4000 }; struct Wiz { |