[Scummvm-cvs-logs] SF.net SVN: scummvm: [29346] scummvm/trunk/engines/agi

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Oct 31 22:28:33 CET 2007


Revision: 29346
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29346&view=rev
Author:   thebluegr
Date:     2007-10-31 14:28:33 -0700 (Wed, 31 Oct 2007)

Log Message:
-----------
Fix for bug #1751483 - "AGI: The -x command-line option appears to be broken"

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/menu.cpp

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2007-10-31 20:26:57 UTC (rev 29345)
+++ scummvm/trunk/engines/agi/agi.cpp	2007-10-31 21:28:33 UTC (rev 29346)
@@ -247,6 +247,19 @@
 	}
 }
 
+void AgiEngine::checkQuickLoad() {
+	if (ConfMan.hasKey("save_slot")) {
+		char saveNameBuffer[256];
+
+		snprintf (saveNameBuffer, 256, "%s.%03d", _targetName.c_str(), ConfMan.getInt("save_slot"));
+
+		if (loadGame(saveNameBuffer, false) == errOK) {	 // Do not check game id
+			_game.exitAllLogics = 1;
+			_menu->enableAll();
+		}
+	}
+}
+
 int AgiEngine::agiIsKeypressLow() {
 	processEvents();
 	return _keyQueueStart != _keyQueueEnd;
@@ -437,15 +450,6 @@
 	if (ec == errOK)
 		ec = _loader->loadResource(rLOGIC, 0);
 
-
-	if (ConfMan.hasKey("save_slot")) {
-		char saveNameBuffer[256];
-
-		snprintf (saveNameBuffer, 256, "%s.%03d", _targetName.c_str(), ConfMan.getInt("save_slot"));
-
-		loadGame(saveNameBuffer, false); // Do not check game id
-	}
-
 #ifdef __DS__
 	// Normally, the engine loads the predictive text dictionary when the predictive dialog
 	// is shown.  On the DS version, the word completion feature needs the dictionary too.

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2007-10-31 20:26:57 UTC (rev 29345)
+++ scummvm/trunk/engines/agi/agi.h	2007-10-31 21:28:33 UTC (rev 29346)
@@ -811,6 +811,7 @@
 
 	void allowSynthetic(bool);
 	void processEvents();
+	void checkQuickLoad();
 
 	// Objects
 	int showObjects();

Modified: scummvm/trunk/engines/agi/menu.cpp
===================================================================
--- scummvm/trunk/engines/agi/menu.cpp	2007-10-31 20:26:57 UTC (rev 29345)
+++ scummvm/trunk/engines/agi/menu.cpp	2007-10-31 21:28:33 UTC (rev 29346)
@@ -260,6 +260,11 @@
 			--iter;
 		}
 	}
+
+	// We need to wait till the main menu is submitted by the game scripts
+	// before checking if we can start loading a save game from the command line.
+	// Menu initialization and submital takes place when the game starts only
+	_vm->checkQuickLoad();
 }
 
 bool Menu::keyhandler(int key) {


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