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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Feb 21 05:44:20 CET 2009


Revision: 38662
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38662&view=rev
Author:   peres001
Date:     2009-02-21 04:44:20 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
Fix for bug #2619824. Command list execution is now paused when showing credits. This fixes the Amiga demo of Nippon Safes, which would otherwise quit without displaying the credits.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables_ns.cpp
    scummvm/trunk/engines/parallaction/exec.h
    scummvm/trunk/engines/parallaction/exec_br.cpp
    scummvm/trunk/engines/parallaction/exec_ns.cpp

Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp	2009-02-21 04:43:49 UTC (rev 38661)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp	2009-02-21 04:44:20 UTC (rev 38662)
@@ -298,6 +298,19 @@
 }
 
 void Parallaction_ns::_c_endComment(void *param) {
+	/*
+		NOTE: this routine is only run when the full game
+		is over. The following command in the scripts is
+		QUIT, which causes the engine to exit and return
+		to system.
+		Since this routine is still *blocking*, QUIT is
+		not executed until the user presses a mouse
+		button. If the input is reconciled with the main
+		loop then the command sequence must be suspended
+		to avoid executing QUIT before this actual
+		routine gets a chance to be run. See bug #2619824
+		for a similar situation.
+	*/
 
 	showLocationComment(_location._endComment, true);
 
@@ -416,6 +429,14 @@
 }
 
 void Parallaction_ns::_c_endIntro(void *parm) {
+	// NOTE: suspend command execution queue, to
+	// avoid running the QUIT command before
+	// credits are displayed. This solves bug
+	// #2619824.
+	// Execution of the command list will resume
+	// as soon as runGameFrame is run.
+	_cmdExec->suspend();
+
 	startCreditSequence();
 	_intro = false;
 }

Modified: scummvm/trunk/engines/parallaction/exec.h
===================================================================
--- scummvm/trunk/engines/parallaction/exec.h	2009-02-21 04:43:49 UTC (rev 38661)
+++ scummvm/trunk/engines/parallaction/exec.h	2009-02-21 04:44:20 UTC (rev 38662)
@@ -49,7 +49,6 @@
 	struct ParallactionStruct1 {
 		CommandPtr cmd;
 		ZonePtr	z;
-		bool suspend;
 	} _ctxt;
 
 	OpcodeSet	_opcodes;
@@ -66,13 +65,19 @@
 	void createSuspendList(CommandList::iterator first, CommandList::iterator last);
 	void cleanSuspendedList();
 
+	bool _running;
+	bool _suspend;
+
 public:
 	virtual void init() = 0;
 	virtual void run(CommandList &list, ZonePtr z = nullZonePtr);
 	void runSuspended();
+	void suspend();
 
 	CommandExec(Parallaction *vm) : _vm(vm) {
 		_suspendedCtxt.valid = false;
+		_suspend = false;
+		_running = false;
 	}
 	virtual ~CommandExec() {
 		for (Common::Array<const Opcode*>::iterator i = _opcodes.begin(); i != _opcodes.end(); ++i)

Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp	2009-02-21 04:43:49 UTC (rev 38661)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp	2009-02-21 04:44:20 UTC (rev 38662)
@@ -155,7 +155,7 @@
 
 DECLARE_COMMAND_OPCODE(move) {
 	_vm->_char.scheduleWalk(_ctxt.cmd->u._move.x, _ctxt.cmd->u._move.y);
-	_ctxt.suspend = true;
+	suspend();
 }
 
 DECLARE_COMMAND_OPCODE(start) {

Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp	2009-02-21 04:43:49 UTC (rev 38661)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp	2009-02-21 04:44:20 UTC (rev 38662)
@@ -356,7 +356,8 @@
 	uint32 useFlags = 0;
 	bool useLocalFlags;
 
-	_ctxt.suspend = false;
+	_suspend = false;
+	_running = true;
 
 	for ( ; first != last; first++) {
 		if (_vm->shouldQuit())
@@ -385,12 +386,14 @@
 
 		(*_opcodes[cmd->_id])();
 
-		if (_ctxt.suspend) {
+		if (_suspend) {
 			createSuspendList(++first, last);
 			return;
 		}
 	}
 
+	_running = false;
+
 }
 
 void CommandExec::run(CommandList& list, ZonePtr z) {
@@ -427,6 +430,13 @@
 	_suspendedCtxt.zone = nullZonePtr;
 }
 
+void CommandExec::suspend() {
+	if (!_running)
+		return;
+
+	_suspend = true;
+}
+
 void CommandExec::runSuspended() {
 	if (_engineFlags & kEngineWalking) {
 		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