[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.271,2.272 script_v72he.cpp,2.130,2.131 script_v80he.cpp,2.40,2.41 script_v90he.cpp,2.56,2.57 scumm.cpp,1.231,1.232 scumm.h,1.500,1.501

Gregory Montoir cyx at users.sourceforge.net
Sun Sep 26 08:34:09 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10641/scumm

Modified Files:
	intern.h script_v72he.cpp script_v80he.cpp script_v90he.cpp 
	scumm.cpp scumm.h 
Log Message:
wiz stuff cleanup and o90_unknown1C opcode update

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.271
retrieving revision 2.272
diff -u -d -r2.271 -r2.272
--- intern.h	26 Sep 2004 07:30:24 -0000	2.271
+++ intern.h	26 Sep 2004 15:29:57 -0000	2.272
@@ -685,10 +685,11 @@
 	} GCC_PACK;
 
 	struct WizImage {
-		int resnum;
+		int resNum;
 		int x1;
 		int y1;
 		int flags;
+		int state;
 	};
 
 #if !defined(__GNUC__)
@@ -721,8 +722,9 @@
 	void writeFileFromArray(int slot, int resID);
 	void arrrays_unk2(int dst, int src, int len2, int len);
 
+	void displayWizImage(const WizImage *pwi);
 	void getWizImageDim(int resnum, int state,  uint32 &w, uint32 &h);
-	uint8 *drawWizImage(int restype, int resnum, int state, int x1, int y1, int flags);
+	uint8 *drawWizImage(int restype, const WizImage *pwi);
 	void drawWizPolygon(int resnum, int state, int id, int flags);
 	void flushWizBuffer();
 
@@ -805,7 +807,7 @@
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 
-	void loadImgSpot(int resId, int state, uint32 &w, uint32 &h);
+	void loadImgSpot(int resId, int state, int16 &x, int16 &y);
 	void loadWizCursor(int resId, int resType, bool state);
 	
 	/* HE version 80 script opcodes */
@@ -828,17 +830,47 @@
 		OpcodeProcV90he proc;
 		const char *desc;
 	};
+
+	struct WizParameters {
+		byte filename[260];
+		Common::Rect box;
+		int drawFlags;
+		int drawMode;
+		int unk_11C;
+		int unk_120;
+		int unk_124;
+		int unk_128;
+		int unk_12C;
+		int unk_130;
+		int unk_134;
+		int unk_138;
+		int unk_148;
+		int unk_14C;
+		int unk_150;
+		int unk_158;
+		int unk_15C;
+		int unk_160;
+		uint8 remapBuf1[256];
+		uint8 remapBuf2[256];
+		int remapPos;
+		WizImage img;
+	};
 	
 	const OpcodeEntryV90he *_opcodesV90he;
+	WizParameters _wizParams;
 
 public:
 	ScummEngine_v90he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v80he(detector, syst, gs, md5sum) {}
 
+	virtual void scummInit();
+
 protected:
 	virtual void setupOpcodes();
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 	
+	void wizDraw(const WizParameters *params);
+	
 	/* HE version 90 script opcodes */
 	void o90_dup();
 	void o90_getLT();

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.130
retrieving revision 2.131
diff -u -d -r2.130 -r2.131
--- script_v72he.cpp	25 Sep 2004 23:59:43 -0000	2.130
+++ script_v72he.cpp	26 Sep 2004 15:29:57 -0000	2.131
@@ -861,8 +861,12 @@
 }
 
 void ScummEngine_v72he::o72_printWizImage() {
-	int resnum = pop();
-	drawWizImage(rtImage, resnum, 0, 0, 0, 4);
+	WizImage wi;
+	wi.resNum = pop();
+	wi.x1 = wi.y1 = 0;
+	wi.state = 0;
+	wi.flags = 4;
+	drawWizImage(rtImage, &wi);
 }
 
 void ScummEngine_v72he::o72_getArrayDimSize() {
@@ -1400,6 +1404,18 @@
 	pop();
 }
 
