[Scummvm-cvs-logs] SF.net SVN: scummvm: [30160] scummvm/trunk/engines/scumm

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Jan 2 19:44:20 CET 2008


Revision: 30160
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30160&view=rev
Author:   sev
Date:     2008-01-02 10:44:20 -0800 (Wed, 02 Jan 2008)

Log Message:
-----------
Workaround for bug #1804278: "MONKEY: Mouse is invisible after loading"

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/cursor.cpp
    scummvm/trunk/engines/scumm/debugger.cpp
    scummvm/trunk/engines/scumm/debugger.h
    scummvm/trunk/engines/scumm/intern.h
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/scumm.h

Modified: scummvm/trunk/engines/scumm/cursor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/cursor.cpp	2008-01-02 17:39:03 UTC (rev 30159)
+++ scummvm/trunk/engines/scumm/cursor.cpp	2008-01-02 18:44:20 UTC (rev 30160)
@@ -467,6 +467,41 @@
 	updateCursor();
 }
 
+void ScummEngine_v5::resetCursors() {
+	// All "classic" games (V5 and older) encrypted their data files
+	// with exception of the GF_OLD256 games and the PC-Engine version
+	// of Loom.
+	if (!(_game.features & GF_OLD256) && _game.platform != Common::kPlatformPCEngine)
+		_game.features |= GF_USE_KEY;
+
+	static const uint16 default_cursor_images[4][16] = {
+		/* cross-hair */
+		{ 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000, 0x7e3f,
+		  0x0000, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000 },
+		/* hourglass */
+		{ 0x0000, 0x7ffe, 0x6006, 0x300c, 0x1818, 0x0c30, 0x0660, 0x03c0,
+		  0x0660, 0x0c30, 0x1998, 0x33cc, 0x67e6, 0x7ffe, 0x0000, 0x0000 },
+		/* arrow */
+		{ 0x0000, 0x4000, 0x6000, 0x7000, 0x7800, 0x7c00, 0x7e00, 0x7f00,
+		  0x7f80, 0x78c0, 0x7c00, 0x4600, 0x0600, 0x0300, 0x0300, 0x0180 },
+		/* hand */
+		{ 0x1e00, 0x1200, 0x1200, 0x1200, 0x1200, 0x13ff, 0x1249, 0x1249,
+		  0xf249, 0x9001, 0x9001, 0x9001, 0x8001, 0x8001, 0x8001, 0xffff },
+	};
+
+	static const byte default_cursor_hotspots[10] = {
+		8, 7,   8, 7,   1, 1,   5, 0,
+		8, 7, //zak256
+	};
+
+
+	for (int i = 0; i < 4; i++) {
+		memcpy(_cursorImages[i], default_cursor_images[i], 32);
+	}
+	memcpy(_cursorHotspots, default_cursor_hotspots, 8);
+
+}
+
 void ScummEngine_v5::setBuiltinCursor(int idx) {
 	int i, j;
 	byte color = default_cursor_colors[idx];

Modified: scummvm/trunk/engines/scumm/debugger.cpp
===================================================================
--- scummvm/trunk/engines/scumm/debugger.cpp	2008-01-02 17:39:03 UTC (rev 30159)
+++ scummvm/trunk/engines/scumm/debugger.cpp	2008-01-02 18:44:20 UTC (rev 30160)
@@ -99,6 +99,8 @@
 	DCmd_Register("hide",      WRAP_METHOD(ScummDebugger, Cmd_Hide));
 
 	DCmd_Register("imuse",     WRAP_METHOD(ScummDebugger, Cmd_IMuse));
+
+	DCmd_Register("resetcursors",    WRAP_METHOD(ScummDebugger, Cmd_ResetCursors));
 }
 
 ScummDebugger::~ScummDebugger() {
@@ -863,4 +865,12 @@
 	return true;
 }
 
+bool ScummDebugger::Cmd_ResetCursors(int argc, const char **argv) {
+	_vm->resetCursors();
+
+	_detach_now = true;
+
+	return false;
+}
+
 } // End of namespace Scumm

