diff options
author | Max Horn | 2004-08-05 11:13:00 +0000 |
---|---|---|
committer | Max Horn | 2004-08-05 11:13:00 +0000 |
commit | b4223febd350ffaa2265570669e88a30642c4ca1 (patch) | |
tree | 73cf089aa11e3e26f669e73f44783215889efeec | |
parent | 61bf615168d1619f97d00ed7b08ea4a92c916732 (diff) | |
download | scummvm-rg350-b4223febd350ffaa2265570669e88a30642c4ca1.tar.gz scummvm-rg350-b4223febd350ffaa2265570669e88a30642c4ca1.tar.bz2 scummvm-rg350-b4223febd350ffaa2265570669e88a30642c4ca1.zip |
Enhanced extrapath support
svn-id: r14470
-rw-r--r-- | base/main.cpp | 5 | ||||
-rw-r--r-- | graphics/animation.cpp | 9 | ||||
-rw-r--r-- | sword1/resman.cpp | 6 |
3 files changed, 7 insertions, 13 deletions
diff --git a/base/main.cpp b/base/main.cpp index 6e461eb842..10c914991e 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -34,6 +34,7 @@ #include "base/plugins.h" #include "base/version.h" #include "common/config-manager.h" +#include "common/file.h" #include "common/scaler.h" // For GFX_NORMAL #include "common/timer.h" #include "gui/newgui.h" @@ -259,6 +260,10 @@ static void runGame(GameDetector &detector, OSystem *system) { Engine *engine = detector.createEngine(system); assert(engine); + // Add extrapath (if any) to the directory search list + if (ConfMan.hasKey("extrapath")) + File::addDefaultDirectory(ConfMan.get("extrapath")); + // Run the game engine engine->go(); diff --git a/graphics/animation.cpp b/graphics/animation.cpp index 32468fd6bd..63f1a2fb67 100644 --- a/graphics/animation.cpp +++ b/graphics/animation.cpp @@ -47,8 +47,6 @@ BaseAnimationState::~BaseAnimationState() { bool BaseAnimationState::init(const char *name) { - const Common::String ePath = ConfMan.get("extrapath"); - #ifdef USE_MPEG2 char tempFile[512]; @@ -65,7 +63,7 @@ bool BaseAnimationState::init(const char *name) { File f; - if (!f.open(tempFile) && !f.open(tempFile, File::kFileReadMode, ePath.c_str())) { + if (!f.open(tempFile)) { warning("Cutscene: %s palette missing", tempFile); return false; } @@ -114,8 +112,7 @@ bool BaseAnimationState::init(const char *name) { // Open MPEG2 stream mpgfile = new File(); sprintf(tempFile, "%s.mp2", name); - if (!mpgfile->open(tempFile) && - !mpgfile->open(tempFile, File::kFileReadMode, ePath.c_str())) { + if (!mpgfile->open(tempFile)) { warning("Cutscene: Could not open %s", tempFile); return false; } @@ -134,8 +131,6 @@ bool BaseAnimationState::init(const char *name) { // Play audio bgSoundStream = AudioStream::openStreamFile(name); - if (bgSoundStream == NULL) - bgSoundStream = AudioStream::openStreamFile(name, ePath.c_str()); if (bgSoundStream != NULL) { _snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false); diff --git a/sword1/resman.cpp b/sword1/resman.cpp index 2cd0205286..69f7bb5a53 100644 --- a/sword1/resman.cpp +++ b/sword1/resman.cpp @@ -58,12 +58,6 @@ ResMan::~ResMan(void) { void ResMan::loadCluDescript(const char *fileName) { File resFile; resFile.open(fileName); - if (!resFile.isOpen()) { - // Uh-uh, file not found. Perhaps we're playing straight from CD2? - // Check the Extra Path. - const Common::String ePath = ConfMan.get("extrapath"); - resFile.open(fileName, File::kFileReadMode, ePath.c_str()); - } if (!resFile.isOpen()) { char msg[512]; |