diff options
-rw-r--r-- | scumm/gfx.cpp | 20 | ||||
-rw-r--r-- | scumm/gfx.h | 2 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 6 | ||||
-rw-r--r-- | scumm/wiz_he.cpp | 20 | ||||
-rw-r--r-- | scumm/wiz_he.h | 2 |
6 files changed, 35 insertions, 21 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 89a93fb93c..064282b38a 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -785,7 +785,7 @@ void ScummEngine_v70he::redrawBGAreas() { if (findResource(MKID('BMAP'), room) != NULL) { if (_fullRedraw) { _bgNeedsRedraw = false; - gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip); + gdi.drawBMAPBg(room, &virtscr[0]); } } else if (findResource(MKID('SMAP'), room) == NULL) { warning("redrawBGAreas(): Both SMAP and BMAP are missing..."); @@ -1538,18 +1538,17 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi * @note This function essentially is a stripped down & special cased version of * the generic Gdi::drawBitmap() method. */ -void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs, int startstrip) { - assert(ptr); - const byte *bmap_ptr; - byte code; +void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) { const byte *z_plane_ptr; byte *mask_ptr; const byte *zplane_list[9]; - bmap_ptr = _vm->findResourceData(MKID('BMAP'), ptr); + const byte *bmap_ptr = _vm->findResourceData(MKID('BMAP'), ptr); assert(bmap_ptr); - code = *bmap_ptr++; + byte code = *bmap_ptr++; + int scrX = _vm->_screenStartStrip * 8; + byte *dst = (byte *)_vm->virtscr[0].backBuf + scrX; // The following few lines more or less duplicate decompressBitmap(), only // for an area spanning multiple strips. In particular, the codecs 13 & 14 @@ -1560,13 +1559,13 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs, int startstrip) { switch (code) { case 13: - drawStripHE((byte *)vs->backBuf, vs->pitch, bmap_ptr, vs->w, vs->h, false); + drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, false); break; case 14: - drawStripHE((byte *)vs->backBuf, vs->pitch, bmap_ptr, vs->w, vs->h, true); + drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, true); break; case 15: - fill((byte *)vs->backBuf, vs->pitch, *bmap_ptr, vs->w, vs->h); + fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h); break; default: // Alternayive russian freddi3 uses badly formatted bitmaps @@ -1612,6 +1611,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, Common::Rect rect2(scrX, 0, vs->w + scrX, vs->h); if (rect1.intersects(rect2)) { + rect1.clip(rect2); rect1.left -= rect2.left; rect1.right -= rect2.left; rect1.top -= rect2.top; diff --git a/scumm/gfx.h b/scumm/gfx.h index feb7bacc52..b6238ce12b 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -292,7 +292,7 @@ public: void decodeNESGfx(const byte *room); void decodeNESObject(const byte *ptr, int xpos, int ypos, int width, int height); - void drawBMAPBg(const byte *ptr, VirtScreen *vs, int startstrip); + void drawBMAPBg(const byte *ptr, VirtScreen *vs); void drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h); void copyVirtScreenBuffers(Common::Rect rect); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index a83e91a8a5..381207cd8a 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -1193,7 +1193,7 @@ void ScummEngine_v100he::o100_wizImageOps() { _wizParams.unk_178 = pop(); break; case 11: - _wizParams.processFlags |= 0x300; + _wizParams.processFlags |= kWPFClipBox | 0x100; _wizParams.processMode = 2; _wizParams.box.bottom = pop(); _wizParams.box.right = pop(); @@ -1267,7 +1267,7 @@ void ScummEngine_v100he::o100_wizImageOps() { _wizParams.unk_174 = pop(); break; case 58: - _wizParams.processFlags |= 0x1102; + _wizParams.processFlags |= 0x1000 | 0x100 | 0x2; _wizParams.processMode = 7; _wizParams.unk_164 = pop(); _wizParams.unk_160 = pop(); @@ -1277,7 +1277,7 @@ void ScummEngine_v100he::o100_wizImageOps() { _wizParams.processFlags |= kWPFUseFile; _wizParams.processMode = 4; copyScriptString(_wizParams.filename); - _wizParams.unk_14C = pop(); + _wizParams.fileWriteMode = pop(); break; case 65: _wizParams.processFlags |= kWPFZoom; diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 7003e8a0af..0720ea8b2c 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -546,10 +546,10 @@ void ScummEngine_v90he::o90_wizImageOps() { _wizParams.processFlags |= kWPFUseFile; _wizParams.processMode = 4; copyScriptString(_wizParams.filename); - _wizParams.unk_14C = pop(); + _wizParams.fileWriteMode = pop(); break; case 5: - _wizParams.processFlags |= 0x300; + _wizParams.processFlags |= kWPFClipBox | 0x100; _wizParams.processMode = 2; _wizParams.box.bottom = pop(); _wizParams.box.right = pop(); @@ -628,7 +628,7 @@ void ScummEngine_v90he::o90_wizImageOps() { _wizParams.unk_15C = pop(); break; case 85: // HE99+ - _wizParams.processFlags |= 0x1102; + _wizParams.processFlags |= 0x1000 | 0x100 | 0x2; _wizParams.processMode = 7; _wizParams.unk_164 = pop(); _wizParams.unk_160 = pop(); diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index caf391c020..0a02724db7 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -1388,11 +1388,14 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) { if (params->processFlags & kWPFUseFile) { File f; if (!f.open((const char *)params->filename, File::kFileReadMode)) { + VAR(VAR_GAME_LOADED) = -3; + VAR(119) = -3; warning("Unable to open for read '%s'", params->filename); } else { uint32 id = f.readUint32BE(); if (id != MKID('AWIZ') && id != MKID('MULT')) { VAR(VAR_GAME_LOADED) = -1; + VAR(119) = -1; } else { uint32 size = f.readUint32BE(); f.seek(0, SEEK_SET); @@ -1401,8 +1404,10 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) { nukeResource(rtImage, params->img.resNum); warning("i/o error when reading '%s'", params->filename); VAR(VAR_GAME_LOADED) = -2; + VAR(119) = -2; } else { VAR(VAR_GAME_LOADED) = 0; + VAR(119) = 0; } } f.close(); @@ -1411,10 +1416,16 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) { break; case 4: if (params->processFlags & kWPFUseFile) { - if (params->unk_14C != 0) { + File f; + + switch(params->fileWriteMode) { + case 2: VAR(119) = -1; - } else { - File f; + break; + case 1: + // TODO Write image to file + break; + case 0: if (!f.open((const char *)params->filename, File::kFileWriteMode)) { warning("Unable to open for write '%s'", params->filename); VAR(119) = -3; @@ -1429,6 +1440,9 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) { } f.close(); } + break; + default: + error("processWizImage: processMode 4 unhandled fileWriteMode %d", params->fileWriteMode); } } break; diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h index e67e85cf31..ec2c99dfaa 100644 --- a/scumm/wiz_he.h +++ b/scumm/wiz_he.h @@ -58,7 +58,7 @@ struct WizParameters { int unk_134; int unk_138; int compType; - int unk_14C; + int fileWriteMode; int angle; int zoom; int unk_15C; |