+void ScummEngine_v72he::displayWizImage(const WizImage *pwi) {
+	if (_fullRedraw) {
+		assert(_wizImagesNum < ARRAYSIZE(_wizImages));
+		memcpy(&_wizImages[_wizImagesNum], pwi, sizeof(WizImage));
+		++_wizImagesNum;
+	} else if (pwi->flags & 0x40) {
+		drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags);
+	} else {
+		drawWizImage(rtImage, pwi);
+	}
+}
+
 void ScummEngine_v72he::getWizImageDim(int resnum, int state, uint32 &w, uint32 &h) {
 	const uint8 *dataPtr = getResourceAddress(rtImage, resnum);
 	if (dataPtr) {
@@ -1412,42 +1428,38 @@
 	}
 }
 
-uint8 *ScummEngine_v72he::drawWizImage(int restype, int resnum, int state, int x1, int y1, int flags) {
-	debug(1, "drawWizImage(%d, %d, %d, %d, 0x%X)", restype, resnum, x1, y1, flags);
-	if (flags & 64) {
-		drawWizPolygon(resnum, state, x1, flags);
-		return NULL;
-	}
+uint8 *ScummEngine_v72he::drawWizImage(int restype, const WizImage *pwi) {
+	debug(1, "drawWizImage(%d, %d, %d, %d, 0x%X)", restype, pwi->resNum, pwi->x1, pwi->y1, pwi->flags);
 	uint8 *dst = NULL;
-	const uint8 *dataPtr = getResourceAddress(restype, resnum);
+	const uint8 *dataPtr = getResourceAddress(restype, pwi->resNum);
 	if (dataPtr) {
-		const uint8 *wizh = findWrappedBlock(MKID('WIZH'), dataPtr, state, 0);
+		const uint8 *wizh = findWrappedBlock(MKID('WIZH'), dataPtr, pwi->state, 0);
 		assert(wizh);
 		uint32 comp   = READ_LE_UINT32(wizh + 0x0);
 		uint32 width  = READ_LE_UINT32(wizh + 0x4);
 		uint32 height = READ_LE_UINT32(wizh + 0x8);
 		if (comp != 1) {
-			warning("%d has invalid compression type %d", resnum, comp);
+			warning("%d has invalid compression type %d", pwi->resNum, comp);
 		}
-		const uint8 *wizd = findWrappedBlock(MKID('WIZD'), dataPtr, state, 0);
+		const uint8 *wizd = findWrappedBlock(MKID('WIZD'), dataPtr, pwi->state, 0);
 		assert(wizd);
-		if (flags & 1) {
-			const uint8 *pal = findWrappedBlock(MKID('RGBS'), dataPtr, state, 0);
+		if (pwi->flags & 1) {
+			const uint8 *pal = findWrappedBlock(MKID('RGBS'), dataPtr, pwi->state, 0);
 			assert(pal);
 			setPaletteFromPtr(pal, 256);
 		}
-		if (flags & 2) {
-			const uint8 *rmap = findWrappedBlock(MKID('RMAP'), dataPtr, state, 0);
+		if (pwi->flags & 2) {
+			const uint8 *rmap = findWrappedBlock(MKID('RMAP'), dataPtr, pwi->state, 0);
 			assert(rmap);
-			const uint8 *rgbs = findWrappedBlock(MKID('RGBS'), dataPtr, state, 0);
+			const uint8 *rgbs = findWrappedBlock(MKID('RGBS'), dataPtr, pwi->state, 0);
 			assert(rgbs);
 //			drawWizImageHelper1(rmap + 4, _currentPalette, rgbs);
 			warning("drawWizImage() unhandled flag 0x2");
 		}
 		uint32 cw, ch;
-		if (flags & 0x24) { // printing (0x4) or rendering to memory (0x20)
+		if (pwi->flags & 0x24) { // printing (0x4) or rendering to memory (0x20)
 			dst = (uint8 *)malloc(width * height);
-			if (flags & 0x20) {
+			if (pwi->flags & 0x20) {
 				int color = 255; // FIXME: should be (VAR_WIZ_TCOLOR != 0xFF) ? VAR(VAR_WIZ_TCOLOR) : 5;
 				memset(dst, color, width * height);
 			}
@@ -1455,7 +1467,7 @@
 			ch = height;
 		} else {
 			VirtScreen *pvs = &virtscr[kMainVirtScreen];
-			if (flags & 0x10) {
+			if (pwi->flags & 0x10) {
 				dst = pvs->getPixels(0, pvs->topline);
 			} else {
 				dst = pvs->getBackPixels(0, pvs->topline);
@@ -1464,23 +1476,23 @@
 			ch = pvs->h;
 		}
 		Common::Rect rScreen(0, 0, cw - 1, ch - 1);
-		if (flags & 0x80) {    
+		if (pwi->flags & 0x80) {    
 //  		drawWizImageHelper2(p, wizd, cw, ch, x1, y1, width, height, &rScreen, 0, 2);
 			warning("drawWizImage() unhandled flag 0x80");
-		} else if (flags & 0x100) {
+		} else if (pwi->flags & 0x100) {
 //  		drawWizImageHelper2(p, wizd, cw, ch, x1, y1, width, height, &rScreen, 0, 1);  			
 			warning("drawWizImage() unhandled flag 0x100");
 		} else {
-			gdi.copyWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen);
+			gdi.copyWizImage(dst, wizd, cw, ch, pwi->x1, pwi->y1, width, height, &rScreen);
 		}
-		if (flags & 4) {
+		if (pwi->flags & 4) {
 			warning("printing Wiz image is unimplemented");
 			dst = NULL;
-		} else if (!(flags & 0x20)) {
-			Common::Rect rImage(x1, y1, x1 + width - 1, y1 + height - 1);
+		} else if (!(pwi->flags & 0x20)) {
+			Common::Rect rImage(pwi->x1, pwi->y1, pwi->x1 + width - 1, pwi->y1 + height - 1);
 			if (rImage.intersects(rScreen)) {
 				rImage.clip(rScreen);
-				if (flags & 0x18) {
+				if (pwi->flags & 0x18) {
 					++rImage.bottom;
 					markRectAsDirty(kMainVirtScreen, rImage);
 				} else {
@@ -1574,7 +1586,12 @@
 	if (wp->numVerts != 5) {
 		error("Invalid point count %d for Polygon %d", wp->numVerts, id);
 	}
-	uint8 *srcWizBuf = drawWizImage(rtImage, resnum, state, 0, 0, 0x20);
+	WizImage wi;
+	wi.resNum = resnum;
+	wi.state = state;
+	wi.x1 = wi.y1 = 0;
+	wi.flags = 0x20;
+	uint8 *srcWizBuf = drawWizImage(rtImage, &wi);
 	if (srcWizBuf) {
 		uint8 *dst;
 		VirtScreen *pvs = &virtscr[kMainVirtScreen];
@@ -1615,24 +1632,24 @@
   		ymin_b = 0;
   		ymax_b = wizH - 1;
 
-		PolygonDrawData *pdd = new PolygonDrawData(ymax_p - ymin_p + 1);
-		pdd->pts[0].x = xmin_p;
-		pdd->pts[0].y = ymin_p;
-		pdd->pts[1].x = xmax_p;
-		pdd->pts[1].y = ymax_p;
-		pdd->pts[2].x = xmin_b;
-		pdd->pts[2].y = ymin_b;
-		pdd->pts[3].x = xmax_b;
-		pdd->pts[3].y = ymax_b;
+		PolygonDrawData pdd(ymax_p - ymin_p + 1);
+		pdd.pts[0].x = xmin_p;
+		pdd.pts[0].y = ymin_p;
+		pdd.pts[1].x = xmax_p;
+		pdd.pts[1].y = ymax_p;
+		pdd.pts[2].x = xmin_b;
+		pdd.pts[2].y = ymin_b;
+		pdd.pts[3].x = xmax_b;
+		pdd.pts[3].y = ymax_b;
 		
 		for (i = 0; i < 3; ++i) {
-			pdd->calcIntersection(&wp->vert[i], &wp->vert[i + 1], &bbox[i], &bbox[i + 1]);
+			pdd.calcIntersection(&wp->vert[i], &wp->vert[i + 1], &bbox[i], &bbox[i + 1]);
 		}
-		pdd->calcIntersection(&wp->vert[3], &wp->vert[0], &bbox[3], &bbox[0]);
+		pdd.calcIntersection(&wp->vert[3], &wp->vert[0], &bbox[3], &bbox[0]);
 		
-		uint yoff = pdd->pts[0].y * pvs->w;
-		for (i = 0; i < pdd->areasNum; ++i) {
-			PolygonDrawData::InterArea *pia = &pdd->ia[i];
+		uint yoff = pdd.pts[0].y * pvs->w;
+		for (i = 0; i < pdd.areasNum; ++i) {
+			PolygonDrawData::InterArea *pia = &pdd.ia[i];
 			uint16 dx = pia->xmax - pia->xmin + 1;
 			uint8 *dstPtr = dst + pia->xmin + yoff;
 			int32 x_acc = pia->x1 << 0x10;
@@ -1649,8 +1666,6 @@
 			yoff += pvs->w;
 		}
 
-		delete pdd;
-
 		if (flags & 0x10) {
 			markRectAsDirty(kMainVirtScreen, wp->bound);
 		} else {
@@ -1669,28 +1684,23 @@
 void ScummEngine_v72he::flushWizBuffer() {
 	for (int i = 0; i < _wizImagesNum; ++i) {
 		WizImage *pwi = &_wizImages[i];
-		drawWizImage(rtImage, pwi->resnum, 0, pwi->x1, pwi->y1, pwi->flags);
+		if (pwi->flags & 0x40) {
+			drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags);
+		} else {
+			drawWizImage(rtImage, pwi);
+		}
 	}
 	_wizImagesNum = 0;
 }
 
 void ScummEngine_v72he::o72_drawWizImage() {
-	int flags = pop();
-	int y1 = pop();
-	int x1 = pop();
-	int resnum = pop();
-
-	if (_fullRedraw) {
-		assert(_wizImagesNum < ARRAYSIZE(_wizImages));
-		WizImage *pwi = &_wizImages[_wizImagesNum];
-		pwi->resnum = resnum;
-		pwi->x1 = x1;
-		pwi->y1 = y1;
-		pwi->flags = flags;
-		++_wizImagesNum;
-	} else {
-		drawWizImage(rtImage, resnum, 0, x1, y1, flags);
-	}
+	WizImage wi;
+	wi.flags = pop();
+	wi.y1 = pop();
+	wi.x1 = pop();
+	wi.resNum = pop();
+	wi.state = 0;
+	displayWizImage(&wi);
 }
 
 void ScummEngine_v72he::o72_unknownCF() {

Index: script_v80he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v80he.cpp,v
retrieving revision 2.40
retrieving revision 2.41
diff -u -d -r2.40 -r2.41
--- script_v80he.cpp	25 Sep 2004 14:17:49 -0000	2.40
+++ script_v80he.cpp	26 Sep 2004 15:29:57 -0000	2.41
@@ -559,44 +559,49 @@
 	VAR(VAR_USERPUT) = _userPut;
 }
 
-void ScummEngine_v80he::loadImgSpot(int resId, int state, uint32 &w, uint32 &h) {
+void ScummEngine_v80he::loadImgSpot(int resId, int state, int16 &x, int16 &y) {
 	const uint8 *dataPtr = getResourceAddress(rtImage, resId);
 	if (!dataPtr) {
 		warning("loadImgSpot: unknown Image %d", resId);
-		w = h = 0;
+		x = y = 0;
 		return;
 	}
 
 	const uint8 *spotPtr = findWrappedBlock(MKID('SPOT'), dataPtr, state, 0);
 
 	if (spotPtr) {
-		w = (int16)READ_LE_UINT32(spotPtr + 0);
-		h = (int16)READ_LE_UINT32(spotPtr + 4);
+		x = (int16)READ_LE_UINT32(spotPtr + 0);
+		y = (int16)READ_LE_UINT32(spotPtr + 4);
 	} else {
-		w = 0;
-		h = 0;
+		x = 0;
+		y = 0;
 	}
 }
 
 void ScummEngine_v80he::loadWizCursor(int resId, int resType, bool state) {
-	Common::Rect rc;
-	uint32 w, h;
-
-	loadImgSpot(resId, 0, w, h);
-
-	rc.top = w;
-	rc.right = h;
-
-	rc.top = MAX((int)rc.top, 0);
-	rc.right = MAX((int)rc.right, 0);
-	rc.top = MIN((int)rc.top, 32);
-	rc.right = MIN((int)rc.right, 32);
+	int16 x, y;
+	loadImgSpot(resId, 0, x, y);
+	if (x < 0) {
+		x = 0;
+	} else if (x > 32) {
+		x = 32;
+	}
+	if (y < 0) {
+		y = 0;
+	} else if (y > 32) {
+		y = 32;
+	}
 
-	uint8 *cursor = drawWizImage(rtImage, resId, 0, 0, 0, 0x20);
-	uint32 cw, ch;
+	WizImage wi;
+	wi.resNum = resId;
+	wi.x1 = wi.y1 = 0;
+	wi.state = 0;
+	wi.flags = 0x20;	
+	uint8 *cursor = drawWizImage(rtImage, &wi);
+	uint32 cw, ch;	
 	getWizImageDim(resId, 0, cw, ch);
 	setCursorFromBuffer(cursor, cw, ch, cw);
-	setCursorHotspot(rc.top, rc.right);
+	setCursorHotspot(x, y);
 	free(cursor);
 }
 
@@ -612,24 +617,14 @@
 void ScummEngine_v80he::o80_drawWizPolygon() {
 	error("o80_drawWizPolygon");
 
-	int xy1 = pop();
-	int resnum = pop();
-
-	if (_fullRedraw) {
-		assert(_wizImagesNum < ARRAYSIZE(_wizImages));
-		WizImage *pwi = &_wizImages[_wizImagesNum];
-		pwi->resnum = resnum;
-		pwi->x1 = xy1;
-		pwi->y1 = xy1;
-		pwi->flags = 64;
-		++_wizImagesNum;
-	} else {
-		drawWizImage(rtImage, resnum, 0, xy1, xy1, 64);
-	}
+	WizImage wi;
+	wi.x1 = wi.y1 = pop();
+	wi.resNum = pop();
+	wi.state = 0;
+	wi.flags = 0x40;
+	displayWizImage(&wi);	
 }
 
-
-
 void ScummEngine_v80he::o80_pickVarRandom() {
 	int num;
 	int args[100];

Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.56
retrieving revision 2.57
diff -u -d -r2.56 -r2.57
--- script_v90he.cpp	23 Sep 2004 09:11:52 -0000	2.56
+++ script_v90he.cpp	26 Sep 2004 15:29:57 -0000	2.57
@@ -422,9 +422,26 @@
 	runScript(script, (flags == 199 || flags == 200), (flags == 195 || flags == 200), args);
 }
 
+void ScummEngine_v90he::wizDraw(const WizParameters *params) {
+	debug(1, "ScummEngine_v90he::wizDraw()");
+	switch (params->drawMode) {
+	case 1:
+		// XXX incomplete
+		displayWizImage(&params->img);
+		break;
+	case 2:
+	case 6:
+	case 3:
+	case 4:
+		warning("unhandled wizDraw mode %d", params->drawMode);
+		break;
+	default:
+		error("invalid wizDraw mode %d", params->drawMode);
+	}
+}
+
 void ScummEngine_v90he::o90_unknown1C() {
-	// For Pajame Sam 2 demo
-	// Incomplete
+	int a, b;
 	int subOp = fetchScriptByte();
 	subOp -= 46;
 
@@ -439,78 +456,98 @@
 		pop();
 		break;
 	case 1:
-		pop();
-		pop();
-		pop();
-		pop();
+		_wizParams.box.bottom = pop();
+		_wizParams.box.right = pop();
+		_wizParams.box.top = pop();
+		_wizParams.box.left = pop();
 		break;
 	case 2:
-		//Sets a variable to 1
+		_wizParams.drawMode = 1;
 		break;
 	case 3:
-		//Gets a script string
+		_wizParams.drawFlags |= 0x800;
+		_wizParams.drawMode = 3;
+		copyScriptString(_wizParams.filename);
 		break;
 	case 4:
-		//Gets a script string
-		pop();
+		_wizParams.drawFlags |= 0x800;
+		_wizParams.drawMode = 4;
+		copyScriptString(_wizParams.filename);
+		_wizParams.unk_14C = pop();
 		break;
 	case 5:
-		pop();
-		pop();
-		pop();
-		pop();
-		pop();
+		_wizParams.drawFlags |= 0x300;
+		_wizParams.drawMode = 2;
+		_wizParams.box.bottom = pop();
+		_wizParams.box.right = pop();
+		_wizParams.box.top = pop();
+		_wizParams.box.left = pop();
+		_wizParams.unk_148 = pop();
 		break;
 	case 6:
-		_wizState = pop();
+		_wizParams.drawFlags |= 0x400;
+		_wizParams.img.state = pop();
 		break;
 	case 7:
-		pop();
+		_wizParams.drawFlags |= 0x10;
+		_wizParams.unk_150 = pop();
 		break;
 	case 8:
-		_wizFlag |= pop();
+		_wizParams.drawFlags |= 0x20;
+		_wizParams.img.flags = pop();
 		break;
 	case 10:
-	{
-		int flags = pop();
-		int state = pop();
-		int y1 = pop();
-		int x1 = pop();
-		int resnum = pop();
-		if (_fullRedraw) {
-			assert(_wizImagesNum < ARRAYSIZE(_wizImages));
-			WizImage *pwi = &_wizImages[_wizImagesNum];
-			pwi->resnum = resnum;
-			pwi->x1 = x1;
-			pwi->y1 = y1;
-			pwi->flags = flags;
-			++_wizImagesNum;
-		} else {
-			drawWizImage(rtImage, resnum, state, x1, y1, flags);
-		}
-	}
+		_wizParams.img.flags = pop();
+		_wizParams.img.state = pop();
+		_wizParams.img.y1 = pop();
+		_wizParams.img.x1 = pop();
+		_wizParams.img.resNum = pop();
+		displayWizImage(&_wizParams.img);
 		break;
 	case 11:
-		_wizResNum = pop();
-		_wizFlag = 0;
+		_wizParams.img.resNum = pop();
+		_wizParams.drawMode = 0;
+		_wizParams.drawFlags = 0;
+		_wizParams.remapPos = 0;
+		_wizParams.img.flags = 0;
 		break;
 	case 19:
-		_wizY1 = pop();
-		_wizX1 = pop();
+		_wizParams.drawFlags |= 1;
+		_wizParams.img.y1 = pop();
+		_wizParams.img.x1 = pop();
 		break;
 	case 20:
-		pop();
-		pop();
+		b = pop();
+		a = pop();
+		_wizParams.drawFlags |= 0x40;
+		_wizParams.drawMode = 6;
+		if (_wizParams.remapPos == 0) {
+			memset(_wizParams.remapBuf2, 0, sizeof(_wizParams.remapBuf2));
+		} else {
+			assert(_wizParams.remapPos < ARRAYSIZE(_wizParams.remapBuf2));
+			_wizParams.remapBuf2[_wizParams.remapPos] = a;
+			_wizParams.remapBuf1[a] = b;
+			++_wizParams.remapPos;
+		}
 		break;
 	case 21:
-		pop();
-		pop();
-		pop();
-		pop();
+		_wizParams.drawFlags |= 0x200;
+		_wizParams.box.bottom = pop();
+		_wizParams.box.right = pop();
+		_wizParams.box.top = pop();
+		_wizParams.box.left = pop();
 		break;
 	case 40: // HE99+
 		pop();
 		break;
+	case 46:
+		_wizParams.drawFlags |= 8;
+		_wizParams.unk_158 = pop();
+		break;
+	case 52:
+		_wizParams.drawFlags |= 4;
+		_wizParams.unk_15C = pop();
+		break;
 	case 87: // HE99+
 		pop();
 		pop();
@@ -521,28 +558,24 @@
 	case 91: // HE99+
 		pop();
 		break;
+	case 108:
+		_wizParams.drawFlags |= 1;
+		_wizParams.img.y1 = pop();
+		_wizParams.img.x1 = pop();
+		break;
 	case 171: // HE99+
 		break;
 	case 200:
-		_wizFlag |= 64;
-		_wizY1 = _wizX1 = pop();
+		_wizParams.drawFlags |= 0x23;
+		_wizParams.img.flags |= 0x40;
+		_wizParams.unk_160 = _wizParams.img.y1 = _wizParams.img.x1 = pop();
 		break;
 	case 203: // HE98+
 		pop();
 		pop();
 		break;
 	case 209:
-		if (_fullRedraw) {
-			assert(_wizImagesNum < ARRAYSIZE(_wizImages));
-			WizImage *pwi = &_wizImages[_wizImagesNum];
-			pwi->resnum = _wizResNum;
-			pwi->x1 = _wizX1;
-			pwi->y1 = _wizY1;
-			pwi->flags = _wizFlag;
-			++_wizImagesNum;
-		} else {
-			drawWizImage(rtImage, _wizResNum, _wizState, _wizX1, _wizY1, _wizFlag);
-		}
+		wizDraw(&_wizParams);
 		break;
 	default:
 		error("o90_unknown1C: unhandled case %d", subOp);
@@ -798,6 +831,7 @@
 void ScummEngine_v90he::o90_unknown29() {
 	int state, resId;
 	uint32 w, h;
+	int16 x, y;
 
 	int subOp = fetchScriptByte();
 	subOp -= 30;
@@ -806,14 +840,14 @@
 	case 0:
 		state = pop();
 		resId = pop();
-		loadImgSpot(resId, state, w, h);
-		push(w);
+		loadImgSpot(resId, state, x, y);
+		push(x);
 		break;
 	case 1:
 		state = pop();
 		resId = pop();
-		loadImgSpot(resId, state, w, h);
-		push(h);
+		loadImgSpot(resId, state, x, y);
+		push(y);
 		break;
 	case 2:
 		state = pop();

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.231
retrieving revision 1.232
diff -u -d -r1.231 -r1.232
--- scumm.cpp	26 Sep 2004 07:30:26 -0000	1.231
+++ scumm.cpp	26 Sep 2004 15:29:57 -0000	1.232
@@ -697,11 +697,6 @@
 	_heSndLoop = 0;
 	_heSndSoundFreq = 0;
 	memset(_timers, 0, sizeof(_timers));
-	_wizResNum = 0;
-	_wizX1 = 0;
-	_wizY1 = 0;
-	_wizState = 0;
-	_wizFlag = 0;
 
 	memset(_akosQueue, 0, sizeof(_akosQueue));
 	_akosQueuePos = 0;
@@ -1317,6 +1312,11 @@
 	}
 }
 
+void ScummEngine_v90he::scummInit() {
+	ScummEngine_v80he::scummInit();
+	memset(&_wizParams, 0, sizeof(_wizParams));
+}
+
 void ScummEngine::setupMusic(int midi) {
 	_midiDriver = GameDetector::detectMusicDriver(midi);
 	_native_mt32 = ConfMan.getBool("native_mt32");

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.500
retrieving revision 1.501
diff -u -d -r1.500 -r1.501
--- scumm.h	26 Sep 2004 07:30:28 -0000	1.500
+++ scumm.h	26 Sep 2004 15:29:58 -0000	1.501
@@ -1082,7 +1082,6 @@
 	int _heSndSoundFreq, _heSndOffset, _heSndChannel, _heSndSoundId, _heSndLoop;
 	bool _skipDrawObject, _skipProcessActors;
 	int _timers[4];
-	int _wizResNum, _wizX1, _wizY1, _wizState, _wizFlag;
 
 protected:
 	int _shadowPaletteSize;





More information about the Scummvm-git-logs mailing list