diff options
| author | Gregory Montoir | 2005-08-31 20:39:52 +0000 | 
|---|---|---|
| committer | Gregory Montoir | 2005-08-31 20:39:52 +0000 | 
| commit | e710a5e6b37b58b81f86ec2500f7d7f873bfc0b4 (patch) | |
| tree | 19433fb35b6b95d8a7d62a1e7f184822acb458c3 | |
| parent | 149d8c835e7a8178bf08956c72bc0157bfcf94b2 (diff) | |
| download | scummvm-rg350-e710a5e6b37b58b81f86ec2500f7d7f873bfc0b4.tar.gz scummvm-rg350-e710a5e6b37b58b81f86ec2500f7d7f873bfc0b4.tar.bz2 scummvm-rg350-e710a5e6b37b58b81f86ec2500f7d7f873bfc0b4.zip | |
add fillWizPixel()
svn-id: r18726
| -rw-r--r-- | scumm/wiz_he.cpp | 39 | ||||
| -rw-r--r-- | scumm/wiz_he.h | 1 | 
2 files changed, 38 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 diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h index e388bc0e99..f3b0529674 100644 --- a/scumm/wiz_he.h +++ b/scumm/wiz_he.h @@ -164,6 +164,7 @@ public:  	void createWizEmptyImage(const WizParameters *params);  	void fillWizRect(const WizParameters *params);  	void fillWizLine(const WizParameters *params); +	void fillWizPixel(const WizParameters *params);  	void getWizImageDim(int resNum, int state,  int32 &w, int32 &h);  	int getWizImageStates(int resnum); | 
