[Scummvm-cvs-logs] CVS: scummvm gameDetector.cpp,1.76,1.77 gameDetector.h,1.13,1.14 scummvm.cpp,1.186,1.187

Ralph Brorsen painelf at users.sourceforge.net
Fri Jul 19 05:07:11 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv3436/scummvm

Modified Files:
	gameDetector.cpp gameDetector.h scummvm.cpp 
Log Message:
patch by khalek, Added -x parameter that loads from a slot (defaults to 0). Also removes _restore, and alphabetizes the scummvm help optionlist.

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gameDetector.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- gameDetector.cpp	16 Jul 2002 21:03:14 -0000	1.76
+++ gameDetector.cpp	19 Jul 2002 12:06:45 -0000	1.77
@@ -44,26 +44,27 @@
 	"Syntax:\n"
 	"\tscummvm [-v] [-d[<num>]] [-n] [-b<num>] [-t<num>] [-s<num>] [-p<path>] [-m<num>] [-f] game\n"
 	"Flags:\n"
-	"\t-v         - show version info and exit\n"
+	"\t-a         - specify game is amiga version\n"
+	"\t-b<num>    - start in room <num>\n"
 	"\t-c<num>    - use cdrom <num> for cd audio\n"
 	"\t-d[<num>]  - enable debug output (debug level [1])\n"
-	"\t-n         - no subtitles for speech\n"
-	"\t-y         - set text speed (default: 60)\n"
-	"\t-b<num>    - start in room <num>\n"
-	"\t-t<num>    - set music tempo (default- adlib: 0x1F0000, midi: 0x460000)\n"
-	"\t-p<path>   - look for game in <path>\n"
-	"\t-m<num>    - set music volume to <num> (0-100)\n"
-	"\t-s<num>    - set sfx volume to <num> (0-255)\n"
 	"\t-e<mode>   - set music engine (see readme.txt for details)\n"
 	"\t-f         - fullscreen mode\n"
 	"\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x)\n"
-	"\t-a         - specify game is amiga version\n"
+	"\t-l<file>   - load config file instead of default\n"
+	"\t-m<num>    - set music volume to <num> (0-100)\n"
+	"\t-n         - no subtitles for speech\n"
+	"\t-p<path>   - look for game in <path>\n"
+	"\t-s<num>    - set sfx volume to <num> (0-255)\n"
+	"\t-t<num>    - set music tempo (default- adlib: 0x1F0000, midi: 0x460000)\n"
+	"\t-v         - show version info and exit\n"
 #if defined(UNIX) || defined(UNIX_X11)
 	"\t-w[<file>] - write to config file [~/.scummvmrc]\n"
 #else
 	"\t-w[<file>] - write to config file [scummvm.ini]\n"
 #endif
-	"\t-l<file>   - load config file instead of default\n"
+	"\t-x[<num>]  - save game slot to load (default: autosave)\n"
+	"\t-y         - set text speed (default: 60)\n"
 ;
 
 void GameDetector::updateconfig()
@@ -75,6 +76,8 @@
 			_amiga = true;
 		else
 			_amiga = false;
+	if ((val = scummcfg->get("save_slot")))
+		_save_slot = atoi(val);
 
 	if ((val = scummcfg->get("cdrom")))
 		_cdrom = atoi(val);
@@ -128,6 +131,7 @@
 	char *s;
 	char *current_option = NULL;
 	char *option = NULL;
+	_save_slot = -1;
 
 	// check for arguments
 	if (argc < 2) {
@@ -235,6 +239,14 @@
 				HANDLE_OPT_OPTION();
 				if (option != NULL)
 					scummcfg->change_filename(option);
+				break;
+			case 'x':
+				_save_slot = 0;
+				HANDLE_OPT_OPTION();
+				if (option != NULL) {
+					_save_slot = atoi(option);
+					scummcfg->set("save_slot", _save_slot);
+				}
 				break;
 			case 'y':
 				HANDLE_OPTION();

Index: gameDetector.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gameDetector.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- gameDetector.h	5 May 2002 20:08:40 -0000	1.13
+++ gameDetector.h	19 Jul 2002 12:06:45 -0000	1.14
@@ -28,7 +28,6 @@
 	char *getGameName(void);
 
 	bool _fullScreen;
-	bool _restore;
 	byte _gameId;
 	bool _simon;
 
@@ -56,6 +55,7 @@
 	
 	int _scummVersion;
 	int _cdrom;
+	int _save_slot;
 	
 	bool _saveconfig;
 

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -d -r1.186 -r1.187
--- scummvm.cpp	19 Jul 2002 01:40:24 -0000	1.186
+++ scummvm.cpp	19 Jul 2002 12:06:45 -0000	1.187
@@ -1544,8 +1544,8 @@
 		scumm->_imuse = imuse;
 	}
 
-	if (detector->_restore) {
-		scumm->_saveLoadSlot = 0;
+	if (detector->_save_slot != -1) {
+		scumm->_saveLoadSlot = detector->_save_slot;
 		scumm->_saveLoadFlag = 2;
 		scumm->_saveLoadCompatible = false;
 	}





More information about the Scummvm-git-logs mailing list