[Scummvm-cvs-logs] CVS: scummvm resource.cpp,1.41,1.42 scumm.h,1.53,1.54 scummvm.cpp,1.48,1.49 sound.cpp,1.18,1.19

Vincent Hamm yazoo at users.sourceforge.net
Wed Feb 27 14:49:08 CET 2002


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

Modified Files:
	resource.cpp scumm.h scummvm.cpp sound.cpp 
Log Message:
Added an option to specify the game data path

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** resource.cpp	24 Feb 2002 17:25:02 -0000	1.41
--- resource.cpp	27 Feb 2002 22:48:55 -0000	1.42
***************
*** 65,71 ****
                  if (!(_features & GF_SMALL_HEADER)) {
  			if(_features & GF_AFTER_V7)
! 				sprintf(buf, "%s.la%d", _exe_name, room==0 ? 0 : res.roomno[rtRoom][room]);
  			else
!                         	sprintf(buf, "%s.%.3d",  _exe_name,  room==0 ? 0 : res.roomno[rtRoom][room]);
                          _encbyte = (_features & GF_USE_KEY) ? 0x69 : 0;
                  } else if(!(_features & GF_SMALL_NAMES)) {
--- 65,71 ----
                  if (!(_features & GF_SMALL_HEADER)) {
  			if(_features & GF_AFTER_V7)
! 				sprintf(buf, "%s%s.la%d", _gameDataPath, _exe_name, room==0 ? 0 : res.roomno[rtRoom][room]);
  			else
!                         	sprintf(buf, "%s%s.%.3d",  _gameDataPath, _exe_name,  room==0 ? 0 : res.roomno[rtRoom][room]);
                          _encbyte = (_features & GF_USE_KEY) ? 0x69 : 0;
                  } else if(!(_features & GF_SMALL_NAMES)) {
***************
*** 79,87 ****
  
  			} else {
! 				sprintf(buf, "%s//disk%.2d.lec",_exe_name,res.roomno[rtRoom][room]);
  				_encbyte = 0x69;
  			}
  		} else {
! 				sprintf(buf, "%s//%.2d.lfl",_exe_name,room);	
  				if(_features & GF_OLD_BUNDLE)
  					_encbyte = 0xFF;
--- 79,87 ----
  
  			} else {
! 				sprintf(buf, "%sdisk%.2d.lec",_gameDataPath,res.roomno[rtRoom][room]);
  				_encbyte = 0x69;
  			}
  		} else {
! 				sprintf(buf, "%s%.2d.lfl",_gameDataPath,room);	
  				if(_features & GF_OLD_BUNDLE)
  					_encbyte = 0xFF;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** scumm.h	26 Feb 2002 04:09:11 -0000	1.53
--- scumm.h	27 Feb 2002 22:48:55 -0000	1.54
***************
*** 807,810 ****
--- 807,811 ----
  	void *_sfxFile;
  	char *_exe_name;
+ 	char *_gameDataPath;
  
  	byte _saveLoadFlag;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** scummvm.cpp	25 Feb 2002 17:29:51 -0000	1.48
--- scummvm.cpp	27 Feb 2002 22:48:55 -0000	1.49
***************
*** 23,26 ****
--- 23,27 ----
  #include "scumm.h"
  #include "gui.h"
+ #include "string.h"
  
  void Scumm::initRandSeeds() {
***************
*** 193,196 ****
--- 194,199 ----
  	_maxHeapThreshold = 450000;
  	_minHeapThreshold = 400000;
+ 
+ 	_gameDataPath = NULL;
  	
  	parseCommandLine(argc, argv);
***************
*** 204,207 ****
--- 207,214 ----
  	}
  
+ 	if (!_gameDataPath) {
+ 		warning("No path was provided. Assuming that data file are in the current directory");
+ 	}
+ 
  	if(_features & GF_AFTER_V7)
  		setupScummVarsNew();
***************
*** 402,405 ****
--- 409,415 ----
  					printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " " __TIME__ "\n");
  					exit(1);
+ 				case 'p':
+ 					_gameDataPath = argv[++i];
+ 					break;
  				default:
  ShowHelpAndExit:;
***************
*** 407,411 ****
  						"ScummVM - Scumm Interpreter\n"
  						"Syntax:\n"
! 						"\tscummvm [-b<num>] game\n"
  						"Flags:\n"
  						"\tb<num> - start in that room\n"
--- 417,421 ----
  						"ScummVM - Scumm Interpreter\n"
  						"Syntax:\n"
! 						"\tscummvm [-b<num>] [-p path] game\n"
  						"Flags:\n"
  						"\tb<num> - start in that room\n"

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** sound.cpp	24 Feb 2002 17:25:02 -0000	1.18
--- sound.cpp	27 Feb 2002 22:48:55 -0000	1.19
***************
*** 377,384 ****
  	 * same directory */
  
! 	sprintf(buf, "%s.sou", _exe_name);
  	file = fopen(buf, "rb");
! 	if (!file)
! 		file = fopen("monster.sou", "rb");
  	return file;
  }
--- 377,386 ----
  	 * same directory */
  
! 	sprintf(buf, "%s%s.sou", _gameDataPath, _exe_name);
  	file = fopen(buf, "rb");
! 	if (!file) {
! 		sprintf(buf, "%smonster.sou", _gameDataPath, _exe_name);
! 		file = fopen(buf, "rb");
! 	}
  	return file;
  }





More information about the Scummvm-git-logs mailing list