Modified: scummvm/trunk/engines/scumm/debugger.h
===================================================================
--- scummvm/trunk/engines/scumm/debugger.h	2008-01-02 17:39:03 UTC (rev 30159)
+++ scummvm/trunk/engines/scumm/debugger.h	2008-01-02 18:44:20 UTC (rev 30160)
@@ -68,8 +68,10 @@
 	bool Cmd_Show(int argc, const char **argv);
 	bool Cmd_Hide(int argc, const char **argv);
 
-	bool Cmd_IMuse (int argc, const char **argv);
+	bool Cmd_IMuse(int argc, const char **argv);
 
+	bool Cmd_ResetCursors(int argc, const char **argv);
+
 	void printBox(int box);
 	void drawBox(int box);
 };

Modified: scummvm/trunk/engines/scumm/intern.h
===================================================================
--- scummvm/trunk/engines/scumm/intern.h	2008-01-02 17:39:03 UTC (rev 30159)
+++ scummvm/trunk/engines/scumm/intern.h	2008-01-02 18:44:20 UTC (rev 30160)
@@ -68,6 +68,9 @@
 	ScummEngine_v5(OSystem *syst, const DetectorResult &dr);
 
 	void clearFlashlight();
+
+	virtual void resetCursors();
+
 protected:
 	virtual void setupOpcodes();
 	virtual void executeOpcode(byte i);

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2008-01-02 17:39:03 UTC (rev 30159)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2008-01-02 18:44:20 UTC (rev 30160)
@@ -602,38 +602,8 @@
 ScummEngine_v5::ScummEngine_v5(OSystem *syst, const DetectorResult &dr)
  : ScummEngine(syst, dr) {
 
-	// All "classic" games (V5 and older) encrypted their data files
-	// with exception of the GF_OLD256 games and the PC-Engine version
-	// of Loom.
-	if (!(_game.features & GF_OLD256) && _game.platform != Common::kPlatformPCEngine)
-		_game.features |= GF_USE_KEY;
+	resetCursors();
 
-	static const uint16 default_cursor_images[4][16] = {
-		/* cross-hair */
-		{ 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000, 0x7e3f,
-		  0x0000, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000 },
-		/* hourglass */
-		{ 0x0000, 0x7ffe, 0x6006, 0x300c, 0x1818, 0x0c30, 0x0660, 0x03c0,
-		  0x0660, 0x0c30, 0x1998, 0x33cc, 0x67e6, 0x7ffe, 0x0000, 0x0000 },
-		/* arrow */
-		{ 0x0000, 0x4000, 0x6000, 0x7000, 0x7800, 0x7c00, 0x7e00, 0x7f00,
-		  0x7f80, 0x78c0, 0x7c00, 0x4600, 0x0600, 0x0300, 0x0300, 0x0180 },
-		/* hand */
-		{ 0x1e00, 0x1200, 0x1200, 0x1200, 0x1200, 0x13ff, 0x1249, 0x1249,
-		  0xf249, 0x9001, 0x9001, 0x9001, 0x8001, 0x8001, 0x8001, 0xffff },
-	};
-
-	static const byte default_cursor_hotspots[10] = {
-		8, 7,   8, 7,   1, 1,   5, 0,
-		8, 7, //zak256
-	};
-
-
-	for (int i = 0; i < 4; i++) {
-		memcpy(_cursorImages[i], default_cursor_images[i], 32);
-	}
-	memcpy(_cursorHotspots, default_cursor_hotspots, 8);
-
 	// Setup flashlight
 	memset(&_flashlight, 0, sizeof(_flashlight));
 	_flashlight.xStrips = 7;

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2008-01-02 17:39:03 UTC (rev 30159)
+++ scummvm/trunk/engines/scumm/scumm.h	2008-01-02 18:44:20 UTC (rev 30160)
@@ -491,6 +491,8 @@
 	virtual void animateCursor() {}
 	virtual void updatePalette();
 
+	virtual void resetCursors() {}
+
 public:
 	void pauseGame();
 	void restart();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list