From 65931d74e3a20632afb363c20d0692382cf6a134 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 22 Jan 2014 18:08:32 +0100 Subject: 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. --- engines/tinsel/tinsel.cpp | 19 +++++++++++-------- engines/tinsel/tinsel.h | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'engines/tinsel') 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); -- cgit v1.2.3