Added an option to specify the game data path
svn-id: r3636
This commit is contained in:
parent
9a6ac48c0f
commit
71a97abfc2
4 changed files with 21 additions and 8 deletions
|
@ -64,9 +64,9 @@ void Scumm::openRoom(int room) {
|
||||||
}
|
}
|
||||||
if (!(_features & GF_SMALL_HEADER)) {
|
if (!(_features & GF_SMALL_HEADER)) {
|
||||||
if(_features & GF_AFTER_V7)
|
if(_features & GF_AFTER_V7)
|
||||||
sprintf(buf, "%s.la%d", _exe_name, room==0 ? 0 : res.roomno[rtRoom][room]);
|
sprintf(buf, "%s%s.la%d", _gameDataPath, _exe_name, room==0 ? 0 : res.roomno[rtRoom][room]);
|
||||||
else
|
else
|
||||||
sprintf(buf, "%s.%.3d", _exe_name, room==0 ? 0 : res.roomno[rtRoom][room]);
|
sprintf(buf, "%s%s.%.3d", _gameDataPath, _exe_name, room==0 ? 0 : res.roomno[rtRoom][room]);
|
||||||
_encbyte = (_features & GF_USE_KEY) ? 0x69 : 0;
|
_encbyte = (_features & GF_USE_KEY) ? 0x69 : 0;
|
||||||
} else if(!(_features & GF_SMALL_NAMES)) {
|
} else if(!(_features & GF_SMALL_NAMES)) {
|
||||||
if(room==0 || room>=900) {
|
if(room==0 || room>=900) {
|
||||||
|
@ -78,11 +78,11 @@ void Scumm::openRoom(int room) {
|
||||||
askForDisk(buf);
|
askForDisk(buf);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s//disk%.2d.lec",_exe_name,res.roomno[rtRoom][room]);
|
sprintf(buf, "%sdisk%.2d.lec",_gameDataPath,res.roomno[rtRoom][room]);
|
||||||
_encbyte = 0x69;
|
_encbyte = 0x69;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s//%.2d.lfl",_exe_name,room);
|
sprintf(buf, "%s%.2d.lfl",_gameDataPath,room);
|
||||||
if(_features & GF_OLD_BUNDLE)
|
if(_features & GF_OLD_BUNDLE)
|
||||||
_encbyte = 0xFF;
|
_encbyte = 0xFF;
|
||||||
else
|
else
|
||||||
|
|
1
scumm.h
1
scumm.h
|
@ -806,6 +806,7 @@ struct Scumm {
|
||||||
void *_fileHandle;
|
void *_fileHandle;
|
||||||
void *_sfxFile;
|
void *_sfxFile;
|
||||||
char *_exe_name;
|
char *_exe_name;
|
||||||
|
char *_gameDataPath;
|
||||||
|
|
||||||
byte _saveLoadFlag;
|
byte _saveLoadFlag;
|
||||||
byte _saveLoadSlot;
|
byte _saveLoadSlot;
|
||||||
|
|
12
scummvm.cpp
12
scummvm.cpp
|
@ -22,6 +22,7 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "scumm.h"
|
#include "scumm.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
void Scumm::initRandSeeds() {
|
void Scumm::initRandSeeds() {
|
||||||
_randSeed1 = 0xA943DE35;
|
_randSeed1 = 0xA943DE35;
|
||||||
|
@ -193,6 +194,8 @@ void Scumm::scummMain(int argc, char **argv) {
|
||||||
_maxHeapThreshold = 450000;
|
_maxHeapThreshold = 450000;
|
||||||
_minHeapThreshold = 400000;
|
_minHeapThreshold = 400000;
|
||||||
|
|
||||||
|
_gameDataPath = NULL;
|
||||||
|
|
||||||
parseCommandLine(argc, argv);
|
parseCommandLine(argc, argv);
|
||||||
|
|
||||||
if (_exe_name==NULL)
|
if (_exe_name==NULL)
|
||||||
|
@ -203,6 +206,10 @@ void Scumm::scummMain(int argc, char **argv) {
|
||||||
_features = GF_DEFAULT;
|
_features = GF_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_gameDataPath) {
|
||||||
|
warning("No path was provided. Assuming that data file are in the current directory");
|
||||||
|
}
|
||||||
|
|
||||||
if(_features & GF_AFTER_V7)
|
if(_features & GF_AFTER_V7)
|
||||||
setupScummVarsNew();
|
setupScummVarsNew();
|
||||||
else
|
else
|
||||||
|
@ -401,12 +408,15 @@ void Scumm::parseCommandLine(int argc, char **argv) {
|
||||||
case 'v':
|
case 'v':
|
||||||
printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " " __TIME__ "\n");
|
printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " " __TIME__ "\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
case 'p':
|
||||||
|
_gameDataPath = argv[++i];
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ShowHelpAndExit:;
|
ShowHelpAndExit:;
|
||||||
printf(
|
printf(
|
||||||
"ScummVM - Scumm Interpreter\n"
|
"ScummVM - Scumm Interpreter\n"
|
||||||
"Syntax:\n"
|
"Syntax:\n"
|
||||||
"\tscummvm [-b<num>] game\n"
|
"\tscummvm [-b<num>] [-p path] game\n"
|
||||||
"Flags:\n"
|
"Flags:\n"
|
||||||
"\tb<num> - start in that room\n"
|
"\tb<num> - start in that room\n"
|
||||||
"\tf - fullscreen mode\n");
|
"\tf - fullscreen mode\n");
|
||||||
|
|
|
@ -376,10 +376,12 @@ void *Scumm::openSfxFile() {
|
||||||
* That way, you can keep .sou files for multiple games in the
|
* That way, you can keep .sou files for multiple games in the
|
||||||
* same directory */
|
* same directory */
|
||||||
|
|
||||||
sprintf(buf, "%s.sou", _exe_name);
|
sprintf(buf, "%s%s.sou", _gameDataPath, _exe_name);
|
||||||
file = fopen(buf, "rb");
|
file = fopen(buf, "rb");
|
||||||
if (!file)
|
if (!file) {
|
||||||
file = fopen("monster.sou", "rb");
|
sprintf(buf, "%smonster.sou", _gameDataPath, _exe_name);
|
||||||
|
file = fopen(buf, "rb");
|
||||||
|
}
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue