aboutsummaryrefslogtreecommitdiff
path: root/scumm/wiz_he.cpp
diff options
context:
space:
mode:
authorGregory Montoir2005-08-31 20:39:52 +0000
committerGregory Montoir2005-08-31 20:39:52 +0000
commite710a5e6b37b58b81f86ec2500f7d7f873bfc0b4 (patch)
tree19433fb35b6b95d8a7d62a1e7f184822acb458c3 /scumm/wiz_he.cpp
parent149d8c835e7a8178bf08956c72bc0157bfcf94b2 (diff)
downloadscummvm-rg350-e710a5e6b37b58b81f86ec2500f7d7f873bfc0b4.tar.gz
scummvm-rg350-e710a5e6b37b58b81f86ec2500f7d7f873bfc0b4.tar.bz2
scummvm-rg350-e710a5e6b37b58b81f86ec2500f7d7f873bfc0b4.zip
add fillWizPixel()
svn-id: r18726
Diffstat (limited to 'scumm/wiz_he.cpp')
-rw-r--r--scumm/wiz_he.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp
index 7f8a64524f..2ce77d130a 100644
--- a/scumm/wiz_he.cpp
+++ b/scumm/wiz_he.cpp
@@ -1697,6 +1697,42 @@ void Wiz::fillWizLine(const WizParameters *params) {
}
}
+void Wiz::fillWizPixel(const WizParameters *params) {
+ if (params->processFlags & kWPFClipBox2) {
+ int px = params->box2.left;
+ int py = params->box2.top;
+ uint8 *dataPtr = _vm->getResourceAddress(rtImage, params->img.resNum);
+ if (dataPtr) {
+ int state = 0;
+ if (params->processFlags & kWPFNewState) {
+ state = params->img.state;
+ }
+ uint8 *wizh = _vm->findWrappedBlock(MKID('WIZH'), dataPtr, state, 0);
+ assert(wizh);
+ int c = READ_LE_UINT32(wizh + 0x0);
+ int w = READ_LE_UINT32(wizh + 0x4);
+ int h = READ_LE_UINT32(wizh + 0x8);
+ assert(c == 0);
+ Common::Rect imageRect(w, h);
+ if (params->processFlags & kWPFClipBox) {
+ if (!imageRect.intersects(params->box)) {
+ return;
+ }
+ imageRect.clip(params->box);
+ }
+ uint8 color = _vm->VAR(93);
+ if (params->processFlags & kWPFFillColor) {
+ color = params->fillColor;
+ }
+ if (imageRect.contains(px, py)) {
+ uint8 *wizd = _vm->findWrappedBlock(MKID('WIZD'), dataPtr, state, 0);
+ assert(wizd);
+ *(wizd + py * w + px) = color;
+ }
+ }
+ }
+}
+
void Wiz::processWizImage(const WizParameters *params) {
char buf[512];
unsigned int i;
@@ -1821,8 +1857,7 @@ void Wiz::processWizImage(const WizParameters *params) {
fillWizLine(params);
break;
case 11:
- // TODO: Fill Pixel
- error("fillWizPixel");
+ fillWizPixel(params);
break;
case 12:
// Used in PuttsFunShop/SamsFunShop