aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-11-04 04:53:48 +0000
committerTravis Howell2005-11-04 04:53:48 +0000
commit58200eef8ec669800b39b0020fdb67486ec14a76 (patch)
tree6a70e9036d89dfec1f91beba407776aa02d149ab
parent25336c36069ec1da5e00e8c24dd0dcbf52f49548 (diff)
downloadscummvm-rg350-58200eef8ec669800b39b0020fdb67486ec14a76.tar.gz
scummvm-rg350-58200eef8ec669800b39b0020fdb67486ec14a76.tar.bz2
scummvm-rg350-58200eef8ec669800b39b0020fdb67486ec14a76.zip
Corrections to fillWizRect().
Fixes asserts in pearl locations of spyozon. svn-id: r19422
-rw-r--r--scumm/wiz_he.cpp29
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;
+ }
}
}
}