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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Feb 4 12:16:41 CET 2007


Revision: 25378
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25378&view=rev
Author:   peres001
Date:     2007-02-04 03:16:40 -0800 (Sun, 04 Feb 2007)

Log Message:
-----------
Implemented workaround to avoid crashes on location switches, using knowledge from Big Red Adventure.

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

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-02-04 08:26:44 UTC (rev 25377)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-02-04 11:16:40 UTC (rev 25378)
@@ -421,9 +421,20 @@
 	while ((_engineFlags & kEngineQuit) == 0) {
 		_keyDown = updateInput();
 
-		if ((_mouseHidden == 0) && ((_engineFlags & kEngineMouse) == 0) && ((_engineFlags & kEngineWalking) == 0)) {
-			debugC(1, kDebugLocation, "runGame: checking input");
+        debugC(1, kDebugLocation, "runGame: input flags (%i, %i, %i, %i)",
+            _mouseHidden == 0,
+            (_engineFlags & kEngineMouse) == 0,
+            (_engineFlags & kEngineWalking) == 0,
+            (_engineFlags & kEngineChangeLocation) == 0
+        );
 
+        // WORKAROUND: the engine doesn't check for displayed labels before performing a location
+        // switch, thus crashing whenever a jobDisplayLabel/jEraseLabel pair is left into the
+        // queue after the character enters a door.
+        // 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)) {
 			InputData *v8 = translateInput();
 			if (v8) processInput(v8);
 		}
@@ -969,12 +980,12 @@
 // and is in fact only used to remove jEraseLabel jobs
 //
 void jobWaitRemoveJob(void *parm, Job *j) {
-//	printf("jobWaitRemoveJob(%x)\n", parm);
-
 	Job *arg = (Job*)parm;
 
 	static uint16 count = 0;
 
+    debugC(1, kDebugLocation, "jobWaitRemoveJob: count = %i", count);
+
 	_engineFlags |= kEngineMouse;
 
 	count++;


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