diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/wiz_he.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index b6cd1892cc..26e147ff3c 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -1557,28 +1557,33 @@ void Wiz::fillWizRect(const WizParameters *params) { int w = READ_LE_UINT32(wizh + 0x4); int h = READ_LE_UINT32(wizh + 0x8); assert(c == 0); - Common::Rect r1(w, h); + Common::Rect areaRect, imageRect(w, h); if (params->processFlags & kWPFClipBox) { - if (!r1.intersects(params->box)) { + if (!imageRect.intersects(params->box)) { return; } - r1.clip(params->box); + imageRect.clip(params->box); } if (params->processFlags & kWPFClipBox2) { - r1.clip(params->box2); + areaRect = params->box2; + } else { + areaRect = imageRect; } uint8 color = _vm->VAR(93); if (params->processFlags & kWPFFillColor) { color = params->fillColor; } - uint8 *wizd = _vm->findWrappedBlock(MKID('WIZD'), dataPtr, state, 0); - assert(wizd); - int dx = r1.width(); - int dy = r1.height(); - wizd += r1.top * w + r1.left; - while (dy--) { - memset(wizd, color, dx); - wizd += w; + if (areaRect.intersects(imageRect)) { + areaRect.clip(imageRect); + uint8 *wizd = _vm->findWrappedBlock(MKID('WIZD'), dataPtr, state, 0); + assert(wizd); + int dx = areaRect.width(); + int dy = areaRect.height(); + wizd += areaRect.top * w + areaRect.left; + while (dy--) { + memset(wizd, color, dx); + wizd += w; + } } } } |