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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Jan 4 16:09:28 CET 2009


Revision: 35725
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35725&view=rev
Author:   peres001
Date:     2009-01-04 15:09:28 +0000 (Sun, 04 Jan 2009)

Log Message:
-----------
Made sure each event is processed only once. This wasn't always the case when _inputMode changed as a result of a game action. This also caused the comment mode to be apparently skipped.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/input.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp

Modified: scummvm/trunk/engines/parallaction/input.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/input.cpp	2009-01-04 14:38:03 UTC (rev 35724)
+++ scummvm/trunk/engines/parallaction/input.cpp	2009-01-04 15:09:28 UTC (rev 35725)
@@ -212,6 +212,8 @@
 
 int Input::updateInput() {
 
+	int oldMode = _inputMode;
+
 	int event = kEvNone;
 	readInput();
 
@@ -225,6 +227,13 @@
 		break;
 	}
 
+	// when mode changes, then consider any input consumed
+	// for the current frame
+	if (oldMode != _inputMode) {
+		_mouseButtons = kEvNone;
+		_hasKeyPressEvent = false;
+	}
+
 	return event;
 }
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2009-01-04 14:38:03 UTC (rev 35724)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2009-01-04 15:09:28 UTC (rev 35725)
@@ -341,11 +341,24 @@
 	if (shouldQuit())
 		return;
 
-	runGuiFrame();
-	runDialogueFrame();
-	runCommentFrame();
-	runGameFrame(event);
+	switch (_input->_inputMode) {
+	case Input::kInputModeMenu:
+		runGuiFrame();
+		break;
 
+	case Input::kInputModeDialogue:
+		runDialogueFrame();
+		break;
+
+	case Input::kInputModeComment:
+		runCommentFrame();
+		break;
+
+	case Input::kInputModeGame:
+		runGameFrame(event);
+		break;
+	}
+
 	if (shouldQuit())
 		return;
 


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