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.
This commit is contained in:
Johannes Schickel 2014-01-22 18:08:32 +01:00
parent 651e280801
commit 65931d74e3
2 changed files with 12 additions and 8 deletions

View File

@ -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) {

View File

@ -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);