[Scummvm-cvs-logs] CVS: scummvm/scumm cursor.cpp,2.34,2.35 intern.h,2.446,2.447 scumm.cpp,1.443,1.444 scumm.h,1.589,1.590

Eugene Sandulenko sev at users.sourceforge.net
Tue Apr 19 20:13:54 CEST 2005


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

Modified Files:
	cursor.cpp intern.h scumm.cpp scumm.h 
Log Message:
Since lost/smaller use default windows cursor we setup our own


Index: cursor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/cursor.cpp,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -d -r2.34 -r2.35
--- cursor.cpp	20 Apr 2005 01:33:41 -0000	2.34
+++ cursor.cpp	20 Apr 2005 03:13:04 -0000	2.35
@@ -65,6 +65,17 @@
 	8, 7, //zak256
 };
 
+static const uint16 default_he_cursor[] = {
+	0x0000, 0x0000, 0x3800, 0x0000, 0x7e00, 0x0000, 0x5f80, 0x0000,
+	0x5fe0, 0x0000, 0x2ff8, 0x0000, 0x27fe, 0x0000, 0x17ff, 0x8000,
+	0x13ff, 0xe000, 0x09ff, 0xf000, 0x09ff, 0xf800, 0x04ff, 0xf800,
+	0x047f, 0xf000, 0x027f, 0xe000, 0x023f, 0xf000, 0x011f, 0xf800,
+	0x0111, 0xfc00, 0x0080, 0xfc00, 0x0084, 0x0c00, 0x004a, 0x0800,
+	0x0031, 0x1000, 0x0000, 0xe000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+};
+
 ScummEngine_v5::ScummEngine_v5(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16])
  : ScummEngine(detector, syst, gs, md5sum) {
 
@@ -152,6 +163,38 @@
 		_win32ResExtractor->setCursor(img);
 }
 
+void ScummEngine_v90he::setDefaultCursor() {
+	const uint16 *src;
+	int i, j;
+	static byte palette[] = { 0xff, 0xff, 0xff, 0,
+							  0,    0,    0,    0};
+
+	memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
+
+	_cursor.hotspotX = _cursor.hotspotY = 2;
+	src = default_he_cursor;
+
+	_cursor.width = 32;
+	_cursor.height = 32;
+
+	for (i = 0; i < 32; i++) {
+		for (j = 0; j < 32; j++) {
+			if (*src & (1 << (15 - (j % 16))))
+				_grabbedCursor[32 * i + j] = 0xfe;
+			if (j == 15)
+				src++;
+		}
+		src++;
+	}
+
+	// Since white color position is not guaranteed
+	// we setup our own palette if supported by backend
+	if (_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+		_system->setCursorPalette(palette, 0xfe, 2);
+
+	updateCursor();
+}
+
 void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) {
 	int w, h;
 	const byte *dataptr, *bomp;

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.446
retrieving revision 2.447
diff -u -d -r2.446 -r2.447
--- intern.h	18 Apr 2005 11:44:00 -0000	2.446
+++ intern.h	20 Apr 2005 03:13:05 -0000	2.447
@@ -1068,6 +1068,8 @@
 	void spritesResetTables(bool refreshScreen);
 	void spriteAddImageToList(int spriteId, int imageNum, int *spriteIdptr);
 
+	void setDefaultCursor();
+
 public:
 	void saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion);
 	void spritesBlitToScreen();

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.443
retrieving revision 1.444
diff -u -d -r1.443 -r1.444
--- scumm.cpp	20 Apr 2005 01:38:48 -0000	1.443
+++ scumm.cpp	20 Apr 2005 03:13:05 -0000	1.444
@@ -314,7 +314,7 @@
 	// these and later games can easily be identified by the .(a) file instead of a .he1
 	// and INIB chunk in the .he0
 	{"lost", "Pajama Sam's Lost & Found", GID_HEGAME, 6, 98, 61, MDT_NONE,
-	 GF_USE_KEY | GF_NEW_COSTUMES | GF_MULTIPLE_VERSIONS, 0, 0},
+	 GF_USE_KEY | GF_NEW_COSTUMES | GF_HE_CURSORLESS | GF_MULTIPLE_VERSIONS, 0, 0},
 	{"racedemo", "Putt-Putt Enters the Race (Demo)", GID_HEGAME, 6, 98, 61, MDT_NONE,
 	 GF_USE_KEY | GF_NEW_COSTUMES | GF_MULTIPLE_VERSIONS, 0, 0},
 	{"puttrace", "Putt-Putt Enters the Race", GID_HEGAME, 6, 98, 61, MDT_NONE,
@@ -333,7 +333,7 @@
 	// Engine moved to c++ 
 	// Humongous Entertainment Scumm Version 9.9 ?  Scummsys.99
 	{"smaller", "Pajama Sam's Lost & Found (Test)", GID_HEGAME, 6, 99, 61, MDT_NONE,
-	 GF_USE_KEY | GF_NEW_COSTUMES, 0, 0},
+	 GF_USE_KEY | GF_NEW_COSTUMES | GF_HE_CURSORLESS, 0, 0},
 	{"puttcircus", "Putt-Putt Joins the Circus", GID_HEGAME, 6, 99, 61, MDT_NONE,
 	 GF_USE_KEY | GF_NEW_COSTUMES, 0, 0},
 	{"circdemo", "Putt-Putt Joins the Circus (Demo)", GID_HEGAME, 6, 99, 61, MDT_NONE,
@@ -1670,6 +1670,9 @@
 
 	spritesResetTables(0);
 	memset(&_wizParams, 0, sizeof(_wizParams));
+
+	if (_features & GF_HE_CURSORLESS)
+		setDefaultCursor();
 }
 
 void ScummEngine_v99he::scummInit() {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.589
retrieving revision 1.590
diff -u -d -r1.589 -r1.590
--- scumm.h	20 Apr 2005 01:59:09 -0000	1.589
+++ scumm.h	20 Apr 2005 03:13:06 -0000	1.590
@@ -114,18 +114,21 @@
 	 */
 	GF_FEW_LOCALS          = 1 << 11,
 
+	/** HE games without cursor resources */
+	GF_HE_CURSORLESS       = 1 << 12,
+
 	/** Games with multiple versions */
-	GF_MULTIPLE_VERSIONS   = 1 << 12,
+	GF_MULTIPLE_VERSIONS   = 1 << 13,
 	
-	GF_FMTOWNS             = 1 << 13,
-	GF_AMIGA               = 1 << 14,
-	GF_NES                 = 1 << 15,
-	GF_ATARI_ST            = 1 << 16,
-	GF_MACINTOSH           = 1 << 17,
-	GF_PC                  = 1 << 18,
-	GF_WINDOWS             = 1 << 19,
+	GF_FMTOWNS             = 1 << 14,
+	GF_AMIGA               = 1 << 15,
+	GF_NES                 = 1 << 16,
+	GF_ATARI_ST            = 1 << 17,
+	GF_MACINTOSH           = 1 << 18,
+	GF_PC                  = 1 << 19,
+	GF_WINDOWS             = 1 << 20,
 	
-	GF_DEMO                = 1 << 20
+	GF_DEMO                = 1 << 21
 };
 
 /* SCUMM Debug Channels */





More information about the Scummvm-git-logs mailing list