[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.316,1.317 akos.cpp,1.204,1.205 charset.cpp,2.122,2.123 gfx.cpp,2.383,2.384 intern.h,2.322,2.323 saveload.cpp,1.185,1.186 scumm.cpp,1.286,1.287 scumm.h,1.522,1.523 wiz_he.cpp,2.1,2.2 wiz_he.h,2.1,2.2

Gregory Montoir cyx at users.sourceforge.net
Sun Dec 19 04:31:04 CET 2004


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

Modified Files:
	actor.cpp akos.cpp charset.cpp gfx.cpp intern.h saveload.cpp 
	scumm.cpp scumm.h wiz_he.cpp wiz_he.h 
Log Message:
to please PalmOS, I moved the _wiz member to ScummEngine_v70he, where it actually belongs, I don't quite like the upcasts I introduced, but I don't know how to deal without them

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.316
retrieving revision 1.317
diff -u -d -r1.316 -r1.317
--- actor.cpp	27 Nov 2004 17:50:21 -0000	1.316
+++ actor.cpp	19 Dec 2004 12:30:26 -0000	1.317
@@ -31,6 +31,7 @@
 #include "scumm/saveload.h"
 #include "scumm/sound.h"
 #include "scumm/usage_bits.h"
+#include "scumm/wiz_he.h"
 
 namespace Scumm {
 
@@ -1921,7 +1922,7 @@
 					uint8 *dst2 = pvs->getBackPixels(0, pvs->topline);
 					switch (comp) {
 					case 1:
-						_wiz.copyAuxImage(dst1, dst2, axfd + 10, pvs->w, pvs->h, x, y, w, h);
+						Wiz::copyAuxImage(dst1, dst2, axfd + 10, pvs->w, pvs->h, x, y, w, h);
 						break;
 					default:
 						warning("unimplemented compression type %d", comp);

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -d -r1.204 -r1.205
--- akos.cpp	28 Nov 2004 22:26:03 -0000	1.204
+++ akos.cpp	19 Dec 2004 12:30:27 -0000	1.205
@@ -28,6 +28,7 @@
 #include "scumm/imuse.h"
 #include "scumm/imuse_digi/dimuse.h"
 #include "scumm/sound.h"
+#include "scumm/wiz_he.h"
 
 namespace Scumm {
 
@@ -1238,7 +1239,7 @@
 		_draw_bottom = dst.bottom;
 
 	byte *dstPtr = (byte *)_out.pixels + dst.left + dst.top * _out.pitch;
-	_vm->_wiz.decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src);
+	Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src);
 	return 0;
 }
 

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.122
retrieving revision 2.123
diff -u -d -r2.122 -r2.123
--- charset.cpp	27 Nov 2004 17:50:21 -0000	2.122
+++ charset.cpp	19 Dec 2004 12:30:38 -0000	2.123
@@ -22,6 +22,7 @@
 #include "scumm/charset.h"
 #include "scumm/scumm.h"
 #include "scumm/nut_renderer.h"
+#include "scumm/wiz_he.h"
 
 namespace Scumm {
 
@@ -1397,7 +1398,7 @@
 		byte imagePalette[256];
 		memset(imagePalette, 255, sizeof(imagePalette));
 		memcpy(imagePalette, _vm->_charsetColorMap, 16);
-		_vm->_wiz.decompressWizImage(dstPtr, vs->w, dst, charPtr, src, imagePalette);
+		Wiz::decompressWizImage(dstPtr, vs->w, dst, charPtr, src, imagePalette);
 
 		if (_blitAlso && vs->hasTwoBuffers)
 			_vm->gdi.copyVirtScreenBuffers(dst);

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.383
retrieving revision 2.384
diff -u -d -r2.383 -r2.384
--- gfx.cpp	10 Dec 2004 15:16:45 -0000	2.383
+++ gfx.cpp	19 Dec 2004 12:30:38 -0000	2.384
@@ -26,6 +26,7 @@
 #include "scumm/intern.h"
 #include "scumm/resource.h"
 #include "scumm/usage_bits.h"
+#include "scumm/wiz_he.h"
 
 #if defined(__PALM_OS__)
 #include "init_arm.h"
@@ -1438,7 +1439,7 @@
 	if (code == 8 || code == 9) {
 		Common::Rect rScreen(0, 0, vs->w, vs->h);
 		byte *dst = (byte *)_vm->virtscr[0].backBuf + scrX;
-		_vm->_wiz.copyWizImage(dst, bmap_ptr, vs->w, vs->h, x - scrX, y, w, h, &rScreen);
+		Wiz::copyWizImage(dst, bmap_ptr, vs->w, vs->h, x - scrX, y, w, h, &rScreen);
 	}
 
 	Common::Rect rect1(x, y, x + w, y + h);

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.322
retrieving revision 2.323
diff -u -d -r2.322 -r2.323
--- intern.h	28 Nov 2004 05:33:33 -0000	2.322
+++ intern.h	19 Dec 2004 12:30:38 -0000	2.323
@@ -24,7 +24,7 @@
 #define INTERN_H
 
 #include "scumm/scumm.h"
-
+#include "scumm/wiz_he.h"
 
 namespace Scumm {
 
@@ -649,6 +649,8 @@
 public:
 	ScummEngine_v70he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
 
+	Wiz _wiz;
+
 protected:
 	virtual void setupOpcodes();
 	virtual void executeOpcode(byte i);

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- saveload.cpp	28 Nov 2004 21:24:00 -0000	1.185
+++ saveload.cpp	19 Dec 2004 12:30:38 -0000	1.186
@@ -28,12 +28,14 @@
 #include "scumm/charset.h"
 #include "scumm/imuse_digi/dimuse.h"
 #include "scumm/imuse.h"
+#include "scumm/intern.h"
 #include "scumm/object.h"
 #include "scumm/resource.h"
 #include "scumm/saveload.h"
 #include "scumm/scumm.h"
 #include "scumm/sound.h"
 #include "scumm/verbs.h"
+#include "scumm/wiz_he.h"
 
 #include "sound/audiocd.h"
 #include "sound/mixer.h"
@@ -726,8 +728,10 @@
 	else
 		s->saveLoadArrayOf(vm.slot, NUM_SCRIPT_SLOT, sizeof(vm.slot[0]), scriptSlotEntries);
 
-	if (_heversion >= 71)
-		s->saveLoadArrayOf(_wiz._polygons, ARRAYSIZE(_wiz._polygons), sizeof(_wiz._polygons[0]), polygonEntries);
+	if (_heversion >= 71) {
+		Wiz *wiz = &((ScummEngine_v70he *)this)->_wiz;
+		s->saveLoadArrayOf(wiz->_polygons, ARRAYSIZE(wiz->_polygons), sizeof(wiz->_polygons[0]), polygonEntries);
+	}
 	s->saveLoadArrayOf(_objs, _numLocalObjects, sizeof(_objs[0]), objectEntries);
 	if (s->isLoading() && savegameVersion < VER(13)) {
 		// Since roughly v13 of the save games, the objs storage has changed a bit

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -d -r1.286 -r1.287
--- scumm.cpp	19 Dec 2004 02:25:11 -0000	1.286
+++ scumm.cpp	19 Dec 2004 12:30:38 -0000	1.287
@@ -1311,6 +1311,7 @@
 void ScummEngine_v90he::scummInit() {
 	ScummEngine_v80he::scummInit();
 
+debug(0, "sizeof(_wiz) = %d", sizeof(_wiz));
 	_heObject = 0;
 	_heObjectNum = 0;
 	_hePaletteNum = 0;
@@ -1818,7 +1819,7 @@
 	_sound->processSoundQues();
 
 	if (_heversion >= 71) {
-		memset(_wiz._polygons, 0, sizeof(_wiz._polygons));
+		((ScummEngine_v70he *)this)->_wiz.polygonClear();
 	}
 
 	// For HE80+ games
@@ -2353,31 +2354,8 @@
 	if (_heversion >= 80) {
 		ptr = findResourceData(MKID('POLD'), roomptr);
 		if (ptr) {
-			int slots = READ_LE_UINT32(ptr);
-			ptr += 4;
-			debug(1, "Loading %d polygon slots", slots);
-
-			bool flag = 1;
-			int id, points, vert1x, vert1y, vert2x, vert2y, vert3x, vert3y, vert4x, vert4y;
-			while (slots--) {
-				id = READ_LE_UINT32(ptr);
-				points = READ_LE_UINT32(ptr + 4);
-				if (points != 4)
-					error("Illegal polygon with %d points", points);
-				vert1x = READ_LE_UINT32(ptr + 8);
-				vert1y = READ_LE_UINT32(ptr + 12);
-				vert2x = READ_LE_UINT32(ptr + 16);
-				vert2y = READ_LE_UINT32(ptr + 20);
-				vert3x = READ_LE_UINT32(ptr + 24);
-				vert3y = READ_LE_UINT32(ptr + 28);
-				vert4x = READ_LE_UINT32(ptr + 32);
-				vert4y = READ_LE_UINT32(ptr + 36);
-
-				ptr += 40;
-				_wiz.polygonStore(id, flag, vert1x, vert1y, vert2x, vert2y, vert3x, vert3y, vert4x, vert4y);
-			}
+			((ScummEngine_v70he *)this)->_wiz.polygonLoad(ptr);
 		}
-
 	}
 
 	if (_PALS_offs || _CLUT_offs)

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.522
retrieving revision 1.523
diff -u -d -r1.522 -r1.523
--- scumm.h	17 Dec 2004 22:27:14 -0000	1.522
+++ scumm.h	19 Dec 2004 12:30:39 -0000	1.523
@@ -32,7 +32,6 @@
 #include "scumm/gfx.h"
 #include "scumm/script.h"
 #include "scumm/util.h"
-#include "scumm/wiz_he.h"
 
 namespace GUI {
 	class Dialog;
@@ -334,9 +333,6 @@
 	/** Graphics manager */
 	Gdi gdi;
 	
-	/** Wiz graphics manager (HE) */
-	Wiz _wiz;
-
 protected:
 	/** Central resource data. */
 	struct {

Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -d -r2.1 -r2.2
--- wiz_he.cpp	27 Nov 2004 17:50:23 -0000	2.1
+++ wiz_he.cpp	19 Dec 2004 12:30:40 -0000	2.2
@@ -35,6 +35,36 @@
 	memset(&_polygons, 0, sizeof(_polygons));
 }
 
+void Wiz::polygonClear() {
+	memset(&_polygons, 0, sizeof(_polygons));
+}
+
+void Wiz::polygonLoad(const uint8 *polData) {
+	int slots = READ_LE_UINT32(polData);
+	polData += 4;
+	debug(1, "Loading %d polygon slots", slots);
+
+	bool flag = 1;
+	int id, points, vert1x, vert1y, vert2x, vert2y, vert3x, vert3y, vert4x, vert4y;
+	while (slots--) {
+		id = READ_LE_UINT32(polData);
+		points = READ_LE_UINT32(polData + 4);
+		if (points != 4)
+			error("Illegal polygon with %d points", points);
+		vert1x = READ_LE_UINT32(polData + 8);
+		vert1y = READ_LE_UINT32(polData + 12);
+		vert2x = READ_LE_UINT32(polData + 16);
+		vert2y = READ_LE_UINT32(polData + 20);
+		vert3x = READ_LE_UINT32(polData + 24);
+		vert3y = READ_LE_UINT32(polData + 28);
+		vert4x = READ_LE_UINT32(polData + 32);
+		vert4y = READ_LE_UINT32(polData + 36);
+
+		polData += 40;
+		polygonStore(id, flag, vert1x, vert1y, vert2x, vert2y, vert3x, vert3y, vert4x, vert4y);
+	}
+}
+
 void Wiz::polygonStore(int id, bool flag, int vert1x, int vert1y, int vert2x, int vert2y, int vert3x, int vert3y, int vert4x, int vert4y) {
 	WizPolygon *wp = NULL;
 	for (int i = 0; i < ARRAYSIZE(_polygons); ++i) {

Index: wiz_he.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.h,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -d -r2.1 -r2.2
--- wiz_he.h	27 Nov 2004 17:50:23 -0000	2.1
+++ wiz_he.h	19 Dec 2004 12:30:40 -0000	2.2
@@ -89,16 +89,18 @@
 	
 	Wiz();
 
+	void polygonClear();
+	void polygonLoad(const uint8 *polData);
 	void polygonStore(int id, bool flag, int vert1x, int vert1y, int vert2x, int vert2y, int vert3x, int vert3y, int vert4x, int vert4y);
 	void polygonErase(int fromId, int toId);
 	int polygonHit(int id, int x, int y);
 	bool polygonDefined(int id);
 	bool polygonContains(const WizPolygon &pol, int x, int y);
 	
-	void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch);	
-	void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect);
-	void copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);
-	void decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, const uint8 *imagePal = NULL);
+	static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch);	
+	static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect);
+	static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);
+	static void decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, const uint8 *imagePal = NULL);
 	int isWizPixelNonTransparent(const uint8 *data, int x, int y, int w, int h);
 	uint8 getWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 color);
 	uint8 getRawWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 color);





More information about the Scummvm-git-logs mailing list