[Scummvm-cvs-logs] scummvm master -> 29eeb91d4e0f7862815cd3129441ba3dfeee85c1
lordhoto
lordhoto at gmail.com
Thu Jan 23 23:22:58 CET 2014
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
651e280801 ENGINES: Introduce method Engine::initializePath which sets up SearchMan.
65931d74e3 TINSEL: Take advante of Engine::initializePath.
29eeb91d4e Merge pull request #423 from lordhoto/engine-path-setup
Commit: 651e2808018d7ca8f36d05cda49e53229b0fd7dd
https://github.com/scummvm/scummvm/commit/651e2808018d7ca8f36d05cda49e53229b0fd7dd
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2014-01-22T09:07:06-08:00
Commit Message:
ENGINES: Introduce method Engine::initializePath which sets up SearchMan.
This replaces the hardcoded addition of the game path in runGame in
base/main.cpp by an engine configurable one.
Changed paths:
base/main.cpp
engines/engine.cpp
engines/engine.h
diff --git a/base/main.cpp b/base/main.cpp
index c993dfa..abf75b7 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -197,7 +197,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
//
// Add the game path to the directory search list
- SearchMan.addDirectory(dir.getPath(), dir, 0, 4);
+ engine->initializePath(dir);
// Add extrapath (if any) to the directory search list
if (ConfMan.hasKey("extrapath")) {
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 52020c7..8326a1f 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -154,6 +154,10 @@ Engine::~Engine() {
CursorMan.popCursorPalette();
}
+void Engine::initializePath(const Common::FSNode &gamePath) {
+ SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 4);
+}
+
void initCommonGFX(bool defaultTo1XScaler) {
const Common::ConfigManager::Domain *transientDomain = ConfMan.getDomain(Common::ConfigManager::kTransientDomain);
const Common::ConfigManager::Domain *gameDomain = ConfMan.getActiveDomain();
diff --git a/engines/engine.h b/engines/engine.h
index 4f42233..33416dd 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -37,6 +37,7 @@ class Error;
class EventManager;
class SaveFileManager;
class TimerManager;
+class FSNode;
}
namespace GUI {
class Debugger;
@@ -142,6 +143,16 @@ public:
virtual ~Engine();
/**
+ * Init SearchMan according to the game path.
+ *
+ * By default it adds the directory in non-flat mode with a depth of 4 as
+ * priority 0 to SearchMan.
+ *
+ * @param gamePath The base directory of the game data.
+ */
+ virtual void initializePath(const Common::FSNode &gamePath);
+
+ /**
* Init the engine and start its main loop.
* @return returns kNoError on success, else an error code.
*/
Commit: 65931d74e3a20632afb363c20d0692382cf6a134
https://github.com/scummvm/scummvm/commit/65931d74e3a20632afb363c20d0692382cf6a134
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2014-01-22T09:08:32-08:00
Commit Message:
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.
Changed paths:
engines/tinsel/tinsel.cpp
engines/tinsel/tinsel.h
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 5d410e6..5ba3c5e 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 d261532..efa9355 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);
Commit: 29eeb91d4e0f7862815cd3129441ba3dfeee85c1
https://github.com/scummvm/scummvm/commit/29eeb91d4e0f7862815cd3129441ba3dfeee85c1
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2014-01-23T14:22:29-08:00
Commit Message:
Merge pull request #423 from lordhoto/engine-path-setup
ENGINES: Make game path addition to SearchMan fully configurable
Changed paths:
base/main.cpp
engines/engine.cpp
engines/engine.h
engines/tinsel/tinsel.cpp
engines/tinsel/tinsel.h
More information about the Scummvm-git-logs
mailing list