[Scummvm-cvs-logs] CVS: scummvm/scumm wiz_he.cpp,2.103,2.104
kirben
kirben at users.sourceforge.net
Thu Nov 3 20:54:29 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19032/scumm
Modified Files:
wiz_he.cpp
Log Message:
Corrections to fillWizRect().
Fixes asserts in pearl locations of spyozon.
Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.103
retrieving revision 2.104
diff -u -d -r2.103 -r2.104
--- wiz_he.cpp 4 Nov 2005 01:12:20 -0000 2.103
+++ wiz_he.cpp 4 Nov 2005 04:53:48 -0000 2.104
@@ -1557,28 +1557,33 @@
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;
+ }
}
}
}
More information about the Scummvm-git-logs
mailing list