aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Apers2004-10-08 16:09:52 +0000
committerChris Apers2004-10-08 16:09:52 +0000
commit757f2fdcefde1606e822acf00f0e6b783bd3174f (patch)
tree3fb1042806eca2b55b3df0f72f60153ae6ea8225
parenta34c7e4b812705891eb76ead1f46b35f01b67f0d (diff)
downloadscummvm-rg350-757f2fdcefde1606e822acf00f0e6b783bd3174f.tar.gz
scummvm-rg350-757f2fdcefde1606e822acf00f0e6b783bd3174f.tar.bz2
scummvm-rg350-757f2fdcefde1606e822acf00f0e6b783bd3174f.zip
Prevent double slash in path
svn-id: r15473
-rw-r--r--base/gameDetector.cpp3
-rw-r--r--saga/saga.cpp8
-rw-r--r--scumm/scumm.cpp22
-rw-r--r--simon/simon.cpp24
-rw-r--r--sword1/sword1.cpp16
-rw-r--r--sword2/sword2.cpp12
6 files changed, 42 insertions, 43 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index 84b5983256..f1578b5e76 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -566,7 +566,7 @@ bool GameDetector::detectMain() {
String gameDataPath(ConfMan.get("path"));
if (gameDataPath.isEmpty()) {
warning("No path was provided. Assuming the data files are in the current directory");
-#ifndef __PALM_OS__ // add last slash also in File::fopenNoCase, so this is not needed
+ gameDataPath = "./";
} else if (gameDataPath.lastChar() != '/'
#ifdef __MORPHOS__
&& gameDataPath.lastChar() != ':'
@@ -574,7 +574,6 @@ bool GameDetector::detectMain() {
&& gameDataPath.lastChar() != '\\') {
gameDataPath += '/';
ConfMan.set("path", gameDataPath, kTransientDomain);
-#endif
}
return true;
diff --git a/saga/saga.cpp b/saga/saga.cpp
index df42153402..dec9c8d657 100644
--- a/saga/saga.cpp
+++ b/saga/saga.cpp
@@ -83,13 +83,13 @@ SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst)
// The Linux version of Inherit the Earth puts all data files in an
// 'itedata' sub-directory, except for voices.rsc
- File::addDefaultDirectory(_gameDataPath + "/itedata/");
+ File::addDefaultDirectory(_gameDataPath + "itedata/");
// The Windows version of Inherit the Earth puts various data files in
// other subdirectories.
- File::addDefaultDirectory(_gameDataPath + "/graphics/");
- File::addDefaultDirectory(_gameDataPath + "/music/");
- File::addDefaultDirectory(_gameDataPath + "/sound/");
+ File::addDefaultDirectory(_gameDataPath + "graphics/");
+ File::addDefaultDirectory(_gameDataPath + "music/");
+ File::addDefaultDirectory(_gameDataPath + "sound/");
// Setup mixer
if (!_mixer->isReady()) {
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 5796f9a905..9467c16e32 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -438,15 +438,15 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
// Add default file directories.
if (((_features & GF_AMIGA) || (_features & GF_ATARI_ST)) && (_version <= 4)) {
// This is for the Amiga version of Indy3/Loom/Maniac/Zak
- File::addDefaultDirectory(_gameDataPath + "/ROOMS/");
- File::addDefaultDirectory(_gameDataPath + "/rooms/");
+ File::addDefaultDirectory(_gameDataPath + "ROOMS/");
+ File::addDefaultDirectory(_gameDataPath + "rooms/");
}
if ((_features & GF_MACINTOSH) && (_version == 3)) {
// This is for the Mac version of Indy3/Loom
- File::addDefaultDirectory(_gameDataPath + "/Rooms 1/");
- File::addDefaultDirectory(_gameDataPath + "/Rooms 2/");
- File::addDefaultDirectory(_gameDataPath + "/Rooms 3/");
+ File::addDefaultDirectory(_gameDataPath + "Rooms 1/");
+ File::addDefaultDirectory(_gameDataPath + "Rooms 2/");
+ File::addDefaultDirectory(_gameDataPath + "Rooms 3/");
}
#ifdef MACOSX
@@ -467,16 +467,16 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
#endif
if (_version == 8) {
// This is for COMI
- File::addDefaultDirectory(_gameDataPath + "/RESOURCE/");
- File::addDefaultDirectory(_gameDataPath + "/resource/");
+ File::addDefaultDirectory(_gameDataPath + "RESOURCE/");
+ File::addDefaultDirectory(_gameDataPath + "resource/");
}
if (_version == 7) {
// This is for Full Throttle & The Dig
- File::addDefaultDirectory(_gameDataPath + "/VIDEO/");
- File::addDefaultDirectory(_gameDataPath + "/video/");
- File::addDefaultDirectory(_gameDataPath + "/DATA/");
- File::addDefaultDirectory(_gameDataPath + "/data/");
+ File::addDefaultDirectory(_gameDataPath + "VIDEO/");
+ File::addDefaultDirectory(_gameDataPath + "video/");
+ File::addDefaultDirectory(_gameDataPath + "DATA/");
+ File::addDefaultDirectory(_gameDataPath + "data/");
}
// The mac versions of Sam&Max, DOTT, FT and The Dig used a special meta
diff --git a/simon/simon.cpp b/simon/simon.cpp
index c56f4fe958..45334eba0a 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -379,16 +379,16 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
gss = PTR(simon2win_settings);
// Add default file directories
- File::addDefaultDirectory(_gameDataPath + "/voices/");
- File::addDefaultDirectory(_gameDataPath + "/VOICES/");
+ File::addDefaultDirectory(_gameDataPath + "voices/");
+ File::addDefaultDirectory(_gameDataPath + "VOICES/");
} else if (_game & GF_SIMON2)
gss = PTR(simon2dos_settings);
else if (_game & GF_ACORN) {
gss = PTR(simon1acorn_settings);
// Add default file directories
- File::addDefaultDirectory(_gameDataPath + "/execute/");
- File::addDefaultDirectory(_gameDataPath + "/EXECUTE/");
+ File::addDefaultDirectory(_gameDataPath + "execute/");
+ File::addDefaultDirectory(_gameDataPath + "EXECUTE/");
} else if (_game & GF_AMIGA) {
gss = PTR(simon1amiga_settings);
} else if (_game & GF_DEMO)
@@ -400,20 +400,20 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
// Add default file directories
switch(_language) {
case 20:
- File::addDefaultDirectory(_gameDataPath + "/hebrew/");
- File::addDefaultDirectory(_gameDataPath + "/HEBREW/");
+ File::addDefaultDirectory(_gameDataPath + "hebrew/");
+ File::addDefaultDirectory(_gameDataPath + "HEBREW/");
break;
case 5:
- File::addDefaultDirectory(_gameDataPath + "/spanish/");
- File::addDefaultDirectory(_gameDataPath + "/SPANISH/");
+ File::addDefaultDirectory(_gameDataPath + "spanish/");
+ File::addDefaultDirectory(_gameDataPath + "SPANISH/");
break;
case 3:
- File::addDefaultDirectory(_gameDataPath + "/italian/");
- File::addDefaultDirectory(_gameDataPath + "/ITALIAN/");
+ File::addDefaultDirectory(_gameDataPath + "italian/");
+ File::addDefaultDirectory(_gameDataPath + "ITALIAN/");
break;
case 2:
- File::addDefaultDirectory(_gameDataPath + "/french/");
- File::addDefaultDirectory(_gameDataPath + "/FRENCH/");
+ File::addDefaultDirectory(_gameDataPath + "french/");
+ File::addDefaultDirectory(_gameDataPath + "FRENCH/");
break;
}
}
diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp
index 80f1e71e92..bc6e787b5a 100644
--- a/sword1/sword1.cpp
+++ b/sword1/sword1.cpp
@@ -118,14 +118,14 @@ SwordEngine::~SwordEngine() {
void SwordEngine::initialize(void) {
// Add default file directories
- File::addDefaultDirectory(_gameDataPath + "/CLUSTERS/");
- File::addDefaultDirectory(_gameDataPath + "/MUSIC/");
- File::addDefaultDirectory(_gameDataPath + "/SPEECH/");
- File::addDefaultDirectory(_gameDataPath + "/VIDEO/");
- File::addDefaultDirectory(_gameDataPath + "/clusters/");
- File::addDefaultDirectory(_gameDataPath + "/music/");
- File::addDefaultDirectory(_gameDataPath + "/speech/");
- File::addDefaultDirectory(_gameDataPath + "/video/");
+ File::addDefaultDirectory(_gameDataPath + "CLUSTERS/");
+ File::addDefaultDirectory(_gameDataPath + "MUSIC/");
+ File::addDefaultDirectory(_gameDataPath + "SPEECH/");
+ File::addDefaultDirectory(_gameDataPath + "VIDEO/");
+ File::addDefaultDirectory(_gameDataPath + "clusters/");
+ File::addDefaultDirectory(_gameDataPath + "music/");
+ File::addDefaultDirectory(_gameDataPath + "speech/");
+ File::addDefaultDirectory(_gameDataPath + "video/");
_system->initSize(640, 480);
debug(5, "Starting memory manager");
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index c78f1492f7..39f83c551f 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -103,12 +103,12 @@ Sword2Engine::Sword2Engine(GameDetector *detector, OSystem *syst)
: Engine(syst) {
// Add default file directories
- File::addDefaultDirectory(_gameDataPath + "/CLUSTERS/");
- File::addDefaultDirectory(_gameDataPath + "/SWORD2/");
- File::addDefaultDirectory(_gameDataPath + "/VIDEO/");
- File::addDefaultDirectory(_gameDataPath + "/clusters/");
- File::addDefaultDirectory(_gameDataPath + "/sword2/");
- File::addDefaultDirectory(_gameDataPath + "/video/");
+ File::addDefaultDirectory(_gameDataPath + "CLUSTERS/");
+ File::addDefaultDirectory(_gameDataPath + "SWORD2/");
+ File::addDefaultDirectory(_gameDataPath + "VIDEO/");
+ File::addDefaultDirectory(_gameDataPath + "clusters/");
+ File::addDefaultDirectory(_gameDataPath + "sword2/");
+ File::addDefaultDirectory(_gameDataPath + "video/");
g_sword2 = this;
_debugger = NULL;