[Scummvm-cvs-logs] SF.net SVN: scummvm: [27539] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Jun 18 22:11:50 CEST 2007


Revision: 27539
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27539&view=rev
Author:   peres001
Date:     2007-06-18 13:11:49 -0700 (Mon, 18 Jun 2007)

Log Message:
-----------
Mouse is now properly hidden during dialogues, and is restored after load/save dialog boxes are closed. Moreover, kEngineMouse constant has been renamed to better match its meaning.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables.cpp
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/intro.cpp
    scummvm/trunk/engines/parallaction/inventory.cpp
    scummvm/trunk/engines/parallaction/location.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h

Modified: scummvm/trunk/engines/parallaction/callables.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables.cpp	2007-06-18 19:56:36 UTC (rev 27538)
+++ scummvm/trunk/engines/parallaction/callables.cpp	2007-06-18 20:11:49 UTC (rev 27539)
@@ -187,14 +187,14 @@
 }
 
 void _c_offMouse(void *parm) {
-	_mouseHidden = 1;
-	_engineFlags |= kEngineMouse;
+	_vm->showCursor(false);
+	_engineFlags |= kEngineBlockInput;
 	return;
 }
 
 void _c_onMouse(void *parm) {
-	_engineFlags &= ~kEngineMouse;
-	_mouseHidden = 0;
+	_engineFlags &= ~kEngineBlockInput;
+	_vm->showCursor(true);
 	return;
 }
 

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2007-06-18 19:56:36 UTC (rev 27538)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2007-06-18 20:11:49 UTC (rev 27539)
@@ -478,6 +478,8 @@
 
 void Parallaction::enterDialogue() {
 
+	showCursor(false);
+	
 	return;
 }
 
@@ -487,6 +489,8 @@
 
 	refreshInventory(_characterName);
 
+	showCursor(true);
+	
 	return;
 }
 

Modified: scummvm/trunk/engines/parallaction/intro.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/intro.cpp	2007-06-18 19:56:36 UTC (rev 27538)
+++ scummvm/trunk/engines/parallaction/intro.cpp	2007-06-18 20:11:49 UTC (rev 27539)
@@ -134,7 +134,7 @@
 		_vm->_soundMan->playMusic();
 	}
 
-	_engineFlags |= kEngineMouse;
+	_engineFlags |= kEngineBlockInput;
 
 	return;
 }
@@ -170,7 +170,7 @@
 
 		waitUntilLeftClick();
 
-		_engineFlags &= ~kEngineMouse;
+		_engineFlags &= ~kEngineBlockInput;
 		_vm->_menu->selectCharacter();
 	} else {
 		waitUntilLeftClick();

Modified: scummvm/trunk/engines/parallaction/inventory.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/inventory.cpp	2007-06-18 19:56:36 UTC (rev 27538)
+++ scummvm/trunk/engines/parallaction/inventory.cpp	2007-06-18 20:11:49 UTC (rev 27539)
@@ -286,13 +286,13 @@
 
 	static uint16 count = 0;
 
-	_engineFlags |= kEngineMouse;
+	_engineFlags |= kEngineBlockInput;
 
 	count++;
 	if (count == 2) {
 		count = 0;
 		j->_finished = 1;
-		_engineFlags &= ~kEngineMouse;
+		_engineFlags &= ~kEngineBlockInput;
 	}
 
 	Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT);

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-06-18 19:56:36 UTC (rev 27538)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-06-18 20:11:49 UTC (rev 27539)
@@ -316,7 +316,7 @@
 
 
 	_hoverZone = NULL;
-	if (_engineFlags & kEngineMouse) {
+	if (_engineFlags & kEngineBlockInput) {
 		changeCursor( kCursorArrow );
 	}
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-06-18 19:56:36 UTC (rev 27538)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-06-18 20:11:49 UTC (rev 27539)
@@ -86,8 +86,6 @@
 uint16		_numForwards = 0;
 char		_soundFile[20];
 
-byte		_mouseHidden = 0;
-
 uint32		_commandFlags = 0;
 uint16		_introSarcData3 = 200;
 uint16		_introSarcData2 = 1;
@@ -106,9 +104,9 @@
 
 	// FIXME
 	_vm = this;
+	
+	_mouseHidden = false;
 
-
-
 	Common::File::addDefaultDirectory( _gameDataPath );
 
 	Common::addSpecialDebugLevel(kDebugDialogue, "dialogue", "Dialogues debug level");
@@ -380,8 +378,8 @@
 		_keyDown = updateInput();
 
 		debugC(3, kDebugInput, "runGame: input flags (%i, %i, %i, %i)",
-			_mouseHidden == 0,
-			(_engineFlags & kEngineMouse) == 0,
+			!_mouseHidden,
+			(_engineFlags & kEngineBlockInput) == 0,
 			(_engineFlags & kEngineWalking) == 0,
 			(_engineFlags & kEngineChangeLocation) == 0
 		);
@@ -392,7 +390,7 @@
 		// Skipping input processing when kEngineChangeLocation is set solves the issue. It's
 		// noteworthy that the programmers added this very check in Big Red Adventure's engine,
 		// so it should be ok here in Nippon Safes too.
-		if ((_mouseHidden == 0) && ((_engineFlags & kEngineMouse) == 0) && ((_engineFlags & kEngineWalking) == 0) && ((_engineFlags & kEngineChangeLocation) == 0)) {
+		if ((!_mouseHidden) && ((_engineFlags & kEngineBlockInput) == 0) && ((_engineFlags & kEngineWalking) == 0) && ((_engineFlags & kEngineChangeLocation) == 0)) {
 			InputData *v8 = translateInput();
 			if (v8) processInput(v8);
 		}
@@ -510,14 +508,14 @@
 
 	case kEvSaveGame:
 		_hoverZone = NULL;
+		saveGame();
 		changeCursor(kCursorArrow);
-		saveGame();
 		break;
 
 	case kEvLoadGame:
 		_hoverZone = NULL;
+		loadGame();
 		changeCursor(kCursorArrow);
-		loadGame();
 		break;
 
 	}
@@ -677,8 +675,11 @@
 }
 
 
+void Parallaction::showCursor(bool visible) {
+	_mouseHidden = !visible;
+	g_system->showMouse(visible);
+}
 
-
 //	changes the mouse pointer
 //	index 0 means standard pointer (from pointer.cnv)
 //	index > 0 means inventory item
@@ -860,13 +861,13 @@
 
 	debugC(3, kDebugJobs, "jobWaitRemoveJob: count = %i", count);
 
-	_engineFlags |= kEngineMouse;
+	_engineFlags |= kEngineBlockInput;
 
 	count++;
 	if (count == 2) {
 		count = 0;
 		_vm->removeJob(arg);
-		_engineFlags &= ~kEngineMouse;
+		_engineFlags &= ~kEngineBlockInput;
 		j->_finished = 1;
 	}
 

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-06-18 19:56:36 UTC (rev 27538)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-06-18 20:11:49 UTC (rev 27539)
@@ -110,7 +110,7 @@
 	kEngineInventory		= (1 << 2),
 	kEngineWalking			= (1 << 3),
 	kEngineChangeLocation	= (1 << 4),
-	kEngineMouse			= (1 << 5),
+	kEngineBlockInput		= (1 << 5),
 	kEngineDragging 		= (1 << 6),
 	kEngineTransformedDonna		= (1 << 7)
 };
@@ -182,7 +182,6 @@
 extern uint16 		_introSarcData3;		 // sarcophagus stuff to be saved
 extern uint16 		_introSarcData2;		 // sarcophagus stuff to be saved
 extern char 		_saveData1[];
-extern byte 		_mouseHidden;
 extern uint32 		_commandFlags;
 extern const char 	*_instructionNamesRes[];
 extern const char 	*_commandsNamesRes[];
@@ -311,6 +310,7 @@
 
 	void 		parseLocation(const char *filename);
 	void 		changeCursor(int32 index);
+	void		showCursor(bool visible);
 	void 		changeCharacter(const char *name);
 
 	char   		*parseComment(Script &script);
@@ -397,6 +397,8 @@
 
 	bool		_skipMenu;
 
+	bool 		_mouseHidden;
+	
 	// input-only
 	InputData	 _input;
 	bool		_actionAfterWalk;  // actived when the character needs to move before taking an action


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