aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2014-01-22 18:08:32 +0100
committerJohannes Schickel2014-01-22 18:08:32 +0100
commit65931d74e3a20632afb363c20d0692382cf6a134 (patch)
treed143e6f14874cc9d8b2c55d2cfd7c83cbb459a57 /engines
parent651e2808018d7ca8f36d05cda49e53229b0fd7dd (diff)
downloadscummvm-rg350-65931d74e3a20632afb363c20d0692382cf6a134.tar.gz
scummvm-rg350-65931d74e3a20632afb363c20d0692382cf6a134.tar.bz2
scummvm-rg350-65931d74e3a20632afb363c20d0692382cf6a134.zip
TINSEL: Take advante of Engine::initializePath.
This makes sure that the game path is only ever added once for the PSX version of DW1. Most noticably this will make the warning about the game path being present in SearchSet disappear on startup.
Diffstat (limited to 'engines')
-rw-r--r--engines/tinsel/tinsel.cpp19
-rw-r--r--engines/tinsel/tinsel.h1
2 files changed, 12 insertions, 8 deletions
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 5d410e62c7..5ba3c5e80a 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -835,14 +835,6 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
// Setup mixer
syncSoundSettings();
- // Add DW2 subfolder to search path in case user is running directly from the CDs
- const Common::FSNode gameDataDir(ConfMan.get("path"));
- SearchMan.addSubDirectoryMatching(gameDataDir, "dw2");
-
- // Add subfolders needed for psx versions of Discworld 1
- if (TinselV1PSX)
- SearchMan.addDirectory(gameDataDir.getPath(), gameDataDir, 0, 3, true);
-
const GameSettings *g;
const char *gameid = ConfMan.get("gameid").c_str();
@@ -892,6 +884,17 @@ Common::String TinselEngine::getSavegameFilename(int16 saveNum) const {
return Common::String::format("%s.%03d", getTargetName().c_str(), saveNum);
}
+void TinselEngine::initializePath(const Common::FSNode &gamePath) {
+ if (TinselV1PSX) {
+ // Add subfolders needed for psx versions of Discworld 1
+ SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 3, true);
+ } else {
+ // Add DW2 subfolder to search path in case user is running directly from the CDs
+ SearchMan.addSubDirectoryMatching(gamePath, "dw2");
+ Engine::initializePath(gamePath);
+ }
+}
+
Common::Error TinselEngine::run() {
// Initialize backend
if (getGameID() == GID_DW2) {
diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h
index d26153245d..efa9355dd5 100644
--- a/engines/tinsel/tinsel.h
+++ b/engines/tinsel/tinsel.h
@@ -161,6 +161,7 @@ class TinselEngine : public Engine {
protected:
// Engine APIs
+ virtual void initializePath(const Common::FSNode &gamePath);
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
Common::Error loadGameState(int slot);